Friday, June 7, 2024
22 changes · master
Resolved issues and error corrections
This fixes an unnecessary warning that appeared when a customer saved a payment token on a subscription. The change helps keep subscription payment flows cleaner and avoids misleading log messages without changing the customer-facing process.
Original PR description
Before this commit, the following warning was visible when customer saved a token on his subscription following https://github.com/odoo/enterprise/pull/49963/files#diff-2ad4b41ff096801e7a6846995ca51ebd96103c40c3591f5b8446771cb3a730e5L172-R182 ``` 2024-06-03 14:52:35,361 130974 INFO prout werkzeug: 127.0.0.1 - - [03/Jun/2024 14:52:35] "POST /payment/status/poll HTTP/1.1" 200 - 215 0.104 4.095 2024-06-03 14:52:35,506 130974 WARNING prout py.warnings: <634>:14: UserWarning: unsupported operand type(s) for "==": 'payment.token()' == '1' ```
This fixes an internal naming issue in the Data Cleaning app introduced during a previous merge. It helps ensure the app references the correct model, reducing the risk of errors in data cleanup workflows.
Original PR description
model name was not changed after merge in 4fc497861fbefee7f4761c3341a3c2bd289edb31
Code cleanup and technical improvements
This update cleans up automated test tour definitions after a platform change made simple presence checks the default behavior. It does not change business features, but helps keep test maintenance simpler and reduces unnecessary test code across several apps.
Original PR description
As of commit https://github.com/odoo/odoo/pull/167743, the default action in tours is now NOTHING. That is to say that if we only put a "trigger", the compiler only checks that the element is in the DOM. To perform a "click" action on the trigger, you must explicitly write run: "click". In this commit, we remove all isCheck: true and empty runs because they are no longer useful... since it is the default action. https://github.com/odoo/odoo/pull/168474
Miscellaneous changes
Since custom and anytime appointment types aren't visible on website pages, it makes sense to set their is_published field to False by default. The only exception when appointment types should be created with published flag is when it is being done from website page, since creating appointment from there implies their public visibility. task-3944831 Forward-Port-Of: odoo/enterprise#64032 Forward-Port-Of: odoo/enterprise#63441
Original PR description
Since custom and anytime appointment types aren't visible on website pages, it makes sense to set their is_published field to False by default. The only exception when appointment types should be created with published flag is when it is being done from website page, since creating appointment from there implies their public visibility. task-3944831 Forward-Port-Of: odoo/enterprise#64032 Forward-Port-Of: odoo/enterprise#63441
Problem: When a selection field is mapped in a template variable, its key is returned instead of its value. E.g. a selection field is mapped in a template variable whose one of the selections is `('out_invoice', 'Customer Invoice')` then `out_invoice` will be returned instead of `Customer Invoice`. Technical Problem: The function `_find_value_from_field_path` of the class `BaseModel` is used to get the value of the template variable. This function uses `.mapped()` to get the template's
Original PR description
Problem:
When a selection field is mapped in a template variable, its key is returned instead of its value. E.g. a selection field is mapped in a template variable whose one of the selections is `('out_invoice', 'Customer Invoice')` then `out_invoice` will be returned instead of `Customer Invoice`.
Technical Problem:
The function `_find_value_from_field_path` of the class `BaseModel` is used to get the value of the template variable. This function uses `.mapped()` to get the template's variable value which returns the key instead of the value whenever the last field of the chain is a selection field.
Solution:
The `last_field_of_chain` and `last_model` are obtained using `field_path`. If `last_field_of_chain` is of the selection field then the function `convert_to_export` of the `Selection` class is used to get the value of the selection field by using the key obtained in the `field_value` and the `last_model`.
Task-3964078
Forward-Port-Of: odoo/enterprise#63695In PlanningView, a traceback happens because a variable is called when it has never been declared before. This PR will add the declaration of the variable and fix the traceback. Forward-Port-Of: odoo/enterprise#63866
Original PR description
In PlanningView, a traceback happens because a variable is called when it has never been declared before. This PR will add the declaration of the variable and fix the traceback. Forward-Port-Of: odoo/enterprise#63866
This commit aims to convert QUnit tests which rely on mail/test_utils to hoot. Part of task-3818666 Forward-Port-Of: odoo/enterprise#63847 Forward-Port-Of: odoo/enterprise#63721
Original PR description
This commit aims to convert QUnit tests which rely on mail/test_utils to hoot. Part of task-3818666 Forward-Port-Of: odoo/enterprise#63847 Forward-Port-Of: odoo/enterprise#63721
Intended: Generate pdfs is meant to run in every hour. It was intention as well at creation and it shows from how nextcall is defined: <field name="nextcall" eval="(DateTime.now() + timedelta(hours=1))"/> Current behavior: But regardless how nextcall is defined, now the cron runs in every month. This is because interval_type is not explicitly defined on the cron and thus it takes default value - that is 'months'. To correct the cron behavior, we explicitly define interval_number
Original PR description
Intended: Generate pdfs is meant to run in every hour. It was intention as well at creation and it shows from how nextcall is defined: <field name="nextcall" eval="(DateTime.now() + timedelta(hours=1))"/> Current behavior: But regardless how nextcall is defined, now the cron runs in every month. This is because interval_type is not explicitly defined on the cron and thus it takes default value - that is 'months'. To correct the cron behavior, we explicitly define interval_number and interval_type task-3960037 Forward-Port-Of: odoo/enterprise#63846 Forward-Port-Of: odoo/enterprise#63565
Include the version of Odoo in the UserAgent header of SIP requests so that the information is available to the provider. Task-3940569 Forward-Port-Of: odoo/enterprise#63281 Forward-Port-Of: odoo/enterprise#62879
Original PR description
Include the version of Odoo in the UserAgent header of SIP requests so that the information is available to the provider. Task-3940569 Forward-Port-Of: odoo/enterprise#63281 Forward-Port-Of: odoo/enterprise#62879
Issue: ------ When we go to a gantt view with the day view, the time format is always displayed in 12-hour format followed by "am" or "pm". Depending on the location, this format may also be 24 hours. Solution: --------- Use the current localization to determine the time display format. opw-3867317 Forward-Port-Of: odoo/enterprise#62896 Forward-Port-Of: odoo/enterprise#61209
Original PR description
Issue: ------ When we go to a gantt view with the day view, the time format is always displayed in 12-hour format followed by "am" or "pm". Depending on the location, this format may also be 24 hours. Solution: --------- Use the current localization to determine the time display format. opw-3867317 Forward-Port-Of: odoo/enterprise#62896 Forward-Port-Of: odoo/enterprise#61209
Current behavior: --- When rendering a linkedin feed, if one of the posts includes a video, no images will be displayed. Steps to reproduce: --- 1. Go to Configuration > Social Media 2. Link a linkedin account 3. Make a post with an image on linkedin 4. Make a post with a video 5. Go to feed 6. Neither the video nor the image is displayed Cause of the issue: --- When getting the image URNs with `post.get('content', {}).get('media', {}).get('id') ` you can get a video URN in th
Original PR description
Current behavior:
---
When rendering a linkedin feed, if one of the posts includes a video, no images will be displayed.
Steps to reproduce:
---
1. Go to Configuration > Social Media
2. Link a linkedin account
3. Make a post with an image on linkedin
4. Make a post with a video
5. Go to feed
6. Neither the video nor the image is displayed
Cause of the issue:
---
When getting the image URNs with
`post.get('content', {}).get('media', {}).get('id') `
you can get a video URN in the shape of
`'urn:li:video:abcdefghijklmnop1234'`
opw-3775212
Forward-Port-Of: odoo/enterprise#60950On computers where WPS office is installed, the mimetype of office files (eg. .docx, .xslx) the mimetype recognition is altered (at least on linux machines [^1][^2]). The detection of xlsx files in Documents did not account for the specific mimetype set by WPS Office. [^1]: https://forum.puppylinux.com/viewtopic.php?t=2379&i=1 [^2]: https://askubuntu.com/questions/1360278/wps-office-messing-up-mime-types-associated-with-office-documents Task-3915912 Forward-Port-Of: odoo/enterprise#63830
Original PR description
On computers where WPS office is installed, the mimetype of office files (eg. .docx, .xslx) the mimetype recognition is altered (at least on linux machines [^1][^2]). The detection of xlsx files in Documents did not account for the specific mimetype set by WPS Office. [^1]: https://forum.puppylinux.com/viewtopic.php?t=2379&i=1 [^2]: https://askubuntu.com/questions/1360278/wps-office-messing-up-mime-types-associated-with-office-documents Task-3915912 Forward-Port-Of: odoo/enterprise#63830 Forward-Port-Of: odoo/enterprise#62100
- Create a credit note - Add a product as a "Discount" and add the proper information - Process it under the use "devoluciones, descuentos o bonificaciones" (G02) - Check the generated XML Issue: Under description, we report "devolucion de mercancias" which wrong, as the user is not returning anything, they´re only getting a discount. opw-3902858 Forward-Port-Of: odoo/enterprise#63757 Forward-Port-Of: odoo/enterprise#63520
Original PR description
- Create a credit note - Add a product as a "Discount" and add the proper information - Process it under the use "devoluciones, descuentos o bonificaciones" (G02) - Check the generated XML Issue: Under description, we report "devolucion de mercancias" which wrong, as the user is not returning anything, they´re only getting a discount. opw-3902858 Forward-Port-Of: odoo/enterprise#63757 Forward-Port-Of: odoo/enterprise#63520
When printing payslip the fields which are not filled in Employee form ,demo data is filled while printing payslip report remove demo data from the payslip report ,the fields should be empty when no info is added task-3948257 Forward-Port-Of: odoo/enterprise#63313
Original PR description
When printing payslip the fields which are not filled in Employee form ,demo data is filled while printing payslip report remove demo data from the payslip report ,the fields should be empty when no info is added task-3948257 Forward-Port-Of: odoo/enterprise#63313
Improvement of the ui and ux of the management of receipts sent by email, sms or whatsapp. taskId: 3962144 Forward-Port-Of: odoo/enterprise#63722
Original PR description
Improvement of the ui and ux of the management of receipts sent by email, sms or whatsapp. taskId: 3962144 Forward-Port-Of: odoo/enterprise#63722
To reproduce: ============= - create a subscription and confirm it - create the invoice for this subscription - create an upsell, add some recurring products with qty > 0 - confirm the upsell, you can see that the parent sub has been updated with the qty coming from Upsell - cancel the upsell afterward -> the parent sub has not been reverted. Problem: ======== When we cancel an upsell, the changes on the parent subscription are not reverted. The message in the chatter is improved to
Original PR description
To reproduce: ============= - create a subscription and confirm it - create the invoice for this subscription - create an upsell, add some recurring products with qty > 0 - confirm the upsell, you can see that the parent sub has been updated with the qty coming from Upsell - cancel the upsell afterward -> the parent sub has not been reverted. Problem: ======== When we cancel an upsell, the changes on the parent subscription are not reverted. The message in the chatter is improved to notify the quantities on the subscription may need to be updated. opw-3269465 Forward-Port-Of: odoo/enterprise#63855 Forward-Port-Of: odoo/enterprise#61678
Configure 'Cash Discount Tax Reduction' on 'On early payment' Have a payment term [TERM] configured with 2% discount for early payment Create a [BILL_1] with: - partner: [DEMO] - payment terms: [TERM] - invoice line: qty 1, unit amount 161.10, tax 19% Create a [BILL_2] with: - partner: [DEMO] - payment terms: [TERM] - invoice line: qty 1, unit amount 77.50, tax 19% Create a bank statement with: - partner: [DEMO] - amount -278.27 - label: test Reconcile the bank statement wi
Original PR description
Configure 'Cash Discount Tax Reduction' on 'On early payment' Have a payment term [TERM] configured with 2% discount for early payment Create a [BILL_1] with: - partner: [DEMO] - payment terms: [TERM] - invoice line: qty 1, unit amount 161.10, tax 19% Create a [BILL_2] with: - partner: [DEMO] - payment terms: [TERM] - invoice line: qty 1, unit amount 77.50, tax 19% Create a bank statement with: - partner: [DEMO] - amount -278.27 - label: test Reconcile the bank statement with the 2 bills, the system will create 2 epd lines: - Discount line with credit 4.77 - Discount line tax with credit 0.90 Go to General Ledger Export "DATEV (ZIP)" and check accounting_entries.csv Issue: Early payment line amount will be 5.68 instead of 5.67 Similar to https://github.com/odoo/enterprise/commit/111cf205d91a1c8f46bc8d3f7b96b6dbfac7071b opw-3801374 Forward-Port-Of: odoo/enterprise#63799 Forward-Port-Of: odoo/enterprise#62910
Forward-Port-Of: odoo/enterprise#63758 Forward-Port-Of: odoo/enterprise#63716
Original PR description
Forward-Port-Of: odoo/enterprise#63758 Forward-Port-Of: odoo/enterprise#63716
Currently, an error occurs when the user tries to select a selection, boolean, or radio field. Steps to produce an error: 1. Install web_studio 2. Go to Settings > Users & Companies > Users > Select any user 3. Open studio mode by clicking the studio icon. 4. Try to select the Administration field from the access right page Error: ``` TypeError: WebStudioController.get_default_value() missing 1 required positional argument: 'field_name' File "odoo/http.py", line 2139, in __call__
Original PR description
Currently, an error occurs when the user tries to select a selection, boolean, or radio field. Steps to produce an error: 1. Install web_studio 2. Go to Settings > Users & Companies > Users > Select…
Currently, an error occurs when the user tries to select a selection, boolean, or radio field.
Steps to produce an error:
1. Install web_studio
2. Go to Settings > Users & Companies > Users > Select any user
3. Open studio mode by clicking the studio icon.
4. Try to select the Administration field from the access right page
Error:
```
TypeError: WebStudioController.get_default_value() missing 1 required positional argument: 'field_name'
File "odoo/http.py", line 2139, in __call__
response = request._serve_db()
File "odoo/http.py", line 1715, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "odoo/service/model.py", line 133, in retrying
result = func()
File "odoo/http.py", line 1742, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1943, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "addons/website/models/ir_http.py", line 235, in _dispatch
response = super()._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 191, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 717, in route_wrapper
result = endpoint(self, *args, **params_ok)
```
This is because before the owl refactor of webstudio with https://github.com/odoo/enterprise/pull/37285/commits/e44403193cbfd7893708ff739fd072f8bb1197c6, the code tries
to access the field name from the 'attrs' of the node (see [1]), but after Commit[1],
it tries to access the field name from the 'field' of the node (see [1]), and it works for
normal fields like text, number, etc., but not for grouped fields like selection, boolean, radio, etc.
This commit fixes the above issue by not fetching or changing the
default value of reified fields. Now, after this commit, the default
value box is not showing for the reified fields.
[1]-https://github.com/odoo/enterprise/blob/1fd7b1182146f1d7e6a7cbb9b725cb4d47281e14/web_studio/static/src/legacy/js/views/view_editor_manager.js#L1029 [2]-https://github.com/odoo/enterprise/blob/50b6e04d2e2f47797ec14bf506a030bd1d9bc797/web_studio/static/src/client_action/view_editor/interactive_editor/properties/field_properties/field_properties.js#L117
sentry-4156923959
Forward-Port-Of: odoo/enterprise#63764
Forward-Port-Of: odoo/enterprise#50249To reproduce the Issue: - Preview any file. - Switch the file preview by clicking the NEXT button twice or thrice. - Now change the owner of the file. - The preview, switches back to the file you chose to preview at first. Reason: - Just as we change the owner of the file, the Component is rendered again, triggering the `onWillUpdateProps`. - At this moment, the value inside the `nextProps.startIndex` is the value, which was set the first time we clicked a file to preview it. It is not
Original PR description
To reproduce the Issue: - Preview any file. - Switch the file preview by clicking the NEXT button twice or thrice. - Now change the owner of the file. - The preview, switches back to the file you…
To reproduce the Issue: - Preview any file. - Switch the file preview by clicking the NEXT button twice or thrice. - Now change the owner of the file. - The preview, switches back to the file you chose to preview at first. Reason: - Just as we change the owner of the file, the Component is rendered again, triggering the `onWillUpdateProps`. - At this moment, the value inside the `nextProps.startIndex` is the value, which was set the first time we clicked a file to preview it. It is not equal to the index of the file currently previewed (`this.state.index`). - Hence, the LOC `this.activateFile(nextProps.startIndex)` executes and switches the preview back to the file present at the `startIndex`. ref. to, where the values of the `previewStore` (including the `startIndex`) are set: https://github.com/odoo/enterprise/blob/saas-16.4/documents/static/src/views/hooks.js#L330-L334 After this commit: - As we select multiple documents, and try to switch the preview from the `DocumentsInspector`, we now compare the current index with the index of the file we wish to preview. The record (`DocumentsKanbanRecord`) of the file (to switch the preview to) is already set as the `selectedDocument` before this Component is rendered. refer - https://github.com/odoo/enterprise/blob/saas-16.4/documents/static/src/views/hooks.js#L296-L298 - While updating the values inside the `DocumentsInspector` we no longer the face the issue of the preview switching to another document Task-3599129 Forward-Port-Of: odoo/enterprise#55957
Handle barcode lookup api key and get from the tools to secure and avoid server action or any other unnecessary calls for getting API key. Forward-Port-Of: odoo/enterprise#62245
Original PR description
Handle barcode lookup api key and get from the tools to secure and avoid server action or any other unnecessary calls for getting API key. Forward-Port-Of: odoo/enterprise#62245
...d on foreign_currency_code received from odoofin Send `include_foreign_currency` to odoofin to avoid throwing errors when odoofin returns `foreign_currency_code` and `amount_currency` for customers that don't have the fix. Convert `foreign_currency_code` to corresponding `foreign_currency_id` in order to be displayed correctly alongside the amount in `account.bank.statement.line` To avoid a validation error(Currency is not activated) pop up for every foreign currency resides in trans
Original PR description
...d on foreign_currency_code received from odoofin Send `include_foreign_currency` to odoofin to avoid throwing errors when odoofin returns `foreign_currency_code` and `amount_currency` for customers that don't have the fix. Convert `foreign_currency_code` to corresponding `foreign_currency_id` in order to be displayed correctly alongside the amount in `account.bank.statement.line` To avoid a validation error(Currency is not activated) pop up for every foreign currency resides in transactions received from Odoofin while fetching transactions, Automatically activating foreign currencies. Remove foreign_currency_id and amount_currency from retrieved transactions in `Fetch Missing Transactions` flow in order to not break the flow in stable.(These fields will be added to `account.bank.statement.line.transient` in master) Odoofin PR: https://github.com/odoo/odoofin/pull/265 task id: 2870614 Forward-Port-Of: odoo/enterprise#63893 Forward-Port-Of: odoo/enterprise#60337