Thursday, February 3, 2022
24 changes · master
Enhancements to existing features
The mail module was updated to use a newer internal component access pattern. This helps keep the codebase aligned with current framework practices and supports easier maintenance without changing user-facing behavior.
Original PR description
Part of task-2694208
Payment tests no longer add CSRF tokens to JSON-based requests because those tokens are not used for that request type. This keeps the test setup simpler and better aligned with how the system actually handles these requests, with no expected impact on users.
Original PR description
The CSRF token is not checked for JSON(-RPC) requests.
This update standardizes how chat and messaging components receive styling information, helping keep the interface more consistent across live chat and mail screens. It is a minor internal improvement that supports easier maintenance without changing core user workflows.
Original PR description
Part of task-2694196
This update adds test coverage to ensure file upload activities keep the correct activity type when changed. It reduces the risk of future regressions in the mail activity workflow without changing the user experience directly.
Original PR description
Some recent changes have evidenced that the modification of the activity type of an 'upload_file' activity was not properly covered by the tests. This commit adds a new test for this specific case. Part of task-2730667
This update tidies internal naming for attachment lists in Odoo's mail features. It helps keep the code easier to maintain without changing how users interact with email attachments.
Several reporting and customization components were adjusted to stay compatible with recent platform changes in Odoo's report rendering engine. This helps ensure invoices, delivery documents, tax reports, and worksheet templates continue to generate reliably after the underlying technical update.
Original PR description
[IMP] web_studio: addapt to community merge file qweb.py and ir_qweb.py [IMP] web_studio: addapt to changes: IrQweb remove compiling recursivity
Resolved issues and error corrections
This change ensures the web interface has the translation support it needs when showing a screen-blocking message. It prevents a small internal dependency issue that could affect the reliability of this user interface behavior.
Original PR description
This commit adds the "localization" dependency to the ui_service. The BlockUi component used by ui_service uses the _t function added by the localization service. 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
Code cleanup and technical improvements
The Mail activity view styling was simplified as part of a broader interface cleanup, making the code easier to maintain without changing core business workflows. A small alignment issue for inline avatars was also corrected, improving the visual consistency of activity displays.
Original PR description
Simplify/Reduce SCSS for the Activity component. task-2731819. requires: - ~~https://github.com/odoo/odoo/pull/83260~~ -> Merged - ~~https://github.com/odoo/odoo/pull/83495~~ -> Discarded - ~~https://github.com/odoo/odoo/pull/83498~~ -> Discarded -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
The method constraint to validate the Check Number is slow # 1. Analyzing the following query: ```sql SELECT payment.check_number, move.journal_id FROM account_payment payment JOIN account_move move ON move.id = payment.move_id JOIN account_journal journal ON journal.id = move.journal_id, account_payment other_payment JOIN account_move other_move ON other_move.id = other_payment.move_id WHERE payment.check_number::integer = other_payment.check_num
Original PR description
The method constraint to validate the Check Number is slow # 1. Analyzing the following query: ```sql SELECT payment.check_number, move.journal_id FROM account_payment payment JOIN account_move move…
The method constraint to validate the Check Number is slow
# 1. Analyzing the following query:
```sql
SELECT
payment.check_number,
move.journal_id
FROM
account_payment payment
JOIN account_move move ON move.id = payment.move_id
JOIN account_journal journal ON journal.id = move.journal_id,
account_payment other_payment
JOIN account_move other_move ON other_move.id = other_payment.move_id
WHERE
payment.check_number::integer = other_payment.check_number::integer
AND move.journal_id = other_move.journal_id
AND payment.id != other_payment.id
AND payment.id IN (1085159)
AND move.state = 'posted'
AND other_move.state = 'posted';
```
The output is:
Planning Time: 3.354 ms
Execution Time: 2514.660 ms
Discarding null values
```diff
AND other_move.state = 'posted';
+ AND payment.check_number IS NOT NULL
```
The output is
Planning Time: 3.216 ms
Execution Time: 0.140 ms
# 2. The constraint is computed even if the payment is not a check (check_number is empty)
Returning early save useless extra computating
It is not needed to compare falsy values for duplicated for whole table
# 3. The validation to check if it not a number is not optimal
It is transforming the string -> integer -> string to check if the string is not a number
but it is enough using only string -> integer not needed to transform to string again
python3 -m timeit -u msec -s "check_numbers = [str(i) for i in range(1000000)]" "[str(int(i)) for i in check_numbers]"
> 1 loop, best of 5: 323 msec per loop
python3 -m timeit -u msec -s "check_numbers = [str(i) for i in range(1000000)]" "[int(i) for i in check_numbers]"
> 2 loops, best of 5: 135 msec per loop
It is better but not enough, using `str.isdigit` method is 5x faster than original approach
python3 -m timeit -u msec -s "check_numbers = [str(i) for i in range(1000000)]" "[i.isdecimal() for i in check_numbers]"
> 5 loops, best of 5: 64 msec per loop
# Disclaimer:
The method has more opportunity areas
1. It could be a sql-constraint to validate digit or even migrate to integer the column
2. It could run the query only in the self.check_number values instead of the whole table
3. There is a maximum recursion for new databases recently migrated (hard to reproduce)
and more... but this PR try to do minimal changes since that it is a stable repository
and it is speeding-up the computation drastically
feel free to re-open a new PR to improve this method in a better and depth way for master branch
Forward-Port-Of: odoo/odoo#82595Users who jump across multiple gamification ranks will now receive only the relevant final rank notification instead of separate emails for each intermediate rank. This reduces unnecessary email noise, especially during new database setup when the administrator starts with enough karma to skip several ranks.
Original PR description
Purpose ======= When a user changes more than one rank at the time, avoid sending emails for every intermediate rank. This is particularly annoying when creating a new database, since the admin starts with 2500 karma and is sent 4 emails for each intermediate rank. Task-2746929
Fixes an issue in Mail where clicking a mention or link inside the preview of a message being replied to could trigger an error. Users can now interact with those preview links without disrupting the reply flow.
Original PR description
When clicking on a mention (or a link) within the preview of the message we're replying to, there was a traceback because we tried to update a component which has already been deleted. task-id: 2747321 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
This update fixes a bug in the timesheet grid to help ensure timesheet information behaves as expected. It matters because employees and managers rely on accurate timesheet entry and review for project tracking and billing.
…eport & Valuation report Steps to reproduce the bug: - Go to Settings > Technical > Decimal Accuracy - Change Unit of Measure to 4 digits - Go to Inventory report or Valuation report Bug: The decimal accuracy in Valuation report for quantity or reserved quantity was in two digits instead of four digits The decimal accuracy in Inventory report for qty_at_date was in two digits instead of four digits PS: In stock move report or stock move line report, the decimal accuracy of qu
Original PR description
…eport & Valuation report Steps to reproduce the bug: - Go to Settings > Technical > Decimal Accuracy - Change Unit of Measure to 4 digits - Go to Inventory report or Valuation report Bug: The decimal accuracy in Valuation report for quantity or reserved quantity was in two digits instead of four digits The decimal accuracy in Inventory report for qty_at_date was in two digits instead of four digits PS: In stock move report or stock move line report, the decimal accuracy of quantity fields are in four digits By default digits of Product Unit of Measure is 3, that's why some test had to be modified opw:2410981 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#82955
Ref: https://drive.google.com/file/d/1ObNPHzl8fIeNtmRIMLT60KtHJqOhrd0r/view Note: also added contextual help to the second occurrence of the "Removal Strategy" combo in `Configuration>Product categories>...>Force Removal Strategy`. task: 2654703-1 Forward-Port-Of: odoo/odoo#83560
Original PR description
Ref: https://drive.google.com/file/d/1ObNPHzl8fIeNtmRIMLT60KtHJqOhrd0r/view Note: also added contextual help to the second occurrence of the "Removal Strategy" combo in `Configuration>Product categories>...>Force Removal Strategy`. task: 2654703-1 Forward-Port-Of: odoo/odoo#83560
When selecting the text content of a link the underline and italic commands were not working in Firefox. We re-implement the Browser command to fix this. task-2667950 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#81033
Original PR description
When selecting the text content of a link the underline and italic commands were not working in Firefox. We re-implement the Browser command to fix this. task-2667950 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#81033
Forward-Port-Of: odoo/odoo#82497 Forward-Port-Of: odoo/odoo#82462
Original PR description
Forward-Port-Of: odoo/odoo#82497 Forward-Port-Of: odoo/odoo#82462
Current behavior : When creating an invoice from a PoS the description attached to the product was not the same as the one in the SO Steps to reproduce: - create a SO from Sales - create an invoice from the SO - preview the invoice - open a POS session - fetch the same SO - validate the order with an invoice compare the 2 invoices, they are not the same opw-2674896 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/o
Original PR description
Current behavior : When creating an invoice from a PoS the description attached to the product was not the same as the one in the SO Steps to reproduce: - create a SO from Sales - create an invoice from the SO - preview the invoice - open a POS session - fetch the same SO - validate the order with an invoice compare the 2 invoices, they are not the same opw-2674896 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82904
To reproduce : - Create a new documentation course from front-end - Add a content there - Edit the course in backend => any attempt to save the record or exiting it will trigger an error as the specific option is set and no content has been manually set. This has been introduced in 2597345 => We restore the default 'latest created' that makes it work all the time. Task-2731468 Forward-Port-Of: odoo/odoo#83171
Original PR description
To reproduce : - Create a new documentation course from front-end - Add a content there - Edit the course in backend => any attempt to save the record or exiting it will trigger an error as the specific option is set and no content has been manually set. This has been introduced in 2597345 => We restore the default 'latest created' that makes it work all the time. Task-2731468 Forward-Port-Of: odoo/odoo#83171
When searching sale order lines from another model (e.g. task), the order number was not being considered. The technical reason for the above is the resulting domaing was like this: [ '|', ('order_id.name', 'ilike', 'SO name'), ('name', 'ilike', 'SO name'), # The below line is added by _name_search of base model ('name', 'ilike', 'SO name'), ]) So, even though the order number is added to the domain, an extra condition was forcing
Original PR description
When searching sale order lines from another model (e.g. task), the
order number was not being considered.
The technical reason for the above is the resulting domaing was like this:
[
'|',
('order_id.name', 'ilike', 'SO name'),
('name', 'ilike', 'SO name'),
# The below line is added by _name_search of base model
('name', 'ilike', 'SO name'),
])
So, even though the order number is added to the domain, an extra
condition was forcing the line description to be the only field to be
considered.
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#83799
Forward-Port-Of: odoo/odoo#83627Steps to reproduce the bug: - Go to barcode app - Inventory adjustment > add a product - Press the gear at the top right - Print inventory Problem: A traceback is triggered, because before this change: https://github.com/odoo/enterprise/commit/c0151bce3c60c69e7cadeb719a81c4a702b71c34 The report_download function was called with the inventory adjustment id, but instead, now there is quants and as the function is called without the ids in the url, the function tries to find this infor
Original PR description
Steps to reproduce the bug: - Go to barcode app - Inventory adjustment > add a product - Press the gear at the top right - Print inventory Problem: A traceback is triggered, because before this change: https://github.com/odoo/enterprise/commit/c0151bce3c60c69e7cadeb719a81c4a702b71c34 The report_download function was called with the inventory adjustment id, but instead, now there is quants and as the function is called without the ids in the url, the function tries to find this information in the data, but nothing is given. Solution: Add quants ids of the current inventory adjustment in the context opw-2728885 Forward-Port-Of: odoo/enterprise#23921
2 fix follow ups for odoo/enterprise#23726: 1. Original fix updated the domain creation logic, but forgot to consider the case of no scheduled products for the mps. This lead to a domain of [] when looking for rfqs/moves to consider and resulted in an index error. Steps to reproduce: - install mrp_mps w/demo data - delete all demo products in MPS => traceback of index error 2.Original fix updated the domain to consider po.lines and outgoing moves that are relevant to a date_rang
Original PR description
2 fix follow ups for odoo/enterprise#23726: 1. Original fix updated the domain creation logic, but forgot to consider the case of no scheduled products for the mps. This lead to a domain of [] when…
2 fix follow ups for odoo/enterprise#23726: 1. Original fix updated the domain creation logic, but forgot to consider the case of no scheduled products for the mps. This lead to a domain of [] when looking for rfqs/moves to consider and resulted in an index error. Steps to reproduce: - install mrp_mps w/demo data - delete all demo products in MPS => traceback of index error 2.Original fix updated the domain to consider po.lines and outgoing moves that are relevant to a date_range due to lead times from multi-step rules. Unfortunately some rules (e.g. buy) can make it so lines/moves that shouldn't be considered are included when determining which date_range they fall under since their lead time isn't related to a picking. In other parts of mps (e.g. action_open_actual_...) these lines/moves are auto-filtered out by _filter_move, so we only need to filter them out during the time slots calculations. Steps to reproduce: - create a product with a 1 purchase vendor, delivery lead time = 1 - add the product to mps - create rfq for product, manually set the purchase.order.line date_planned = the last day of the previous month (e.g. if today is Feb, set to Jan 31) - try to open mps => traceback of index error since trying to figure out which date_range the po.line with date_planned < after_date should go under (e.g. where Jan 31 should go when after_date = Feb 1) Forward-Port-Of: odoo/enterprise#23910
- Have a group of taxes containing some children taxes having 'type_tax_use' != 'none'. - Create an invoice and open the tax report => The amounts are computed only for the group of taxes. Before 15.0, the children taxes were displayed in that case. This commit aims to reintroduce this behavior. Forward-Port-Of: odoo/enterprise#23855
Original PR description
- Have a group of taxes containing some children taxes having 'type_tax_use' != 'none'. - Create an invoice and open the tax report => The amounts are computed only for the group of taxes. Before 15.0, the children taxes were displayed in that case. This commit aims to reintroduce this behavior. Forward-Port-Of: odoo/enterprise#23855
When clicking on consolidated balance with a conso without any accounts, It would try to build a total line with a total that does not exist. Add a condition to ensure that this will not be done when no total have been computed. Forward-Port-Of: odoo/enterprise#23939
Original PR description
When clicking on consolidated balance with a conso without any accounts, It would try to build a total line with a total that does not exist. Add a condition to ensure that this will not be done when no total have been computed. Forward-Port-Of: odoo/enterprise#23939
…oduct qty = 0 When a purchase order with a line where the product quantity is 0 was matched by the OCR, it caused a blackhole ... ahem ... a ZeroDivisionError. An additional check on that is now done to prevent it. opw: 2728241 Forward-Port-Of: odoo/enterprise#23906
Original PR description
…oduct qty = 0 When a purchase order with a line where the product quantity is 0 was matched by the OCR, it caused a blackhole ... ahem ... a ZeroDivisionError. An additional check on that is now done to prevent it. opw: 2728241 Forward-Port-Of: odoo/enterprise#23906