Friday, November 6, 2020
21 changes · master
Enhancements to existing features
Users can now search and filter records by activity status, such as overdue, due today, or planned. This makes it easier for teams to find and prioritize work based on upcoming or missed activities, with timezone-aware results.
Original PR description
Purpose ======= Make the "activity_state" searchable on the "mail.activity" mixin. This field is not stored as it depends on the current time. Technical ========= To make the search, we perform a SQL query. The "activity_state" depends on the state of each activities on the record. And this state also depends on the timezone of the user of the activity. That's what made things tricky and we need to make the conversion in SQL for performance purpose (we can not fetch all records and compute them in python). There's a special case, where there's less than 24 hours between the deadline and the current time but one day of difference. In that case the state should be "planned" and not "today". This case is handle by the function "DATE_TRUNC" (e.g. 23h 01/01/2020 & 1h 02/02/2020). Also for performance purpose, we compute the delay only once and we use the function "SIGN" so we can use a switch/case instead of duplicating 3 times the expressions. Task 2354754
The Notes app form view has been restyled to use more of the available screen space, removing the visible sheet-like framing and resizing controls. This gives users a cleaner, wider writing area while keeping compatibility with existing Odoo form and chatter behavior.
Original PR description
   --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update increases the padding around text block and title snippets on website pages. The added spacing helps content look cleaner and easier to read when building or editing pages.
Original PR description
task-2327741 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
Supplier bank account choices now include the bank name during payment selection. This makes it easier for users to pick the correct account when a supplier has multiple bank accounts.
Original PR description
Description of the issue/feature this PR addresses: When you make a payment, if a supplier have multi bank account, the bank name is not show in the selection. With the bank name it is more simple to find the good bank account (if you know the bank). Current behavior before PR:  Desired behavior after PR is merged:  @qdp-odoo @alexis-via -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Resolved issues and error corrections
This fixes a minor issue in the website editor test suite by ensuring test page content is properly cleaned up after a save test. It helps keep automated testing reliable and prevents one test from affecting later checks, with no direct impact on end users.
Original PR description
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
-- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#61331
Original PR description
-- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#61331
Removing an image from an image wall now deletes only the selected image instead of sometimes removing two. The image add helper also reappears when the last image is removed, making gallery editing more reliable for website editors.
Original PR description
* On image remove was removing two images instead of one -> fixed * Reactivate the image adder helper if you manually remove the last image ---- Bug report : [QSM] Images wall snippet -> Add images -> click on one -> Delete via the trash icon button on the overlay -> Sometimes (most of the time) delete 2 images instead of the selected one
This fix ensures that when a website editor adds a background video, any previous background image is properly cleared. It helps prevent unwanted visual overlap or outdated imagery from appearing on published pages.
Original PR description
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
When using eg. arabic locale, the figures inside dates were replaced by arabic figures which are not supported server side (they are almost always sent in latin figures). With this changeset, the we are using english locale to get date in domains. Without the change, added test fails with: Numbers in domain should not use addoneForTest locale Expected:...[date_field, >=, 2020-06-01], [date_field, <=, 2020-06-30] Result:...[date_field, >=, 3131-17-12], [date_field, <=, 3131-17-41] opw-2
Original PR description
When using eg. arabic locale, the figures inside dates were replaced by arabic figures which are not supported server side (they are almost always sent in latin figures). With this changeset, the we are using english locale to get date in domains. Without the change, added test fails with: Numbers in domain should not use addoneForTest locale Expected:...[date_field, >=, 2020-06-01], [date_field, <=, 2020-06-30] Result:...[date_field, >=, 3131-17-12], [date_field, <=, 3131-17-41] opw-2370392 Forward-Port-Of: odoo/odoo#61354
Fix traceback when creating a new contact by checking the id list is not empty Filter default reporting by name rather then by campaign (as campaign is an option) Group by Campaign only if the option is checked to enforce coherency. -> This is unblocked with a group. Hide the 'replied' status from sms reports as it is not relevant for sms. Remove the preview message for sms as it is not relevant elsewhere then the object of mails. Warn the user if he's trying to send a sms with only white-
Original PR description
Fix traceback when creating a new contact by checking the id list is not empty Filter default reporting by name rather then by campaign (as campaign is an option) Group by Campaign only if the option is checked to enforce coherency. -> This is unblocked with a group. Hide the 'replied' status from sms reports as it is not relevant for sms. Remove the preview message for sms as it is not relevant elsewhere then the object of mails. Warn the user if he's trying to send a sms with only white-space characters. -> this causes an error because the plaintext-html conversion in mail_thread.py -> consider a white-spaces-only text as empty. Mobile placeholder added for a better understanding of the field by the user. Task ID : 2302578 Forward-Port-Of: odoo/odoo#60426
We need to ensure the name stays consistent with the journal_id and the date when we try to change one of those fields. opw-[2374551](https://www.odoo.com/web#id=2374551&model=project.task) -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#61440 Forward-Port-Of: odoo/odoo#60234
Original PR description
We need to ensure the name stays consistent with the journal_id and the date when we try to change one of those fields. opw-[2374551](https://www.odoo.com/web#id=2374551&model=project.task) -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#61440 Forward-Port-Of: odoo/odoo#60234
Steps to reproduce the bug: - CRM--> Configuration --> Tags - Delete the tag "No more partner available" - CRM --> Lead --> Automatic Assignment Bug: It will raise Traceback `AttributeError: 'NoneType' object has no attribute 'id'` as Tag is not Present. With this Commit: It will add Tag if it exists on database. Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed t
Original PR description
Steps to reproduce the bug: - CRM--> Configuration --> Tags - Delete the tag "No more partner available" - CRM --> Lead --> Automatic Assignment Bug: It will raise Traceback `AttributeError: 'NoneType' object has no attribute 'id'` as Tag is not Present. With this Commit: It will add Tag if it exists on database. 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#61447
The BS4 tempusdominus lib has 2 issues within Odoo: 1. On wrong string formating (eg typing "33"), the lib would trigger its own error "datetimepicker.error" that would be catch in our crash manager making it display a modal error. This is generally handled by catching that event and preventing it to bubble to the crash manager, see: Datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/widgets/date_picker.js#
Original PR description
The BS4 tempusdominus lib has 2 issues within Odoo: 1. On wrong string formating (eg typing "33"), the lib would trigger its own error "datetimepicker.error" that would be catch in our crash manager…
The BS4 tempusdominus lib has 2 issues within Odoo: 1. On wrong string formating (eg typing "33"), the lib would trigger its own error "datetimepicker.error" that would be catch in our crash manager making it display a modal error. This is generally handled by catching that event and preventing it to bubble to the crash manager, see: Datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/widgets/date_picker.js#L128 OWL datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/components/datepicker.js#L43 Snippets options: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web_editor/static/src/js/editor/snippets.options.js#L1646 2. If there is a valid date, and an user enter an unvalid date, the lib crashed by throwing `Cannot read property 'format' of undefined'`. Datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/widgets/date_picker.js#L94 (fbbfa6ddca and 5481c429efb) OWL datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/components/datepicker.js#L149 Snippets options: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web_editor/static/src/js/editor/snippets.options.js#L1617 Note that the issue was reported at https://github.com/tempusdominus/bootstrap-4/issues/223 This commit fixes those issues at a lower level so every BS4 date(time)picker benefits of it, for instance the page properties publish date. task-2335403 Forward-Port-Of: odoo/odoo#60514
Issue - Open any opportunity - Go to "Extra Information" and click on "Campaign" field - try to create new campaign Traceback is raised Cause "self.ids" is empty and the "tuple(self.ids)" on the SQL query return "()" Solution Initialize campaign field with default values opw-2376082 Forward-Port-Of: odoo/odoo#61318
Original PR description
Issue
- Open any opportunity
- Go to "Extra Information" and click on "Campaign" field
- try to create new campaign
Traceback is raised
Cause
"self.ids" is empty and the "tuple(self.ids)" on the SQL query return "()"
Solution
Initialize campaign field with default values
opw-2376082
Forward-Port-Of: odoo/odoo#61318Issue - Install "Approvals" - Submit new approval with you as "Request Owner" - Click on "View Approval Request" in your mailbox The link redirects to a 505 error Cause The model is not the correct one and the res_id is undefined Solution Specify the model and the res_id to _notify_get_action_link when creating the link with kwargs old PR: https://github.com/odoo/odoo/pull/60581 opw-2358845 Forward-Port-Of: odoo/odoo#61463 Forward-Port-Of:
Original PR description
Issue
- Install "Approvals"
- Submit new approval with you as "Request Owner"
- Click on "View Approval Request" in your mailbox
The link redirects to a 505 error
Cause
The model is not the correct one and the res_id is undefined
Solution
Specify the model and the res_id to _notify_get_action_link
when creating the link with kwargs
old PR: https://github.com/odoo/odoo/pull/60581
opw-2358845
Forward-Port-Of: odoo/odoo#61463
Forward-Port-Of: odoo/odoo#60998Add a margin bottom on snippet buttons. So when there are 2 buttons (or more) on the same line, we have a space between them on small devices when displayed vertically. task-2327741 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#60592
Original PR description
Add a margin bottom on snippet buttons. So when there are 2 buttons (or more) on the same line, we have a space between them on small devices when displayed vertically. task-2327741 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#60592
Before this commit, the value of data-oe-shape-data required double quotes to be properly parsed in JSON in the getShapeData method. After this commit, we also allow single quotes to prevent issue if someone doesn't use double quotes in the the value of data-oe-shape-data. Which was precisely the case in one of the themes and this is why this commit is a fix. task-2327741 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR
Original PR description
Before this commit, the value of data-oe-shape-data required double quotes to be properly parsed in JSON in the getShapeData method. After this commit, we also allow single quotes to prevent issue if someone doesn't use double quotes in the the value of data-oe-shape-data. Which was precisely the case in one of the themes and this is why this commit is a fix. task-2327741 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#60835
Usecase to reproduce: - Rule from WH/A -> WH/B as automatique no step added - Rule from WH/B -> WH/C as transfer created Do a move that goes to WH/A and confirm it. It's destination location is correctly set to WH/B but the internal transfer from WH/B to WH/C is not created. It's due to the avoid loop location that returns always true due to code removed in commit 1d36fb428f3dedfc343075c8b4f1980ec3f12600 Forward-Port-Of: odoo/odoo#61432 Forward-Port-Of: odoo/odoo#61414
Original PR description
Usecase to reproduce: - Rule from WH/A -> WH/B as automatique no step added - Rule from WH/B -> WH/C as transfer created Do a move that goes to WH/A and confirm it. It's destination location is correctly set to WH/B but the internal transfer from WH/B to WH/C is not created. It's due to the avoid loop location that returns always true due to code removed in commit 1d36fb428f3dedfc343075c8b4f1980ec3f12600 Forward-Port-Of: odoo/odoo#61432 Forward-Port-Of: odoo/odoo#61414
The order to find when to reset the sequence needs to be the following: * find a sequence used before the date of this move * if there isn't any, find the sequence of any move Because we were not looking at the second step for bank statements, we could have an issue since we were not checking the sequence relative to the correct date. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#61486
Original PR description
The order to find when to reset the sequence needs to be the following: * find a sequence used before the date of this move * if there isn't any, find the sequence of any move Because we were not looking at the second step for bank statements, we could have an issue since we were not checking the sequence relative to the correct date. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#61486
Issue - Install "Accounting" module - Create new company with "Mexico" as country and switch to this company - Install "l10n_mx_edi" module and ensure the current company have Mexican COA - Go to "Accounting" and create a quotation with some products. - Save then try to print the current quotation. The printed pdf have wrong structure: the table is not well arranged. Cause - 'th_source' was removed and therefore must update the indexes. - Check if 'is_cfdi_signed'
Original PR description
Issue - Install "Accounting" module - Create new company with "Mexico" as country and switch to this company - Install "l10n_mx_edi" module and ensure the current company have Mexican COA - Go to "Accounting" and create a quotation with some products. - Save then try to print the current quotation. The printed pdf have wrong structure: the table is not well arranged. Cause - 'th_source' was removed and therefore must update the indexes. - Check if 'is_cfdi_signed' on `th` but not `td` Solution - Update index column `td` - Add t-if='is_cfdi_signed' on `td` opw-2372759 Forward-Port-Of: odoo/enterprise#14613
In a multi-companies environment where company ids are not stored in cookies and default company is selected upon connection, changing background image with Studio will not display the new background immediately. If the background had been changed previously, it will not be visible directly. User will have to switch between companies to display the background image. Also, resetting default background only works for user's default company. The display issue comes from the fact that we a
Original PR description
In a multi-companies environment where company ids are not stored in cookies and default company is selected upon connection, changing background image with Studio will not display the new background…
In a multi-companies environment where company ids are not stored in cookies and default company is selected upon connection, changing background image with Studio will not display the new background immediately. If the background had been changed previously, it will not be visible directly. User will have to switch between companies to display the background image. Also, resetting default background only works for user's default company. The display issue comes from the fact that we are not checking the correct company (the selected one) to know if there is a background image, but the first one from "allowed_company_ids" set in context. The solution to check background image of the correct company would be to use the first company id retrieved from cookies, but only if user belongs to all retrieved company ids. Because when it is not the case, it means that connected user has changed and if one of the companies is not available for him, the current company becomes user's default one. In all other cases, background image is checked from user's default company. opw-2371025 Forward-Port-Of: odoo/enterprise#14604 Forward-Port-Of: odoo/enterprise#14591