[10.0][MIG] website snippet country dropdown - #349
Conversation
|
Hey @HaTry, thank you for your Pull Request. It looks like some users haven't signed our Contributor License Agreement, yet.
Appreciation of efforts, |
yajo
left a comment
There was a problem hiding this comment.
Generally OK, but still needed to fix some comments.
Besides those, please squash the translation commits.
| @@ -0,0 +1,2 @@ | |||
|
|
|||
| import test No newline at end of file | |||
There was a problem hiding this comment.
You don't have to import tests, this folder is autoimported when needed.
| var country_code_test = 'ES'; | ||
| var vat_number_test = 'B01010101'; | ||
|
|
||
| tour.register("demo_page", { |
There was a problem hiding this comment.
Don't register the tour with this name. Tours share a global namespace, and demo_page seems like you are testing another thing. Better call it website_snippet_country_dropdown_tour_demo_page for example.
| run: function(){ | ||
| var complete_field = $("#complete_field").val(); | ||
| if(complete_field !== country_code_test + vat_number_test) | ||
| console.log("error"); |
There was a problem hiding this comment.
Since this is not very common, future reviewers will appreciate little comments about why you are doing this check in a function and why this console.log.
| console.log("error"); | ||
| } | ||
| }]); | ||
| }) No newline at end of file |
There was a problem hiding this comment.
Configure your editor to always add a newline at the end of file, and do it.
| @@ -0,0 +1,2 @@ | |||
|
|
|||
| import test_snippet_country_dropdown No newline at end of file | |||
There was a problem hiding this comment.
You need to put from . import before.
You also need the license boilerplate as you can see in the module template.
| @@ -0,0 +1,12 @@ | |||
| # -*- coding: utf-8 -*- | |||
| # Part of Odoo. See LICENSE file for full copyright and licensing details. | |||
There was a problem hiding this comment.
This license header is not accepted. Use the official one as I linked above.
| self.phantom_js( | ||
| "/", | ||
| "odoo.__DEBUG__.services['web_tour.tour'].run('demo_page')", | ||
| "odoo.__DEBUG__.services['web_tour.tour'].tours.demo_page.ready" |
There was a problem hiding this comment.
You will have to change the tour name as above.
| <script type="text/javascript" | ||
| src="/website_snippet_country_dropdown/static/src/js/website_snippet_country_dropdown.js"/> | ||
| <script type="text/javascript" | ||
| src="/website_snippet_country_dropdown/static/src/js/web_tour_country_dropdown.js"/> |
There was a problem hiding this comment.
Test tour assets should be added in a demo view to avoid overloading the main frontend.
yajo
left a comment
There was a problem hiding this comment.
Better, although still some things to fix.
| # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
|
||
| import test No newline at end of file | ||
| from . import tests |
There was a problem hiding this comment.
Oh sorry I think I mistaked before in the comment. You don't have to import tests in the addon's __init__.py; never.
This module gets autoimported when running the unit tests.
| content: "Validate Text", | ||
| trigger: '#no_country_field', | ||
| run: function(){ | ||
| // This funtion alow to evaluate a hide html element |
| trigger: '#no_country_field', | ||
| run: function(){ | ||
| // This funtion alow to evaluate a hide html element | ||
| // Imposible to do it though trigger |
| # © 2016 Jairo Llopis <jairo.llopis@tecnativa.com> | ||
| # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
|
||
| from . import test_snippet_country_dropdown No newline at end of file |
There was a problem hiding this comment.
Remember to add a newline character at the end of all files. Usually you can configure your text editor to do it automatically.
| self.phantom_js( | ||
| "/", | ||
| "odoo.__DEBUG__.services['web_tour.tour'].run('website_snippet_country_dropdown_tour_demo_page')", | ||
| "odoo.__DEBUG__.services['web_tour.tour'].tours.website_snippet_country_dropdown_tour_demo_page.ready" |
There was a problem hiding this comment.
Limit to 79 chars/line. You'll probably have to join 2 strings to get to that.
OsoTranquilo
left a comment
There was a problem hiding this comment.
Tested in a local machine. O.K.
OsoTranquilo
left a comment
There was a problem hiding this comment.
Tested again in a local machine. O.K.
Last minor changes be good.
0e9abc9 to
c836a5a
Compare
|
Is the CLA signed? |
|
So I believe; @jbeficent? |
|
I pushed a commit here to see if it fixes travis. |
Migration of website snippet country dropdown to v10.0.
Because of Odoo seems to even forbid dragging the snippet into a
<form>element that is inside aneditable area.