Saturday, February 3, 2024
63 changes · master
Enhancements to existing features
Several small internal test suites for web utility functions were moved to a newer testing approach. This helps keep Odoo's web code easier to maintain and supports more reliable future development without changing user-facing behavior.
Original PR description
This PR converts a few small test suites: - core/utils/assets - core/utils/binary - core/utils/components - core/utils/render task-id: 3705027
Resolved issues and error corrections
Users adding materials to a field service task can now open the product availability report without encountering an error. This ensures teams can quickly check stock availability from the task workflow and continue planning work without interruption.
Original PR description
Before this commit, when the user is currently in the view to add some material on a task and wants to view availability of a product, a traceback is occured instead of displaying the report, the reason is because the context in the action is a string and not a dict and so we cannot do an update to update the context. This commit fixes the issue by doing first a literal_eval to get a dictionary for the action context and then update the context to add the warehouse to use. X-original-commit: c78a49b0984fb36c9909cb02ca71ae4760912a79
Code cleanup and technical improvements
This update improves the reliability and efficiency of automated tests for online sales, delivery, product, and sales workflows. It also corrects a company-specific delivery provider issue so unavailable carriers from other companies no longer affect checkout display decisions.
Original PR description
--- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
This commit fix unconsistent test. https://runbot.odoo.com/web/#id=54900&view_type=form&model=runbot.build.error&menu_id=405&cids=1 opw-3583174 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#151995 Forward-Port-Of: odoo/odoo#150101
Original PR description
This commit fix unconsistent test. https://runbot.odoo.com/web/#id=54900&view_type=form&model=runbot.build.error&menu_id=405&cids=1 opw-3583174 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#151995 Forward-Port-Of: odoo/odoo#150101
This update moves character field checks in the web module to a newer testing system and fixes an issue in the test mock behavior. It helps developers catch problems more reliably without changing day-to-day user workflows.
Original PR description
[[REF] web: hoot: char_field conversion](https://github.com/odoo/odoo/pull/152305/commits/f503ad9ab0a9b92826134ee6e1d80022703e90b8) ----------- This commit converts the legacy char_field tests to the new test framework. task-3705027 [[FIX] web: hoot: return boolean in set handler](https://github.com/odoo/odoo/pull/152305/commits/6131730088a1a41aff38fa4b76d3e67598e10024) ----- According to [1] set should: - Return true to indicate that assignment succeeded. - if the set() method returns false, and the assignment happened in strict-mode code, a TypeError will be thrown. Before this commit, the set handler did not return anything, which resulted in the TypeError being thrown. Now, the set handler does return a boolean. [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/set
This update simplifies internal naming in Odoo's mail and live chat code, making it easier for developers to maintain. It should not change day-to-day user behavior, but it reduces future complexity and risk around chat and messaging features.
Original PR description
[REF] mail, *: rename originThread to thread [REF] mail, im_livechat: use channel_type rather than type [REF] mail, *: rename followedThread to thread https://github.com/odoo/enterprise/pull/55645
This update simplifies internal naming in messaging-related features and aligns WhatsApp channel data with the standard channel field. It should not change user workflows, but it helps reduce maintenance complexity and supports more reliable future improvements.
Original PR description
[REF] mail, *: rename originThread to thread [REF] whatsapp: use channel_type rather than type https://github.com/odoo/odoo/pull/152320
Since [1] when installing a theme from the Website builder's Themes tab, if that theme used other snippets than the default ones in their configurator pages which were inherited, the import of the theme failed because the primary template was not generated before the import of the data files. This commit relies on each theme calling `_generate_primary_snippet_templates` before declaring templates that require them. In master, the early loading is removed altogether. See the changes in
Original PR description
Since [1] when installing a theme from the Website builder's Themes tab, if that theme used other snippets than the default ones in their configurator pages which were inherited, the import of the theme failed because the primary template was not generated before the import of the data files. This commit relies on each theme calling `_generate_primary_snippet_templates` before declaring templates that require them. In master, the early loading is removed altogether. See the changes in `theme_default` for the approach that was adopted through all themes. Steps to reproduce in master: - Start odoo-bin with `-i website`. - Edit home page. - Go to the "Theme" tab. - Click on "Switch Theme". - Pick "CORPORATE / Buzzy". => Fails because the `website.configurator_s_banner` template is not defined. [1]: https://github.com/odoo/odoo/commit/cfed4e391d11058b1b46417f0b630cdbc4070d7c task-3670496 Forward-Port-Of: odoo/odoo#150524 Forward-Port-Of: odoo/odoo#148443
To reproduce: - Create an employee record for the connected admin user - Switch the user's company to another one (or the employee's company) - Upgrade to 17.0 A user who has the correct rights can change his company anytime to see employees from other companies So it doesn't make sense to have access right error during an upgrade. In this line: https://github.com/odoo/odoo/blob/140e58c5a68db674fc1d240147e4d669b29f2cad/addons/hr_expense/models/hr_expense_sheet.py#L385 The call to parent
Original PR description
To reproduce: - Create an employee record for the connected admin user - Switch the user's company to another one (or the employee's company) - Upgrade to 17.0 A user who has the correct rights can…
To reproduce: - Create an employee record for the connected admin user - Switch the user's company to another one (or the employee's company) - Upgrade to 17.0 A user who has the correct rights can change his company anytime to see employees from other companies So it doesn't make sense to have access right error during an upgrade. In this line: https://github.com/odoo/odoo/blob/140e58c5a68db674fc1d240147e4d669b29f2cad/addons/hr_expense/models/hr_expense_sheet.py#L385 The call to parent_id.user_id fail upgrades to 17.0 if the parent and the user have different companies. Since Administrator-level users are not restricted, we put the check on that at the top to avoid errors during upgrades to 17.0. Note: in 17.1, it was made possible to have a manager from another company: https://github.com/odoo/odoo/pull/112768/commits/b841a24fc11cb83ca8e95fce7a83648d87cb90e3 Description of the issue/feature this PR addresses: Current behavior before PR: During upgrade, the Administrator doesn't have access rights to employees if he's not in the same company. Desired behavior after PR is merged: Since the admin can change companies to access other employees, it should not be blocking during the upgrade. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#150660
When a button is updated, its `btn` classes are stripped by the editor. However, in so doing the regex replaces `btn_cta` by `_cta`. This commit fixes it. Related to opw-3644220 Forward-Port-Of: odoo/odoo#151436 Forward-Port-Of: odoo/odoo#149086
Original PR description
When a button is updated, its `btn` classes are stripped by the editor. However, in so doing the regex replaces `btn_cta` by `_cta`. This commit fixes it. Related to opw-3644220 Forward-Port-Of: odoo/odoo#151436 Forward-Port-Of: odoo/odoo#149086
Steps to reproduce: ------------------- On the Time Off dashboard, click on a public holiday. Issue: ------ The duration is 1 Day instead of zero day. Cause: ------ To ignore the current holiday, the domain for finding holidays adds the condition: ```py ('holiday_id', '!=', self.id) ``` Unfortunately, if we have a `NewId`, in postgresql, `NULL != NULL` condition always returns NULL. As a result, public holidays (which do not have a `holiday_id`) will not be taken into accoun
Original PR description
Steps to reproduce:
-------------------
On the Time Off dashboard, click on a public holiday.
Issue:
------
The duration is 1 Day instead of zero day.
Cause:
------
To ignore the current holiday, the domain for finding holidays adds the condition:
```py
('holiday_id', '!=', self.id)
```
Unfortunately, if we have a `NewId`, in postgresql, `NULL != NULL` condition always returns NULL.
As a result, public holidays (which do not have a `holiday_id`) will not be taken into account.
Note:
This does not happen when you save because the id exists.
Solution:
---------
Accept `holiday_id` equal to `False` in the domain.
opw-3635949
Forward-Port-Of: odoo/odoo#151534When a char field contains a value which represents a number (e.g. "00036"), the value is inserted as a number in the formula instead of a string. Because of this, the function value is not found. actual: =ODOO.PIVOT.HEADER(1,"x_studio_barcode",00003456799) expected: =ODOO.PIVOT.HEADER(1,"x_studio_barcode","00003456799") opw: 3623662 Task: 3631998 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#152031 Forwar
Original PR description
When a char field contains a value which represents a number (e.g. "00036"), the value is inserted as a number in the formula instead of a string. Because of this, the function value is not found. actual: =ODOO.PIVOT.HEADER(1,"x_studio_barcode",00003456799) expected: =ODOO.PIVOT.HEADER(1,"x_studio_barcode","00003456799") opw: 3623662 Task: 3631998 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#152031 Forward-Port-Of: odoo/odoo#151312
Current behavior: When you try to pay with razorpay, you got an error saying the phone number was missing. Steps to reproduce: - Setup RazorPay - Set a phone number on admin - Go to the POS - Add a product to the cart - Click on the payment button - Select razorpay - Scan the QRCode with your phone (make sure you'r connected on the admin account) - Try to finalize the payment opw-3669600 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Fo
Original PR description
Current behavior: When you try to pay with razorpay, you got an error saying the phone number was missing. Steps to reproduce: - Setup RazorPay - Set a phone number on admin - Go to the POS - Add a product to the cart - Click on the payment button - Select razorpay - Scan the QRCode with your phone (make sure you'r connected on the admin account) - Try to finalize the payment opw-3669600 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#152040
This traceback arises when the user tries to `create a draft invoice` Steps to produce 1. Install `sale_timesheet and l10n_in_sale` 2. Open `Sales/Orders/Quotations` 3. Create a `new record/save it/conform/create invoice` 4. Give the positive value to the down payment then click on `Create draft` Error: ``` TypeError: SaleAdvancePaymentInv._prepare_invoice_values() takes 3 positional arguments but 4 were given File "odoo/http.py", line 2206, in __call__ response = request.
Original PR description
This traceback arises when the user tries to `create a draft invoice` Steps to produce 1. Install `sale_timesheet and l10n_in_sale` 2. Open `Sales/Orders/Quotations` 3. Create a `new record/save…
This traceback arises when the user tries to `create a draft invoice`
Steps to produce
1. Install `sale_timesheet and l10n_in_sale`
2. Open `Sales/Orders/Quotations`
3. Create a `new record/save it/conform/create invoice`
4. Give the positive value to the down payment then click on `Create draft`
Error:
``` TypeError: SaleAdvancePaymentInv._prepare_invoice_values() takes 3 positional arguments but 4 were given
File "odoo/http.py", line 2206, in __call__
response = request._serve_db()
File "odoo/http.py", line 1777, in _serve_db
return self._transactioning(_serve_ir_http, readonly=ro)
File "odoo/http.py", line 1798, in _transactioning
return service_model.retrying(func, env=self.env)
File "odoo/service/model.py", line 134, in retrying
result = func()
File "odoo/http.py", line 1775, in _serve_ir_http
return self._serve_ir_http(rule, args)
File "odoo/http.py", line 1783, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2008, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 222, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 740, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 38, in call_button
action = self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 30, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 458, in call_kw
result = getattr(recs, name)(*args, **kwargs)
File "addons/sale/wizard/sale_make_invoice_advance.py", line 136, in create_invoices
invoices = self._create_invoices(self.sale_order_ids)
File "addons/sale_timesheet/wizard/sale_make_invoice_advance.py", line 51, in _create_invoices
return super()._create_invoices(sale_orders)
File "addons/sale/wizard/sale_make_invoice_advance.py", line 171, in _create_invoices
self._prepare_invoice_values(order, down_payment_lines, accounts)
```
When the user tries to Create a `draft invoice` traceback will arise because the method `SaleAdvancePaymentInv._prepare_invoice_values()` is being called with four arguments instead of the expected three.
Which leads to a traceback here
https://github.com/odoo/odoo/blob/f302a5a52845c739bff3bbc3c65f8117eadc0789/addons/l10n_in_sale/wizard/sale_make_invoice_advance.py#L10-L16
After applying this commit we will resolve the issue by adding the argument `Sale AdvancePaymentInv._prepare_invoice_values()` the issue will be resolved
sentry-4928083299
Forward-Port-Of: odoo/odoo#152183Description 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#144266 Forward-Port-Of: odoo/odoo#142709
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 Forward-Port-Of: odoo/odoo#144266 Forward-Port-Of: odoo/odoo#142709
Purpose ======= From 800ms to 6ms to execute _compute_new_application_count on odoo.com 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#151303
Original PR description
Purpose ======= From 800ms to 6ms to execute _compute_new_application_count on odoo.com 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#151303
Commit that introduced the issue: fbc167bf84340b4bb6d0f8c59f2734814f56c6df Issue: ====== Adding a table in a long chatter message with scroll raise a traceback Steps to reproduce the issue: ============================= - Switch to RTL lang - Go to any form view and open the editor composer to create a log note - Write a lot of lines so that the scrollbar appears - Add a table - Log the note - Try to scroll -> traceback Origin of the issue: ==================== The `_onScroll
Original PR description
Commit that introduced the issue: fbc167bf84340b4bb6d0f8c59f2734814f56c6df Issue: ====== Adding a table in a long chatter message with scroll raise a traceback Steps to reproduce the issue: ============================= - Switch to RTL lang - Go to any form view and open the editor composer to create a log note - Write a lot of lines so that the scrollbar appears - Add a table - Log the note - Try to scroll -> traceback Origin of the issue: ==================== The `_onScroll` method is called and it has `this._rowUiTarget` as the row from the composer dialog which is not in the ui anymore so `closestElement(row, 'table')` will return `null`. Solution: ========= We just do nothing when the element is not connected. task-3707808 Forward-Port-Of: odoo/odoo#151800
Before this commit: The website selected in the website selector of the search view in the website.page list/kanban view was always set to the first one found in the DB and was never: 1. the one you visited in the website preview 2. or the one matching the URL of your backend. But 1. was working fine before commit [1] from the frameworkjs which introduced a way to "reset" the screen between apps/menu switch. Despite 1. working before commit [1], it was not ideally coded and worked "by c
Original PR description
Before this commit: The website selected in the website selector of the search view in the website.page list/kanban view was always set to the first one found in the DB and was never: 1. the one you…
Before this commit: The website selected in the website selector of the search view in the website.page list/kanban view was always set to the first one found in the DB and was never: 1. the one you visited in the website preview 2. or the one matching the URL of your backend. But 1. was working fine before commit [1] from the frameworkjs which introduced a way to "reset" the screen between apps/menu switch. Despite 1. working before commit [1], it was not ideally coded and worked "by chance", see below for a few facts and explication. ------------------ Fact 1: When you have multiple websites and you are on a website, the website served is result of 2 possibilities: 1. All websites have a specific domain, then you can only see a given website on its own domain. Attempting to select another website in the website switcher will redirect you to that other website domain. 2. You have one or more websites without any domain, then you can see those ones from any domain by using the website switcher. It will force the website in session, and despite being on a domain which should serve a given website (the one which has its domain set that domain if there is one), it will serve you the one you selected in the website switcher. Fact 2: - It is the `website_preview` which is setting the currentWebsite property of the `website_service`. - But the `website_service` can be used on its own, without any `website_preview` being involved in the process. - When the website preview is unmounted, the currentWebsite from the website service is reset to null. - The website page list component is reading the currentWebsite from the website service. - When switching from the website preview to another menu like the website pages list, the page list component (PageControllerMixin) is actually initialized/created before the website preview is unmounted. In the end, the follow happen: 1. Go to website preview -> it sets the website service current website 2. Go to website page list 3. The website page list component reads the current website from the website service which is set 4. The website preview is unmounted, emptying the current website from the website service 5. The website page list is shown to the user 6. Any call from the page list component to the current website will now be "wrong" / not return the same as during its `onWillStart`, as website preview was unmounted just after that, emptying the website set in the website service. Fact 3: Commit [1] changed the order listed above, now 4 occurs before 3, so when the page list component reads the website from the website service, the unmount of the website preview already kicked in, emptying that website service website. ----------------- This commit is simply finding the current website_id by asking it to the server. It will fix point 1. listed at the very beginning of the commit message, but will also make point 2. work. ---------------- Steps to reproduce 1: - Without any domain set, go to your DB in the website preview of your website in the backend - Switch to the website 2 in the navbar website switcher - You are now viewing website 2 in the website preview - Click on "Pages" in the "Site" menu to go to the page list view - The website selected in the search view is the first one, not the website 2. Also, the page shown are from the website 1, not the website 2. - This was working before commit [1] and this commit is fixing that. But this commit is also fixing/improving flows which never worked: - Before commit [1] (or in Odoo 16 to be simpler), do the same 4 first steps as above. - You will see that the listed pages are the ones from website 2 and that the selected website is the second one, correct. - Now just reload the page, it will show website 1, despite the website 2 being forced (if you did reload the page on the preview, it would still show website 2). - This is because the website_preview was never involved after the reload since you reached the list view / website service without going through the website preview. - The same can be seen if you go to the Pages list view directly through CTRL+K, in which case you won't go through the preview. [1]: https://github.com/odoo/odoo/commit/9f6ed9f6d1ef7ec1870980498480cae0ffc729d8 Related to task-3676124 opw-3658648 Forward-Port-Of: odoo/odoo#151709 Forward-Port-Of: odoo/odoo#149070
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#151944 Forward-Port-Of: odoo/odoo#149230
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 Forward-Port-Of: odoo/odoo#151944 Forward-Port-Of: odoo/odoo#149230
1. [TECHNICAL] Move send & print files into wizard folder when it's not the case 2. [TECHNICAL] More testing: test cron + cron in multicompany setup 3. Make 'invoices.zip' translatable 4. Use the bus to notify when cron is done (and maybe when it's started ? ) task-id: 3568549 Forward-Port-Of: odoo/odoo#152092 Forward-Port-Of: odoo/odoo#149717
Original PR description
1. [TECHNICAL] Move send & print files into wizard folder when it's not the case 2. [TECHNICAL] More testing: test cron + cron in multicompany setup 3. Make 'invoices.zip' translatable 4. Use the bus to notify when cron is done (and maybe when it's started ? ) task-id: 3568549 Forward-Port-Of: odoo/odoo#152092 Forward-Port-Of: odoo/odoo#149717
In Language settings, change decimal separator to ',' Go to Journal Items In the search bar input '4,50' and search for 'Amount' Error: ValueError: could not convert string to float: '4,50' This occurs becuase when the search model assemble the domain for the orm we use the original string '4,50' and not the parsed value '4.5' opw-3700578 Forward-Port-Of: odoo/odoo#152075
Original PR description
In Language settings, change decimal separator to ',' Go to Journal Items In the search bar input '4,50' and search for 'Amount' Error: ValueError: could not convert string to float: '4,50' This occurs becuase when the search model assemble the domain for the orm we use the original string '4,50' and not the parsed value '4.5' opw-3700578 Forward-Port-Of: odoo/odoo#152075
Since https://github.com/odoo/odoo/issues/1432 To reproduce the problem, you need to ensure that a read_group returns several groups, with the first element being a group with no value if you choose to group on a many2many (see test). Here's an example to reproduce in website_sale: - Install `website_sale` without demo-data - Go to `eCommerce/Products` - Create a new product - Go to `Sales` tab in the product form view - Set a new `eCommerce shop/Categories` like `Sales` - Save
Original PR description
Since https://github.com/odoo/odoo/issues/1432 To reproduce the problem, you need to ensure that a read_group returns several groups, with the first element being a group with no value if you choose…
Since https://github.com/odoo/odoo/issues/1432 To reproduce the problem, you need to ensure that a read_group returns several groups, with the first element being a group with no value if you choose to group on a many2many (see test). Here's an example to reproduce in website_sale: - Install `website_sale` without demo-data - Go to `eCommerce/Products` - Create a new product - Go to `Sales` tab in the product form view - Set a new `eCommerce shop/Categories` like `Sales` - Save - Return to `eCommerce/Products` - Remove default filters - Group by `Website Product Categories` - There are two group: `None` and Sales` - Click on None - Traceback In this case, the orderby is website_sequence:sum ASC, and will therefore return as first group None containing `Delivery Product` and as second group `Sales` containing the newly created product. What happens is that `read_group` will build `rows_dict` thanks to `_read_group`. https://github.com/odoo/odoo/blob/cb67b4e1472ae6689e943ade1e27cb43e8d87025/odoo/models.py#L2724 this `rows_dict` will be ordered according to `orderby`and then passed as an argument to the `_read_group_format_result` function https://github.com/odoo/odoo/blob/cb67b4e1472ae6689e943ade1e27cb43e8d87025/odoo/models.py#L2759 For each row, this function will convert `row[group]` (group in this case is the many2many field) into a tuple containing (id, displayname) in case the value (`row[group]`) is found which will be used to build the domain `[(field_name, =, value)]`. So, for example, replacing ```py rows_dict = [ groupbyField': odoo.model(1), groupbyField': odoo.model(4), ] ``` with ```py rows_dict = [ groupbyField': (1, 'First record'), groupbyField': (4, 'Fourth record'), ] ``` https://github.com/odoo/odoo/blob/cb67b4e1472ae6689e943ade1e27cb43e8d87025/odoo/models.py#L2460-L2462 If the value is False, we'll use the 'not in' operator instead. To do this, we need to retrieve the ids of all the other groups to include in this one all the records that aren't in any group, either by retrieving the id if it's a model, or by retrieving the first element of the tuple if it's already been modified, or by directly retrieving the value of the field if it's not a many2x. Except that if the first element is directly a group without a value, it won't be able to retrieve the values of the other groups, because the condition for checking that it's a `BaseModel` instance contained a typo https://github.com/odoo/odoo/blob/cb67b4e1472ae6689e943ade1e27cb43e8d87025/odoo/models.py#L2465-L2467 Forward-Port-Of: odoo/odoo#151497
**Current behavior before PR:** - In the project module, when a user opens the color picker, it opens as a dropdown even if there is not enough space available, resulting in some parts of the color picker being inaccessible. - In the project, when a user opens the color picker a second time, it always opens as a dropup, even if there is space available for it to open as a dropdown. **Desired behavior after PR is merged:** - Now, when a user opens the color picker, it opens as a dropup
Original PR description
**Current behavior before PR:** - In the project module, when a user opens the color picker, it opens as a dropdown even if there is not enough space available, resulting in some parts of the color picker being inaccessible. - In the project, when a user opens the color picker a second time, it always opens as a dropup, even if there is space available for it to open as a dropdown. **Desired behavior after PR is merged:** - Now, when a user opens the color picker, it opens as a dropup when there is not enough space available for the color picker to open as a dropdown. - The color picker will open as a dropdown when there is enough space available. task-3608803 Forward-Port-Of: odoo/odoo#151681 Forward-Port-Of: odoo/odoo#144698
Thanks to changes in 82314364c6029a83 the auto-lock settings also works for public users. But, going from `self.env.user` to `self.create_uid` to check the group leads to a traceback when `self.create_uid` is not a singleton. This is because `has_group` expects a single record. To fix that, this commits checks the group of the create_uid of the first record in self. Because `sale.group_auto_done_setting` is an implied_group of a res.config.settings parameter, it's enough to only check for the
Original PR description
Thanks to changes in 82314364c6029a83 the auto-lock settings also works for public users. But, going from `self.env.user` to `self.create_uid` to check the group leads to a traceback when `self.create_uid` is not a singleton. This is because `has_group` expects a single record. To fix that, this commits checks the group of the create_uid of the first record in self. Because `sale.group_auto_done_setting` is an implied_group of a res.config.settings parameter, it's enough to only check for the first record in the recordset. To reproduce: - Install sale - Create a quotation as Mitchell Admin - Create a quotation as Marc Demo - Create a cron that searches on all draft sale.orders and confirm them in batch - Run the cron -> Singleton Error --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#151903 Forward-Port-Of: odoo/odoo#151789
The reCaptcha score was set by default on 0.5. According to [Google's documentation], that score isn't valid by default. It should be one of 0.1, 0.3, 0.7, 0.9. To use other values you must first go through a security review from reCaptcha. [Google's documentation]: https://cloud.google.com/recaptcha-enterprise/docs/interpret-assessment-website#before_you_begin task-3585213 Forward-Port-Of: odoo/odoo#152193 Forward-Port-Of: odoo/odoo#150208
Original PR description
The reCaptcha score was set by default on 0.5. According to [Google's documentation], that score isn't valid by default. It should be one of 0.1, 0.3, 0.7, 0.9. To use other values you must first go through a security review from reCaptcha. [Google's documentation]: https://cloud.google.com/recaptcha-enterprise/docs/interpret-assessment-website#before_you_begin task-3585213 Forward-Port-Of: odoo/odoo#152193 Forward-Port-Of: odoo/odoo#150208
No idea where it comes from, let's just get it fixed for now. runbot-55466 Forward-Port-Of: odoo/odoo#152310
Original PR description
No idea where it comes from, let's just get it fixed for now. runbot-55466 Forward-Port-Of: odoo/odoo#152310
Current behavior before PR: When in a checklist where first and second checklist are marked done after selecting first and second checklist and deleting it the third checklist would be marked as done. Desired behavior after PR is merged: Now deleting previous done checklist would not affect the current checklist. task-3203889 Forward-Port-Of: odoo/odoo#151778 Forward-Port-Of: odoo/odoo#134619
Original PR description
Current behavior before PR: When in a checklist where first and second checklist are marked done after selecting first and second checklist and deleting it the third checklist would be marked as done. Desired behavior after PR is merged: Now deleting previous done checklist would not affect the current checklist. task-3203889 Forward-Port-Of: odoo/odoo#151778 Forward-Port-Of: odoo/odoo#134619
When a customer sends a message to Odoo via WhatsApp, their number is saved in the `phone.blacklist` model, but the active state is set to False. If the customer sends 'STOP', it will be set to True, and if the customer sends a new message, it will again be set to False. Before sending a message from Odoo to a customer via WhatsApp, we check if the number is in the `phone.blacklist` with this line in whatsapp_message.py if self.env['phone.blacklist'].sudo().search([('number', 'ilike', numb
Original PR description
When a customer sends a message to Odoo via WhatsApp, their number is saved in the `phone.blacklist` model, but the active state is set to False. If the customer sends 'STOP', it will be set to True,…
When a customer sends a message to Odoo via WhatsApp, their number is saved in the `phone.blacklist` model, but the active state is set to False. If the customer sends 'STOP', it will be set to True, and if the customer sends a new message, it will again be set to False.
Before sending a message from Odoo to a customer via WhatsApp, we check if the number is in the `phone.blacklist` with this line in whatsapp_message.py
if self.env['phone.blacklist'].sudo().search([('number', 'ilike', number)]):
In SaaS 16.4, this line returns the following SQL request:
SELECT "phone_blacklist"."id" FROM "phone_blacklist" WHERE (("phone_blacklist"."active" = true) AND ("phone_blacklist"."number"::text ILIKE '%32491730941%')) ORDER BY "phone_blacklist"."id";
Here, we check if the Active state is True to block the message if necessary.
In 17, this same line returns this SQL request:
SELECT "phone_blacklist"."id" FROM "phone_blacklist" WHERE ("phone_blacklist"."number"::text ILIKE '%32491730941%') ORDER BY "phone_blacklist"."id";
I correct it in a PR https://github.com/odoo/enterprise/pull/55498
But if we go further we find that it's really because of the active_test = False of this line in thread.py thread = request.env[thread_model].with_context(active_test=False).search([("id", "=", thread_id)]) from this commit
https://github.com/odoo-dev/odoo/commit/8b2605b99348b7707b3db3db46af880c17c7029c
with the fix of this PR, the discussion on Whatsapp is now possible and we keep the fix of the previous commit.
opw-3704136
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#152273In form views, when the user closes the tab while having unsaved changes, and if those changes are valid, we want to save them automatically before leaving. Before this commit, there could be situations where the changes weren't actually saved. For instance, if they involved an heavy payload for the write rpc, or if the network connection was poor, it might happen that the xhr is killed. Or at least, browsers do not offer any guarantee to wait for those xhr to reach the server. Instead of
Original PR description
In form views, when the user closes the tab while having unsaved changes, and if those changes are valid, we want to save them automatically before leaving. Before this commit, there could be…
In form views, when the user closes the tab while having unsaved changes, and if those changes are valid, we want to save them automatically before leaving. Before this commit, there could be situations where the changes weren't actually saved. For instance, if they involved an heavy payload for the write rpc, or if the network connection was poor, it might happen that the xhr is killed. Or at least, browsers do not offer any guarantee to wait for those xhr to reach the server. Instead of a classical xhr, we thus use navigator.sendBeacon which ensures that the data will be sent reliably [1]. There's a drawback though, as its payload is limited. When the payload is too heavy, sendBeacon simply returns false and does nothing. In this case, we prevent the page from unloading and display a notification suggesting the user to manually save his changes before leaving. [1] https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon Task 3537838 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#151834 Forward-Port-Of: odoo/odoo#149944
Force post does not work in the validate account move wizard. Steps: - Create a move in the future and set it to be auto post - On the list view, select the move and select action "post entries" - On the wizard, check "force" and validate -> UserError "This move is configured to be auto-posted ..." Forward-Port-Of: odoo/odoo#152400 Forward-Port-Of: odoo/odoo#152003
Original PR description
Force post does not work in the validate account move wizard. Steps: - Create a move in the future and set it to be auto post - On the list view, select the move and select action "post entries" - On the wizard, check "force" and validate -> UserError "This move is configured to be auto-posted ..." Forward-Port-Of: odoo/odoo#152400 Forward-Port-Of: odoo/odoo#152003
In order to better analyze profitability, we added an extra measure to the Invoice Analysis report to show the "Margin" on every invoice line based on the product cost price. In order to have a simplified inventory valuation without fully using the Inventory app, we also added an "Inventory Value" measure that also uses the product cost price to show the change in inventory value based on incoming and outgoing accounting documents. An extra filter "Inventory Valuation" was added as well to
Original PR description
In order to better analyze profitability, we added an extra measure to the Invoice Analysis report to show the "Margin" on every invoice line based on the product cost price. In order to have a simplified inventory valuation without fully using the Inventory app, we also added an "Inventory Value" measure that also uses the product cost price to show the change in inventory value based on incoming and outgoing accounting documents. An extra filter "Inventory Valuation" was added as well to show the "Inventory Value" values per storable product and per month. [task-3708415](https://www.odoo.com/web#id=3708415&cids=1&menu_id=4720&action=333&active_id=967&model=project.task&view_type=form) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#151805
Steps to reproduce: 1) Try to make a payment with the amount less than 0.50$ (minimum amount required in Stripe) 2) Stripe inline form fails to load 3) One can still click pay and see the traceback After this commit the error are handled and displayed on the form loading and on the form submit. opw-3634316 Forward-Port-Of: odoo/odoo#152307
Original PR description
Steps to reproduce: 1) Try to make a payment with the amount less than 0.50$ (minimum amount required in Stripe) 2) Stripe inline form fails to load 3) One can still click pay and see the traceback After this commit the error are handled and displayed on the form loading and on the form submit. opw-3634316 Forward-Port-Of: odoo/odoo#152307
Summing discount percentages doesn't mean anything. This commit makes sure the operator used to compute discount on group of records is 'average'. It won't always be meaningful, but in some cases, e.g. when the solines only hold one product, and the lines are grouped by product. opw-3649377 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#152386 Forward-Port-Of: odoo/odoo#152265
Original PR description
Summing discount percentages doesn't mean anything. This commit makes sure the operator used to compute discount on group of records is 'average'. It won't always be meaningful, but in some cases, e.g. when the solines only hold one product, and the lines are grouped by product. opw-3649377 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#152386 Forward-Port-Of: odoo/odoo#152265
Commit [1] introduced a way to "hide" an ir.ui.view through a new visibility field. That field has multiple possible values to restrict the access. One of those is "Restricted Groups", but when selected it's really hard to figure what to do next because nothing happens on screen: there is no "groups" field where to add the groups. Those groups should actually be added a bit below, in the groups_id field which is "hidden" inside the "Access Rights" second tab. This is because the groups_id fi
Original PR description
Commit [1] introduced a way to "hide" an ir.ui.view through a new visibility field. That field has multiple possible values to restrict the access. One of those is "Restricted Groups", but when…
Commit [1] introduced a way to "hide" an ir.ui.view through a new visibility field. That field has multiple possible values to restrict the access. One of those is "Restricted Groups", but when selected it's really hard to figure what to do next because nothing happens on screen: there is no "groups" field where to add the groups. Those groups should actually be added a bit below, in the groups_id field which is "hidden" inside the "Access Rights" second tab. This is because the groups_id field already existed (in base module) before introducing the website visibility feature which just relied on that field when set to "Restricted Groups". Note that another possible value for visibility is "Password", and in this case a password field appear below the visibility field as one would expect. [1]: https://github.com/odoo/odoo/commit/e239934abe456257c9dc285d1ad9829c0353900c  Forward-Port-Of: odoo/odoo#152392 Forward-Port-Of: odoo/odoo#151602
Before the current PR, the version of Odoo along with the git branch of the IoT Box and the associated image were never logged. Adding this information to logs allow to to debug / inspect issues more easily task-3716879 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#152361 Forward-Port-Of:
Original PR description
Before the current PR, the version of Odoo along with the git branch of the IoT Box and the associated image were never logged. Adding this information to logs allow to to debug / inspect issues more easily task-3716879 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#152361 Forward-Port-Of: odoo/odoo#152291
Before: When a user receive a mass_mailing and click on the unsubscribe button, he arrives on the unsubscribe webpage where the first sentence stay in english whatever the website language Step to reproduce: - Create a db with the email marketing and web module - Create a mailing list with at least one recipient - Send the mailing (catch the email with an email catcher, ex: mailhog) - Click on the unsubscribe button Now: The first sentence is in the website (or portal) language opw-
Original PR description
Before: When a user receive a mass_mailing and click on the unsubscribe button, he arrives on the unsubscribe webpage where the first sentence stay in english whatever the website language Step to reproduce: - Create a db with the email marketing and web module - Create a mailing list with at least one recipient - Send the mailing (catch the email with an email catcher, ex: mailhog) - Click on the unsubscribe button Now: The first sentence is in the website (or portal) language opw-3538873 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#142714
To reproduce ============= - Go to shop page - Edit the page - select a product - add a ribbon - modify the ribbon (background or text color) the ribbon is not updated Problem ======= the default ribbon are using the bootstrap class "text-bg-*" to set the background color and the text color. But the editor expects the ribbon to have a class "bg-*" and color css style. That's why when editing, the class "text-bg-*" is never removed so each time it's taken instead of the added style.
Original PR description
To reproduce ============= - Go to shop page - Edit the page - select a product - add a ribbon - modify the ribbon (background or text color) the ribbon is not updated Problem ======= the default ribbon are using the bootstrap class "text-bg-*" to set the background color and the text color. But the editor expects the ribbon to have a class "bg-*" and color css style. That's why when editing, the class "text-bg-*" is never removed so each time it's taken instead of the added style. Solution ======== remove the class "text-bg-*" from default ribbons and use the fields "bg_color" and "text_color" to set the background and text color opw-3674520 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#150185
Slot params are dynamic content, similar to props, and are not translated. There is no point in adding untranslated content to the .pot files; so this commit prevents the content of slot params from being exported for translation. Task-3718993 Forward-Port-Of: odoo/odoo#152499
Original PR description
Slot params are dynamic content, similar to props, and are not translated. There is no point in adding untranslated content to the .pot files; so this commit prevents the content of slot params from being exported for translation. Task-3718993 Forward-Port-Of: odoo/odoo#152499
…ts of goods 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#152125
Original PR description
…ts of goods 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#152125
**Steps to reproduce the bug:** Run the following command: `-i purchase_stock,l10n_fr -d cro_test --test-enable --test-tags purchase_stock --stop-after-init` **Problem:** An error is triggered: “odoo.exceptions.UserError: Cannot find a stock input account for the product Analytic Product. You must define one on the product category, or on the location, before processing this operation.” When installing the "l10n_fr" module, the French accounting for the default company will be set
Original PR description
**Steps to reproduce the bug:** Run the following command: `-i purchase_stock,l10n_fr -d cro_test --test-enable --test-tags purchase_stock --stop-after-init` **Problem:** An error is triggered:…
**Steps to reproduce the bug:** Run the following command: `-i purchase_stock,l10n_fr -d cro_test --test-enable --test-tags purchase_stock --stop-after-init` **Problem:** An error is triggered: “odoo.exceptions.UserError: Cannot find a stock input account for the product Analytic Product. You must define one on the product category, or on the location, before processing this operation.” When installing the "l10n_fr" module, the French accounting for the default company will be set. so the "property_stock_account_input_categ_id" will not be set when creating a product category with "property_valuation" set as real_time because the user's company has no chart of accounts: https://github.com/odoo/odoo/blob/c3b4c7d8f2c260c31f9549d480ed2db4159a8119/addons/stock_account/models/product.py#L833-L835 Therefore, when validating the picking related to the purchase order created: https://github.com/odoo/odoo/blob/31d1a2a8a0f1490dd49d86628c0f856ca82198c8/addons/purchase_stock/tests/test_purchase_order_process.py#L124 The product accounts are then retrieved, but will be False: https://github.com/odoo/odoo/blob/9215e73fa229d64167de076ef0a288dd8d89a2cc/addons/stock_account/models/stock_move.py#L336 https://github.com/odoo/odoo/blob/493502bc4ad3ac35b1c0cb2eeb73ac6b6d0fe5b5/addons/stock_account/models/product.py#L29 **Solution:** skip the test if the user's company has no chart of accounts. opw-3698341 Forward-Port-Of: odoo/odoo#152128 Forward-Port-Of: odoo/odoo#151712
To reproduce ============ - Go to Appraisal select an employee and send by email - the url in the email is wrong Problem ======= - the body of the request is rendered twice with qweb, but the template wasn't designed for that, as we have `t-att-href="ctx.get('url')"` that will be `href="ctx['url']"` after first render and expecting to be rendered again and replace `ctx['url']` with the real url but qweb has no way to know that without a `t-att-` prefix. Solution ======== - before se
Original PR description
To reproduce
============
- Go to Appraisal select an employee and send by email
- the url in the email is wrong
Problem
=======
- the body of the request is rendered twice with qweb, but the template wasn't designed for that, as we have `t-att-href="ctx.get('url')"` that will be `href="ctx['url']"` after first render and expecting to be rendered again and replace `ctx['url']` with the real url but qweb has no way to know that without a `t-att-` prefix.
Solution
========
- before second render, add `t-att-` prefix to `href` so qweb will know that it should be rendered again and replace `ctx['url']` with the real url.
opw-3687928
Forward-Port-Of: odoo/enterprise#55780
Forward-Port-Of: odoo/enterprise#55464Like props, slot params are not translated. This commit moves the content to be translated to a text node, allowing it to be translated. opw-3702748 part of task-3718993 Forward-Port-Of: odoo/enterprise#55802 Forward-Port-Of: odoo/enterprise#55772
Original PR description
Like props, slot params are not translated. This commit moves the content to be translated to a text node, allowing it to be translated. opw-3702748 part of task-3718993 Forward-Port-Of: odoo/enterprise#55802 Forward-Port-Of: odoo/enterprise#55772
In databases with multiple companies, currencies and lots of `account_move_lines`, generating consolidations journals can take a lot of time. There are two bottlenecks for that. The first one comes from `_apply_historical_rates`. The second one is the creation of the `consolidation_journal_lines` records. Nothing can be done about the latter as there are just a lot of records to create. This commit focuses on the former. To speed up `_apply_historical_rates`, a rate_cache is passed through th
Original PR description
In databases with multiple companies, currencies and lots of `account_move_lines`, generating consolidations journals can take a lot of time. There are two bottlenecks for that. The first one comes…
In databases with multiple companies, currencies and lots of `account_move_lines`, generating consolidations journals can take a lot of time. There are two bottlenecks for that. The first one comes from `_apply_historical_rates`. The second one is the creation of the `consolidation_journal_lines` records. Nothing can be done about the latter as there are just a lot of records to create. This commit focuses on the former. To speed up `_apply_historical_rates`, a rate_cache is passed through the context to the `get_rate_for` method of consolidation rates. This method is called a lot of times (once by move_line) with mostly the same values (company_id and chart_id are fixed, only the date changes). Adding a small cache vastly reduces the number of queries on `consolidation.rate`. Also, instead of calling `res_currency_rate._convert` to convert an amount from a given currency to another one, a currency_rate cache is introduced. This cache contains a mapping between `(from_currency, to_currency, company_id, date)` and the conversion rate. That way, `res_currency_rate._get_conversion_rate` is only called for new key-value, which greatly speeds up the generation of consolidations journals. #### speedup Customer database with 2.5M account.move.lines, 2M account.moves, 202 consolidation_periods, 243 consolidation accounts, 0 consolidation_rate, 17 companies, 8512 accounts. Timing to generate consolidation journals. | #account_move_lines, #res_currencies | Before PR | After PR | |:----------------------------------------------------:|:--------------:|:-----------:| | 1036 amls, 2 currencies | 7s | 1.89s | | 4329 amls, 7 currencies | 2.2min | 19.3s | | 15301 amls, 7 currencies | 1.4min | 1.4min| | 43749 amls, 6 currencies | 22.1min | 2min| | 134055 amls, 7 currencies |21.6min | 3.3min| The third entry only contains non-historical consolidation accounts so no visible speedup is expected. Forward-Port-Of: odoo/enterprise#55692 Forward-Port-Of: odoo/enterprise#54030
**Steps to reproduce the bug:** - Configure the ups connector: - UPS Package Type: UPS Pallet - UPS Service Type: UPS Worldwide Express Freight - Package Weight Unit: Kilograms - Package Size Unit: Centimeters - Create a French contact - Create a storable product “P1”: - Weight: 500 kg - Create a SO - Add the product P1 - Add shipping: - Select UPS - Get Rate **Problem:** A user Error is triggered: “Missing or Invalid Total Number of Pieces in
Original PR description
**Steps to reproduce the bug:**
- Configure the ups connector:
- UPS Package Type: UPS Pallet
- UPS Service Type: UPS Worldwide Express Freight
- Package Weight Unit: Kilograms
- Package Size Unit: Centimeters
- Create a French contact
- Create a storable product “P1”:
- Weight: 500 kg
- Create a SO
- Add the product P1
- Add shipping:
- Select UPS
- Get Rate
**Problem:**
A user Error is triggered: “Missing or Invalid Total Number of Pieces in all Pallets in a Shipment."
Phone numbers in the API can't contain space characters: e.g: “+32 465 65 65 65”
opw-3680420
opw-3681186
Forward-Port-Of: odoo/enterprise#55481
Forward-Port-Of: odoo/enterprise#55121Current behavior: When both preparation display and printer are enabled, the printer was not able to print changes from an order. Steps to reproduce: - Create a preparation display that show all the orders - Create a pos printer that print all the pos categories - Setup the PoS to use both the preparation display and the printer - Create an order with some products - Validate the order, and pay for it - At this point the order should be printed and displayed on the preparation display.
Original PR description
Current behavior: When both preparation display and printer are enabled, the printer was not able to print changes from an order. Steps to reproduce: - Create a preparation display that show all the orders - Create a pos printer that print all the pos categories - Setup the PoS to use both the preparation display and the printer - Create an order with some products - Validate the order, and pay for it - At this point the order should be printed and displayed on the preparation display. But the printer will not print the order. opw-3606888 Forward-Port-Of: odoo/enterprise#55487 Forward-Port-Of: odoo/enterprise#55245
Before this commit, when a pending transaction was created for a subscription payment, the invoice was posted and the pending_transaction flag remained. After this commit, the invoice is not posted and the flag prevent the cron to process the contract again. taskid: 3685013 Forward-Port-Of: odoo/enterprise#54305
Original PR description
Before this commit, when a pending transaction was created for a subscription payment, the invoice was posted and the pending_transaction flag remained. After this commit, the invoice is not posted and the flag prevent the cron to process the contract again. taskid: 3685013 Forward-Port-Of: odoo/enterprise#54305
Steps to reproduce: - Install attendance app - Setup working schedule with no break like so (Mon 8-12h), (Mon 12-17h) - Check attendance for the week Issues: Traceback is displayed opw-3705883 opw-3706118 Forward-Port-Of: odoo/enterprise#55603
Original PR description
Steps to reproduce: - Install attendance app - Setup working schedule with no break like so (Mon 8-12h), (Mon 12-17h) - Check attendance for the week Issues: Traceback is displayed opw-3705883 opw-3706118 Forward-Port-Of: odoo/enterprise#55603
Steps to reproduce: ------------------- In Data Cleaning app, try to apply a custom filter on Company with "contains" or "not contains" operator. Issue: ------ A traceback occurs. For this line: `res = self._obj.execute(query, params)`, we have `IndexError: list index out of range`. Cause: ------ There is a mismatch between the `%` in the query and the number of parameters. The query is constructed by combining subqueries with a template. These subqueries will be determined using
Original PR description
Steps to reproduce: ------------------- In Data Cleaning app, try to apply a custom filter on Company with "contains" or "not contains" operator. Issue: ------ A traceback occurs. For this line: `res…
Steps to reproduce:
-------------------
In Data Cleaning app, try to apply a custom filter on Company with "contains" or "not contains" operator.
Issue:
------
A traceback occurs.
For this line: `res = self._obj.execute(query, params)`, we have `IndexError: list index out of range`.
Cause:
------
There is a mismatch between the `%` in the query and the number of parameters.
The query is constructed by combining subqueries with a template. These subqueries will be determined using the `mogrify` method and will be concatenated to the main query template.
The `'` characters are correctly escaped with `\` , but the `%` characters are not.
Solution:
---------
Don't use mogrify, so that we can keep the subquery parameters
and pass them directly to the main query.
By leaving the values wrapped with `%` in the parameters,
there are no more escape problems.
Note:
This is a better fix than manually escaping the `%` if necessary like:
```py
if operator in ('not ilike', 'ilike'):
value = f'%{value}%'
```
opw-3668433
Forward-Port-Of: odoo/enterprise#55204
Forward-Port-Of: odoo/enterprise#54287When an analytic distribution is set on the counterpart of a bank transaction, the analytic column should appear in the preview of the bank entry. task-3687839 Forward-Port-Of: odoo/enterprise#55354 Forward-Port-Of: odoo/enterprise#54837
Original PR description
When an analytic distribution is set on the counterpart of a bank transaction, the analytic column should appear in the preview of the bank entry. task-3687839 Forward-Port-Of: odoo/enterprise#55354 Forward-Port-Of: odoo/enterprise#54837
In 17.0, the style applied in the python side was not used in the template. This commit will add the style classes, change the template used in the python side since it isn't there anymore and correct a traceback when the date_maturity is not set. Also, a bug fix is applied: - the date was not populated on top of the report because the field today is only accessible on lines but not on the report itself. task: 3695867 Forward-Port-Of: odoo/enterprise#54901
Original PR description
In 17.0, the style applied in the python side was not used in the template. This commit will add the style classes, change the template used in the python side since it isn't there anymore and correct a traceback when the date_maturity is not set. Also, a bug fix is applied: - the date was not populated on top of the report because the field today is only accessible on lines but not on the report itself. task: 3695867 Forward-Port-Of: odoo/enterprise#54901
This commit is the counterpart of odoo/odoo#149944 where we use sendBeacon instead of the classical xhr in the case of an urgent save. As a consequence, a knowledge needed to be adapted. Task 3537838 Forward-Port-Of: odoo/enterprise#55457 Forward-Port-Of: odoo/enterprise#54634
Original PR description
This commit is the counterpart of odoo/odoo#149944 where we use sendBeacon instead of the classical xhr in the case of an urgent save. As a consequence, a knowledge needed to be adapted. Task 3537838 Forward-Port-Of: odoo/enterprise#55457 Forward-Port-Of: odoo/enterprise#54634
The Location API allow developpers to specify options when requesting a device's location - notably, it can request 'high accuracy' positioning. By default, 'high accuracy' is set to false so that the location API returns a position *quickly*. We can assume that it will return a position based on e.g. WiFi networks it sees around it and an API call to a location provider like Google, Apple, Here, etc. Setting 'high accuracy' to high will make this process much slower (20-30s is not gonna be a
Original PR description
The Location API allow developpers to specify options when requesting a device's location - notably, it can request 'high accuracy' positioning. By default, 'high accuracy' is set to false so that…
The Location API allow developpers to specify options when requesting a device's location - notably, it can request 'high accuracy' positioning. By default, 'high accuracy' is set to false so that the location API returns a position *quickly*. We can assume that it will return a position based on e.g. WiFi networks it sees around it and an API call to a location provider like Google, Apple, Here, etc. Setting 'high accuracy' to high will make this process much slower (20-30s is not gonna be an exception), but it means that devices with built-in GPS will usually provide an far more precise location. In Sign, it's rather important to have reliable data rather than a quick process. Assuming a person signing something for real, it's safe to assume that the browser will have the time to provide a precise position before the user submits their signature. If not, the position will simply not be saved. opw-3677499 Forward-Port-Of: odoo/enterprise#55588 Forward-Port-Of: odoo/enterprise#55411
When a customer sends a message to Odoo via WhatsApp, their number is saved in the `phone.blacklist` model, but the active state is set to False. If the customer sends 'STOP', it will be set to True, and if the customer sends a new message, it will again be set to False. Before sending a message from Odoo to a customer via WhatsApp, we check if the number is in the `phone.blacklist` with this line: if self.env['phone.blacklist'].sudo().search([('number', 'ilike', number)]): In SaaS 16.4
Original PR description
When a customer sends a message to Odoo via WhatsApp, their number is saved in the `phone.blacklist` model, but the active state is set to False. If the customer sends 'STOP', it will be set to True,…
When a customer sends a message to Odoo via WhatsApp, their number is saved in the `phone.blacklist` model, but the active state is set to False. If the customer sends 'STOP', it will be set to True, and if the customer sends a new message, it will again be set to False.
Before sending a message from Odoo to a customer via WhatsApp, we check if the number is in the `phone.blacklist` with this line:
if self.env['phone.blacklist'].sudo().search([('number', 'ilike', number)]):
In SaaS 16.4, this line returns the following SQL request:
SELECT "phone_blacklist"."id" FROM "phone_blacklist" WHERE (("phone_blacklist"."active" = true) AND ("phone_blacklist"."number"::text ILIKE '%32491730941%')) ORDER BY "phone_blacklist"."id";
Here, we check if the Active state is True to block the message if necessary.
In 17.0, this same line returns this SQL request:
SELECT "phone_blacklist"."id" FROM "phone_blacklist" WHERE ("phone_blacklist"."number"::text ILIKE '%32491730941%') ORDER BY "phone_blacklist"."id";
This time, the Active state is not checked, so regardless of whether it's False or True, the message is blocked. This makes it impossible to have a conversation with a customer in Odoo 17.0
The solution is to add ('active', '=', True) to the line in 17.0
if we go further we find that it's really because of the active_test = False of this line in thread.py thread = request.env[thread_model].with_context(active_test=False).search([("id", "=", thread_id)]) from this commit
https://github.com/odoo-dev/odoo/commit/8b2605b99348b7707b3db3db46af880c17c7029c
Forward-Port-Of: odoo/enterprise#55498After changing the payment method of a subscription, the confirmation message was not displayed on the subscription. To reproduce: - prerequisite: setup a test payment provider with tokenization support - login in as 'portal' user - Buy a 'Car Leasing' product, on payment choose the preceding payment provider with tokenization - go to 'My Account', then click on 'Subscriptions' - choose the order with 'Car Leasing' - click "Manage Payment Method" - click on "Save Payment Method" =>
Original PR description
After changing the payment method of a subscription, the confirmation message was not displayed on the subscription. To reproduce: - prerequisite: setup a test payment provider with tokenization support - login in as 'portal' user - Buy a 'Car Leasing' product, on payment choose the preceding payment provider with tokenization - go to 'My Account', then click on 'Subscriptions' - choose the order with 'Car Leasing' - click "Manage Payment Method" - click on "Save Payment Method" => After page reload we should see a message saying that the payment method was successfully changed, but no message are displayed. Forward-Port-Of: odoo/enterprise#48671
Forward-Port-Of: odoo/enterprise#55491
Original PR description
Forward-Port-Of: odoo/enterprise#55491
The tour ended with a class no always present, meaning it can fail in stock specific cases. This commit replace the last step by a new one searching the notification success to click on. Forward-Port-Of: odoo/enterprise#55608 Forward-Port-Of: odoo/enterprise#55239
Original PR description
The tour ended with a class no always present, meaning it can fail in stock specific cases. This commit replace the last step by a new one searching the notification success to click on. Forward-Port-Of: odoo/enterprise#55608 Forward-Port-Of: odoo/enterprise#55239
Steps to reproduce ================== - In date_merge modul, have enough records (such as leads) to be merged - unfolf one record - select all -> only the unfolded record is selected opw-3613615 Forward-Port-Of: odoo/enterprise#55459 Forward-Port-Of: odoo/enterprise#53941
Original PR description
Steps to reproduce ================== - In date_merge modul, have enough records (such as leads) to be merged - unfolf one record - select all -> only the unfolded record is selected opw-3613615 Forward-Port-Of: odoo/enterprise#55459 Forward-Port-Of: odoo/enterprise#53941
Problem --------- With the integration of Codabox in l10n_be_codabox, we need to managed the automatic import of SODA. This is currently done but can be improved. Objective --------- Adapt the following point: 1. Put the date from <GenDate> by default in the date of document 2. Add the period linked to the document in the ref of the document. This info is store in the field <AccountPeriod> 3. In the matching form between SODA account and Account in the company: Merge the account and
Original PR description
Problem --------- With the integration of Codabox in l10n_be_codabox, we need to managed the automatic import of SODA. This is currently done but can be improved. Objective --------- Adapt the…
Problem --------- With the integration of Codabox in l10n_be_codabox, we need to managed the automatic import of SODA. This is currently done but can be improved. Objective --------- Adapt the following point: 1. Put the date from <GenDate> by default in the date of document 2. Add the period linked to the document in the ref of the document. This info is store in the field <AccountPeriod> 3. In the matching form between SODA account and Account in the company: Merge the account and the name from SODA (to be consistante with the column in which the user should add account) Solution --------- 1. Simply add the date data from the XML in the dictionary that will be passed to the wizard creating the account move and make sure the wizard gives that value in the move create method. 2. Concatenate the formatted <AccountPeriod> text to the ref. 3. Add a compute method to computes the display_name for the current model as it is done in account_account. Use the display name in the wizard view in readonly instead of the SODA account codes and names. task-3615994 Forward-Port-Of: odoo/enterprise#55540 Forward-Port-Of: odoo/enterprise#53204
With PR odoo/odoo#149543, we call dialog.closeAll when the action service executes an action. As a consequence, there was a crash in studio because that function doesn't exist on the override of the dialog service inside Studio. This commit fixes the issue. Forward-Port-Of: odoo/enterprise#55486 Forward-Port-Of: odoo/enterprise#55257
Original PR description
With PR odoo/odoo#149543, we call dialog.closeAll when the action service executes an action. As a consequence, there was a crash in studio because that function doesn't exist on the override of the dialog service inside Studio. This commit fixes the issue. Forward-Port-Of: odoo/enterprise#55486 Forward-Port-Of: odoo/enterprise#55257
1. When the user scan a product from the byProduct registration page, add it as a by product, not a component. 2. Add 'To Close' to the default active filters when opening MOs in the barcode app. 3. When I produce a serial, and I specify a serial number manually, the components are consumed. 4. Remove Traceback when cancel transfer action is discarded. 5. Renamed the 'Cancel Transfer' into 'Cancel Manufacturing Order' and its notification to 'The manufacturing order has been cancelled.' 6.
Original PR description
1. When the user scan a product from the byProduct registration page, add it as a by product, not a component. 2. Add 'To Close' to the default active filters when opening MOs in the barcode app. 3. When I produce a serial, and I specify a serial number manually, the components are consumed. 4. Remove Traceback when cancel transfer action is discarded. 5. Renamed the 'Cancel Transfer' into 'Cancel Manufacturing Order' and its notification to 'The manufacturing order has been cancelled.' 6. Do not allow to add a component/byProduct that is the same as the final product. 7. Allow production of product without BoM 8. Scanning a Manufacturing Operation Type triggers the creation of a MO rather than the creation of a Picking 9. Scanning O-BTN.scrap should open scrap view with digipad rather than scrap form dialog Task 3612790 Forward-Port-Of: odoo/enterprise#55133 Forward-Port-Of: odoo/enterprise#52149
Fix net wage pdf value. Forward-Port-Of: odoo/enterprise#55425
Original PR description
Fix net wage pdf value. Forward-Port-Of: odoo/enterprise#55425
### Steps to reproduce issue: 1. Create a quotation, set a recurrence and a subscription product 2. Confirm quotation 3. Start date (Other Infos tab) becomes readonly ### Explanation: Behaviour was changed in versions 16.2 and 16.3 with commit odoo@433f631cba0d1889674fadf999a1b078266e0110 but was brought back to original with commit odoo@1748e8368c1dcce4c7ddfb326ea8a11bb6f9bce3 ### Suggested fix: Make behaviour the same for every version. Here, we adapt the saas to the major ver
Original PR description
### Steps to reproduce issue: 1. Create a quotation, set a recurrence and a subscription product 2. Confirm quotation 3. Start date (Other Infos tab) becomes readonly ### Explanation: Behaviour was changed in versions 16.2 and 16.3 with commit odoo@433f631cba0d1889674fadf999a1b078266e0110 but was brought back to original with commit odoo@1748e8368c1dcce4c7ddfb326ea8a11bb6f9bce3 ### Suggested fix: Make behaviour the same for every version. Here, we adapt the saas to the major versions. opw-3670543 Forward-Port-Of: odoo/enterprise#55545 Forward-Port-Of: odoo/enterprise#55250
Current behavior: When you do a global invoice with line that have a price unit of 0, then refund the order you get an error on the CFDI. Steps to reproduce: - Install l10n_mx_edi_pos - Create a product with a price unit of 0 - Create a POS order with this product and another one - Validate the order - Go in backend and create a global invoice form the orders view - Refund the order - Go on the order and check the CFDI, it will be in error opw-3630583 Forward-Port-Of: odoo/enterpr
Original PR description
Current behavior: When you do a global invoice with line that have a price unit of 0, then refund the order you get an error on the CFDI. Steps to reproduce: - Install l10n_mx_edi_pos - Create a product with a price unit of 0 - Create a POS order with this product and another one - Validate the order - Go in backend and create a global invoice form the orders view - Refund the order - Go on the order and check the CFDI, it will be in error opw-3630583 Forward-Port-Of: odoo/enterprise#55480 Forward-Port-Of: odoo/enterprise#54921