Tuesday, June 11, 2024
15 changes · 17.0
Enhancements to existing features
This PR updates withholding tax template data for Argentina in Odoo. It helps keep localization tax configuration aligned for companies using Argentine accounting rules, though the PR details are still marked as work in progress.
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
Resolved issues and error corrections
Checkout now assumes shipping mode when no mode is provided, removing ambiguity in some order flows. This helps customers and staff get more consistent delivery-related behavior during online purchases.
Original PR description
Before this commit, the mode was sometimes ambiguous in certain cases After this commit, if we forget to provide the mode, we will always consider the shipping mode as the default.
Miscellaneous changes
After this commit: https://github.com/odoo/odoo/commit/88782d3a76fb3941b9ed7d998ec0610aa26ff611#diff-5e2dc39b3b508222892a48d869e4c958557e1881f6d54d7590831f9132ac68a9R289-R291 this error is raised when you have a manual created payment method: ``` RPC_ERROR Odoo Server Error Traceback (most recent call last): File "/opt/odoo/custom/src/odoo/odoo/api.py", line 909, in get return field_cache[record._ids[0]] KeyError: <NewId 0x7f703fa9ec70> During handling of the above exception,
Original PR description
After this commit: https://github.com/odoo/odoo/commit/88782d3a76fb3941b9ed7d998ec0610aa26ff611#diff-5e2dc39b3b508222892a48d869e4c958557e1881f6d54d7590831f9132ac68a9R289-R291 this error is raised…
After this commit:
https://github.com/odoo/odoo/commit/88782d3a76fb3941b9ed7d998ec0610aa26ff611#diff-5e2dc39b3b508222892a48d869e4c958557e1881f6d54d7590831f9132ac68a9R289-R291
this error is raised when you have a manual created payment method:
```
RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/api.py", line 909, in get
return field_cache[record._ids[0]]
KeyError: <NewId 0x7f703fa9ec70>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1083, in __get__
value = env.cache.get(record, self)
File "/opt/odoo/custom/src/odoo/odoo/api.py", line 912, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: 'account.journal(<NewId 0x7f703fa9ec70>,).available_payment_method_ids'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_http.py", line 242, in _dispatch
result = request.dispatch()
File "/opt/odoo/custom/src/odoo/odoo/http.py", line 702, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/custom/src/odoo/odoo/http.py", line 368, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/custom/src/odoo/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/custom/src/odoo/odoo/http.py", line 357, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo/custom/src/odoo/odoo/http.py", line 925, in __call__
return self.method(*args, **kw)
File "/opt/odoo/custom/src/odoo/odoo/http.py", line 546, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/auto/addons/web/controllers/main.py", line 1324, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/auto/addons/web/controllers/main.py", line 1316, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/custom/src/odoo/odoo/api.py", line 471, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/custom/src/odoo/odoo/api.py", line 456, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 6527, in onchange
todo = [
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 6530, in <listcomp>
if name not in done and snapshot0.has_changed(name)
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 6340, in has_changed
len(self[name]) != len(record[name])
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5936, in __getitem__
return self._fields[key].__get__(self, self.env.registry[self._name])
File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 2620, in __get__
return super().__get__(records, owner)
File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1132, in __get__
self.compute_value(recs)
File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1295, in compute_value
records._compute_field_value(self)
File "/opt/odoo/auto/addons/mail/models/mail_thread.py", line 411, in _compute_field_value
return super()._compute_field_value(field)
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4277, in _compute_field_value
fields.determine(field.compute, self)
File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 88, in determine
return needle(*args)
File "/opt/odoo/auto/addons/account/models/account_journal.py", line 312, in _compute_available_payment_method_ids
if manage_acquirers and method_information_mapping[[line.payment_method_id.id](http://line.payment_method_id.id/)]['mode'] == 'electronic':
Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/http.py", line 658, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/custom/src/odoo/odoo/http.py", line 301, in _handle_exception
raise exception.with_traceback(None) from new_cause
KeyError: 16
```
This PR adds the same condition used here:
https://github.com/odoo/odoo/blob/000579b7aa3cb640a642ae62162f651cce621790/addons/account/models/account_journal.py#L523
@Tecnativa TT49364
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#168460This update fixes an issue where online shop tax calculations could fail when prices were computed for multiple products at once. Taxes are now calculated for each product separately, helping prevent checkout or product listing errors related to pricing.
Original PR description
since 9338ac01745156abff2bf7606c2679f7c623bb81, we were erroneously giving all the templates whose price was computed to the taxes computation logic, when we should have been giving one template at a time (as we were looping on the templates here). --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Undoing a moved global filter in spreadsheets now works correctly instead of disrupting the edit history. This helps users safely revise spreadsheet filter changes without losing reliable undo behavior.
Original PR description
Before this fix, undoing a command MOVE_GLOBAL_FILTER broke the history because the inverse command was missing from the inverse registry. This fix adds the missing inverse command. OWP: 3966053 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Accounting reconciliation groups now show a proper readable name instead of a technical record reference. This makes grouped reconciliation lists easier for users to understand when reviewing accounting entries.
Original PR description
On Odoo enterprise, use the menu reconcile in accounting. Reconcile some lines with the wizard. In the tree view group by reconcile_id you show 'account.full.reconcile(67)'.  @qdp-odoo @oco-odoo --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Before this commit: - Graph chart metrics not properly visible in dark mode. After this commit: - White color is added to the text of the metrics, label and legends to make them properly visible in the dark mode. Task-3770589 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#161027
Original PR description
Before this commit: - Graph chart metrics not properly visible in dark mode. After this commit: - White color is added to the text of the metrics, label and legends to make them properly visible in the dark mode. Task-3770589 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#161027
Issue: - when we have a shipping method that has a discount the shipping and the delivery prices are not displayed correctly (see attached screenshot). Steps To Reproduce: - configure the sale app to have the discount&loyalty and free shipping options enabled. - create a product that cost 100$. - create a new discount/loyalty where type is promotions and set rule to if minimum 300$ spent the reward is free shipping max to 75$. - create a shipping method based on rules where the deliv
Original PR description
Issue: - when we have a shipping method that has a discount the shipping and the delivery prices are not displayed correctly (see attached screenshot). Steps To Reproduce: - configure the sale app to…
Issue: - when we have a shipping method that has a discount the shipping and the delivery prices are not displayed correctly (see attached screenshot). Steps To Reproduce: - configure the sale app to have the discount&loyalty and free shipping options enabled. - create a product that cost 100$. - create a new discount/loyalty where type is promotions and set rule to if minimum 300$ spent the reward is free shipping max to 75$. - create a shipping method based on rules where the delivery product is a service that costs 100$. - in your shipping mehtod pricing add a line with if quantity >= 3.0 then fixed price 100.0 and publish it. - in your website shop select 3 items from the product you created. and select your delivery method. - notice the prices not updating correctly. Solution: - Before the fix we always assumed that free_shipping_lines are equal to 0. - free_shipping_lines might be shipping discounts not actual free shipping.so I adjusted update_eshop_carrier method to make it handle the case of discounted shipping. opw-3718885 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#164404 Forward-Port-Of: odoo/odoo#154487
The field is translatable, but the default value wasn't being translated so new projects' tasks labels were always defaulting to English regardless of language. opw-3976888 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#168567 Forward-Port-Of: odoo/odoo#168482
Original PR description
The field is translatable, but the default value wasn't being translated so new projects' tasks labels were always defaulting to English regardless of language. opw-3976888 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#168567 Forward-Port-Of: odoo/odoo#168482
Since early June 2024, on new individual accounts, Stripe validates Indian mandate parameters even if they are irrelevant (e.g. mandates are not needed and won't be created). This prevents payments not compatible with Indian mandates from being made, like those made with MXN currency. With this fix, mandate parameters will be sent only if the payment's currency is supported by Indian mandates. Note: Accounts created before June 2024 or accounts linked to a platform created before June 2024
Original PR description
Since early June 2024, on new individual accounts, Stripe validates Indian mandate parameters even if they are irrelevant (e.g. mandates are not needed and won't be created). This prevents payments not compatible with Indian mandates from being made, like those made with MXN currency. With this fix, mandate parameters will be sent only if the payment's currency is supported by Indian mandates. Note: Accounts created before June 2024 or accounts linked to a platform created before June 2024 that have already used mandates are not affected by this bug. opw-3946505 Forward-Port-Of: odoo/odoo#168465
### Issue: When in firm mode, it is possible to change manually the name of an invoice, so it is possible to change its sequence number when the invoice is in draft. If the invoice sequence is more than 1, it is impossible to change the journal afterward. The client need to reset the name to nothing, change the journal and then rechange the name if he wants to change the journal. The same thing happens with Vendor Bills when the firm setting is activated. ### Steps to reproduce: - In Set
Original PR description
### Issue: When in firm mode, it is possible to change manually the name of an invoice, so it is possible to change its sequence number when the invoice is in draft. If the invoice sequence is more…
### Issue: When in firm mode, it is possible to change manually the name of an invoice, so it is possible to change its sequence number when the invoice is in draft. If the invoice sequence is more than 1, it is impossible to change the journal afterward. The client need to reset the name to nothing, change the journal and then rechange the name if he wants to change the journal. The same thing happens with Vendor Bills when the firm setting is activated. ### Steps to reproduce: - In Settings > Accounting > 'Accounting Firms Mode' select "Customer Invoices and Vendor Bills" - In Accounting > Customers > Invoices create a new Invoice - Choose a name, for example 'INV234' and a journal - Save the record - Change the journal - When saving a popup indicates it is impossible to change the journal when a sequence number is assigned ### Cause: When not in firm mode the invoice can't be filled (displays as Draft) and will be generated from the previous invoice name (In fact the user can only modify the name of the first invoice created in the journal, not the next ones). With the firm mode activated, the user can always modify the name of the draft invoice, giving it a sequence number. Then when changing the journal, it is blocked because the user is not supposed to change the journal of an invoice with a sequence number greater than 1. The check: https://github.com/odoo/odoo/blame/16.0/addons/account/models/account_move.py#L2303 ### Solution: Modify the condition of the UserError so that it is not triggered when the 'Firm Mode' is active. opw-3925402 Forward-Port-Of: odoo/odoo#168319
## Description As an internal user one has access to many timesheets as if from the backend. If the group by option of the portal view `/my/timesheets` is set to `None`, on a large database with millions of timesheets, the computation for the aggregate of the `unit_amount` is really slow, and it faces an internal limitation of the ORM when the `mapped` hitting fields out of cache. The code path used to fetch the missing records `expands_ids` has a bad space complexity and with millions of reco
Original PR description
## Description As an internal user one has access to many timesheets as if from the backend. If the group by option of the portal view `/my/timesheets` is set to `None`, on a large database with millions of timesheets, the computation for the aggregate of the `unit_amount` is really slow, and it faces an internal limitation of the ORM when the `mapped` hitting fields out of cache. The code path used to fetch the missing records `expands_ids` has a bad space complexity and with millions of records, this leads to an Memory Error (OOM). ## Benchmark On a database with over 4+M of timesheets matching the domain: | | Before | After | |--------|-----------|-------| | Timing | N/A (OOM) | 0.7s | ## Reference task-3977971 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#168549
starts. If the user language cannot be determined, it uses the one set in the html `lang` attribute. If this language is not installed, the webclient translation route does not return lang parameters such as date fortmat. However, the JS code expects those parameters to be available and missing parameters lead to multiple errors (e.g. when calling `parseDatetime` which requires the date format). This PR ignore the lang passed to this route if it is not installed in order for it to fallback
Original PR description
starts. If the user language cannot be determined, it uses the one set in the html `lang` attribute. If this language is not installed, the webclient translation route does not return lang parameters such as date fortmat. However, the JS code expects those parameters to be available and missing parameters lead to multiple errors (e.g. when calling `parseDatetime` which requires the date format). This PR ignore the lang passed to this route if it is not installed in order for it to fallback to the context lang. Steps to reproduce the issue: - Create an html page and set the lang attribute value to the IETF Xhosa tag (xh-ZA) - A request to `/web/webclient/translation` is made and an error is displayed in the console. opw-3953457 Forward-Port-Of: odoo/odoo#167491
Steps: - Install Ecom. - Buy a product without login and set different address for billing and shipping. Issue: - SO email sent to both billing and shipping emails it should only be sent to billing (main address). Cause: - In Ecom address controller it set both shipping and billing partner record to follower of SO and because of that SO sent to both emails. Fix: - Only set main address partner to follower of SO so it'll only send email to Customer's main email like it do for normal
Original PR description
Steps: - Install Ecom. - Buy a product without login and set different address for billing and shipping. Issue: - SO email sent to both billing and shipping emails it should only be sent to billing (main address). Cause: - In Ecom address controller it set both shipping and billing partner record to follower of SO and because of that SO sent to both emails. Fix: - Only set main address partner to follower of SO so it'll only send email to Customer's main email like it do for normal Sales flow. opw-3714686 Forward-Port-Of: odoo/odoo#168259
https://github.com/odoo/enterprise/commit/b580c6863c64338c9d7e182b7e00aea8334213d7 forgot to check previous_options were set before accessing their content. Forward-Port-Of: odoo/enterprise#64070
Original PR description
https://github.com/odoo/enterprise/commit/b580c6863c64338c9d7e182b7e00aea8334213d7 forgot to check previous_options were set before accessing their content. Forward-Port-Of: odoo/enterprise#64070