Tuesday, April 18, 2023
20 changes · master
New functionality added to Odoo
Adds a stock ageing report that helps businesses understand how long inventory has been in stock, including products tracked by lots or serial numbers. The report uses stock movement data to calculate quantities by age, supports loading more products, and can be printed for review or sharing.
Enhancements to existing features
OCR-related updates in document chatter will now consistently appear as posted by OdooBot, regardless of whether the refresh was started manually or automatically. This avoids confusion from messages previously appearing under different authors such as the user or Public User.
Original PR description
There was an inconsistency about the author of the update message posted in the chatter when the OCR filled the document. If the user manually clicked on the "Refresh" button, they would be set as the author, whereas if the refresh was performed automatically (i.e. by the cron or the webhook), "Public User" would be the author. Now, OdooBot will always be the author. Community PR: odoo/odoo#117073
Resolved issues and error corrections
The contract history view no longer shows a signing request field that only applies to active employee contracts. This prevents confusion and avoids export errors when users work with contract history records.
Original PR description
Field `sign_request_ids` makes sense in `hr.contract` model, but not in `hr.contract.history`. Remove it to don't confuse users. For example, it leads to error if user tries to export it. opw-3140697
Miscellaneous changes
1. Install [Chile - Accounting] [Accounting] [Inventory] 2. Configure Chilean Localization on [Settings] if not by default 3. [Inventory] - [Delivery Orders] - [NEW] on the top left - Set the environment to CL Company (SII, etc configured on runbot) - Delivery Address has to be one configured with SII (Blanco Martin) - Add a Product [Large Cabinet] with quantity under Done - [VALIDATE] [CREATE DELIVERY GUIDE] on the top left - [DRAFT] next to delivery guide field created - [RETURN] on t
Original PR description
1. Install [Chile - Accounting] [Accounting] [Inventory] 2. Configure Chilean Localization on [Settings] if not by default 3. [Inventory] - [Delivery Orders] - [NEW] on the top left - Set the environment to CL Company (SII, etc configured on runbot) - Delivery Address has to be one configured with SII (Blanco Martin) - Add a Product [Large Cabinet] with quantity under Done - [VALIDATE] [CREATE DELIVERY GUIDE] on the top left - [DRAFT] next to delivery guide field created - [RETURN] on the top menu - [RETURN] on popup Issue: Delivery guide should not be mandatory field on return Resolve by: Hide from the view Impacted versions: 16 to master opw-2927683 Forward-Port-Of: odoo/enterprise#39407
**Before this commit:** If a user tries to move the child article(which cannot be displayed in the menu because a user can't read its parent) elsewhere with the "move to" gives a traceback. **After this commit:** Without any traceback, a user moves the child article even if it cannot be displayed in the menu. **Task**-3062064 Forward-Port-Of: odoo/enterprise#39906 Forward-Port-Of: odoo/enterprise#37385
Original PR description
**Before this commit:** If a user tries to move the child article(which cannot be displayed in the menu because a user can't read its parent) elsewhere with the "move to" gives a traceback. **After this commit:** Without any traceback, a user moves the child article even if it cannot be displayed in the menu. **Task**-3062064 Forward-Port-Of: odoo/enterprise#39906 Forward-Port-Of: odoo/enterprise#37385
At the end of the Belgian P&L, the result to be allocated (line 9906) is allocated among several accounts: 791/2 - Prélèvement sur les capitaux propres 691/2 - Affectation aux capitaux propres 794 - Intervention d'associés dans la perte 694/6 - Bénéfice à distribuer The remainder should go into line 14 - Bénéfice (Perte) à reporter. So the balance of line 14 should be obtained by deducting the 69x and 79x lines from line 9906. This fixes the formula for line 14. Task : 3246383 Forw
Original PR description
At the end of the Belgian P&L, the result to be allocated (line 9906) is allocated among several accounts: 791/2 - Prélèvement sur les capitaux propres 691/2 - Affectation aux capitaux propres 794 - Intervention d'associés dans la perte 694/6 - Bénéfice à distribuer The remainder should go into line 14 - Bénéfice (Perte) à reporter. So the balance of line 14 should be obtained by deducting the 69x and 79x lines from line 9906. This fixes the formula for line 14. Task : 3246383 Forward-Port-Of: odoo/enterprise#39897 Forward-Port-Of: odoo/enterprise#39868
**Purpose**: In calendar, Kanban view for online appointment menu has a redundant weird 'Quick Add' option for Users . **Specification**: One cannot add 'Users; directly from Kanban view as the field is set to readonly in kanban view. **Task**-3265074 Forward-Port-Of: odoo/enterprise#39876
Original PR description
**Purpose**: In calendar, Kanban view for online appointment menu has a redundant weird 'Quick Add' option for Users . **Specification**: One cannot add 'Users; directly from Kanban view as the field is set to readonly in kanban view. **Task**-3265074 Forward-Port-Of: odoo/enterprise#39876
With the B2B task, the way we handle error is different than before, we want to be able to redirect the user directly to what he should do when needed. Since the redirect error can happen in different method call, use a custom error for this and also fix an issue when we need to link a new institution Forward-Port-Of: odoo/enterprise#38688
Original PR description
With the B2B task, the way we handle error is different than before, we want to be able to redirect the user directly to what he should do when needed. Since the redirect error can happen in different method call, use a custom error for this and also fix an issue when we need to link a new institution Forward-Port-Of: odoo/enterprise#38688
[FIX] sign: Update _compute_email method to include documents in other states than just 'sent' to be able to update the 'signer_email' field. Issue: In Odoo 15 or prior --> A res.partner record is created without an email and a document to be signed by this person is created and signed on the spot. The result is a creation of a sign.request.item record is created without a signer_email and the state is set to 'completed'. After upgrading to Odoo 16 --> When an email is added to this parti
Original PR description
[FIX] sign: Update _compute_email method to include documents in other states than just 'sent' to be able to update the 'signer_email' field. Issue: In Odoo 15 or prior --> A res.partner record is…
[FIX] sign: Update _compute_email method to include documents in other states than just 'sent' to be able to update the 'signer_email' field. Issue: In Odoo 15 or prior --> A res.partner record is created without an email and a document to be signed by this person is created and signed on the spot. The result is a creation of a sign.request.item record is created without a signer_email and the state is set to 'completed'. After upgrading to Odoo 16 --> When an email is added to this particular res.partner record, the sign.request.item records that are related to the partner are filtered out and the signer_email field is unpopulated. This results in this validation error being raised (see below) https://github.com/odoo/enterprise/blob/1c1ec2b06ad2458e55f04e06f0210a2ed346d45d/sign/models/sign_request.py#L706-L709 Solution --> Remove the filter because the sender_email should get updated for a contact regardless of the state of the document. opw-3185181 Forward-Port-Of: odoo/enterprise#37154
*: social_facebook, social_linkedin, social_push_notifications, social_twitter, social_youtube, website_appointment This commit fixes improperly escaped query parameters across javascripts of website-related modules. See https://github.com/odoo/odoo/pull/100868. Forward-Port-Of: odoo/enterprise#39500 Forward-Port-Of: odoo/enterprise#31711
Original PR description
*: social_facebook, social_linkedin, social_push_notifications, social_twitter, social_youtube, website_appointment This commit fixes improperly escaped query parameters across javascripts of website-related modules. See https://github.com/odoo/odoo/pull/100868. Forward-Port-Of: odoo/enterprise#39500 Forward-Port-Of: odoo/enterprise#31711
This commit allows to display a journal group in reports journal filter, as long as one of its accepted journal is accepted by the report. Steps: - Having a company with journals A, B, C, D, E - Have a journal group X excluding journals E - Go to a report accepting journals A, B, C -> Journal group X is not present in the journal filter opw-3247962 Forward-Port-Of: odoo/enterprise#39662
Original PR description
This commit allows to display a journal group in reports journal filter, as long as one of its accepted journal is accepted by the report. Steps: - Having a company with journals A, B, C, D, E - Have a journal group X excluding journals E - Go to a report accepting journals A, B, C -> Journal group X is not present in the journal filter opw-3247962 Forward-Port-Of: odoo/enterprise#39662
Currently, when exporting the XML of the EC Sales List, partners with a VAT number that have an amount = 0 are inlcuded. But this leads to failed valisation by the tax authorities. In order to fix it, we need to ignore those partners from the export. task-3263659 Forward-Port-Of: odoo/enterprise#39721
Original PR description
Currently, when exporting the XML of the EC Sales List, partners with a VAT number that have an amount = 0 are inlcuded. But this leads to failed valisation by the tax authorities. In order to fix it, we need to ignore those partners from the export. task-3263659 Forward-Port-Of: odoo/enterprise#39721
When defining an external value in a report, if the column type is 'monetary', the rounding is taken from the company currency. The only problem is that the 'rounding' parameter expects to be a number of decimal places to round to, rather than the precision. see https://github.com/odoo/enterprise/blob/049a8955dd0d75ee0927ef6b350b1d94c066216b/account_reports/models/account_report.py#L3346 So we should use `env['res.currency'].decimal_places` rather than `env['res.currency'].rounding` Fo
Original PR description
When defining an external value in a report, if the column type is 'monetary', the rounding is taken from the company currency. The only problem is that the 'rounding' parameter expects to be a number of decimal places to round to, rather than the precision. see https://github.com/odoo/enterprise/blob/049a8955dd0d75ee0927ef6b350b1d94c066216b/account_reports/models/account_report.py#L3346 So we should use `env['res.currency'].decimal_places` rather than `env['res.currency'].rounding` Forward-Port-Of: odoo/enterprise#39822 Forward-Port-Of: odoo/enterprise#39794
### Bug Currently, Taxcloud taxes are not calculated when a quotation is sent. ### Steps to reproduce 1. setup taxcloud 2. create a quotation and set the taxcloud fiscal position 3. add a product line 4. send the quotation (or mark it as sent): the taxes are not computed. The taxes ARE added to the SO after payment, but the user has only paid the pre-tax price. opw-3210974 Forward-Port-Of: odoo/enterprise#38276
Original PR description
### Bug Currently, Taxcloud taxes are not calculated when a quotation is sent. ### Steps to reproduce 1. setup taxcloud 2. create a quotation and set the taxcloud fiscal position 3. add a product line 4. send the quotation (or mark it as sent): the taxes are not computed. The taxes ARE added to the SO after payment, but the user has only paid the pre-tax price. opw-3210974 Forward-Port-Of: odoo/enterprise#38276
task - 3246028 Forward-Port-Of: odoo/enterprise#38980
Original PR description
task - 3246028 Forward-Port-Of: odoo/enterprise#38980
Add index --------- Before this query, the query planner would usually go for an Index Scan using `account_move_line_partner_account_ids`. This is far from being optimal because it still needs to filter the non reconciled lines afterwards. If you are often dealing with the same partners, most of the lines are already reconciled so we don't need to go through all of them again. Adding a new index `account_move_line__unreconciled_index` solves this issue. Even though adding an index on a bool
Original PR description
Add index --------- Before this query, the query planner would usually go for an Index Scan using `account_move_line_partner_account_ids`. This is far from being optimal because it still needs to…
Add index --------- Before this query, the query planner would usually go for an Index Scan using `account_move_line_partner_account_ids`. This is far from being optimal because it still needs to filter the non reconciled lines afterwards. If you are often dealing with the same partners, most of the lines are already reconciled so we don't need to go through all of them again. Adding a new index `account_move_line__unreconciled_index` solves this issue. Even though adding an index on a boolean field is often useless, it being paired with the `account_id` makes it so that only a low percentage of the lines in the accounts are not reconciled. Since the unreconciled lines are (hopefully) only in a few recent pages (compared to the reconciled lines), this should also greatly improve the database IO. Running query only once ----------------------- When there are a lot of partners, `web_search_read` might do an additionnal `search_count`. This as the effect of running the query of `_query_followup_data` a second time. That query is by far the most expensive piece of code of this flow... By storing it in a temporary table, we can avoid that double computation. In order to do that, we need to ignore the parameter `all_partners`, which wasn't used in the standard code anyways since the last refactoring[^1] Remove useless JOINs -------------------- Some JOIN on `account_move` were done even though the needed columns were already copied on `account_move_line` through a related field. Benchmark --------- On a test database with[^2] * 400k customers * 500k customer invoices * 450k customer payments * 1k customers with overdue invoices Before: 2 identical queries were taking 97% of the total time, 3.5s each; for a total of 7s. It is even worse if the domain contained `followup_status` or `followup_line_id` because for each of the clauses, it adds twice the query again. So searching on one followup level would take 14s. After: only one query, taking 1.7s. [^1]: 80f9c296624f54370d7dde3f077f37789d094bc5 [^2]: all the counts only for one company Forward-Port-Of: odoo/enterprise#39922 Forward-Port-Of: odoo/enterprise#39563
Before this commit: if the partner belonged to "Company B" and the default company was "Company A", it would cause an issue during the creation of the record (opportunity, ticket, ...) from the mail plugin. Community PR: https://github.com/odoo/odoo/pull/112088 The solution is to use the partner's company to create. opw-3141578 Forward-Port-Of: odoo/enterprise#36770
Original PR description
Before this commit: if the partner belonged to "Company B" and the default company was "Company A", it would cause an issue during the creation of the record (opportunity, ticket, ...) from the mail plugin. Community PR: https://github.com/odoo/odoo/pull/112088 The solution is to use the partner's company to create. opw-3141578 Forward-Port-Of: odoo/enterprise#36770
The download button on the preview was not working. Added the dowload record method to the attachement viewer implemented in the document module. task-3168827 Forward-Port-Of: odoo/enterprise#36684
Original PR description
The download button on the preview was not working. Added the dowload record method to the attachement viewer implemented in the document module. task-3168827 Forward-Port-Of: odoo/enterprise#36684
Forward-Port-Of: odoo/enterprise#36623
Original PR description
Forward-Port-Of: odoo/enterprise#36623
We need to explicitly set the account_id for the second line in the test since we removed the suggestion for the second line. Related to #[110821](https://github.com/odoo/odoo/pull/110821) opw-3098361 Forward-Port-Of: odoo/enterprise#39784
Original PR description
We need to explicitly set the account_id for the second line in the test since we removed the suggestion for the second line. Related to #[110821](https://github.com/odoo/odoo/pull/110821) opw-3098361 Forward-Port-Of: odoo/enterprise#39784