Tuesday, May 6, 2025
18 changes · saas-17.4
Miscellaneous changes
Fix an issue in the xml template where the custom import form reference is set at the wrong place, causing errors when it is in use at the same time as a customer reference. task-4761954 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#208048
Original PR description
Fix an issue in the xml template where the custom import form reference is set at the wrong place, causing errors when it is in use at the same time as a customer reference. task-4761954 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#208048
PROBLEM 1: Steps to reproduce: - Create branch company - Create a user for the branch company and assign the bookkeeper role - Log in as the newly created user - Inside accounting module navigate to Vendor menu -> Payment - Create a payment and set the amount - Attempt to edit the payment Error:- Access Error: Access to unauthorized or invalid companies. Cause: Before this pr, the context passed during the accessible branches calculation included 'journal_id.company_id' (i.e., t
Original PR description
PROBLEM 1: Steps to reproduce: - Create branch company - Create a user for the branch company and assign the bookkeeper role - Log in as the newly created user - Inside accounting module navigate to…
PROBLEM 1: Steps to reproduce: - Create branch company - Create a user for the branch company and assign the bookkeeper role - Log in as the newly created user - Inside accounting module navigate to Vendor menu -> Payment - Create a payment and set the amount - Attempt to edit the payment Error:- Access Error: Access to unauthorized or invalid companies. Cause: Before this pr, the context passed during the accessible branches calculation included 'journal_id.company_id' (i.e., the parent company_id). This led to an error during validation in the companies method of the env class, since the parent company_id is not valid for branch-specific operations/users. Solution: After this pr, remove the context modification introduced by the 'with_company()' method during the invocation of '_accessible_branches()', ensuring that the correct branch context is used for access validation. PROBLEM 2: Steps to reproduce: - First 3 steps are same as problem 1 - Inside accounting module navigate to bank reconciliation list view - Create new bank statement line - Attempt to edit the bank statement line Error:- Access Error: because of company rule employee Cause: Before this pr, in the '_synchronize_to_moves' method the 'company_currency' calculation included 'journal.company_id.currency_id' in which 'journal.company_id' is the parent company_id to which the user does not have access. Solution: After this pr, adding 'sudo()' method call at the time of accessing 'journal.comapny_id' (i.e., parent company_id) for bypassing the access rights. Task - 4654866 Forward-Port-Of: odoo/odoo#205548
web push payloads currently get their body truncated when the payload comes out to more than 4096 bytes. However this only keeps the plaintext payload under that limit, not accounting for encryption. As we need the payload to be 4096 bytes at most *after encryption* the threshold for body truncation is reduced to around 3990 bytes to account for the fixed overhead of encryption as laid out in the added constants and getters so that they can be adjusted as needed. Additionally there we
Original PR description
web push payloads currently get their body truncated when the payload comes out to more than 4096 bytes. However this only keeps the plaintext payload under that limit, not accounting for encryption.…
web push payloads currently get their body truncated when the payload comes out to more than 4096 bytes. However this only keeps the plaintext payload under that limit, not accounting for encryption. As we need the payload to be 4096 bytes at most *after encryption* the threshold for body truncation is reduced to around 3990 bytes to account for the fixed overhead of encryption as laid out in the added constants and getters so that they can be adjusted as needed. Additionally there were some issues with the logic for truncation: - Checking character length against byte length for the comparison, which led to potentially a lot more truncated text than necessary. - Truncation being done with the assumption the text would be encoded in utf-8 when it is actually transformed to json unicode escape sequences (see ensure_ascii argument in json.dumps) again making the truncation inaccurate. - The calculation of body_max_length was incorrect, as it allowed for negative values which sometimes resulted in an empty body. Steps to reproduce: 1. Activate desktop notifications. 2. Fastest way will be to send to an account A (with activated notis), a message through discuss from an account B. 3. Additionally this affects the current flow too: 3.1 When we try to notify a user following a heldesk team. 3.2 We create an alias and set this to that current team. 3.3 We simulate an email to that heldesk team, eg vip-support@test.com opw-3939019 Forward-Port-Of: odoo/odoo#193641
Description of the issue/feature this PR addresses: Wrong address/zip/city in Swiss QR bill template. Current behavior before PR: The template for Swiss QR bills uses the company address, zip code and city. Desired behavior after PR is merged: The template for Swiss QR bills uses the address/zip/city of the creditor's bank account, if available. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#207640
Original PR description
Description of the issue/feature this PR addresses: Wrong address/zip/city in Swiss QR bill template. Current behavior before PR: The template for Swiss QR bills uses the company address, zip code and city. Desired behavior after PR is merged: The template for Swiss QR bills uses the address/zip/city of the creditor's bank account, if available. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#207640
**Steps to reproduce:** Create a new contact/company with more than 25 character **Issue:** The name field is partially shown as compared to version 16. **Cause:** The issue occurs after this change (odoo/odoo@a68cfbb) in version 17. The below CSS for the partner autocomplete field has been removed as the field has 'field_partner_autocomplete' widget. https://github.com/odoo/odoo/blob/05e60f226a0d15bfa3b71eaebe2786f4d687f23e/addons/partner_autocomplete/static/src/scss/partner_autocompl
Original PR description
**Steps to reproduce:** Create a new contact/company with more than 25 character **Issue:** The name field is partially shown as compared to version 16. **Cause:** The issue occurs after this change (odoo/odoo@a68cfbb) in version 17. The below CSS for the partner autocomplete field has been removed as the field has 'field_partner_autocomplete' widget. https://github.com/odoo/odoo/blob/05e60f226a0d15bfa3b71eaebe2786f4d687f23e/addons/partner_autocomplete/static/src/scss/partner_autocomplete.scss#L31-L34 **Solution:** Reintroduce partner autocomplete CSS fix (odoo/odoo@b9788544b7101e5a202cf87989bc3f5fc0495249) [opw-4686705](https://www.odoo.com/odoo/project/49/tasks/4686705) 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#205661
If you open the same SO in two different tabs, confirming it in one tab while further modifying it in the other, the readonly restriction won't be considered and you might shoot yourself in the foot by modifying something you shouldn't have. This commit makes sure the product cannot be modified on order lines where it's not supposed to be possible (unless you try to be smart/dumb by opening it in two tabs, or two salesmen are modifying it separately). opw-4595008 Backport of fb3778d97fc
Original PR description
If you open the same SO in two different tabs, confirming it in one tab while further modifying it in the other, the readonly restriction won't be considered and you might shoot yourself in the foot by modifying something you shouldn't have. This commit makes sure the product cannot be modified on order lines where it's not supposed to be possible (unless you try to be smart/dumb by opening it in two tabs, or two salesmen are modifying it separately). opw-4595008 Backport of fb3778d97fc5108a5ca6acc4f8b3a30175e9e550 in 17 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#208434
Currently the reconciliation may create unnecessary exchange difference entries or have unnecessary residual amounts. This can happen in case we try to reconcile lines with multiple currencies. Consider e.g. the following case (c.f. the added test cases in the code): company currency: EUR foreign currency: USD rate: 1 EUR = 18.8777 USD (1 USD = 0.052972554919 EUR) rounding: Both EUR and USD are rounded to 2 decimal places (to 0.01) Lines to reconicle: line0 | 20000.00 USD | 377554
Original PR description
Currently the reconciliation may create unnecessary exchange difference entries or have unnecessary residual amounts. This can happen in case we try to reconcile lines with multiple currencies.…
Currently the reconciliation may create unnecessary exchange difference entries or have unnecessary residual amounts. This can happen in case we try to reconcile lines with multiple currencies. Consider e.g. the following case (c.f. the added test cases in the code): company currency: EUR foreign currency: USD rate: 1 EUR = 18.8777 USD (1 USD = 0.052972554919 EUR) rounding: Both EUR and USD are rounded to 2 decimal places (to 0.01) Lines to reconicle: line0 | 20000.00 USD | 377554.00 EUR line1 | -372239.38 EUR | -372239.38 EUR Perfect write-off line for a full reconciliation (w/o exchange difference or remaining residuals) line2 | -281.53 USD | -5314.62 EUR Since EUR: 377554.00 + -372239.38 = 5314.62 USD: 200000.00 + USD.round(-372239.38 * 0.052972554919) = 200000.00 + USD.round(-19718.47100006451) = 281.53 Note the actually used exchange rates during the reconciliation are not necessarily the ones from the currencies. They could also be (re)computed from the lines. Note that the "reconciliation currency" may be choosen differently in the following cases - the reconciled account is a payable (`liability_payable`) or receivable (`asset_receivable`) account - the reconciled account has another type In the code see - `recon_currency` in `_prepare_reconciliation_single_partial` - `is_rec_pay_account` in `_prepare_move_line_residual_amounts` #### Problem (1); receivable / payable account & partial reconciliation In this case we reconcile line0 and line1 and the account on the lines is either a payable or a receivable account. The following happens 1. Due to the account type we try to match the foreign currency (USD) amounts. line1: 20000.00 USD line2: 19718.47 USD (= USD.round(-372239.38 * ≈0.052972554919) = USD.round(-19718.47100006451)) USD: 19718.47 (= min(20000.00, 19718.47)) 2. Use the exchange rate (from line0) to compute the value in EUR (company currency) EUR: 372239.36 (= EUR.round(19718.47 * ≈18.8777) = EUR.round(372239.36111900007)) 3. We still have a residual of 0.02 EUR on line1. But since line2 was fully matched in step 1 we create an exchange difference entry (to cover for the residual in company currency) Issue: We could have matched 372239.38 EUR on both lines since the difference (0.02 EUR) is just a rounding error. Here 372239.38 EUR represents the full remaining amount in company currency on line1. Then there would have been no residual (and thus no need for an exchange difference entry) #### Problem (2); other account type & try full reconciliation with correct write-off line In this case we reconcile line0 and line1 and line2 and the account on the lines is neither payable nor receivable. First the reconciliation will reconcile line0 and line2 (roughly speaking since they have the same foreign currency). 1. Since both are in foreign currency we try to match these amounts first: USD: 281.53 (= min(20000.00, 281.53)) 2. We then use the exchange rate to compute the value in EUR (company currency) line0, EUR: 5314.64 (= EUR.round(281.53 * ≈18.8777) = EUR.round(5314.638881)) line2, EUR: 5314.62 (281.53 converted via the "custom" rate on line2) 3. We now have the following residuals line0 (residuals) | 19718.47 USD | 372239.36 EUR line2 (residuals) | 0.00 USD | 0.00 EUR We substracted 5314.64 EUR from line0 but only 5314.62 EUR from line2. 4. To account for the difference we create an exchange difference entry We could have matched 5314.62 EUR on both lines (since the difference is just a rounding error) This way we could void the exchange difference entry. And we would also have a "correct" residual on line0. The residuals on line0 will cause the full reconciliation to fail (see below). Next the reconciliation will match line1 with the residuals of line0 The following happens. 1. We try to match company currency amounts first (due to the account type) line0, EUR: 372239.36 line1, EUR: 372239.38 EUR: 372239.36 = min(372239.38, 372239.36) 2. Compute the amounts in currency line0, USD: 19718.47 (= USD.round(372239.36 * ≈0.052972554919)) line1, EUR: 372239.36 (= 372239.36 * 1) 3. We now have the following residuals line0 (residuals) | 0.00 USD | 0.02 EUR line1 (residuals) | 0.00 USD | 0.00 EUR 4. The reconciliation ends without creating an exchange difference entry #### Solution Problem (1) In case the remaining amount (in company currency) could be fully matched if not for rounding issues we will just match the full remaining amount. Problem (2) We match the company currency amounts of the individual lines to a common value if they are the same up to exchange rounding issues. #### References opw-4438542 Forward-Port-Of: odoo/odoo#204746
### Issue: Spamming the validation button in the barcode app can end up performing the operation on an already processed record and raise an invalid operation. ### Steps to reproduce: - Create and confirm a delivery for 1 unit of a storable product. - In the barcode app, scan 1 unit - Spam the validate button #### > An invalid operation is raised: You can not validate a transfer if no quantities are reserved. ### Cause of the issue: Spamming the validate button will launch conc
Original PR description
### Issue: Spamming the validation button in the barcode app can end up performing the operation on an already processed record and raise an invalid operation. ### Steps to reproduce: - Create and confirm a delivery for 1 unit of a storable product. - In the barcode app, scan 1 unit - Spam the validate button #### > An invalid operation is raised: You can not validate a transfer if no quantities are reserved. ### Cause of the issue: Spamming the validate button will launch concurrent calls of the `validate` method. However, if the record has already been processed by a call of the validate method, the next call might be performed on an updated record that should not be able to be validated. opw-4599862 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#204790
Currently, when a loyalty program has expired, loyalty card are still getting created even though points are not granted. Steps to reproduce: ------------------- * Create a loyatly program and make it sot that is has already expired * Open pos and make an order selecting any customer * Go to the backend and check the loyalty program > Observation: 1 card has been created with 0 points Why the fix: ------------ Not loading the expired programs prevent the creation of loyalty cards.
Original PR description
Currently, when a loyalty program has expired, loyalty card are still getting created even though points are not granted. Steps to reproduce: ------------------- * Create a loyatly program and make it sot that is has already expired * Open pos and make an order selecting any customer * Go to the backend and check the loyalty program > Observation: 1 card has been created with 0 points Why the fix: ------------ Not loading the expired programs prevent the creation of loyalty cards. Using the same logic as module `sale_loyalty` https://github.com/odoo-dev/odoo/blob/5acb89b8ba9be0e18bca65e26c03f47199fcfb4b/addons/sale_loyalty/models/sale_order.py#L461-L465 opw-4671522 Forward-Port-Of: odoo/odoo#208134
Apply the HSN schema based on the `l10n_in_reports.hsn_new_schemna_apply_date` system parameter. If the parameter is missing or invalid, default to 2025-05-01 as per government guidelines. Forward-Port-Of: odoo/enterprise#84760 Forward-Port-Of: odoo/enterprise#84726
Original PR description
Apply the HSN schema based on the `l10n_in_reports.hsn_new_schemna_apply_date` system parameter. If the parameter is missing or invalid, default to 2025-05-01 as per government guidelines. Forward-Port-Of: odoo/enterprise#84760 Forward-Port-Of: odoo/enterprise#84726
Steps to Reproduce: 1. Install industry_fsm_sale module. 2. Create a SO with at least one SOL. 3. Save the record. 4. Delete the line, then click the Catalog button without saving. Issue: - An error occurs indicating a missing record. Cause: - The action_add_from_catalog method is accessing self.task_id, but self still includes the deleted SOL, which no longer exists. As a result, accessing its fields raises an error. Fix: - Move the action_add_from_catalog method to the
Original PR description
Steps to Reproduce: 1. Install industry_fsm_sale module. 2. Create a SO with at least one SOL. 3. Save the record. 4. Delete the line, then click the Catalog button without saving. Issue: - An error occurs indicating a missing record. Cause: - The action_add_from_catalog method is accessing self.task_id, but self still includes the deleted SOL, which no longer exists. As a result, accessing its fields raises an error. Fix: - Move the action_add_from_catalog method to the sale.order model, which is the appropriate place to handle this logic, ensuring the method doesn't depend on potentially stale or deleted lines. opw-4760487 Forward-Port-Of: odoo/enterprise#84414
### Description: When accessing `l10n_ec_withhold_ids` and `l10n_ec_withhold_count`, the compute method `_compute_l10n_ec_withhold_inv_fields` is triggered. This method is badly made since it calls a search inside a loop rather than doing the search outside of the loop and retrieving from a dictionary. This bug was fixed in 18.0 but not in the previous versions. ### Benchmark: | Nb of move | Before | After | |------------|---------|--------| | 80 | 43s | 724ms | |
Original PR description
### Description: When accessing `l10n_ec_withhold_ids` and `l10n_ec_withhold_count`, the compute method `_compute_l10n_ec_withhold_inv_fields` is triggered. This method is badly made since it calls a search inside a loop rather than doing the search outside of the loop and retrieving from a dictionary. This bug was fixed in 18.0 but not in the previous versions. ### Benchmark: | Nb of move | Before | After | |------------|---------|--------| | 80 | 43s | 724ms | | 160 | 1:16 | 948ms | ### Reference: opw-4741855 Forward-Port-Of: odoo/enterprise#83943
A mismatch between backend and frontend caused the time displayed in the grid to be incorrect. The cell value was doubled due to a frontend-only calculation, but the actual data was correct on the backend. Refreshing the page fixed the display issue. Steps to reproduce: ------------------- * Open the view form of a timesheet cell (🔍) * Start the timer in the Hours Spent column * Go back to My Timesheets * Stop the timer > Observation: timer displayed was previous_timer * 2 + new_tim
Original PR description
A mismatch between backend and frontend caused the time displayed in the grid to be incorrect. The cell value was doubled due to a frontend-only calculation, but the actual data was correct on the backend. Refreshing the page fixed the display issue. Steps to reproduce: ------------------- * Open the view form of a timesheet cell (🔍) * Start the timer in the Hours Spent column * Go back to My Timesheets * Stop the timer > Observation: timer displayed was previous_timer * 2 + new_timer Why the fix: ------------ 'stopTimer()' waits for the orm call 'action_timer_stop' to return a value that will be added to the current cell value. opw-4701396 Forward-Port-Of: odoo/enterprise#84416
- With l10n_mx_edi, create an invoice and send it to the cfdi. Download the cfdi xml. - Import the xml as a vendor bill. Confirm and click on Update SAT. - The vendor bill list view the l10n_mx_edi_cfdi_sat_state is set to false despite the l10n_mx_edi.document.sat_state being set. https://github.com/odoo/enterprise/commit/b34a4d105c67807628284257be51295e33da6bf0 added the ability to import cfdi xml as vendor bills and updated the selection for l10n_mx_edi.document.state with invoice_receiv
Original PR description
- With l10n_mx_edi, create an invoice and send it to the cfdi. Download the cfdi xml. - Import the xml as a vendor bill. Confirm and click on Update SAT. - The vendor bill list view the l10n_mx_edi_cfdi_sat_state is set to false despite the l10n_mx_edi.document.sat_state being set. https://github.com/odoo/enterprise/commit/b34a4d105c67807628284257be51295e33da6bf0 added the ability to import cfdi xml as vendor bills and updated the selection for l10n_mx_edi.document.state with invoice_received. However the compute _compute_l10n_mx_edi_cfdi_state_and_attachment which depends on l10n_mx_edi.document.state was not updated to take into account that new possible selection. opw-4673134 Forward-Port-Of: odoo/enterprise#83629
#### [FIX] account_accountant: reco wizard: exchange rate rounding In the related community commit we improved the reconciliation behavior with regards to exchange rate and rounding issues. See there for more details. For one of the tests there we manually created the write-off line with the correct amount. Here we add a test to check that the wizard computes the right amounts for the write-off line / entry. opw-4438542 #### [FIX] account_accountant: reco wizard: show company amou
Original PR description
#### [FIX] account_accountant: reco wizard: exchange rate rounding In the related community commit we improved the reconciliation behavior with regards to exchange rate and rounding issues. See there…
#### [FIX] account_accountant: reco wizard: exchange rate rounding In the related community commit we improved the reconciliation behavior with regards to exchange rate and rounding issues. See there for more details. For one of the tests there we manually created the write-off line with the correct amount. Here we add a test to check that the wizard computes the right amounts for the write-off line / entry. opw-4438542 #### [FIX] account_accountant: reco wizard: show company amount The reconciliation wizard may create a write-off line / entry. Roughly speaking this happens in case - the amount of the input lines does not sum to 0 - and the "Allow partials" option is not ticked The write-off line can be in foreign currency. Currently the wizard only displays the amount in foreign currency but not the amount in company currency. So currently the company currency amount can not be checked before reconciling. After this commit the wizard also displays the amount in company currency. opw-4623933 Forward-Port-Of: odoo/enterprise#82865
**issue:** When a task with an allocated time > 0.0 but no timesheets is created in a shared project (with edit rights), the portal user incorrectly sees 0.0 as the allocated time. **Steps to reproduce:** - Ensure the sale_timesheet module is installed. - Create a new project. - Create a task with allocated time and no timesheets. - Share the project with a portal user (edit permission). In the portal user's kanban view, the allocated time of the task is displayed as 0.0 instead o
Original PR description
**issue:** When a task with an allocated time > 0.0 but no timesheets is created in a shared project (with edit rights), the portal user incorrectly sees 0.0 as the allocated time. **Steps to reproduce:** - Ensure the sale_timesheet module is installed. - Create a new project. - Create a task with allocated time and no timesheets. - Share the project with a portal user (edit permission). In the portal user's kanban view, the allocated time of the task is displayed as 0.0 instead of the correct allocated time. opw-4582705 Forward-Port-Of: odoo/enterprise#82171
### Before this PR If the backorder is "always", on the shopfloor when clicking "close production" on the "production overview", it redirects to the backend ### After this PR Clicking on close production it does not redirect to backend Forward-Port-Of: odoo/enterprise#79918
Original PR description
### Before this PR If the backorder is "always", on the shopfloor when clicking "close production" on the "production overview", it redirects to the backend ### After this PR Clicking on close production it does not redirect to backend Forward-Port-Of: odoo/enterprise#79918
Before this commit: When using the sign app, after clicking on a signature field to sign, attempting to drag the signature field away, which is unnecessary and pointless, causes the app to crash. After this commit: Dragging a signed signature field is not possible since it is pointless. The file should remain unchanged, and no crash should occur. Merge Note: This fix should be applied for the branches > 17.0 and before 18.1. It should be ignored by 18.1 and after. task-4489008 Forw
Original PR description
Before this commit: When using the sign app, after clicking on a signature field to sign, attempting to drag the signature field away, which is unnecessary and pointless, causes the app to crash. After this commit: Dragging a signed signature field is not possible since it is pointless. The file should remain unchanged, and no crash should occur. Merge Note: This fix should be applied for the branches > 17.0 and before 18.1. It should be ignored by 18.1 and after. task-4489008 Forward-Port-Of: odoo/enterprise#77325