Friday, December 24, 2021
16 changes · master
Enhancements to existing features
New CRM opportunities now automatically use the linked contact’s preferred language when available, improving customer communication consistency. Lead conversion was also optimized to avoid unnecessary updates when no customer is involved, improving performance in those cases.
Original PR description
Purpose ======= When creating an opportunity, set the language of the Lead/Opportunity to the partner's language if it is set instead of leaving it blank. Task-2709436
This update removes an unnecessary internal reference in the enterprise mail interface. It helps keep the messaging component simpler and easier to maintain without changing the user experience.
Original PR description
Task-2694206
Resolved issues and error corrections
This change updates CRM Helpdesk tests so they stay aligned with related test data changes in the community edition. It helps keep automated quality checks reliable without changing day-to-day user behavior.
Code cleanup and technical improvements
This change reorganizes part of the product pricelist logic to make pricing rule checks easier to customize in future developments. It does not introduce a visible change for users, but it helps maintain and extend pricing behavior more safely.
Original PR description
Extract in a method the check of pricelist rules with a given product for easier inherit. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
This commit fixes an issue where the trash icon was not properly shown in the dropdown when adding more custom filters. A test has been written to verify if the download button is present in the dropdown. task-2716032 Current behavior before PR: It was not possible to delete a condition added in a custom filter. Desired behavior after PR is merged: You can click on the delete button to delete the related condition. -- I confirm I have signed the CLA and read the PR guidelines
Original PR description
This commit fixes an issue where the trash icon was not properly shown in the dropdown when adding more custom filters. A test has been written to verify if the download button is present in the dropdown. task-2716032 Current behavior before PR: It was not possible to delete a condition added in a custom filter. Desired behavior after PR is merged: You can click on the delete button to delete the related condition. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#81852
This update simplifies and modernizes internal record handling in Odoo's core framework while removing old unused code and deprecated hooks. It should make future maintenance easier and slightly improve performance in some form update scenarios, with minimal direct impact for everyday users.
Original PR description
[REF] base: replace `_browse` by `__init__` The creation of recordset object was done by `_browse` instead of a normal python class with the `__init__`. We remove the old usage of `__init__`, we can…
[REF] base: replace `_browse` by `__init__` The creation of recordset object was done by `_browse` instead of a normal python class with the `__init__`. We remove the old usage of `__init__`, we can now reuse it with a normal usage. After this commit, we can create recordset by the Class without call a classmethod: `self.env['model_name'](env, ids, prefetch_ids)` [REM] base: depreciate _execute_sql It wasn't unused then depreciate to be removed in the next version. [REM] base: remove deadcode from models.py - Remove unused imports `AsIs` and `Collector` - Remove _schema variable (unused) - Remove same_name function (unused) - Remove attribute `_needaction` which is useless - Remove backward compatibility `__new__` and `__init__` which isn't used anymore. - Remove backward compatibility `__export_rows` [FIX] base: two small optimisation - The `update` method of BaseModel wasn't batch for no reason. This method is used in `_onchange_eval` and in few onchange in Odoo. - In `_modified_triggers` avoid a useless record union. [REM] base: depreciated refresh method The `refresh` method of models.py is a duplicate of `invalidate_cache` and deprecated since 8.0 but without any warning. Add this warning to be able to completely remove it in the next version. [REM] base: remove useless view_init view_init is a useless hook call from default_get. We can get the same result by overriding default_get directly.
Bug === Since 2d359b909bc27fd41125c9e44d9376b5a910f6d5 we moved the mailing list feature of the <mail.channel> in a different model, <mail.group>. During this split, some SMTP headers have been forgotten. Task-2721009 Forward-Port-Of: odoo/odoo#81785
Original PR description
Bug === Since 2d359b909bc27fd41125c9e44d9376b5a910f6d5 we moved the mailing list feature of the <mail.channel> in a different model, <mail.group>. During this split, some SMTP headers have been forgotten. Task-2721009 Forward-Port-Of: odoo/odoo#81785
Steps to reproduce: - Install Argentinian Electronic Payment (l10n_ar_edi) - Change company (ar responsable) - Go in Accounting > Settings: in the AFIP section - delete key and certificate - click on `generate request` -> the key is not persisted unless a manual refresh/discard is done Solution: In V14 the `onchange` is triggered. Why? Because this https://github.com/odoo/odoo/blob/1723c52d42389a8b5124ab4d15d55dad0d119a8f/addons/web/static/src/js/chrome/action_manager.js#L130-L139
Original PR description
Steps to reproduce: - Install Argentinian Electronic Payment (l10n_ar_edi) - Change company (ar responsable) - Go in Accounting > Settings: in the AFIP section - delete key and certificate - click on…
Steps to reproduce: - Install Argentinian Electronic Payment (l10n_ar_edi) - Change company (ar responsable) - Go in Accounting > Settings: in the AFIP section - delete key and certificate - click on `generate request` -> the key is not persisted unless a manual refresh/discard is done Solution: In V14 the `onchange` is triggered. Why? Because this https://github.com/odoo/odoo/blob/1723c52d42389a8b5124ab4d15d55dad0d119a8f/addons/web/static/src/js/chrome/action_manager.js#L130-L139 works because of the call of the `on_close` function: https://github.com/odoo/odoo/blob/1723c52d42389a8b5124ab4d15d55dad0d119a8f/addons/web/static/src/js/chrome/action_manager.js#L534-L543 Why not in V15? In V15 the onchange can be triggered when the `this.reload` function is called via the `on_closed` function: https://github.com/odoo/odoo/blob/7ce6d8d70be79c9c626865598b898dce9a18b045/addons/web/static/src/legacy/js/views/basic/basic_controller.js#L472-L482 But to be triggered, in the `wrapSuccessOrFail` (when the `_trigger_up` funciton is called), the `onClose` must be called: https://github.com/odoo/odoo/blob/fb3878b581b831c13550d40e38a8e8890d82ea0d/addons/web/static/src/legacy/action_adapters.js#L362-L376 In order to do that, we would have to use the `options` (the `params`) sent with the `doActionButton` in the `doAction` function. https://github.com/odoo/odoo/blob/fee371be291ba3d6f1adc71c08420b6510fdf386/addons/web/static/src/webclient/actions/action_service.js#L1198-L1199 BUT the `options` are not used anymore when `_executeActURLAction`* is called (only the `action`paramater is required): https://github.com/odoo/odoo/blob/fee371be291ba3d6f1adc71c08420b6510fdf386/addons/web/static/src/webclient/actions/action_service.js#L1098-L1104 Therefore, we find ourselves in a situation in which we cannot call the `on_closed` function in (the `options` are not even an 'option'**): https://github.com/odoo/odoo/blob/fee371be291ba3d6f1adc71c08420b6510fdf386/addons/web/static/src/webclient/actions/action_service.js#L748-L764 Look again in V14 how the function is called: https://github.com/odoo/odoo/blob/1723c52d42389a8b5124ab4d15d55dad0d119a8f/addons/web/static/src/js/chrome/action_manager.js#L527-L543 The solution is therefore easily understandable. *we are in this specific switch_case because the action executed is: https://github.com/odoo/enterprise/blob/6805d2f591237ad17d7db827dcf6fe36c2c2744f/l10n_ar_edi/models/res_config_settings.py#L30-L32 ** no pun intended OPW-2680841 Forward-Port-Of: odoo/odoo#81777
Some naming errors were introduced a few hours ago, this commit quickly fixes them hoping it goes unnoticed. [1]: https://github.com/odoo/odoo/commit/9f56357cc1f4a7b8606ef4d5fd431fc396bdf1e8 Forward-Port-Of: odoo/odoo#81870
Original PR description
Some naming errors were introduced a few hours ago, this commit quickly fixes them hoping it goes unnoticed. [1]: https://github.com/odoo/odoo/commit/9f56357cc1f4a7b8606ef4d5fd431fc396bdf1e8 Forward-Port-Of: odoo/odoo#81870
When sending a survey invite, applicant_id was populated with whatever active_id was available, regardless of the origin model. This was preventing users without Recruitment access rights from sending surveys. TaskID: 2721987 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#81851
Original PR description
When sending a survey invite, applicant_id was populated with whatever active_id was available, regardless of the origin model. This was preventing users without Recruitment access rights from sending surveys. TaskID: 2721987 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#81851
As JS is not taking the Object properties in the order they are written, the order in the rendering was always following the property name order (=id). Previous to this commit: - The companies were ordered by their id in the company switcher. After this commit: - The companies will be sorted by their sequence in the company switcher. task-2722235 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#81875
Original PR description
As JS is not taking the Object properties in the order they are written,
the order in the rendering was always following the property name order (=id).
Previous to this commit:
- The companies were ordered by their id in the company switcher.
After this commit:
- The companies will be sorted by their sequence in the company switcher.
task-2722235
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#81875There is an issue when exporting pdf using edi documents created before the PDF/A commit. With the subtype now included, the system would try to use the subtype given by the ir.attachment which would not be formated as expected by the pdf file format. The attachment may get neutered by the ORM, so we may have to force the mimetype when embedding it. This fix in two parts will allow to "hardcode" a subtype when adding an attachment into a pdf, as well as parse the subtype of ir.attachm
Original PR description
There is an issue when exporting pdf using edi documents created before the PDF/A commit. With the subtype now included, the system would try to use the subtype given by the ir.attachment which would not be formated as expected by the pdf file format. The attachment may get neutered by the ORM, so we may have to force the mimetype when embedding it. This fix in two parts will allow to "hardcode" a subtype when adding an attachment into a pdf, as well as parse the subtype of ir.attachment to give them the right format. xxx/xxx should become /xxx#2Fxxx opw-2714040 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#81890 Forward-Port-Of: odoo/odoo#81709
When printing a ticket, if some lines mix RTL and LTR words, the rendering won't be correct To reproduce the issue: (Need l10n_sa. Use demo data) 1. Switch the company: SA Company 2. Create a point of sale POS - Setup a direct device to print the tickets 3. Start POS 4. Process an order and print the ticket Error: On the printed ticket (not the displayed one, which is correct), some Arabic words overlap (see for instance the "Served by"). When printed the ticket, the latter
Original PR description
When printing a ticket, if some lines mix RTL and LTR words, the
rendering won't be correct
To reproduce the issue:
(Need l10n_sa. Use demo data)
1. Switch the company: SA Company
2. Create a point of sale POS
- Setup a direct device to print the tickets
3. Start POS
4. Process an order and print the ticket
Error: On the printed ticket (not the displayed one, which is correct),
some Arabic words overlap (see for instance the "Served by").
When printed the ticket, the latter is converted into an image thanks to
`html2canvas`. However, we need to add a space to separate LTR and RTL
words, otherwise the rendering won't be done properly. A similar issue
can be observed if the user language is AR: some other rendering issues
can be noticed on the ticket.
OPW-2704550
Forward-Port-Of: odoo/odoo#81886This commit adds an index on the user_id field of account.analytic.account Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>, Nicolas Seinlet <nse@odoo.com> task-2700429 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#81894
Original PR description
This commit adds an index on the user_id field of account.analytic.account Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>, Nicolas Seinlet <nse@odoo.com> task-2700429 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#81894
This commit implements the read_grid_grouped which returns the web_grid data at once, instead of per section (group) as it is when calling read_grid. The current implementation is too slow when called on big database. Thanks to this commit, the number of calls to the database to fetch de grid data is lowered to 2 instead of 1 + #groups. Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>, Priyanka Kaakdiya <pka@odoo.com>, Mohammed Shekha <msh@odoo.com> task-2700429 Related PR: odoo/od
Original PR description
This commit implements the read_grid_grouped which returns the web_grid data at once, instead of per section (group) as it is when calling read_grid. The current implementation is too slow when called on big database. Thanks to this commit, the number of calls to the database to fetch de grid data is lowered to 2 instead of 1 + #groups. Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>, Priyanka Kaakdiya <pka@odoo.com>, Mohammed Shekha <msh@odoo.com> task-2700429 Related PR: odoo/odoo#81894 Forward-Port-Of: odoo/enterprise#23096
Build Finnish Balance Sheet with domains on account_id.code rather than account_id.tags; the latter being not required fields. Also add an english version of both reports. Task id #2520452 Forward-Port-Of: odoo/enterprise#23036 Forward-Port-Of: odoo/enterprise#21999
Original PR description
Build Finnish Balance Sheet with domains on account_id.code rather than account_id.tags; the latter being not required fields. Also add an english version of both reports. Task id #2520452 Forward-Port-Of: odoo/enterprise#23036 Forward-Port-Of: odoo/enterprise#21999