Thursday, January 9, 2025
24 changes · master
Enhancements to existing features
Odoo now detects when Instagram posts or YouTube videos have comments disabled on the platform and shows that status in the comments dialog. This prevents users from trying to comment where it is not allowed and hides misleading Instagram comment counts when comments are disabled.
Original PR description
- In case the comments for a post on INSTAGRAM, or the comments for a video on YOUTUBE are disabled (not PAUSED), we show it as disabled in the `StreamPostComments` dialog box (the dialog box opened…
- In case the comments for a post on INSTAGRAM, or the comments for a video on YOUTUBE are disabled (not PAUSED), we show it as disabled in the `StreamPostComments` dialog box (the dialog box opened by clicking on the comments icon) - we also hide the `instagram_comments_count` in case we have disabled on the instagram platform. IMPLEMENTATION DIFFERENCES =========================== INSTAGRAM --------- - while fetching all the posts during the execution of the function `_fetch_instagram_posts`, we request an additional field (is_comment_enabled) which gives us if commenting is enabled. - this field is only available to us on the `/media` endpoint. - this field is not available to us when we are requesting comments using the `/comments` endpoint on a specific post. - we create a new field to store it to simply use it to check if comments are enabled. YOUTUBE ------- - unlike instagram, the YOUTUBE DATA API does not provide us with any field while we are fetching the videos in the function `_fetch_channel_videos`. - but what it does provide is an errorneous response when we are requesting comments on a video that has comments disabled. (in case of instagram, it does not throw any error, it just gives an empty object) - we use that response to then derive the conclusion that comments on that video is disabled. - we have intentionally left a TODO, to check for a direct field which would give us the information about commenting on a video. Task-4070000
The signing request view was simplified by removing an unnecessary layout container. This minor cleanup helps keep the Sign interface easier to maintain without changing business workflows.
Users can now delete draft invoices that were imported with Mexican CFDI data. This removes an unnecessary restriction for imported documents while still preserving controls for invoices sent to SAT through Odoo.
Original PR description
If we import an invoice with CFDI, our fields are populated (and CFDI related fields) with the invoice state set to Draft. The current behaviour is to prevent invoice deletion when we have the CFDI. It makes sense to prevent the deletion of sent invoices when we send them to SAT via Odoo but when we import them, it'll be useful to be able to delete them. This commit enables the deletion of an imported invoice, even when the CFDI fields are populated. task-4306416
Miscellaneous changes
Behavior Before the Commit: When generating a new payment link, the system creates a new mandate without explicitly setting the `company_id`. As a result, the default company (`company_id` of the public user, `user_id = 4`) is assigned, which may not match the intended company if the payment is being processed for a company other than the default one. This mismatch between the journal's company and the mandate's `company_id` prevents the payment from being completed. Fix: The `company_id` i
Original PR description
Behavior Before the Commit: When generating a new payment link, the system creates a new mandate without explicitly setting the `company_id`. As a result, the default company (`company_id` of the…
Behavior Before the Commit: When generating a new payment link, the system creates a new mandate without explicitly setting the `company_id`. As a result, the default company (`company_id` of the public user, `user_id = 4`) is assigned, which may not match the intended company if the payment is being processed for a company other than the default one. This mismatch between the journal's company and the mandate's `company_id` prevents the payment from being completed. Fix: The `company_id` is properly set during mandate creation, aligning it with the payment link's associated company and preventing unexpected behavior. Steps: 1) Configure two companies with accounting setups. 2) Open the Payment Providers menu. 3) Select SEPA, activate test mode, and ensure it is published. 4) Duplicate the SEPA payment provider, set the company_id to the second company, activate test mode, and ensure it is published. 5) Go to any sales order in the first company, generate a payment link, open it, and select SEPA. Enter any fake IBAN — it will process successfully. 6) Switch to the second company and repeat step 5. You will encounter an error message because the mandate is incorrectly assigned to the first company, preventing payment completion. Forward-Port-Of: odoo/enterprise#76705
Camera driver was not working, so we updated the logic to detect camera devices, and improved the one to take pictures. We also caught the opportunity to move IoT Handlers corresponding to `quality` modules to `quality_iot`. Community PR: [https://github.com/odoo/odoo/pull/192449](https://github.com/odoo/odoo/pull/192449) Task: 4432584 Forward-Port-Of: odoo/enterprise#76780 Forward-Port-Of: odoo/enterprise#76511
Original PR description
Camera driver was not working, so we updated the logic to detect camera devices, and improved the one to take pictures. We also caught the opportunity to move IoT Handlers corresponding to `quality` modules to `quality_iot`. Community PR: [https://github.com/odoo/odoo/pull/192449](https://github.com/odoo/odoo/pull/192449) Task: 4432584 Forward-Port-Of: odoo/enterprise#76780 Forward-Port-Of: odoo/enterprise#76511
partial payments An user may receive several partial payments for invoices/bills. These payments could be grouped in a batch and reconciled with a single statement line. However this flow is currently not working because the bank reconciliation fails Steps to reproduce: - Create 2 invoice and register a partial payment for each one - Select the 2 payments create a batch - Create a new statement with the sum of the payment amounts - Reconcile the statement with the created batch Issue:
Original PR description
partial payments An user may receive several partial payments for invoices/bills. These payments could be grouped in a batch and reconciled with a single statement line. However this flow is…
partial payments An user may receive several partial payments for invoices/bills. These payments could be grouped in a batch and reconciled with a single statement line. However this flow is currently not working because the bank reconciliation fails Steps to reproduce: - Create 2 invoice and register a partial payment for each one - Select the 2 payments create a batch - Create a new statement with the sum of the payment amounts - Reconcile the statement with the created batch Issue: An error will block the validation ``` The move (BNK1/2024/00011) is not balanced. The total of debits equals $ 510.60 and the total of credits equals $ 100.00. You might want to specify a default account on journal "Bank" to automatically balance each move. ``` This occurs because the system is taking the amount to reconcile from the invoice, instead of the payment, so it will try to reconcile the full amount. opw-4379673 Forward-Port-Of: odoo/enterprise#76121
### Steps to reproduce: - Install "l10n_mx" and switch to a Mexican company - Create an invoice with a Mexican partner and confirm - Create a Payment - In the invoice form view, go to the "CFDI" page - Click "Update CFDI" - The payment appears, click on "Show" - The button "Request Cancel" does nothing ### Cause: the method `button_request_cancel` on move is called from the payment model but does not return anything: ``` def button_request_cancel(self): self.move_id.button_requ
Original PR description
### Steps to reproduce:
- Install "l10n_mx" and switch to a Mexican company
- Create an invoice with a Mexican partner and confirm
- Create a Payment
- In the invoice form view, go to the "CFDI" page
- Click "Update CFDI"
- The payment appears, click on "Show"
- The button "Request Cancel" does nothing
### Cause:
the method `button_request_cancel` on move is called from the payment model but does not return anything:
```
def button_request_cancel(self):
self.move_id.button_request_cancel()
```
But the `button_request_cancel` from `l10n_mx_edi` is returning a wizard that is never caught.
### Solution:
When clicking the "Request cancel" button, the method `action_request_cancel` is called instead of `action_cancel` which will dispatch the request depending on the type of move being cancelled.
opw-4332483
Forward-Port-Of: odoo/enterprise#76027
Forward-Port-Of: odoo/enterprise#75714In this commit, we wait the modal is shown (managed by jQuery) before to continue the tour. In these modals, if we don't wait for the modal is shown, as the tour engine can be too much fast, element in modal can be not focusable when we try to target it. In odoo/addons/website/static/src/js/content/website_root.js the class modal_show is added in _onModalShown: ```javascript _onModalShown: function (ev) { $(ev.target).addClass('modal_shown'); }, ``` This fix add classes in triggers
Original PR description
In this commit, we wait the modal is shown (managed by jQuery) before to continue the tour. In these modals, if we don't wait for the modal is shown, as the tour engine can be too much fast, element in modal can be not focusable when we try to target it.
In odoo/addons/website/static/src/js/content/website_root.js the class modal_show is added in _onModalShown:
```javascript
_onModalShown: function (ev) {
$(ev.target).addClass('modal_shown');
},
```
This fix add classes in triggers to ensure modal is shown before continuing the tour.
Forward-Port-Of: odoo/enterprise#76605When [adding this module], the translations were forgotten. We are adding them here. [adding this module]: https://github.com/odoo/enterprise/commit/055ed588dd7558c568373fbaa6d24208d0aeeb87 opw-4425163 Forward-Port-Of: odoo/enterprise#76646 Forward-Port-Of: odoo/enterprise#76612
Original PR description
When [adding this module], the translations were forgotten. We are adding them here. [adding this module]: https://github.com/odoo/enterprise/commit/055ed588dd7558c568373fbaa6d24208d0aeeb87 opw-4425163 Forward-Port-Of: odoo/enterprise#76646 Forward-Port-Of: odoo/enterprise#76612
Since the Select owl componenent is used to display the benefits values, the 'options' of the select are displayed alphabetically. It is caused by the default value to 'true' for the autoSort attribute of the component. As we give the data in a specific order to the select in salary cofigurator we don't want the JS to re-order it. e.g.: the cars are sorted by cost and we don't wan't it in the alphabetical order. Forward-Port-Of: odoo/enterprise#76642
Original PR description
Since the Select owl componenent is used to display the benefits values, the 'options' of the select are displayed alphabetically. It is caused by the default value to 'true' for the autoSort attribute of the component. As we give the data in a specific order to the select in salary cofigurator we don't want the JS to re-order it. e.g.: the cars are sorted by cost and we don't wan't it in the alphabetical order. Forward-Port-Of: odoo/enterprise#76642
In GanttModel, we markup html values like it is done in the util function parseServerValue so that is it now possible to use t-out on html field values in the gantt popovers (and possibly elsewhere) and have correct results. Task ID: 4382205 Forward-Port-Of: odoo/enterprise#76665 Forward-Port-Of: odoo/enterprise#76530
Original PR description
In GanttModel, we markup html values like it is done in the util function parseServerValue so that is it now possible to use t-out on html field values in the gantt popovers (and possibly elsewhere) and have correct results. Task ID: 4382205 Forward-Port-Of: odoo/enterprise#76665 Forward-Port-Of: odoo/enterprise#76530
Starting from saas-17.4, the default transaction code in settings shows the commidity code instead of transaction codes. This commit applies the domain for showing transaction codes instead. opw-4419718 Forward-Port-Of: odoo/enterprise#76519
Original PR description
Starting from saas-17.4, the default transaction code in settings shows the commidity code instead of transaction codes. This commit applies the domain for showing transaction codes instead. opw-4419718 Forward-Port-Of: odoo/enterprise#76519
Related to https://github.com/odoo/odoo/pull/187430 Forward-Port-Of: odoo/enterprise#74818 Forward-Port-Of: odoo/enterprise#73927
Original PR description
Related to https://github.com/odoo/odoo/pull/187430 Forward-Port-Of: odoo/enterprise#74818 Forward-Port-Of: odoo/enterprise#73927
Before this commit, fields that were always invisible (with an `invisible` attribute equals to True|1) were not listed in the Sidebar's "Existing Fields", and were not available for drag/drop. This was rather impractical as such field may be in the arch just to have their data loaded, not really displayed. Moreover, since odoo/odoo@6f06420e4a9443c52dc0cb427f8f55eb4aecabce, fields may be added in the view automatically based on whether their value will be used in some condition or context else
Original PR description
Before this commit, fields that were always invisible (with an `invisible` attribute equals to True|1) were not listed in the Sidebar's "Existing Fields", and were not available for drag/drop. This was rather impractical as such field may be in the arch just to have their data loaded, not really displayed. Moreover, since odoo/odoo@6f06420e4a9443c52dc0cb427f8f55eb4aecabce, fields may be added in the view automatically based on whether their value will be used in some condition or context elsewhere in the view. After this commit, always invisible fields are always proposed for addition in the view. opw-4450351 Forward-Port-Of: odoo/enterprise#76677 Forward-Port-Of: odoo/enterprise#76608
Following the "nice urls" [task][1] It may happen that the studio's systray item is re-rendered while the actionService is loading a URL with multiple actions In this case, there may be a crash because the SystrayItem would check if the current action (in this case from the virtual controller) is editable. After this commit, there is no crash. part of task-4391729 [1]: https://github.com/odoo/odoo/commit/c63d14a0485a553b74a8457aee158384e9ae6d3f Forward-Port-Of: odoo/enterprise#76
Original PR description
Following the "nice urls" [task][1] It may happen that the studio's systray item is re-rendered while the actionService is loading a URL with multiple actions In this case, there may be a crash because the SystrayItem would check if the current action (in this case from the virtual controller) is editable. After this commit, there is no crash. part of task-4391729 [1]: https://github.com/odoo/odoo/commit/c63d14a0485a553b74a8457aee158384e9ae6d3f Forward-Port-Of: odoo/enterprise#76694
Steps: - Have 2 or more companies, select both in company selector - Go to Cash Flow Statement report -> Traceback: `TypeError: '<' not supported between instances of 'str' and 'NoneType'` Cause: https://github.com/odoo/enterprise/blob/0dad52c1371f2daca50775d72571a0eac768ac03/account_reports/models/account_cash_flow_report.py#L228 is equal to `SQL('("account_move_line__account_id"."code_store"->%s->>0)::VARCHAR', '<self.env.company.id>')` therefore the account code for accounts that
Original PR description
Steps:
- Have 2 or more companies, select both in company selector
- Go to Cash Flow Statement report
-> Traceback: `TypeError: '<' not supported between instances of 'str' and 'NoneType'`
Cause:
https://github.com/odoo/enterprise/blob/0dad52c1371f2daca50775d72571a0eac768ac03/account_reports/models/account_cash_flow_report.py#L228
is equal to `SQL('("account_move_line__account_id"."code_store"->%s->>0)::VARCHAR', '<self.env.company.id>')` therefore the account code
for accounts that are not from `self.env.company` are set to None in the data dict
Fix:
Adding a default value set to '' and reversing the order allowing to
keep the accounts from the selected company first.
opw-4367588
Forward-Port-Of: odoo/enterprise#75892Purpose: -------- The comments popover is not displayed when the computed popover top value is "0". This issue arises from incorrectly using this value as a boolean condition, whereas "0" is an acceptable top value (= top of the body). To fix this issue, we now check if the popover's top is undefined instead of using it as a boolean. Task-4461321 Forward-Port-Of: odoo/enterprise#76703
Original PR description
Purpose: -------- The comments popover is not displayed when the computed popover top value is "0". This issue arises from incorrectly using this value as a boolean condition, whereas "0" is an acceptable top value (= top of the body). To fix this issue, we now check if the popover's top is undefined instead of using it as a boolean. Task-4461321 Forward-Port-Of: odoo/enterprise#76703
### Steps to reproduce the issue: - Employee > open your favorite employee > HR Settings tab - Add a Badge Id say: 111 - Go to the shopfloor > extends the employee panel on the left - Scan the badge of your employee #### Expected behavior: The corresponding employee is added to the employee panel on the left and is set as the session owner. If you had clicked on the `+ Add operator` button before the scan, the dialog should be closed. #### Current behavior: TypeError: Cannot re
Original PR description
### Steps to reproduce the issue: - Employee > open your favorite employee > HR Settings tab - Add a Badge Id say: 111 - Go to the shopfloor > extends the employee panel on the left - Scan the badge…
### Steps to reproduce the issue: - Employee > open your favorite employee > HR Settings tab - Add a Badge Id say: 111 - Go to the shopfloor > extends the employee panel on the left - Scan the badge of your employee #### Expected behavior: The corresponding employee is added to the employee panel on the left and is set as the session owner. If you had clicked on the `+ Add operator` button before the scan, the dialog should be closed. #### Current behavior: TypeError: Cannot read properties of undefined (reading 'isShown') at `MrpDisplay._onBarcodeScanned` ### Cause of the issue: Once the scanned barcode is parsed and match a given employee in the `_onBarcodeScanned`, this call checks that a `SelectionPopup` is shown (representing the search dialog) and if so close it: https://github.com/odoo/enterprise/blob/e6bb5d2dcd1042ae6269487056babceca34b8655/mrp_workorder/static/src/mrp_display/mrp_display.js#L170-L177 Then, the session owner is set to the scanned employee. However, the `SelectionPopup` has been removed in saas-17.3 by Commit 209b0840df4d3de184dcba6cbc09539ec191a43a: https://github.com/odoo/enterprise/pull/56927/commits/209b0840df4d3de184dcba6cbc09539ec191a43a#diff-119404910b34efb326dbe84735b8ca63c16391841da9a7a85e5f61f790b25bd6L26-L31 and has been replaced by a regular dialog of the dialogService. It should therefore be closed in a similar way to how its done in the `selectEmployee` of the `useConnectedEmployee`: https://github.com/odoo/enterprise/blob/e6bb5d2dcd1042ae6269487056babceca34b8655/mrp_workorder/static/src/mrp_display/hooks/employee_hooks.js#L76 opw-4405585 --- Forward-Port-Of: odoo/enterprise#76361 Forward-Port-Of: odoo/enterprise#75820
Excluding counbtries on an appointment type should not lead to a 404 page when directly given the appointment link (even wihtout invite). Now the countries excluded are used to not display these appointments when necessary but they can still be reached with the direct link. task-4456488 Forward-Port-Of: odoo/enterprise#76674
Original PR description
Excluding counbtries on an appointment type should not lead to a 404 page when directly given the appointment link (even wihtout invite). Now the countries excluded are used to not display these appointments when necessary but they can still be reached with the direct link. task-4456488 Forward-Port-Of: odoo/enterprise#76674
Versions: ------------- 16.0 Steps to Reproduce: ---------------------------- 1. Open the Sign app. 2. Switch to the kanban view of sign templates. 3. Upload a document without adding any sign items. 4. Switch to the list view and open the template. 5. In the form view, go to the "Fields" notebook tab. 6. Add 2-3 sign items, then go back to the kanban view. 7. Reopen the template. Issue: --------- An error occurs when trying to sign the template. Cause: ---------- When a
Original PR description
Versions: ------------- 16.0 Steps to Reproduce: ---------------------------- 1. Open the Sign app. 2. Switch to the kanban view of sign templates. 3. Upload a document without adding any sign items. 4. Switch to the list view and open the template. 5. In the form view, go to the "Fields" notebook tab. 6. Add 2-3 sign items, then go back to the kanban view. 7. Reopen the template. Issue: --------- An error occurs when trying to sign the template. Cause: ---------- When adding sign items in the form view, other required fields are left empty. These missing values are needed to properly render the items in the PDF iframe. Solution: ------------ Make the sign items in the "Fields" notebook read-only. task-4212762 Forward-Port-Of: odoo/enterprise#71017
An error occurs while preparing monster data because in code mistakenly uses the attribute name 'is_flexible_hours' instead of the correct attribute name 'flexible_hours' to check the flexible hours of the resource calendar. `AttributeError: 'resource.calendar' object has no attribute 'is_flexible_hours'` To resolve this issue, Give a valid attribute name 'flexible_hours' instead of 'is_flexible_hours'. Sentry-6150854320 Forward-Port-Of: odoo/enterprise#75730
Original PR description
An error occurs while preparing monster data because in code mistakenly uses the attribute name 'is_flexible_hours' instead of the correct attribute name 'flexible_hours' to check the flexible hours of the resource calendar. `AttributeError: 'resource.calendar' object has no attribute 'is_flexible_hours'` To resolve this issue, Give a valid attribute name 'flexible_hours' instead of 'is_flexible_hours'. Sentry-6150854320 Forward-Port-Of: odoo/enterprise#75730
Steps to reproduce: 1. Install l10n_uk_reports_cis 2. Open a new bill 3. Set the 20% G tax on a new line. 4. Save without assigning a partner. 5. A traceback is raised. --- Description of the issue this commit addresses: In the l10n_uk_reports_cis module, a tax validation system is implemented that reaches into move.partner_id to check the chosen taxes validity. This causes an issue when the move doesn't have a partner yet, raising a traceback. --- Desired behavior after th
Original PR description
Steps to reproduce: 1. Install l10n_uk_reports_cis 2. Open a new bill 3. Set the 20% G tax on a new line. 4. Save without assigning a partner. 5. A traceback is raised. --- Description of the issue this commit addresses: In the l10n_uk_reports_cis module, a tax validation system is implemented that reaches into move.partner_id to check the chosen taxes validity. This causes an issue when the move doesn't have a partner yet, raising a traceback. --- Desired behavior after this commit is merged: No traceback is raised. --- Note on the fix: An additionnal check verifying the move has a partner is done before reaching into its values. The error happens inside the lambda line 20 and is **not** modified in the PR, the next line is modified to remove the `move.partner_id and ` that became redundant with the ` or not move.partner_id` condition added to the initial `if`. --- opw-4365356 Forward-Port-Of: odoo/enterprise#76527
Steps to reproduce: ------------- - Install Sales, Field Service, and Stock, - Go into Field service and open any task that has products. - Through stat button on the top access the product catalog. - Click on burger menu on any service type product. Issue: - View Availability option should not be shown for service type products Cause: - No condition to make it invisible. Solution: - Added a condition when product type is service to the option invisible. task-3801551
Original PR description
Steps to reproduce: ------------- - Install Sales, Field Service, and Stock, - Go into Field service and open any task that has products. - Through stat button on the top access the product catalog. - Click on burger menu on any service type product. Issue: - View Availability option should not be shown for service type products Cause: - No condition to make it invisible. Solution: - Added a condition when product type is service to the option invisible. task-3801551 Forward-Port-Of: odoo/enterprise#76144 Forward-Port-Of: odoo/enterprise#58817
In project sharing, when the user changes a planned date in task form, a traceback occurs, because the portal user doesn't have the rights on `resource.calendar.attendance`. To solve that, we call the method that get those records with sudo (`_get_tasks_by_resource_calendar_dict`). task-3973305 Forward-Port-Of: odoo/enterprise#72695
Original PR description
In project sharing, when the user changes a planned date in task form, a traceback occurs, because the portal user doesn't have the rights on `resource.calendar.attendance`. To solve that, we call the method that get those records with sudo (`_get_tasks_by_resource_calendar_dict`). task-3973305 Forward-Port-Of: odoo/enterprise#72695