Migration to version 11.0 - #12
Conversation
|
Hey @bizzappdev, thank you for your Pull Request. It looks like some users haven't signed our Contributor License Agreement, yet.
Appreciation of efforts, |
|
@elicoidal here is a PR for the v11. there was one bug/error (from interface-github) which was causing the Odoo module/version do not have the icon so the products did not have Icons. the Bug will be solved once the OCA/interface-git#19 will be approved and merged. |
|
@bizzappdev thanks for the PR. |
elicoidal
left a comment
There was a problem hiding this comment.
@bizzappdev Thanks for your contribution!
No real technical review on my side. Some questions though
| @@ -0,0 +1,27 @@ | |||
| # Copyright 2017 BizzAppDev | |||
| @@ -0,0 +1,88 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <odoo> | |||
| <data> | |||
|
|
||
| @api.multi | ||
| def generate_zip_file(self): | ||
| product1 = self.env.ref('apps_download.product_product_100') |
There was a problem hiding this comment.
I am a little bit confused by this piece of code: what do you intend to do with the tests data?
I would suggest at least some docstrings to the function and short comments in the code.
| @@ -0,0 +1,4 @@ | |||
|
|
|||
| }, | ||
| { | ||
| content: "Select Author", | ||
| trigger: ".dropdown_author_by .dropdown-menu a:contains('OCA')", |
There was a problem hiding this comment.
I prefer not to have OCA hard-coded.
We should set up somewhere the organization and use it here
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <odoo> | ||
| <data> | ||
| <template id="assets_frontend" name="Website Apps Store" inherit_id="website.assets_frontend"> |
There was a problem hiding this comment.
please improve readbility with one line per attribute
| <xpath expr='//a[hasclass("js_check_product")]' position="attributes"> | ||
| <attribute name="t-if">not product.odoo_module_id</attribute> | ||
| </xpath> | ||
| <!--xpath expr="//hr" position="attributes"> |
|
@elicoidal All requests have been taken care. |
|
might be @pedrobaeza or @RoelAdriaans can do a technical review? |
|
@OCA/board @gdgellatly Technical review welcome. |
max3903
left a comment
There was a problem hiding this comment.
@elicoidal Apart from splitting the README.rst, LGTM
👍
yvaucher
left a comment
There was a problem hiding this comment.
Hello,
Thanks for the porting.
I'm a bit concerned about the purpose of apps_download module. It seems like it is a Proof of concept with demo data. What is in folder demo is not loaded as demo but really seems to be demo data.
I would advise to put the load of this file under demo key and make sure the method can be used without thoses data.
Otherwise you will find few other tiny remarks on the python code.
| ], | ||
| "summary": "Product Download for Appstore", | ||
| "data": [ | ||
| 'demo/product_template_demo.xml', |
There was a problem hiding this comment.
Shouldn't this be under demo key loading this setup only in case of an instance with without_demo=False ?
| if self._check_related_to_module(product): | ||
| attribute = self._get_version_attribute(values) | ||
| version = self._get_version_with_attribute( | ||
| version_ids = self._get_version_with_attribute( |
There was a problem hiding this comment.
Here you renamed version to version_ids but _get_version_with_attribute returns you a record set.
To not mix with actual integer ids, I suggest you to rename version_ids to versions
| 'odoo_module_version_id': version.id, | ||
| }) | ||
| for version in version_ids: | ||
| module_id = version.module_id |
There was a problem hiding this comment.
s/module_id/module
It preferable to not use suffix _id when the variable is a record set.
| url = "/shop/category/%s" % slug(category) | ||
|
|
||
| category_all = request.env['product.public.category'].search([]) | ||
| versions = request.env['product.attribute.value'].search([]) |
There was a problem hiding this comment.
Shouldn't this be filtered by attribute_id = ref('apps_product_creator.attribute_odoo_version') ? If an other product.attribute was created it would be confusing. product.attribute can be a lot of things.
| --> | ||
| <odoo> | ||
| <record id="ir_cron_scheduler_generate_zip" model="ir.cron"> | ||
| <field name="name">Generate all product zip</field> |
| <page string="Module Dependency"> | ||
| <separator string="Modules Dependency" colspan="4"/> | ||
| <field name="dependent_product_ids" colspan="4" nolabel="1"/> | ||
| <button string="Get all Dependency" type="object" name="generate_zip_file"/> |
| var base = require("web_editor.base"); | ||
|
|
||
| Tour.register('download_zip', { | ||
| name: "Download Product Zip", |
|
@bizzappdev have you had a chance to check the review? |
|
@elicoidal I think @sbidoul and @pedrobaeza are organizing the test instance. Just been a bit delayed with holidays. |
|
@gdgellatly the test environment is ready now. |
|
@elicoidal all the requested changes are done. |
|
@yvaucher could you please have a second look? |
|
@bizzappdev I added more question on your reply, I get that you need some setup for the PhantomJS tests, but it seems it adds an action and a cron that won't work as they can only launch the test version of the method, or is it supposed to be overwritten somewhere? Don't hesitate also to write a more complete Pull request's description if some context must be known by the reviewers. |
| super(TestUi, self).setUp() | ||
| self.tour = "odoo.__DEBUG__.services['web_tour.tour']" | ||
|
|
||
| def test_download_zip_tour(self): |
There was a problem hiding this comment.
You probably want to do the following:
In generate_zip_files extract this in an other method name _get_module_path:
module_path = product.module_path + '/'\
+ product.odoo_module_version_id.technical_nameto get it like that:
module_path = product._get_module_path()Then you need to mock this method to return your special test path:
[...]
import mock
mock_get_module_path = (
'openerp.addons.apps_download.models.product.ProductProduct._get_module_path'
) # it might be odoo.addons in v11 to check
[...]
def test_download_zip_tour(self):
with mock.patch(mock_get_module_path) as mock_func:
mock_func.return_value = <your test path string>
self.phantom_js('/shop', ...)|
@yvaucher Thank you so much, I was not aware of the mock. we have implemented that as per your example. |
|
@yvaucher anything else has to be taken care? |
|
@bizzappdev thanks for the change, LGTM |
|
Thanks all! |
|
@elicoidal yes sure, that will be great. I will be also around. |
Migration to version 11.0 as per the request at #4