Thursday, November 21, 2024
28 changes · saas-17.2
Resolved issues and error corrections
The accounting demo setup now ensures a country is defined for the company. This prevents failures in automated checks that depend on country-specific accounting configuration, improving reliability for test and demo environments.
Original PR description
Fix for 1c5cc23b5eb3b59da10926688fc350b56397b550 Generic CoA sets the country on the company. Without one many tests fail. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
**Steps to reproduce:** - Install Accounting and Point of Sale - Open a "Point of Sale" session - Create a POS order and pay it by bank - Create another POS order and pay it by Customer Account - Close POS session - Go to Accounting - Open Bank journal - Create a statement line and reconcile it with the POS payment - Go to "Accounting / Reporting / Audit Reports / General Ledger" - Check the amount of the POS orders in the following journals: * [101300] Account Receivable (PoS) *
Original PR description
**Steps to reproduce:** - Install Accounting and Point of Sale - Open a "Point of Sale" session - Create a POS order and pay it by bank - Create another POS order and pay it by Customer Account -…
**Steps to reproduce:** - Install Accounting and Point of Sale - Open a "Point of Sale" session - Create a POS order and pay it by bank - Create another POS order and pay it by Customer Account - Close POS session - Go to Accounting - Open Bank journal - Create a statement line and reconcile it with the POS payment - Go to "Accounting / Reporting / Audit Reports / General Ledger" - Check the amount of the POS orders in the following journals: * [101300] Account Receivable (PoS) * [121000] Account Receivable * [400000] Product Sales - Check "Cash Basis Method" in the options - Check again the amount of the POS orders in the same journals **Issue 1:** The amount for "[121000] Account Receivable" is present but it shouldn't because no payment has been done for it yet. **Extra steps:** - Create another statement line and reconcile it with the POS customer account payment - Check again the amount of the POS orders in the same journals **Issue 2:** The amount of the POS orders is double the original amount. **Issue 3:** If a partial payment is made for one line, the report has incorrect values. **Cause:** To retrieve the cash basis lines, a complex SQL query is executed. Let's take the following entries: - Invoice: | account | debit | credit | | ----------- | -------- | -------- | | Account Receivable 1 | 100 | 0 | | Account Receivable 2 | 200 | 0 | | Product Sales | 0 | 300 | - Payments: | account | debit | credit | | ---------------- | ------------ | ----------- | | Bank | 50 | 0 | | Account Receivable 1 | 0 | 50 | | account | debit | credit | | ------------ | ---------------- | ----------- | | Bank | 200 | 0 | | Account Receivable 2 | 0 | 200| A SELECT is executed to compute and get the percentage of the paid amount of each receivable/payable account by move, generating a temporary "table" as followed: | move_id | matched_percentage| | ------------------|---------------------------------| | 1 | 0.5 (50% paid for Account Receivable 1)| | 1 | 1.0 (100% paid for Account Receivable 2)| This table is then joined to account_move_line table on move_id where matched_percentage is applied to the amounts. Issues 1 and 2 are due to the fact that it was assumed that each account move would only contain 1 receivable/payable account, which is not the case here. As account_id is not present in the temporary table, it is not possible to identify to which account a line of that table refers to. As there is only a JOIN ON move_id when joining with account_move_line table, each aml from a move is taken into account even when it shouldn't. In this example, they are taken into account twice because the 2 entries have the same move_id. Issue 3 is coming from the fact that the WHOLE amount of "Product Sales" is computed with matched_percentage each time. For example, these 2 lines are computed from the tempory table for "Product Sales": * Product Sales = 300 * 0.5 = 150 (for Account Receivable 1) * Product Sales = 300 * 1.0 = 300 (for Account Receivable 2) The amount for "Product Sales" sums to 450, which is not correct. It should be 250. **Solution for issues 1 and 2:** Get account_id and join account_move_line table on it. An exception should be done for "Product Sales" when joining account_move_line table because it is not a receivable/payable account and the temporay table only contains receivable/payable accounts. **Solution for issue 3:** Compute a ratio for "Product Sales" for each receivable account. Its amount is 100 for "Account Receivable 1" and 200 for "Account Receivable 2" So its ratio should be: * 100 / 300 = 0.33 (for Account Receivable 1) * 100 / 300 = 0.66 (for Account Receivable 2) By applying this ratio, the correct amounts are computed for "Product Sales": * Product Sales = 300 * 0.5 * 0.33 = 50 (for Account Receivable 1) * Product Sales = 300 * 1.0 * 0.66 = 200 (for Account Receivable 2) opw-4224136 Forward-Port-Of: odoo/enterprise#74237 Forward-Port-Of: odoo/enterprise#73593
Following 81dce8461c7, when only some of the invoice lines have subscription start/end date, the commission generation crash when computing the maximum end date or minimal start start: ``` TypeError: '>' not supported between instances of 'bool' and 'datetime.date' ``` This commit ensure we only try to max/min non-falsy values. Forward-Port-Of: odoo/enterprise#74112
Original PR description
Following 81dce8461c7, when only some of the invoice lines have subscription start/end date, the commission generation crash when computing the maximum end date or minimal start start: ``` TypeError: '>' not supported between instances of 'bool' and 'datetime.date' ``` This commit ensure we only try to max/min non-falsy values. Forward-Port-Of: odoo/enterprise#74112
Add some hooks and tweaks to improve the experience to customize/improve on top of this module. Info: @wt-io-it Forward-Port-Of: odoo/enterprise#72123
Original PR description
Add some hooks and tweaks to improve the experience to customize/improve on top of this module. Info: @wt-io-it Forward-Port-Of: odoo/enterprise#72123
### After this PR You can add new column to the account partner ledger Example: ``` def _get_additional_column_aml_query_values(self): res = super()._get_additional_column_aml_query_values() res +="account_move_line.date as date," return res ``` Forward-Port-Of: odoo/enterprise#74075
Original PR description
### After this PR
You can add new column to the account partner ledger
Example:
```
def _get_additional_column_aml_query_values(self):
res = super()._get_additional_column_aml_query_values()
res +="account_move_line.date as date,"
return res
```
Forward-Port-Of: odoo/enterprise#74075### Steps to reproduce: - Create a new project and set it to be billable. - Set an analytic account on it - On the analytic account, set a plan that is not the default plan - Create a sale order for a subscription product with this analytic account and confirm it. - Create an invoice and confirm it. - Go to the project and click on Status Updates - Notice that the revenues show 0 in “Invoiced” even though we have invoiced the product - If we change the plan on the analytic accoun
Original PR description
### Steps to reproduce: - Create a new project and set it to be billable. - Set an analytic account on it - On the analytic account, set a plan that is not the default plan - Create a sale order for…
### Steps to reproduce:
- Create a new project and set it to be billable.
- Set an analytic account on it
- On the analytic account, set a plan that is not the default plan
- Create a sale order for a subscription product with this analytic account and confirm it.
- Create an invoice and confirm it.
- Go to the project and click on Status Updates
- Notice that the revenues show 0 in “Invoiced” even though we have invoiced the product
- If we change the plan on the analytic account, we will be able to see the invoiced amount on the profitability report
### Current behavior before PR:
When setting analytic account with different analytic plan than the default one the analytic account value will be stored in x_plan{plan_id}_id field when creating the analytic account line record. https://github.com/odoo/odoo/blob/39029710bbce55889c6b951fc423c1254e05ff22/addons/account/models/account_move_line.py#L3092
https://github.com/odoo/odoo/blob/17.0/addons/analytic/models/analytic_plan.py#L106:L122
So when fetching the profitability data for a project we are just checking the account_id field.
https://github.com/odoo/enterprise/blob/17.0/project_sale_subscription/models/project.py#L111:L115
### Desired behavior after PR is merged:
We are now using the same method of _column_name() to know which field should we use in the domain whether it is 'account_id' or 'x_plan{plan_id}_id'
opw-4137931
Forward-Port-Of: odoo/enterprise#70508This commit drastically reduces the spreadsheet thumbnails size. Go to CRM lead and insert the pivot in a spreadsheet: The size of the thumbnail: | Description | Size | |-----------------------|--------| | Before | 107Kb | | After quality=0.5 | 7.8Kb | | After quality=0 | 2.9Kb | Image quality is indeed reduced, but the thumbnails are always displayed so small that it doesn't really make any difference to the naked eye. Note: I'm not back
Original PR description
This commit drastically reduces the spreadsheet thumbnails size. Go to CRM lead and insert the pivot in a spreadsheet: The size of the thumbnail: | Description | Size | |-----------------------|--------| | Before | 107Kb | | After quality=0.5 | 7.8Kb | | After quality=0 | 2.9Kb | Image quality is indeed reduced, but the thumbnails are always displayed so small that it doesn't really make any difference to the naked eye. Note: I'm not backporting this fix to 16.0 because the code changed and webp was not supported at the time (even though we could use jpeg) Task: 4337496 Forward-Port-Of: odoo/enterprise#73881
This is a fix for failing test after the change introduced in the corrosponding community [PR] task-4240730 [PR]: https://github.com/odoo/odoo/pull/183129 Forward-Port-Of: odoo/enterprise#71778
Original PR description
This is a fix for failing test after the change introduced in the corrosponding community [PR] task-4240730 [PR]: https://github.com/odoo/odoo/pull/183129 Forward-Port-Of: odoo/enterprise#71778
Related to https://github.com/odoo/odoo/pull/187430 Forward-Port-Of: odoo/enterprise#73946 Forward-Port-Of: odoo/enterprise#73927
Original PR description
Related to https://github.com/odoo/odoo/pull/187430 Forward-Port-Of: odoo/enterprise#73946 Forward-Port-Of: odoo/enterprise#73927
Add the picking name as a reference number on ups shipment. [opw-3930816](https://www.odoo.com/odoo/project/49/tasks/3930816) Forward-Port-Of: odoo/enterprise#67303
Original PR description
Add the picking name as a reference number on ups shipment. [opw-3930816](https://www.odoo.com/odoo/project/49/tasks/3930816) Forward-Port-Of: odoo/enterprise#67303
### Steps to reproduce the issue: 1. Activate Mexican Localization 2. With a Mexican Company, create an Invoice and add a Product with a valid UNSPSC code 3. On the Invoice Line, set Price to 1030.17 and add a 3% Discount 4. Confirm then Send & Print (with CFDI checked) 5. In the generated XML, the following values are off: - In node "Comprobante, SubTotal="1030.16" Descuento="30.90" - In node "Concepto", ValorUnitario="1030.16" Importe="1030.16" Descuento="30.90" - Expecte
Original PR description
### Steps to reproduce the issue: 1. Activate Mexican Localization 2. With a Mexican Company, create an Invoice and add a Product with a valid UNSPSC code 3. On the Invoice Line, set Price to 1030.17…
### Steps to reproduce the issue:
1. Activate Mexican Localization
2. With a Mexican Company, create an Invoice and add a Product with a valid UNSPSC code
3. On the Invoice Line, set Price to 1030.17 and add a 3% Discount
4. Confirm then Send & Print (with CFDI checked)
5. In the generated XML, the following values are off:
- In node "Comprobante, SubTotal="1030.16" Descuento="30.90"
- In node "Concepto", ValorUnitario="1030.16" Importe="1030.16" Descuento="30.90"
- Expected are 1030.17 and 30.91
### Explanation:
During the calculation of the values for the CFDI, `gross_price_subtotal_before_discount` is calculated using `price_subtotal` in every case where `discount` is not 100%. This is due to other values affecting `price_subtotal` (e.g.: taxes with `price_include=True`), in which case calculating a value related to `price_subtotal` with `price_unit` would give the wrong result.
This calculation method causes rounding issues such as above because `price_subtotal` is rounded before calculating `gross_price_subtotal_before_discount`.
### Fix reasoning:
We need to account for any value that could affect `price_subtotal` and make it different from `price_unit * quantity` except for `discount`, which will be included when comparing both values.
The case `discount == 100.0` is covered by this new condition as well, since `discount_factor` would equal to 0 and `price_subtotal` too.
opw-4183556
Forward-Port-Of: odoo/enterprise#72593The existing FedEx implementation used the old FedEx SOAP API which is no longer in development. This new version makes use of the current REST APIs available at developer.fedex.com task-3759206 Forward-Port-Of: odoo/enterprise#73899 Forward-Port-Of: odoo/enterprise#73579
Original PR description
The existing FedEx implementation used the old FedEx SOAP API which is no longer in development. This new version makes use of the current REST APIs available at developer.fedex.com task-3759206 Forward-Port-Of: odoo/enterprise#73899 Forward-Port-Of: odoo/enterprise#73579
**Issue:** Two different actions have the same shortcut making one action impossible to reach. **Expected:** Different actions should have different keyboard shortcuts. **Steps to reproduce:** - Activate Subscription app; - Open an existing subscription; - Press `ALT` (`CTRL` on MacOS) to display all shortcuts and look at the `UPSELL` and `CLOSE` buttons. **Cause:** The same `data-hotkey` has been used for both buttons. **Fix:** Change the `UPSELL` button shortcut to `ALT+E` (
Original PR description
**Issue:** Two different actions have the same shortcut making one action impossible to reach. **Expected:** Different actions should have different keyboard shortcuts. **Steps to reproduce:** - Activate Subscription app; - Open an existing subscription; - Press `ALT` (`CTRL` on MacOS) to display all shortcuts and look at the `UPSELL` and `CLOSE` buttons. **Cause:** The same `data-hotkey` has been used for both buttons. **Fix:** Change the `UPSELL` button shortcut to `ALT+E` (`CTRL+E` on MacOS) as for Odoo 17. opw-4306179 Forward-Port-Of: odoo/enterprise#74136 Forward-Port-Of: odoo/enterprise#73548
``_try_to_check_ocr_status`` method attempts to check the OCR status for a record, If an exception occurs during this process, It will log an error. Error: ``` Couldn't check OCR status of hr.expense with id 1: 'currency_id' ``` This commit changes the log level from an error to a warning. This helps reduce noise in the logs by preventing excessive error messages. sentry-4597345306 Forward-Port-Of: odoo/enterprise#73817
Original PR description
``_try_to_check_ocr_status`` method attempts to check the OCR status for a record, If an exception occurs during this process, It will log an error. Error: ``` Couldn't check OCR status of hr.expense with id 1: 'currency_id' ``` This commit changes the log level from an error to a warning. This helps reduce noise in the logs by preventing excessive error messages. sentry-4597345306 Forward-Port-Of: odoo/enterprise#73817
The existing FedEx implementation used the old FedEx SOAP API which is no longer in development. This new version makes use of the current REST APIs available at developer.fedex.com task-3759206 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#186787
Original PR description
The existing FedEx implementation used the old FedEx SOAP API which is no longer in development. This new version makes use of the current REST APIs available at developer.fedex.com task-3759206 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#186787
Since odoo/odoo@4d2aa271 we cannot add any manual field to `res.users`. We are always faced with the error: ``` ... fields used for ordering must be present on the model and stored. ``` The reason is that the `res.users.name` field is a related stored field, via inherits. Similarly if we install base_automation we cannot add any field to `base.automation` model, because they are ordered by `sequence`, another stored related field. In this patch we propose to extend the check for field
Original PR description
Since odoo/odoo@4d2aa271 we cannot add any manual field to `res.users`. We are always faced with the error: ``` ... fields used for ordering must be present on the model and stored. ``` The reason is that the `res.users.name` field is a related stored field, via inherits. Similarly if we install base_automation we cannot add any field to `base.automation` model, because they are ordered by `sequence`, another stored related field. In this patch we propose to extend the check for field used in `_order` to related fields. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#187629
Description of the issue/feature this PR addresses: Commit [1] made sure that when pasting within blockquote and pre the pasted tag are not unwrapped. But the commit did not change the title as well as the describe of the test cases. This PR places the test cases at correct place. [1]: https://github.com/odoo/odoo/commit/460d88a20a908182e7e9aaf607816c0419a1c6bc --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#187918 Fo
Original PR description
Description of the issue/feature this PR addresses: Commit [1] made sure that when pasting within blockquote and pre the pasted tag are not unwrapped. But the commit did not change the title as well as the describe of the test cases. This PR places the test cases at correct place. [1]: https://github.com/odoo/odoo/commit/460d88a20a908182e7e9aaf607816c0419a1c6bc --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#187918 Forward-Port-Of: odoo/odoo#187724
**Steps to reproduce:** - Go to the `Todo` app. - Open a task. - Write any text. - Select the text. - Type `/command` - Hit Enter. **Description of the issue/feature this PR addresses:** The command is correctly added, but the issue is that the selected text is also re-added after the command is applied. **Desired behavior after PR is merged:** Selected text from before the `/command` will be removed and commands will still be executed. The process now involves clearing the c
Original PR description
**Steps to reproduce:** - Go to the `Todo` app. - Open a task. - Write any text. - Select the text. - Type `/command` - Hit Enter. **Description of the issue/feature this PR addresses:** The command is correctly added, but the issue is that the selected text is also re-added after the command is applied. **Desired behavior after PR is merged:** Selected text from before the `/command` will be removed and commands will still be executed. The process now involves clearing the content first and then launching the command. task-3487792 Forward-Port-Of: odoo/odoo#175808
### Steps to reproduce the issue: 1. Make sure you are in a company that is not a branch 2. Create a branch company 3. In the parent company, create an account group 4. In the branch company, create an account that should be set in the account group 5. The branch account is not set in the account group ### Explanation: When creating an account, we will enter `_adapt_accounts_for_account_groups` with a value for `account_ids`. As can be seen, `company_ids` is then assigned `account_i
Original PR description
### Steps to reproduce the issue: 1. Make sure you are in a company that is not a branch 2. Create a branch company 3. In the parent company, create an account group 4. In the branch company, create an account that should be set in the account group 5. The branch account is not set in the account group ### Explanation: When creating an account, we will enter `_adapt_accounts_for_account_groups` with a value for `account_ids`. As can be seen, `company_ids` is then assigned `account_ids.company_id.root_id.ids` which only corresponds to the id of the root company, not its branches. ### Fix reasoning: As asked by TSB, `account.group.company_id` can not have a `parent_id`, redirecting default value to `root_id`. `_accessible_branches` is only looking for active companies, the objective is to retrieve all children of `root_companies` (recursively). opw-4192988 Forward-Port-Of: odoo/odoo#182109
This commit fixes the direction of the arrows in the stock rules diagram if the user languange is right-to-left. opw-4302429 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#187921
Original PR description
This commit fixes the direction of the arrows in the stock rules diagram if the user languange is right-to-left. opw-4302429 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#187921
Before this commit, there was no check to see if the microphone was still needed when starting recording, which could leave the stream active with no reference to it. This commit fixes this issue by checking if the component is destroyed when the microphone promise is resolved. Forward-Port-Of: odoo/odoo#187870
Original PR description
Before this commit, there was no check to see if the microphone was still needed when starting recording, which could leave the stream active with no reference to it. This commit fixes this issue by checking if the component is destroyed when the microphone promise is resolved. Forward-Port-Of: odoo/odoo#187870
Related to https://github.com/odoo/enterprise/pull/73927 Forward-Port-Of: odoo/odoo#187468 Forward-Port-Of: odoo/odoo#187430
Original PR description
Related to https://github.com/odoo/enterprise/pull/73927 Forward-Port-Of: odoo/odoo#187468 Forward-Port-Of: odoo/odoo#187430
Prior to this commit, the `FormStatusIndicator` buttons were not properly aligned with the content of the breadcrumb in the control panel. This commit adjusts the alignment of `FormStatusIndicator` correctly according to the content of the breadcrumb. Also, to align the cog menu perfectly with the "save" and "cancel" buttons, we've removed the border around the latter two. task-3874495 | Before | After | |--------|--------| |  |  | |  |  | --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#186463
Steps to reproduce: 1. Drag and drop a text snippet. 2. Select background video and insert the video in the mediaDialog. 3. Click on the add button. Issue: A traceback occurs due to the tag name not being found for an element. This issue was introduced in commit [1]. Issue link: https://github.com/odoo/odoo/issues/186874 Solution: This PR resolves the traceback by adding a `parentEl` condition in the replace media on save function. [1] : https://github.com/odoo/odoo/commit/36594d04a
Original PR description
Steps to reproduce: 1. Drag and drop a text snippet. 2. Select background video and insert the video in the mediaDialog. 3. Click on the add button. Issue: A traceback occurs due to the tag name not being found for an element. This issue was introduced in commit [1]. Issue link: https://github.com/odoo/odoo/issues/186874 Solution: This PR resolves the traceback by adding a `parentEl` condition in the replace media on save function. [1] : https://github.com/odoo/odoo/commit/36594d04a8909dd40ab6384f387c372ddae62345 Forward-Port-Of: odoo/odoo#187793 Forward-Port-Of: odoo/odoo#186876
Issue: ====== sperator isn't inserted in the correct place. Steps to reproduce the issue: ============================= - Go to studio - Create a new internal report - Put the cursor in the div (second line) - Add some content over some lines - Insert seperator at the end of the lines - It gets inserted at the start Origin of the issue: ==================== Since we are writing inside the div directly, inserting the hr will look for the closest block and insert it before it whi
Original PR description
Issue: ====== sperator isn't inserted in the correct place. Steps to reproduce the issue: ============================= - Go to studio - Create a new internal report - Put the cursor in the div (second line) - Add some content over some lines - Insert seperator at the end of the lines - It gets inserted at the start Origin of the issue: ==================== Since we are writing inside the div directly, inserting the hr will look for the closest block and insert it before it which is the div. Because, new line inside a div is just a br and doesn't split the div. Solution: ========= Add a p element inside an empty div element when we put the selection there. task-4240730 Forward-Port-Of: odoo/odoo#183129
Before this PR, one-letter domain (like https://x.com) would not be linkified. This PR allows one-letter domain. Task-4344826 Forward-Port-Of: odoo/odoo#187924 Forward-Port-Of: odoo/odoo#187899
Original PR description
Before this PR, one-letter domain (like https://x.com) would not be linkified. This PR allows one-letter domain. Task-4344826 Forward-Port-Of: odoo/odoo#187924 Forward-Port-Of: odoo/odoo#187899
In #173866, the IoT configuration files were merged into one file. However, a logic check in `wireless_ap.sh` was inverted in the process, causing it not to wait for an IP. This PR simply restores the `!` to fix the check. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#187862
Original PR description
In #173866, the IoT configuration files were merged into one file. However, a logic check in `wireless_ap.sh` was inverted in the process, causing it not to wait for an IP. This PR simply restores the `!` to fix the check. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#187862
Follow-up of https://github.com/odoo/odoo/pull/186756 PR above improves push notification title in group chat without a name. The fix assumed that all members are partners, which is not necessarily the case. As a result, title contains `False` in conversation name and author when new message comes from a guest. This commit takes guests into account in push notification from new messages in channels as author. Group chat default name also uses guest names for the conversation name. Forw
Original PR description
Follow-up of https://github.com/odoo/odoo/pull/186756 PR above improves push notification title in group chat without a name. The fix assumed that all members are partners, which is not necessarily the case. As a result, title contains `False` in conversation name and author when new message comes from a guest. This commit takes guests into account in push notification from new messages in channels as author. Group chat default name also uses guest names for the conversation name. Forward-Port-Of: odoo/odoo#187713