Tuesday, January 5, 2021
16 changes · master
Enhancements to existing features
Currency information has been made available more broadly so monetary tracking messages can display the correct currency symbol. This improves clarity for users reviewing value changes, making financial updates easier to understand at a glance.
Original PR description
Move the session information for the currency in community to display the currency symbol in the message for the monetary tracking fields. odoo/odoo#61999 task-2387268
Code cleanup and technical improvements
This update simplifies internal inventory and manufacturing data handling so stock movements, production orders, and bills of materials stay more consistent. It mainly reduces duplicated or unused setup data and improves reliability without introducing major visible changes for users.
Original PR description
odoo/upgrade#1998
Update the standard_price outside the loop to avoid recompute ` quantity_svl` at each iteration. `quantity_svl` is not modify in the process and the `standard_price` is not read in process. `NewPrice = OldPrice + (cost_to_add_x1) / quantity_svl + (cost_to_add_x2) / quantity_svl` Becomes `NewPrice = OldPrice + (cost_to_add_x1 + cost_to_add_x2) / quantity_svl` which is equals. opw-2374405 Description of the issue/feature this PR addresses: Current behavior before PR: Desired
Original PR description
Update the standard_price outside the loop to avoid recompute ` quantity_svl` at each iteration. `quantity_svl` is not modify in the process and the `standard_price` is not read in process. `NewPrice = OldPrice + (cost_to_add_x1) / quantity_svl + (cost_to_add_x2) / quantity_svl` Becomes `NewPrice = OldPrice + (cost_to_add_x1 + cost_to_add_x2) / quantity_svl` which is equals. opw-2374405 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#64011 Forward-Port-Of: odoo/odoo#63742
Let's assume an editable list with a many2one field. The user types something in the many2one and then clicks outside (mousedown, not mouseup, and thus click, yet). A dialog opens to ask the user if he wants to quickcreate a record. Before this commit, the dialog and the row disappeared as soon as he released the click, because the click was considered by the list renderer as an "external click", and the row was discarded (alongside the many2one it contained). Task 2411029 Descrip
Original PR description
Let's assume an editable list with a many2one field. The user types something in the many2one and then clicks outside (mousedown, not mouseup, and thus click, yet). A dialog opens to ask the user if he wants to quickcreate a record. Before this commit, the dialog and the row disappeared as soon as he released the click, because the click was considered by the list renderer as an "external click", and the row was discarded (alongside the many2one it contained). Task 2411029 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#63697
…il to attendees When emails related to calendar events are sent email_from is set from templates like invite template. Author of those email is however not set and current user is used as default value. In this commit we do as done in templates and try to set event responsible as user, and fall back on current user if not set. This notably solves an issue when using website_calendar. Appointments are done using public user and mails have public user as author. This leads to emails
Original PR description
…il to attendees When emails related to calendar events are sent email_from is set from templates like invite template. Author of those email is however not set and current user is used as default value. In this commit we do as done in templates and try to set event responsible as user, and fall back on current user if not set. This notably solves an issue when using website_calendar. Appointments are done using public user and mails have public user as author. This leads to emails not being accessible or having a false email_from. Task ID-2413792 Forward-Port-Of: odoo/odoo#64027 Forward-Port-Of: odoo/odoo#64020
What are the steps to reproduce your issue ? 1. Install contacts in a db with demo data 2. Create a contact with complete address 3. Click on Add button (edit mode) What is currently happening ? The address get copied but not completely (no zip code, state, street) What are you expecting to happen ? The whole address have to be copied How to fix the bug ? Don't call the onchange if the record is not yet created opw-2415891 Forward-Port-Of: odoo/
Original PR description
What are the steps to reproduce your issue ?
1. Install contacts in a db with demo data
2. Create a contact with complete address
3. Click on Add button (edit mode)
What is currently happening ?
The address get copied but not completely (no zip code, state, street)
What are you expecting to happen ?
The whole address have to be copied
How to fix the bug ?
Don't call the onchange if the record is not yet created
opw-2415891
Forward-Port-Of: odoo/odoo#63880**Description of the issue/feature this PR addresses:** Raise QWebException instead of a KeyError exception. **Current behavior before PR:** When a website Qweb view has inheritance issues like, for example: `<xpath expr="//form/ul/t/li[hasclass('nav-item')]">`, we get the following exception + traceback, which is not very informative: ``` Traceback (most recent call last): File "/home/odoo/src/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch result = request.dis
Original PR description
**Description of the issue/feature this PR addresses:** Raise QWebException instead of a KeyError exception. **Current behavior before PR:** When a website Qweb view has inheritance issues like, for…
**Description of the issue/feature this PR addresses:**
Raise QWebException instead of a KeyError exception.
**Current behavior before PR:**
When a website Qweb view has inheritance issues like, for example: `<xpath expr="//form/ul/t/li[hasclass('nav-item')]">`, we get the following exception + traceback, which is not very informative:
```
Traceback (most recent call last):
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/home/odoo/src/odoo/odoo/http.py", line 806, in dispatch
r = self._call_function(**self.params)
File "/home/odoo/src/odoo/odoo/http.py", line 359, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/odoo/src/odoo/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/home/odoo/src/odoo/odoo/http.py", line 350, in checked_call
result.flatten()
File "/home/odoo/src/odoo/odoo/http.py", line 1242, in flatten
self.response.append(self.render())
File "/home/odoo/src/odoo/odoo/http.py", line 1235, in render
return env["ir.ui.view"]._render_template(self.template, self.qcontext)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_ui_view.py", line 1708, in _render_template
return self.browse(self.get_view_id(template))._render(values, engine)
File "/home/odoo/src/odoo/addons/website/models/ir_ui_view.py", line 402, in _render
return super(View, self)._render(values, engine=engine, minimal_qcontext=minimal_qcontext)
File "/home/odoo/src/odoo/addons/web_editor/models/ir_ui_view.py", line 28, in _render
return super(IrUiView, self)._render(values=values, engine=engine, minimal_qcontext=minimal_qcontext)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_ui_view.py", line 1716, in _render
return self.env[engine]._render(self.id, qcontext)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_qweb.py", line 55, in _render
result = super(IrQWeb, self)._render(id_or_xml_id, values=values, **context)
File "/home/odoo/src/odoo/odoo/addons/base/models/qweb.py", line 258, in _render
self.compile(template, options)(self, body.append, values or {})
File "<decorator-gen-66>", line 2, in compile
File "/home/odoo/src/odoo/odoo/tools/cache.py", line 90, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_qweb.py", line 110, in compile
return super(IrQWeb, self).compile(id_or_xml_id, options=options)
File "/home/odoo/src/odoo/odoo/addons/base/models/qweb.py", line 275, in compile
element, document = self.get_template(template, options)
File "/home/odoo/src/odoo/odoo/addons/base/models/qweb.py", line 363, in get_template
path = options['last_path_node']
Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/home/odoo/src/odoo/odoo/http.py", line 806, in dispatch
r = self._call_function(**self.params)
File "/home/odoo/src/odoo/odoo/http.py", line 359, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/odoo/src/odoo/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/home/odoo/src/odoo/odoo/http.py", line 350, in checked_call
result.flatten()
File "/home/odoo/src/odoo/odoo/http.py", line 1242, in flatten
self.response.append(self.render())
File "/home/odoo/src/odoo/odoo/http.py", line 1235, in render
return env["ir.ui.view"]._render_template(self.template, self.qcontext)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_ui_view.py", line 1708, in _render_template
return self.browse(self.get_view_id(template))._render(values, engine)
File "/home/odoo/src/odoo/addons/website/models/ir_ui_view.py", line 402, in _render
return super(View, self)._render(values, engine=engine, minimal_qcontext=minimal_qcontext)
File "/home/odoo/src/odoo/addons/web_editor/models/ir_ui_view.py", line 28, in _render
return super(IrUiView, self)._render(values=values, engine=engine, minimal_qcontext=minimal_qcontext)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_ui_view.py", line 1716, in _render
return self.env[engine]._render(self.id, qcontext)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_qweb.py", line 55, in _render
result = super(IrQWeb, self)._render(id_or_xml_id, values=values, **context)
File "/home/odoo/src/odoo/odoo/addons/base/models/qweb.py", line 258, in _render
self.compile(template, options)(self, body.append, values or {})
File "<decorator-gen-66>", line 2, in compile
File "/home/odoo/src/odoo/odoo/tools/cache.py", line 90, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_qweb.py", line 110, in compile
return super(IrQWeb, self).compile(id_or_xml_id, options=options)
File "/home/odoo/src/odoo/odoo/addons/base/models/qweb.py", line 275, in compile
element, document = self.get_template(template, options)
File "/home/odoo/src/odoo/odoo/addons/base/models/qweb.py", line 363, in get_template
path = options['last_path_node']
KeyError: 'last_path_node'
```
**Desired behavior after PR is merged:**
Clearly the developer's intention is to raise QWebException instead, that provides more information:
```
Traceback (most recent call last):
File "/home/odoo/.local/lib/python3.7/site-packages/werkzeug/serving.py", line 270, in run_wsgi
execute(self.server.app)
File "/home/odoo/.local/lib/python3.7/site-packages/werkzeug/serving.py", line 258, in execute
application_iter = app(environ, start_response)
File "/home/odoo/src/odoo/odoo/service/server.py", line 440, in app
return self.app(e, s)
File "/home/odoo/src/odoo/odoo/service/wsgi_server.py", line 124, in application
return application_unproxied(environ, start_response)
File "/home/odoo/src/odoo/odoo/service/wsgi_server.py", line 99, in application_unproxied
result = odoo.http.root(environ, start_response)
File "/home/odoo/src/odoo/odoo/http.py", line 1295, in __call__
return self.dispatch(environ, start_response)
File "/home/odoo/src/odoo/odoo/http.py", line 1263, in __call__
return self.app(environ, start_wrapped)
File "/home/odoo/.local/lib/python3.7/site-packages/werkzeug/wsgi.py", line 766, in __call__
return self.app(environ, start_response)
File "/home/odoo/src/odoo/odoo/http.py", line 1465, in dispatch
result = ir_http._dispatch()
File "/home/odoo/src/odoo/addons/website_sale/models/ir_http.py", line 15, in _dispatch
return super(IrHttp, cls)._dispatch()
File "/home/odoo/src/odoo/addons/website/models/ir_http.py", line 181, in _dispatch
response = super(Http, cls)._dispatch()
File "/home/odoo/src/odoo/addons/auth_signup/models/ir_http.py", line 19, in _dispatch
return super(Http, cls)._dispatch()
File "/home/odoo/src/odoo/addons/web_editor/models/ir_http.py", line 21, in _dispatch
return super(IrHttp, cls)._dispatch()
File "/home/odoo/src/odoo/addons/utm/models/ir_http.py", line 29, in _dispatch
response = super(IrHttp, cls)._dispatch()
File "/home/odoo/src/odoo/addons/http_routing/models/ir_http.py", line 512, in _dispatch
result = super(IrHttp, cls)._dispatch()
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_http.py", line 241, in _dispatch
return cls._handle_exception(e)
File "/home/odoo/src/odoo/addons/utm/models/ir_http.py", line 34, in _handle_exception
response = super(IrHttp, cls)._handle_exception(exc)
File "/home/odoo/src/odoo/addons/http_routing/models/ir_http.py", line 644, in _handle_exception
values = cls._get_values_500_error(env, values, exception)
File "/home/odoo/src/odoo/addons/website/models/ir_http.py", line 357, in _get_values_500_error
et = etree.fromstring(view.with_context(inherit_branding=False).read_combined(['arch'])['arch'])
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_ui_view.py", line 809, in read_combined
arch = root.apply_view_inheritance(arch_tree, self.model)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_ui_view.py", line 750, in apply_view_inheritance
return self._apply_view_inheritance(source, inherit_tree)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_ui_view.py", line 759, in _apply_view_inheritance
source = view._apply_view_inheritance(source, inherit_tree)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_ui_view.py", line 758, in _apply_view_inheritance
source = view.apply_inheritance_specs(source, arch_tree)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_ui_view.py", line 735, in apply_inheritance_specs
self.handle_view_error(str(e))
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_ui_view.py", line 673, in handle_view_error
raise ValueError(formatted_message).with_traceback(from_traceback) from from_exception
ValueError: Element '<xpath expr="//form/ul/t/li[hasclass('nav-item')]">' cannot be located in parent view
View name: products_attributes
Error context:
view: ir.ui.view(3656,)
view.parent: ir.ui.view(2620,) - - -
```
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#63931PURPOSE The purpose is to make sure that clicking on the top/bottom padding of a m2x dropdown selects the first/last item instead of closing the dropdown. SPEC Clicking on top/bottom padding of many2one dropdown inside editable listview should not unselect row i.e. should not close editable row instead row remain open as well as many2one dropdown should also remain open. TASK 2377864 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Po
Original PR description
PURPOSE The purpose is to make sure that clicking on the top/bottom padding of a m2x dropdown selects the first/last item instead of closing the dropdown. SPEC Clicking on top/bottom padding of many2one dropdown inside editable listview should not unselect row i.e. should not close editable row instead row remain open as well as many2one dropdown should also remain open. TASK 2377864 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#63993 Forward-Port-Of: odoo/odoo#61712
PURPOSE Currently in embedded listview in o2m if there is no records and user opens optional dropdown and if optional dropdown is bigger then it is hidden behind listview, optional dropdown should open on top of listview. SPEC in a embedded listview, the optional fields dropdown should be 'on top of' (i.e. outside) the listview TASK 2370860 Fixes https://github.com/odoo/odoo/issues/62681 Closes https://github.com/odoo/odoo/issues/62681 -- I confirm I have signed the CLA and rea
Original PR description
PURPOSE Currently in embedded listview in o2m if there is no records and user opens optional dropdown and if optional dropdown is bigger then it is hidden behind listview, optional dropdown should open on top of listview. SPEC in a embedded listview, the optional fields dropdown should be 'on top of' (i.e. outside) the listview TASK 2370860 Fixes https://github.com/odoo/odoo/issues/62681 Closes https://github.com/odoo/odoo/issues/62681 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#63698 Forward-Port-Of: odoo/odoo#62472
Follow up on d0a4b20d3660c09b1ebe203125d57c9a533c7957 The `lang` at this step is compared to the locale `code` (eg. fr_BE) so the split is a mistake. To reproduce the issue: - change the language of a website to fr_BE only - allow free signup - register as a new user Notice how the language of the user is set to en_US before this PR instead of fr_BE as it should be. closes #63616 Forward-Port-Of: odoo/odoo#63879
Original PR description
Follow up on d0a4b20d3660c09b1ebe203125d57c9a533c7957 The `lang` at this step is compared to the locale `code` (eg. fr_BE) so the split is a mistake. To reproduce the issue: - change the language of a website to fr_BE only - allow free signup - register as a new user Notice how the language of the user is set to en_US before this PR instead of fr_BE as it should be. closes #63616 Forward-Port-Of: odoo/odoo#63879
Best regards Description of the issue/feature this PR addresses: Hi i detected an issue on POS, to reproduce just get into a customer on the POS UI, change something else than the name, then try to save changes, this trigger the if in line 47 of ClientDetailsEdit, making the user to mandatory edit the name field then save again and it works. Current behavior before PR: Name is asked when user edits something else when name ios available Desired behavior after PR is merged: If name is
Original PR description
Best regards Description of the issue/feature this PR addresses: Hi i detected an issue on POS, to reproduce just get into a customer on the POS UI, change something else than the name, then try to save changes, this trigger the if in line 47 of ClientDetailsEdit, making the user to mandatory edit the name field then save again and it works. Current behavior before PR: Name is asked when user edits something else when name ios available Desired behavior after PR is merged: If name is present it doesnt ask for it, if it isnt presents it asks for it The only change on the file is on line 47 where I check if the name is already on the prop so that it works as intended. Its a mild UX issue with a very easy fix. hope you can upload it soon to the repo so that users on Odoo SaaS or users with no code skills dont have this Issue anymore- -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#63281
Fixes 3a6ac95 that ignores computation of recursive stored fields during creation of records. ping @rco-odoo Description of the issue/feature this PR addresses: The change in https://github.com/odoo/odoo/pull/63293 led to a regression observed in unit tests of an OCA module (https://github.com/OCA/stock-logistics-warehouse/pull/1035). The impacted field in the OCA module is https://github.com/OCA/stock-logistics-warehouse/blob/18f6c1e60adc7cb12c18868888bd1bcb3ba3f979/stock_vertical_li
Original PR description
Fixes 3a6ac95 that ignores computation of recursive stored fields during creation of records. ping @rco-odoo Description of the issue/feature this PR addresses: The change in…
Fixes 3a6ac95 that ignores computation of recursive stored fields during creation of records. ping @rco-odoo Description of the issue/feature this PR addresses: The change in https://github.com/odoo/odoo/pull/63293 led to a regression observed in unit tests of an OCA module (https://github.com/OCA/stock-logistics-warehouse/pull/1035). The impacted field in the OCA module is https://github.com/OCA/stock-logistics-warehouse/blob/18f6c1e60adc7cb12c18868888bd1bcb3ba3f979/stock_vertical_lift/models/stock_location.py#L53-L64. The problem happens when we have: * a recursive stored computed field * an `api.depends` of this field which is a relation to another record When this "another record" is created and should recompute the recursive field, it is ignored. Current behavior before PR: On creation of records, dependent recursive fields are not recomputed. Desired behavior after PR is merged: On creation of records, dependent recursive fields are recomputed. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#64031 Forward-Port-Of: odoo/odoo#63979
BEFORE: * no translation * no errors, because underscore.js allows this usage * apparently, someone mistook py and js translations --- opw-2421769 Forward-Port-Of: odoo/enterprise#15562
Original PR description
BEFORE: * no translation * no errors, because underscore.js allows this usage * apparently, someone mistook py and js translations --- opw-2421769 Forward-Port-Of: odoo/enterprise#15562
Before this commit, when documents is installed without demo data, the sample data would trigger rpc requests to fetch thumbnails of record that does not exists. taskid: 2421457 Forward-Port-Of: odoo/enterprise#15405
Original PR description
Before this commit, when documents is installed without demo data, the sample data would trigger rpc requests to fetch thumbnails of record that does not exists. taskid: 2421457 Forward-Port-Of: odoo/enterprise#15405
Forward-Port-Of: odoo/enterprise#15528
Original PR description
Forward-Port-Of: odoo/enterprise#15528