Tuesday, May 6, 2025
26 changes · 18.0
Enhancements to existing features
This update renames Hong Kong accounting entries related to MPF to include more detail. The clearer labels help finance users identify payroll-related pension accounts more easily and reduce ambiguity in reports or account setup.
Original PR description
See also: odoo/enterprise#84595 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Accounting menus for analytic items are now better aligned with whether analytic accounting is enabled. This reduces confusion by preventing users from seeing analytic options that are not meant to be available in their setup.
Original PR description
Before this commit, the "Analytic Items" and "Analytic Report" menu items were visible even when the analytic feature was disabled, leading to potential confusion. To address this: - "Analytic Items": The solution is to restrict visibility by keeping only the `group_analytic_accounting` group and removing all the other groups. - "Analytic Report": After consideration, it was decided to leave this menu item with `group_account_readonly`. While this is not a perfect solution, it remains the best option compared to the alternatives: - Making it visible to everyone when the analytic feature is enabled, which would grant access too broadly. - Creating a dedicated parent menu item to set `group_account_readonly` at the parent level and `group_analytic_accounting` at the child level. However, this would introduce unnecessary complexity and negatively impact the UI/UX. task-4497442 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Resolved issues and error corrections
The bus service now uses the latest notification information shared across browser tabs instead of relying only on the main tab. This prevents users from being incorrectly told their page is outdated after a temporary connection drop.
Original PR description
The outdated page watcher checks whether bus notifications were missed when the bus reconnects after an unexpected disconnection. To do so, it checks if the last known notification id is still in the bus table. However, it relies on the main tab's last received notification which might not be available when the main tab didn't receive notifications after being elected. To fix this issue, this commit uses the global last notification stored in the local storage to ensure every tab has access to it. 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
Documentation and clarification updates
This pull request adds a contributor license agreement record for an individual contributor. It helps ensure the project has the necessary legal confirmation for accepting contributions, with no expected impact on product behavior.
Original PR description
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
Miscellaneous changes
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#208371 Forward-Port-Of: odoo/odoo#204746
Tasks created from service sale order lines now display the added line description when one is provided, rather than always showing the product name. This makes linked task information clearer for users and preserves the product name as a fallback when no description exists.
Original PR description
Versions -------- - 18.0+ Steps ----- 1. Create a service product that creates a task; 2. add product to an order; 3. add an extra description to the sale order line; 4. confirm the order; 5. go to the task. Issue ----- The name of the sale order item linked to the task displays the product name instead of the extra line description. Cause ----- As 18.0, the first line of the sale order line name is always the product name. In earlier versions, the product name was only used as a fall-back value when no extra description was added to the line. Solution -------- Account for the guaranteed addition of the product name in the SOL name, and instead use the second line for the display name if it exists and is non-empty, else fall back on the product name as intended. opw-4634149
This fixes an issue where mapping accounts between companies could be blocked when one company used German accounting rules. The change ensures German account-code restrictions are only applied in the relevant German company, allowing cross-company account mapping to proceed correctly.
Original PR description
Writing the account code is restricted on l10n_de accounts. Odoo checks that the code we write is different from the old one, and if so it checks of there are already some entries for that accounts. If any of the condition is met, the write is prevented. When we try to map an account from another company to a l10n_de company, the _inverse_code function from the account mapping will try and update the account code in the other company, as the code is company dependent. The issue is that we check that the l10n_de code remains the same, even if we are in another, non l10n_de company. This PR adapts the check to l10n_de account to only check the code if we are writing it from the l10n_de company. opw-4711417
Integer ID fields can now hide thousand separators without disabling other formatting behavior. This prevents new list-view records from temporarily showing an incorrect “false” value before they are saved, improving clarity for users working with task and subtask lists.
Original PR description
Steps: Set enable_formatting to false on an Integer field (ex. ID). Turn the ID column to be visible in subtask list view. Add a new record using list view. Issue: The ID field displays false till saved. Reason: enable_formatting: false was used to remove regional formatting (e.g., thousand separators) for the ID field. But this also disabled all other formatters, including null value handling, resulting in false value in ID field. Fix: Introduced a new option skip_thousands_separator under the IntegerField formatting logic.When enabled, it disables only the thousands separator while preserving other formatting behaviors. task-4700791
This update makes account follow-up report tests adapt to the company’s configured currency symbol instead of assuming a fixed dollar sign. It helps prevent false test failures when a company uses a different currency display format, improving reliability without changing customer-facing behavior.
Original PR description
The aim of this PR is to prevent errors in the account_followup tests because of the symbol on the company currency. If the company currency is changed for some reason (for example USD dollar to…
The aim of this PR is to prevent errors in the account_followup tests because of the symbol on the company currency. If the company currency is changed for some reason (for example USD dollar to "USD" instead of "$" as typically used in Odoo), the test will fail raising an error similar to the following:
`[odoo.addons.account_followup.tests.test_followup_report:184](https://github.com/adhoc-cicd/odoo-enterprise/blob/74a5097e1d6ab79eb31ed302865aa075162494c2/account_followup/tests/test_followup_report.py#L184)
FAIL: TestAccountFollowupReports.test_followup_lines_branches
Traceback (most recent call last):
File "/data/build/adhoc-cicd-odoo-enterprise/account_followup/tests/test_followup_report.py", line 184, in test_followup_lines_branches
self.assertLinesValues(
File "/data/build/adhoc-cicd-odoo-enterprise/account_reports/tests/common.py", line 273, in assertLinesValues
self.fail('\n'.join(errors))
AssertionError:
==== Differences at index 0 ====
Current Values: ['INV/2016/00001', '01/01/2016', '01/01/2016', '', 'USD\xa0500.00']
Expected Values: ['INV/2016/00001', '01/01/2016', '01/01/2016', '', '$\xa0500.00']
==== Differences at index 1 ====
Current Values: ['', '', '', '', 'USD\xa0500.00']
Expected Values: ['', '', '', '', '$\xa0500.00']
==== Differences at index 2 ====
Current Values: ['', '', '', '', 'USD\xa0500.00']
Expected Values: ['', '', '', '', '$\xa0500.00']`
That's the reason why I refactor the test to first fetch the company currency symbol and then used it in the test assertions.The Colombian eCommerce invoicing flow now only matches the NIT tax ID type for Colombia. This prevents errors when another country has an ID type with the same name, helping customers complete checkout reliably.
Original PR description
Adding a condition to match contry to CO when looking for NIT latam ID type. Otherwise, adding another ID type named 'NIT' for a different country causes the search to return both, resulting in a traceback. Related to https://github.com/odoo/odoo/pull/189687 task-4318265
This pull request adds an individual contributor license agreement document. It supports project governance and legal record-keeping without changing product functionality for users.
Original PR description
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
Currently ssl certificates are only generated on odoo.com based on db_uuid and enterprise_code. Since we won't be needing enterprise_code anymore we adapt our code to still recover the ssl certificate and be able to recover and log the new 'error' values sent by odoo.com task-4585446 Related PR: https://github.com/odoo/internal/pull/3425 Forward-Port-Of: odoo/odoo#203834 Forward-Port-Of: odoo/odoo#203328
Original PR description
Currently ssl certificates are only generated on odoo.com based on db_uuid and enterprise_code. Since we won't be needing enterprise_code anymore we adapt our code to still recover the ssl certificate and be able to recover and log the new 'error' values sent by odoo.com task-4585446 Related PR: https://github.com/odoo/internal/pull/3425 Forward-Port-Of: odoo/odoo#203834 Forward-Port-Of: odoo/odoo#203328
Steps: ------ 1. Create a combo product and make it available in restaurant 2. In PoS, add this product to an order 3. Click the product line, and set the quantity to 2 let's 4. Click split button, it takes you to the split screen Observation: We can not select one of these 2 combos to split, it's either all of them, or none. Reason: ------- That's because combos are considered as non groupable in pos, see `is_pos_groupable` [1]. And then, when splitting a combo in `_splitQuantity`
Original PR description
Steps: ------ 1. Create a combo product and make it available in restaurant 2. In PoS, add this product to an order 3. Click the product line, and set the quantity to 2 let's 4. Click split button,…
Steps: ------ 1. Create a combo product and make it available in restaurant 2. In PoS, add this product to an order 3. Click the product line, and set the quantity to 2 let's 4. Click split button, it takes you to the split screen Observation: We can not select one of these 2 combos to split, it's either all of them, or none. Reason: ------- That's because combos are considered as non groupable in pos, see `is_pos_groupable` [1]. And then, when splitting a combo in `_splitQuantity` [2], we either take all the quantity or 0. Fix: ---- We update the split logic to account for special combo cases. [1]: https://github.com/odoo/odoo/blob/bee8b55d7783ea11f2362990cd9d7695b877b8e9/addons/point_of_sale/static/src/app/store/models.js#L829 [2]: https://github.com/odoo/odoo/blob/bee8b55d7783ea11f2362990cd9d7695b877b8e9/addons/pos_restaurant/static/src/app/split_bill_screen/split_bill_screen.js#L124-L127 opw-4737788 Forward-Port-Of: odoo/odoo#208266 Forward-Port-Of: odoo/odoo#208055
At the moment, whenever the partner is changed on an invoice, the l10n_latam_document_type_id field is recomputed and re-set to the default value corresponding to the partner and invoice type. We don't want this to happen if the existing l10n_latam_document_type_id is already compatible with the new partner. opw-4168385 Forward-Port-Of: odoo/odoo#208324 Forward-Port-Of: odoo/odoo#195581
Original PR description
At the moment, whenever the partner is changed on an invoice, the l10n_latam_document_type_id field is recomputed and re-set to the default value corresponding to the partner and invoice type. We don't want this to happen if the existing l10n_latam_document_type_id is already compatible with the new partner. opw-4168385 Forward-Port-Of: odoo/odoo#208324 Forward-Port-Of: odoo/odoo#195581
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
**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
## Description I am experiencing slow processing times for incoming stock from vendors when the historical data contains a large number of records. Currently, my company has around 20 million `stock.valuation.layer` records. As a result, any transaction involving incoming stock takes approximately 5–21 seconds to complete, even for a small number of products (around 1–5 products). Through profiling, I have identified that the root cause is the compute function `_compute_value_svl`. This c
Original PR description
## Description I am experiencing slow processing times for incoming stock from vendors when the historical data contains a large number of records. Currently, my company has around 20 million…
## Description
I am experiencing slow processing times for incoming stock from vendors when the historical data contains a large number of records.
Currently, my company has around 20 million `stock.valuation.layer` records. As a result, any transaction involving incoming stock takes approximately 5–21 seconds to complete, even for a small number of products (around 1–5 products).
Through profiling, I have identified that the root cause is the compute function `_compute_value_svl`. This computed field is always triggered during incoming stock transactions when calculating the average cost or fixing rounding errors.
## Proposal
To improve performance, I propose implementing a Parallel Index-Only Scan. This method is effective for grouping large datasets while retrieving only fixed columns, optimizing query execution.
## Benchmark
| Before | After | Speedup |
|--------|--------|--------|
| 1.1 s| 97.8 ms | 11x|
### Before
```
Finalize GroupAggregate (cost=1000.56..397852.39 rows=538 width=80) (actual time=1040.355..1114.694 rows=1 loops=1)
Group Key: product_id
Buffers: shared hit=227534 read=330906 dirtied=83 written=683
-> Gather (cost=1000.56..397825.49 rows=1076 width=80) (actual time=1039.900..1114.679 rows=3 loops=1)
Workers Planned: 2
Workers Launched: 2
Buffers: shared hit=227534 read=330906 dirtied=83 written=683
-> Partial GroupAggregate (cost=0.56..396717.89 rows=538 width=80) (actual time=1036.758..1036.759 rows=1 loops=3)
Group Key: product_id
Buffers: shared hit=227534 read=330906 dirtied=83 written=683
-> Parallel Index Scan using stock_valuation_layer_index on stock_valuation_layer
(cost=0.56..392927.16 rows=302613 width=20) (actual time=0.608..975.431 rows=247487 loops=3)
Index Cond: ((product_id = 140) AND (company_id = 1))
Buffers: shared hit=227534 read=330906 dirtied=83 written=683
Planning:
Buffers: shared hit=9 dirtied=1
Planning Time: 0.139 ms
Execution Time: 1114.732 ms
```
### After
```
Finalize GroupAggregate (cost=1000.56..21876.83 rows=538 width=80) (actual time=91.888..97.719 rows=1 loops=1)
Group Key: product_id
Buffers: shared hit=12889 read=7121
-> Gather (cost=1000.56..21849.93 rows=1076 width=80) (actual time=91.636..97.704 rows=3 loops=1)
Workers Planned: 2
Workers Launched: 2
Buffers: shared hit=12889 read=7121
-> Partial GroupAggregate (cost=0.56..20742.33 rows=538 width=80) (actual time=87.579..87.580 rows=1 loops=3)
Group Key: product_id
Buffers: shared hit=12889 read=7121
-> Parallel Index Only Scan using idx_svl_company_product on stock_valuation_layer
(cost=0.56..16951.60 rows=302613 width=20) (actual time=0.044..46.642 rows=247487 loops=3)
Index Cond: ((company_id = 1) AND (product_id = 140))
Heap Fetches: 9188
Buffers: shared hit=12889 read=7121
Planning Time: 0.107 ms
Execution Time: 97.751 ms
```
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#206587
Forward-Port-Of: odoo/odoo#203038Fix 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
#### [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#84652 Forward-Port-Of: odoo/enterprise#82865
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
If you have a company A that has a journal set up with bank synchronization, and a company B that is a branch of company A, you have access to the journal and the bank synchronization (account.online.link) of company A in company B. This causes an issue when fetching the transactions from the context of company B, as that will create the fetched transactions with a `company_id` set to B, which will cascade on the journal entries and items linked to these transactions. To ensure the correct
Original PR description
If you have a company A that has a journal set up with bank synchronization, and a company B that is a branch of company A, you have access to the journal and the bank synchronization…
If you have a company A that has a journal set up with bank synchronization, and a company B that is a branch of company A, you have access to the journal and the bank synchronization (account.online.link) of company A in company B. This causes an issue when fetching the transactions from the context of company B, as that will create the fetched transactions with a `company_id` set to B, which will cascade on the journal entries and items linked to these transactions. To ensure the correct company is set on the transactions, we force the company in the context when creating them. As a result: - When only company A is selected, transactions are correctly created in company A. - When both company are selected, no matter if the transactions are fetched from A or B, the transactions are correctly created in company A. - When only company B is selected, the user is faced with an access error, as Odoo is trying to open a view with the fecthed transaction, which belong to company A. To prevent this access error, it was decided that the "Fetch Transaction" buttons should not appear when the company owning the bank synchronization is not selected. A new computed field was then introduced on the account.online.account to check if we should allow fetching given the currenctly selected companies. That field is also added on the account.online.link as a logical conjunction of its account.online.account values of the field. These fields are then used to decide whether if we show the transaction fetching buttons on the dashboard and on the online link form view. Another issue with branches is the 'connect bank' button. With the same configuration as above, let's have companies A and B enabled, with B as the selected company. If you connect a bank to a journal belonging to company A by clicking on the 'connect bank' button on the dashboard, it will successfully connect, but the account.online.link will belong to company B. Then, if you try to access the accounting dashboard with only company A enabled, you will be faced with an access error, as the journal from company A tries to diplay informations computed with the above account.online.link of company B. To prevent this, we only make the 'connect bank' button appear if company A (i.e. the company owning the journal) is selected as the active company. This did not require a new field, and was done by adding an entry in the dashboard data. opw-4515862 Forward-Port-Of: odoo/enterprise#84363 Forward-Port-Of: odoo/enterprise#83134
If stock was not installed, we could not run skip test_prevent_advance_payment_delivered_quantity_product, as there is no qty_to_deliver field in sale.order.line model. By moving the test to sale_subscription_stock, we are solving this issue [link to broken tests](https://runbot.odoo.com/web#id=108148&menu_id=424&cids=1&action=573&model=runbot.build.error&view_type=form) Forward-Port-Of: odoo/enterprise#75149
Original PR description
If stock was not installed, we could not run skip test_prevent_advance_payment_delivered_quantity_product, as there is no qty_to_deliver field in sale.order.line model. By moving the test to sale_subscription_stock, we are solving this issue [link to broken tests](https://runbot.odoo.com/web#id=108148&menu_id=424&cids=1&action=573&model=runbot.build.error&view_type=form) Forward-Port-Of: odoo/enterprise#75149
**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
We remove unnecessary blackbox call in preSyncAllOrders method. Before we were calling the blackbox every time we were syncing orders with the server, even if it was not useful when there was no line change. Now we only call the blackbox when there is at least a line change. Forward-Port-Of: odoo/enterprise#75981
Original PR description
We remove unnecessary blackbox call in preSyncAllOrders method. Before we were calling the blackbox every time we were syncing orders with the server, even if it was not useful when there was no line change. Now we only call the blackbox when there is at least a line change. Forward-Port-Of: odoo/enterprise#75981
Before, `l10n_ar_edi` had only live test cases. This means that if there is an error in a PR or forward port, no tests would catch it as the were marked `external_l10n` and not ran. Using both `l10n_ke_edi_oscu` and and `l10n_br_edi_pos` recent mock setup as an example, this PR aims to mock the soap requests sent in the module. Notes: - As of now this is only one individual test case. More tests will come as there is time, but having 1 will prevent errors from happening again. - Within th
Original PR description
Before, `l10n_ar_edi` had only live test cases. This means that if there is an error in a PR or forward port, no tests would catch it as the were marked `external_l10n` and not ran. Using both…
Before, `l10n_ar_edi` had only live test cases. This means that if there is an error in a PR or forward port, no tests would catch it as the were marked `external_l10n` and not ran. Using both `l10n_ke_edi_oscu` and and `l10n_br_edi_pos` recent mock setup as an example, this PR aims to mock the soap requests sent in the module. Notes: - As of now this is only one individual test case. More tests will come as there is time, but having 1 will prevent errors from happening again. - Within this module, when the first record within an EDI journal is created, it will try to pull the sequence from the database, and if it can't find a suitable last sequence, it will query the API. This means that any onchange on the first journal entry that will recompute the name or sequence leads to the `_get_last_sequence` function being called and making an API request as the sequence isn't stored in the database yet. The point of this appears to be convenience when transfering from another system to odoo and pulling the latest invoice number they had. The main downside of this feature is that creating the first record now has around 5 API calls returning the same value due to different onchanges on the record. The main calls come from `_compute_name` in the base account module but the rest are from other methods that use the sequence or call `_compute_name` (like `_onchange_l10n_latam_document_type_id`) As this PR is only intended to write tests for the module, the test file matches what occurs in the front-end but future PRs can look into if there are improvements that can be made on stable to simplify this. task-4714096 Forward-Port-Of: odoo/enterprise#84704 Forward-Port-Of: odoo/enterprise#83553
Currently, an error occurs when changing the internal note of an order in **POS Restaurant** if all food items are removed before updating the order. **Steps to reproduce:** - Open a POS session for the **Restaurant** shop. - Select a table, add the food (e.g., "Cheese Burger") and place the order. - Add an `Internal Note` to the ordered food item. - Remove the food item and click the `Order` button (it shows '-1 Food'). - Observe the error. **Error:** `KeyError: 'qty'` The issue
Original PR description
Currently, an error occurs when changing the internal note of an order in **POS Restaurant** if all food items are removed before updating the order. **Steps to reproduce:** - Open a POS session for…
Currently, an error occurs when changing the internal note of an order in **POS Restaurant** if all food items are removed before updating the order. **Steps to reproduce:** - Open a POS session for the **Restaurant** shop. - Select a table, add the food (e.g., "Cheese Burger") and place the order. - Add an `Internal Note` to the ordered food item. - Remove the food item and click the `Order` button (it shows '-1 Food'). - Observe the error. **Error:** `KeyError: 'qty'` The issue occurs because when all food items are removed, `note_history` does not contain the `qty` key and it attempts to access `qty` from `note` at [1]. This commit resolves the issue by adding an additional check to ensure that 'qty' is in `note` before accessing the `qty` key. [1] - https://github.com/odoo/enterprise/blob/f1615134029860d32b95ade09738549a7bb1632d/pos_preparation_display/models/pos_order.py#L79-L80 Sentry - 6303446407 Forward-Port-Of: odoo/enterprise#80924 Forward-Port-Of: odoo/enterprise#79685