Thursday, October 26, 2023
13 changes · master
Enhancements to existing features
This update removes an outdated internal web helper and adjusts related mobile web tests. It helps keep the web codebase simpler and easier to maintain without introducing a direct user-facing change.
Original PR description
Part-of-task: 3439226
Resolved issues and error corrections
Toggling the option to hide empty lines in financial reports now updates the display immediately without reloading the full report from the database. This avoids unnecessary waiting and reduces system load while keeping the report data unchanged.
Original PR description
https://github.com/odoo/enterprise/commit/4bf10c05ec9fa0aa794a02b163f2afd858ffa613#diff-9c1cf6319c0d789e8b5f51f2f340e63f9c3ca54e3df3b9d6babc4c35670880c7 introduced the new hide_0_lines filter, allowing the user to hide the lines with an empty amount. This filter relies on a javascript treatment of the returned lines to decide whether or not to display them, but they are always all returned by the server. The original implementation, however, made use of the toggleFilter() helper function, which modifies the options dict before calling the database to fully regenerate the report. In this case, this was useless, since the returned lines would be the same. Instead of doing that, we now assign the option key without reloading everything, and then just recompute the visibility of the lines.
Code cleanup and technical improvements
The company switching code has been reorganized and renamed to make it easier for developers to understand and maintain. There is no intended functional change for users, aside from clearer company hierarchy display on mobile.
Original PR description
This commit refactors the company service to be split responsibilities. The selection logic is now entirely contained in the switch_company_menu, making the company service clearer. The following variables have also been renamed: - `availableCompanies` has been renamed to `allowedCompanies` to reflect the name from the python side - `allowedCompanies` has been renamed to `activeCompanies` Indent has aslo been added to SwitchMenuItem on mobile to display the hierachy of companies. *The functional aspect of the company service and company switch has not been changed.* Community: https://github.com/odoo/odoo/pull/138521 Task: [3522168](https://www.odoo.com/mail/view?model=project.task&res_id=3522168) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
The formatting parameter should be a parameter to `_()` itself, and should especially not be formatted in *before* translation, as that makes the source string not match and the entire thing fail. Forward-Port-Of: odoo/enterprise#49445 Forward-Port-Of: odoo/enterprise#49406
Original PR description
The formatting parameter should be a parameter to `_()` itself, and should especially not be formatted in *before* translation, as that makes the source string not match and the entire thing fail. Forward-Port-Of: odoo/enterprise#49445 Forward-Port-Of: odoo/enterprise#49406
This update cleans up two minor user experience issues in manufacturing and rental sales workflows. It removes an unnecessary creation option from the work center overview and restores normal Tab-key navigation when a quantity availability field is hidden, making daily use smoother and less confusing.
Original PR description
This back to basics fix and revamp some small features from mrp. task-id: 3201527
This update fixes a minor alignment issue in the screen used to convert helpdesk tickets into leads. The change makes the conversion form look cleaner and easier to use, without altering the underlying process.
Original PR description
In this PR, we fix the small alignment issue when the user try to convert the ticket to lead. task-3248965
This update modernizes how keyboard input is detected across several Odoo apps by replacing outdated browser properties. It helps keep document signing, PDF handling, helpdesk search, website knowledge search, and related screens compatible with current and future browsers without changing business workflows.
Original PR description
…perties These properties are deprecated. We should consider to use `KeyboardEvent.key` or `KeyboardEvent.code` for new code. Note that we prefer to use the `key` property as multiple physical keys…
…perties These properties are deprecated. We should consider to use `KeyboardEvent.key` or `KeyboardEvent.code` for new code. Note that we prefer to use the `key` property as multiple physical keys can send the same value (e.g. Enter can also be sent by the numeric pad). We should only use `code` when we explicitly want to target a single physical key on the keyboard. By doing this, we can now remove the dependency of `jQuery.ui.keyCode` that was used as mapping of key code descriptions to their numeric values. References: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/charCode (deprecated) https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode (deprecated) https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/which (deprecated) https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key https://api.jqueryui.com/1.12/jQuery.ui.keyCode/ Some links that helps: https://w3c.github.io/uievents/tools/key-event-viewer.html https://www.toptal.com/developers/keycode/table
This update removes older behind-the-scenes page behavior functions as part of ongoing code cleanup. It should make the product easier to maintain without changing how business users work day to day.
The Knowledge app now uses the browser's built-in clipboard capability for copying template content. This reduces reliance on an external clipboard tool while keeping the user experience the same.
Original PR description
task-3439226
# Issue: The General Ledger can't open when coming from Profit & Loss by selecting a specific account to show in the GL. # Analyze: When coming from another report to the General Ledger with a specific contextual account while having the `unfold_all` option. The unfold_all option is passed to the general ledger. Which leads to a TimeOut issue on databases using a lot accounting because there are just too many lines. # Fix: As on V15. When coming from another report and specifying a con
Original PR description
# Issue: The General Ledger can't open when coming from Profit & Loss by selecting a specific account to show in the GL. # Analyze: When coming from another report to the General Ledger with a specific contextual account while having the `unfold_all` option. The unfold_all option is passed to the general ledger. Which leads to a TimeOut issue on databases using a lot accounting because there are just too many lines. # Fix: As on V15. When coming from another report and specifying a contextual account, the report should open with only the data from the specified account. If the user want to Unfold All it is only 2 more clicks. Which is either a perf and an ergonomic improvement. # Related ticket: opw-3452606 # Affected version: 16.0 and above Forward-Port-Of: odoo/enterprise#49068
There is a typo introduced in https://github.com/odoo/enterprise/pull/47550/commits/24310f33a16da9e9ae4493c80c6450b561465697 that causes a traceback when the sendcloud rating request fails. opw-3568930 Forward-Port-Of: odoo/enterprise#49467
Original PR description
There is a typo introduced in https://github.com/odoo/enterprise/pull/47550/commits/24310f33a16da9e9ae4493c80c6450b561465697 that causes a traceback when the sendcloud rating request fails. opw-3568930 Forward-Port-Of: odoo/enterprise#49467
Steps to reproduce: ------------------- - go to Time-Off / Overview; - remove default "My Team" filter; - group by "Company"; - add a custom group by on "Employee". Issue: ------ A traceback occurs. Cause: ------ When we try to get leaves (via `leave_mapping`) using employee id, the id doesn't exist in this dictionnary. It is because we don't have employee to initialise `leave_mapping`. In fact, the `tag_employee_rows` method doesn't return employee ids. Solution: ---------
Original PR description
Steps to reproduce: ------------------- - go to Time-Off / Overview; - remove default "My Team" filter; - group by "Company"; - add a custom group by on "Employee". Issue: ------ A traceback occurs. Cause: ------ When we try to get leaves (via `leave_mapping`) using employee id, the id doesn't exist in this dictionnary. It is because we don't have employee to initialise `leave_mapping`. In fact, the `tag_employee_rows` method doesn't return employee ids. Solution: --------- As the `tag_employee_rows` method is recursive via itself, it is necessary to update the internal employee id set variable with the employee ids of the subrows. This method will return all the employees concerned by the rows and we can build the dictionary with their leaves. opw-3547369 Forward-Port-Of: odoo/enterprise#49386
The `_notify_by_web_push_prepare_payload` function dictionary contains message information for a browser device. https://github.com/odoo/enterprise/blob/36bc68ff4008a0b3d0b15d88244fa8db22b30ef4/mail_enterprise/models/mail_thread.py#L155 the `author_id` will be prepared in the form list of a list. https://github.com/odoo/enterprise/blob/36bc68ff4008a0b3d0b15d88244fa8db22b30ef4/mail_enterprise/models/mail_thread.py#L156 after that browse the `author_Id` and author id prepare like this `[
Original PR description
The `_notify_by_web_push_prepare_payload` function dictionary contains message information for a browser device.…
The `_notify_by_web_push_prepare_payload` function dictionary contains message information for a browser device.
https://github.com/odoo/enterprise/blob/36bc68ff4008a0b3d0b15d88244fa8db22b30ef4/mail_enterprise/models/mail_thread.py#L155
the `author_id` will be prepared in the form list of a list.
https://github.com/odoo/enterprise/blob/36bc68ff4008a0b3d0b15d88244fa8db22b30ef4/mail_enterprise/models/mail_thread.py#L156
after that browse the `author_Id` and author id prepare like this `[[1]]`,that why error will be generated.
The `message.author_id.ids` are returning ids in list form, so here we don't need to add `[message.author_id.ids]` to the list because it already returns id in list form.
sentry traceback:
```
TypeError: unhashable type: 'list'
File "odoo/tools/safe_eval.py", line 365, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "ir.actions.server(132,)", line 1, in <module>
File "addons/mail/models/mail_message_schedule.py", line 51, in _send_notifications_cron
messages_scheduled._send_notifications()
File "addons/mail/models/mail_message_schedule.py", line 80, in _send_notifications
record._notify_thread(schedule.mail_message_id, msg_vals=False, **notify_kwargs)
File "home/odoo/src/enterprise/saas-16.4/mail_mobile/models/mail_thread.py", line 25, in _notify_thread
recipients_data = super(MailThread, self)._notify_thread(message, msg_vals=msg_vals, **kwargs)
File "addons/sms/models/mail_thread.py", line 240, in _notify_thread
recipients_data = super(MailThread, self)._notify_thread(message, msg_vals=msg_vals, **kwargs)
File "home/odoo/src/enterprise/saas-16.4/mail_enterprise/models/mail_thread.py", line 21, in _notify_thread
self._notify_thread_by_web_push(message, recipients_data, msg_vals, **kwargs)
File "home/odoo/src/enterprise/saas-16.4/mail_enterprise/models/mail_thread.py", line 103, in _notify_thread_by_web_push
payload = self._notify_by_web_push_prepare_payload(message, msg_vals=msg_vals)
File "home/odoo/src/enterprise/saas-16.4/mail_enterprise/models/mail_thread.py", line 156, in _notify_by_web_push_prepare_payload
author_name = self.env['res.partner'].browse(author_id).name
File "odoo/fields.py", line 1160, in __get__
value = env.cache.get(record, self)
File "odoo/api.py", line 965, in get
cache_value = field_cache[record._ids[0]]
ValueError: <class 'TypeError'>: "unhashable type: 'list'" while evaluating
'model._send_notifications_cron()'
File "odoo/addons/base/models/ir_cron.py", line 373, in _callback
self.env['ir.actions.server'].browse(server_action_id).run()
File "home/odoo/src/custom/trial/saas_trial/models/sentry.py", line 33, in run
res = super().run()
File "odoo/addons/base/models/ir_actions.py", line 688, in run
res = runner(run_self, eval_context=eval_context)
File "addons/website/models/ir_actions_server.py", line 61, in _run_action_code_multi
res = super(ServerAction, self)._run_action_code_multi(eval_context)
File "odoo/addons/base/models/ir_actions.py", line 558, in _run_action_code_multi
safe_eval(self.code.strip(), eval_context, mode="exec", nocopy=True, filename=str(self)) # nocopy allows to return 'action'
File "odoo/tools/safe_eval.py", line 379, in safe_eval
raise ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr))
```
sentry-4528742217
Forward-Port-Of: odoo/enterprise#48617