Skip to content
This repository was archived by the owner on Apr 28, 2022. It is now read-only.

[MIG] Migrate all modules to v11 #152

Closed
wants to merge 24 commits into from
Closed

[MIG] Migrate all modules to v11 #152

wants to merge 24 commits into from

Conversation

CGenie
Copy link

@CGenie CGenie commented Aug 22, 2018

This is an extension of #148 but I managed to migrate the web wizard and as far as I can tell everything works, even the reconfiguration of sale.order.line as noted in #148 (comment)

@CGenie
Copy link
Author

CGenie commented Aug 22, 2018

The last commit actually fixes the issue with that sale.order.line editing, I don't know why it was added in PR #148 .

@CasVissers-360ERP
Copy link

Thnx @CGenie closed my pr so we can continue here.

@ska-ibees
Copy link

ska-ibees commented Aug 25, 2018

Guys, Thanks for putting efforts for V11 migration!
During testing latest PR code, I am not able to use any custom field.
If i do not set a field as custom, it works otherwise gives error.

@CGenie Could you please confirm if you have same issue?

(Please note: sb.com is my local domain hosted in VM)

I am getting below error.
Error:
Uncaught TypeError: Cannot read property '1' of undefined

http://www.sb.com/web/static/src/js/views/basic/basic_model.js:3456
Traceback:
TypeError: Cannot read property '1' of undefined
at http://www.sb.com/web/static/src/js/views/basic/basic_model.js:3456:46
at Function..each..forEach (http://www.sb.com/web/static/lib/underscore/underscore.js:145:9)
at Class._parseServerData (http://www.sb.com/web/static/src/js/views/basic/basic_model.js:3442:11)
at Object. (http://www.sb.com/web/static/src/js/views/basic/basic_model.js:2005:22)
at Object. (http://www.sb.com/web/static/lib/jquery/jquery.js:3276:89)
at fire (http://www.sb.com/web/static/lib/jquery/jquery.js:3119:58)
at Object.fireWith [as resolveWith] (http://www.sb.com/web/static/lib/jquery/jquery.js:3231:49)
at Object. (http://www.sb.com/web/static/lib/jquery/jquery.js:3283:104)
at fire (http://www.sb.com/web/static/lib/jquery/jquery.js:3119:58)
at Object.fireWith [as resolveWith] (http://www.sb.com/web/static/lib/jquery/jquery.js:3231:49)

@CGenie
Copy link
Author

CGenie commented Aug 27, 2018

@CasVissers thank you for reporting that, I think I found the solution.

@ska-ibees
Copy link

@CGenie Thanks for the fix.
However, found more issues as listed below:

  1. Can not complete Product configuration wizard if ONLY custom field is used and there is no Configuration STEP created in product template. However, if Step is configured then it works. Is it mandatory to have at-least one step?

  2. 'Back' button on Product wizard modal is not working. Getting below error:

Error:
Uncaught TypeError: Cannot read property 'always' of undefined

http://www.sb.com/web/content/1035-16ff838/web.assets_backend.js:1414
Traceback:

### TypeError: Cannot read property 'always' of undefined

at Class._onButtonClicked (http://www.sb.com/web/content/1035-16ff838/web.assets_backend.js:1414:5)
at Class.<anonymous> (http://www.sb.com/web/content/874-da88ef7/web.assets_common.js:3923:11)
at Class.trigger (http://www.sb.com/web/content/874-da88ef7/web.assets_common.js:3921:180)
at Class._trigger_up (http://www.sb.com/web/content/874-da88ef7/web.assets_common.js:3927:365)
at Class._trigger_up (http://www.sb.com/web/content/874-da88ef7/web.assets_common.js:3927:449)
at Class.trigger_up (http://www.sb.com/web/content/874-da88ef7/web.assets_common.js:3927:280)
at HTMLButtonElement.<anonymous> (http://www.sb.com/web/content/1035-16ff838/web.assets_backend.js:1372:334)
at HTMLButtonElement.dispatch (http://www.sb.com/web/content/874-da88ef7/web.assets_common.js:892:451)
at HTMLButtonElement.elemData.handle (http://www.sb.com/web/content/874-da88ef7/web.assets_common.js:865:173)
  1. I tried converting python2 code to python3 using 2to3 tool. It changed:
    ../wizard/product_configurator.py line 137
    dynamic_fields.values())
    to
    list(dynamic_fields.values()))
    However, in your code you are still using "dynamic_fields.values())". Any specific reason for that?

@CGenie
Copy link
Author

CGenie commented Aug 28, 2018

  1. Is fixed.
    As for 1. and 2 (3 is missing?) I think I reproduce the same behavior on v10 and I think it's an issue with configurator itself, not with migration to odoo v11.

@ska-ibees
Copy link

Thanks for the prompt actions and reply.

@GSLabIt
Copy link

GSLabIt commented Sep 21, 2018

Hi there, any ETA for this one?

@CGenie
Copy link
Author

CGenie commented Sep 22, 2018

@joezsweet Well we're testing this and fixing any issues that come up, can't quite estimate this but for us it looks stable and we already use it for one of the customers.
I guess tests should be fixed as well.

@Danoolo
Copy link

Danoolo commented Sep 29, 2018

Hi everyone!..i want to ask you about website_configurator...with this module functionality about 'Reset' button and others elements with js controllers don't work so that it produces that website configurator is incomplete because others python logic functions and controllers are good and e.g. in 'config_ok' button in the product_template form view the traslation doesn't work either. My question is, in your versions does these functions work properly?. Thanks in advance

Przemek Kaminski added 2 commits October 4, 2018 17:05
Without this, the variant prices aren't refreshed properly because the on change
watches are not set up properly yet.
@Danoolo
Copy link

Danoolo commented Oct 9, 2018

Hi guys!..commit 2602a24 fixes problem with onchange methods in form view like you said CGenie, thanks a lot, but configuration button (id='submit_configuration') doesn't send the request for variant creation..and in your last commit 042a26a ...in my version, the selected fields doesn't let me to pick any option. Thank you for your collab CGenie!

@Danoolo
Copy link

Danoolo commented Oct 9, 2018

Hi guys!..commit 2602a24 fixes problem with onchange methods in form view like you said CGenie, thanks a lot, but configuration button (id='submit_configuration') doesn't send the request for variant creation..and in your last commit 042a26a ...in my version, the selected fields doesn't let me to pick any option. Thank you for your collab CGenie!

I was studying that problem, and i watch that post method doesn't have any item so in controller method cfg_session it checks about if post variable has elements, so it doesn't return anything. This post variable required of an 'add_qty' number referring to quantity of variant to order.

Przemek Kaminski added 3 commits October 10, 2018 09:45
@CGenie
Copy link
Author

CGenie commented Oct 11, 2018

@Danoolo For me this seems to work... I mean I do have the variants created.

Przemek Kaminski added 2 commits October 11, 2018 08:52
This is for easier extension of these (for example adding new view types).
This allows to easily change onchange/value_onchange/etc functions in
product_config in dependent modules.
@Danoolo
Copy link

Danoolo commented Oct 12, 2018

@CGenie thks a lot for interesting...
captura de pantalla de 2018-10-12 16-10-13
That's the first problem i mentioned..in wrench icon always figure that traslation "In", i supposed it's the standard traslation..
Other problem i have with website configurator i can to solve..but i had to add an element in post variable..i'm not sure if it's a problem with my browser or i dont know...
Again thks a lot.

@Danoolo
Copy link

Danoolo commented Oct 12, 2018

I have installed spanish-AR language..can this language making that issue?

@GSLabIt
Copy link

GSLabIt commented Nov 28, 2018

Is this ready to be merged in 11.0?

@CGenie
Copy link
Author

CGenie commented Nov 28, 2018

Well we work with this module for some time now and it seems to work fine.
There is no v11.0 anyways, I guess it's good to merge it and fix bugs when they are reported. :)

@CGenie
Copy link
Author

CGenie commented Nov 28, 2018

I guess the tests could be fixed, that is one thing that bothers me :)

@SalahAdDin
Copy link

@CGenie did you test the product-variant repository in OCA modules?

Przemek Kaminski added 2 commits December 14, 2018 14:22
@bennals
Copy link

bennals commented Feb 26, 2019

I just tried this module and struck the following error when clicking on the 'Add to Cart' button. Nothing happens in the browser - just this error in the log.

Traceback (most recent call last):
File "/home/odoo/odoo-server/odoo/http.py", line 651, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/odoo/odoo-server/odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/home/odoo/odoo-server/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/home/odoo/odoo-server/odoo/http.py", line 693, in dispatch
result = self._call_function(**self.params)
File "/home/odoo/odoo-server/odoo/http.py", line 342, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/odoo/odoo-server/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/home/odoo/odoo-server/odoo/http.py", line 335, in checked_call
result = self.endpoint(*a, **kw)
File "/home/odoo/odoo-server/odoo/http.py", line 937, in call
return self.method(*args, **kw)
File "/home/odoo/odoo-server/odoo/http.py", line 515, in response_wrap
response = f(*args, **kw)
File "/home/odoo/odoo-server/addons/website_sale_options/controllers/main.py", line 70, in modal
product = request.env['product.product'].with_context(product_context).browse(int(product_id))
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Is the Website configurator working properly for others? FYI, the 'Add to Cart' button works fine for webstore purchases of products that are not 'Configurable Templates'.

@Danoolo
Copy link

Danoolo commented Feb 26, 2019

@bennals For me works fine!...but in website_product_configurator you do not have to add it to the cart, you only have to configure the variant and then it add to cart inmediatly...

@bennals
Copy link

bennals commented Feb 26, 2019

@Danoolo thanks for replying. Well that automatic adding to cart after configuration is not happening here either.

I found a similar issue reported on Pledra's repositry here

Any ideas about the error?

@Danoolo
Copy link

Danoolo commented Feb 27, 2019

@bennals Excuse me i got it...well that error says that product with 'product_id' has a None type value, try to follow the controller.py file...above in this chatter i mentioned an error similar when a configure in website and i had to manually add a value for the dict key 'add_qty'.. #152 (comment) ...maybe it's not the solution for your problem and i dont remember the error dialogue i got..

@Alpiek-Oisterwijk Alpiek-Oisterwijk closed this by deleting the head repository Feb 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants