Friday, December 3, 2021
26 changes · master
Enhancements to existing features
This change improves how Odoo calculates and saves important automatic values before records are created, reducing the risk of missing or inconsistent data. It mainly strengthens sales, accounting, delivery, event, and product workflows, with added tests to ensure pricing, refunds, invoicing, and event sales continue to behave correctly.
Original PR description
-- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Product category names can now be translated, making them easier to use in multilingual businesses. This helps teams present product organization consistently in each user's language without changing the underlying category structure.
Original PR description
Product category name field is made translatable
This update adds convenient commands to launch standard and mobile JavaScript tests from Odoo's debug tools or command palette. Tests now run in a mode that loads individual assets, making it easier for teams to investigate issues during development and quality assurance.
Original PR description
After this commit, the tests launched from the debug tools or the command palette will be in debug=assets mode. This commit adds the "Run JS tests" and "Run Mobile JS tests" commands. 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
The Indian GSTR-1 tax report has been rebuilt to better match current government requirements, address known reporting issues, and improve speed when viewing reports or exporting CSV files. The outdated GSTR-3 report has been removed because it no longer provides a useful compliant format.
Original PR description
Refactor the whole GSTR-1 report because of many notifications from Government and bugs in the old report. Also, performance improvements in view the report and export to CSV Remove GSTR-3 because it is not in the right format so it is not useful anymore.
Users can now search within Salary Configurator dropdown lists instead of scrolling through long option lists. This makes selecting salary package options faster and easier, especially when many choices are available.
Original PR description
The dropdowns of the Salary Configurator don't allow searching in the different options. The user has to scroll to the option he wants to select it This PR allows searching through the different options of a dropdown task-2678911
Miscellaneous changes
``` >>> u1 = self.sudo(False).browse(1) >>> u2 = self.sudo().browse(2) >>> (u1 + u2).env.su False >>> (u2 + u1).env.su True ``` Ensure all attachments are always in sudo Before this commit, a low level user could not regenerate the assets Introduced at 3a98996eed ``` Traceback (most recent call last): File "/home/odoo/src/odoo/13.0/odoo/addons/base/models/qweb.py", line 333, in _compiled_fn return compiled(self, append, new, options, log) File "<template>", line 1, i
Original PR description
``` >>> u1 = self.sudo(False).browse(1) >>> u2 = self.sudo().browse(2) >>> (u1 + u2).env.su False >>> (u2 + u1).env.su True ``` Ensure all attachments are always in sudo Before this commit, a low…
```
>>> u1 = self.sudo(False).browse(1)
>>> u2 = self.sudo().browse(2)
>>> (u1 + u2).env.su
False
>>> (u2 + u1).env.su
True
```
Ensure all attachments are always in sudo
Before this commit, a low level user could not regenerate the assets
Introduced at 3a98996eed
```
Traceback (most recent call last):
File "/home/odoo/src/odoo/13.0/odoo/addons/base/models/qweb.py", line 333, in _compiled_fn
return compiled(self, append, new, options, log)
File "<template>", line 1, in template_web_frontend_layout_191
File "<decorator-gen-56>", line 2, in _get_asset_nodes
File "/home/odoo/src/odoo/13.0/odoo/tools/cache.py", line 90, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/home/odoo/src/odoo/13.0/odoo/addons/base/models/ir_qweb.py", line 299, in _get_asset_nodes
return remains + asset.to_node(css=css, js=js, debug=debug, async_load=async_load, defer_load=defer_load, lazy_load=lazy_load)
File "/home/odoo/src/odoo/13.0/odoo/addons/base/models/assetsbundle.py", line 137, in to_node
self.preprocess_css(debug=debug, old_attachments=old_attachments)
File "/home/odoo/src/odoo/13.0/odoo/addons/base/models/assetsbundle.py", line 463, in preprocess_css
old_attachments.unlink()
File "/home/odoo/src/odoo/13.0/odoo/addons/base/models/ir_attachment.py", line 503, in unlink
self.check('unlink')
File "/home/odoo/src/odoo/13.0/odoo/addons/base/models/ir_attachment.py", line 386, in check
raise AccessError(_("Sorry, you are not allowed to access this document."))
odoo.exceptions.AccessError: ('Sorry, you are not allowed to access this document.', None)
```
Forward-Port-Of: odoo/odoo#80754Description of the issue/feature this PR addresses: According to https://www.impots.gouv.fr/portail/files/formulaires/3310-ca3-sd/2018/3310-ca3-sd_2076.pdf, for TVA EU you should also add the value of the tax in the line 20. @oco-odoo @alexis-via -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#80695
Original PR description
Description of the issue/feature this PR addresses: According to https://www.impots.gouv.fr/portail/files/formulaires/3310-ca3-sd/2018/3310-ca3-sd_2076.pdf, for TVA EU you should also add the value of the tax in the line 20. @oco-odoo @alexis-via -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#80695
task - 2695252 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#80211
Original PR description
task - 2695252 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#80211
When Chrome is spawned, the `DevToolsActivePort`file is awaited to read the port. Sometimes the file is read but is still empty, resulting in a ValueError when trying to cast into integer. This happens when Chrome did not have time yet to write into the file. With this commit, we expect the file to contain at least 5 bytes which is enough to contain the max port number. Forward-Port-Of: odoo/odoo#80765
Original PR description
When Chrome is spawned, the `DevToolsActivePort`file is awaited to read the port. Sometimes the file is read but is still empty, resulting in a ValueError when trying to cast into integer. This happens when Chrome did not have time yet to write into the file. With this commit, we expect the file to contain at least 5 bytes which is enough to contain the max port number. Forward-Port-Of: odoo/odoo#80765
…e https://github.com/odoo/odoo/pull/79737 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#80802 Forward-Port-Of: odoo/odoo#80771
Original PR description
…e https://github.com/odoo/odoo/pull/79737 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#80802 Forward-Port-Of: odoo/odoo#80771
Steps to reproduce: 1. Install the Expenses and Contacts Apps 2. Go to the Contacts App 3. Add a bank account to the private address linked to a specific employee 4. Go to the Expenses App 5. Create an expense for the employee and try to register the payment 6. The bank account will not show up Solution: If the employee doesn't have a bank account selected in the Employee form, we select the first bank account of his private address OPW-2655450 Forward-Port-Of: odoo/odoo#80535
Original PR description
Steps to reproduce: 1. Install the Expenses and Contacts Apps 2. Go to the Contacts App 3. Add a bank account to the private address linked to a specific employee 4. Go to the Expenses App 5. Create an expense for the employee and try to register the payment 6. The bank account will not show up Solution: If the employee doesn't have a bank account selected in the Employee form, we select the first bank account of his private address OPW-2655450 Forward-Port-Of: odoo/odoo#80535
Previously, when a main component errored during rendering, we would remove it from the list of main components that should be rendered by the MainComponentsContainer to avoid it erroring again on a subsequent rendering (which can cause infinite error loops). Unfortunately, since we did not rerender the MainComponentsContainer after this removal, the erroring main component would remain, and could cause such error loops anyway. This commit fixes that. Forward-Port-Of: odoo/odoo#80772
Original PR description
Previously, when a main component errored during rendering, we would remove it from the list of main components that should be rendered by the MainComponentsContainer to avoid it erroring again on a subsequent rendering (which can cause infinite error loops). Unfortunately, since we did not rerender the MainComponentsContainer after this removal, the erroring main component would remain, and could cause such error loops anyway. This commit fixes that. Forward-Port-Of: odoo/odoo#80772
Small side effect of commit https://github.com/odoo/odoo/commit/b19dc634684aab239575b9a9e784c7420d110b7d When deleting old attendees, we are removing the partner id associated with the email from the partner_ids set on the event. As the same partner can be set on more than one event, we need to loop only once on each attendee email, otherwise we will face the error "Record does not exist or has been deleted." Also, when deleting partner_ids on an event, the attendee is already automa
Original PR description
Small side effect of commit https://github.com/odoo/odoo/commit/b19dc634684aab239575b9a9e784c7420d110b7d When deleting old attendees, we are removing the partner id associated with the email from the partner_ids set on the event. As the same partner can be set on more than one event, we need to loop only once on each attendee email, otherwise we will face the error "Record does not exist or has been deleted." Also, when deleting partner_ids on an event, the attendee is already automatically removed as well in _attendees_values method, there is no need to do it manually, as it will raise the error a second time. opw-2694428 opw-2695915 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#80440
The mockSearch function should not return the list of records for a domain and a model but the list of ids. The path "/web/dataset/search" does not exist. 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#80762
Original PR description
The mockSearch function should not return the list of records for a domain and a model but the list of ids. The path "/web/dataset/search" does not exist. 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#80762
As part of loading orders, we need to make sure we load the missing products. This process relies on the existence of the `product.product` model declaration in the PosModel. However, since we are loading products differently here in pos_cache, the `product.product` model is removed from the list of models. We are now return the `product.product` model to the list of models after loading. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forwa
Original PR description
As part of loading orders, we need to make sure we load the missing products. This process relies on the existence of the `product.product` model declaration in the PosModel. However, since we are loading products differently here in pos_cache, the `product.product` model is removed from the list of models. We are now return the `product.product` model to the list of models after loading. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#80780
Before this fix there is no real way to influence the VAT validation. This can be problematic though as in some cases external platforms push data to you on which you don't really have control. If an external software pushes an invalid VAT and your database has the option 'Verify VAT Numbers' checked on there is no way for you to bypass this though. This means that before this commit you have to always run VAT number checks on all data, no matter if they come through the frontend or backen
Original PR description
Before this fix there is no real way to influence the VAT validation. This can be problematic though as in some cases external platforms push data to you on which you don't really have control. If an…
Before this fix there is no real way to influence the VAT validation. This can be problematic though as in some cases external platforms push data to you on which you don't really have control. If an external software pushes an invalid VAT and your database has the option 'Verify VAT Numbers' checked on there is no way for you to bypass this though. This means that before this commit you have to always run VAT number checks on all data, no matter if they come through the frontend or backend. After this commit you can supply a context key 'no_vat_validation' though. This way you could skip doing VAT number validations on (some) records while still enforcing this in the UI. This allows you to have crons/external API's push any VAT number while enforcing full validation through the UI. This opens up the best of both worlds. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#80804 Forward-Port-Of: odoo/odoo#80503
This pull request handles a bunch of fixes for the dynamic snippets. The intial goal was to prevent refreshing on add2cart on snippets that didn't need to, but while doing so, some more bugs surfaced. task-2654924 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#77483
Original PR description
This pull request handles a bunch of fixes for the dynamic snippets. The intial goal was to prevent refreshing on add2cart on snippets that didn't need to, but while doing so, some more bugs surfaced. task-2654924 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#77483
Open Accounting>Reporting>Taxable Payments Annual Reports(TPAR) traceback This occur after 4ec39bd53e197432e823805dd485f2f5affd47f7. The method `._prepare_lines_for_cash_basis` changed signature opw-2681296 Forward-Port-Of: odoo/enterprise#22557
Original PR description
Open Accounting>Reporting>Taxable Payments Annual Reports(TPAR) traceback This occur after 4ec39bd53e197432e823805dd485f2f5affd47f7. The method `._prepare_lines_for_cash_basis` changed signature opw-2681296 Forward-Port-Of: odoo/enterprise#22557
### Expected behavior As in version 14: there is no option to create an employee ### Current behavior A button to create an employee is present in the employee selection view. (If an employee is created like this, it will not be saved). ### Steps to reproduce - Install Calendar and Appointments - Go to Calendar then Online Appointments - Select an appointment (Doctor Appointment e.g.) - "Add a line" under Available Employees list - Create button is present in the modal's footer
Original PR description
### Expected behavior As in version 14: there is no option to create an employee ### Current behavior A button to create an employee is present in the employee selection view. (If an employee is created like this, it will not be saved). ### Steps to reproduce - Install Calendar and Appointments - Go to Calendar then Online Appointments - Select an appointment (Doctor Appointment e.g.) - "Add a line" under Available Employees list - Create button is present in the modal's footer OPW-2698163 Forward-Port-Of: odoo/enterprise#22683
Steps: - Install Accounting - Setting > Activate Multicurrency - Currencies > Euro (not main currency) > Rates > Create a different rate with today's date - Create Invoice with * Currency: Euro * Invoice Date: yesterday * Due Date: Immediate Payment * an Invoice Line with a Price - Log in as Demo (note your Accounting rights are Accountant) - Accounting > Reporting > Unrealized Currency Gains/Losses > Adjustment entry - In this wizard, set any * Journal * Expense account *
Original PR description
Steps: - Install Accounting - Setting > Activate Multicurrency - Currencies > Euro (not main currency) > Rates > Create a different rate with today's date - Create Invoice with * Currency: Euro * Invoice Date: yesterday * Due Date: Immediate Payment * an Invoice Line with a Price - Log in as Demo (note your Accounting rights are Accountant) - Accounting > Reporting > Unrealized Currency Gains/Losses > Adjustment entry - In this wizard, set any * Journal * Expense account * Income account - Create Entry Issue: - User Error : You are not allowed to modify res.company records... Cause: - Setting those journal and accounts in the wizard set it for the company. - Yet, an accountant doesn't have the required administrator right to modify company records. Solution: - Bypass this restriction using "sudo". Forward-Port-Of: odoo/enterprise#22364
**Current behavior** When a product as a rental delay cost (so when it's return late), the expected date is the pickup date (not the date in which it was supposed to be returned)  **Step to reproduce** - Install the sale_renting app - Create a Rental Orders with a customer and with at least one Rental product (like the projector or the Meeting Room) - Setup the both date in the
Original PR description
**Current behavior** When a product as a rental delay cost (so when it's return late), the expected date is the pickup date (not the date in which it was supposed to be returned)  **Step to reproduce** - Install the sale_renting app - Create a Rental Orders with a customer and with at least one Rental product (like the projector or the Meeting Room) - Setup the both date in the past, in the view Rent a product; ADD - Save - Confirm - Pickup, Validate - Return, Validate And here is the issue: the "Expected date" for the product "Rental Delay Cost" is not correct. **The behavior after the fix** The Expected date should be the same as the end date for the rental product opw-2671244 Forward-Port-Of: odoo/enterprise#22693
Steps: - Install Accounting - Set Marc Demo's Accounting rights to Advisor - Log in as Marc Demo - Create an Asset A - A > Sell or Dispose - In Sell Asset wizard, set: - Action: Sell - Customer Invoice: any - Gain/Loss Account: any - Sell Issue: - User Error : You are not allowed to modify res.company records... Cause: - Setting this Gain/Loss Account in the wizard set it for the company. - Yet, an accountant doesn't have the required administrator right to modify company r
Original PR description
Steps: - Install Accounting - Set Marc Demo's Accounting rights to Advisor - Log in as Marc Demo - Create an Asset A - A > Sell or Dispose - In Sell Asset wizard, set: - Action: Sell - Customer Invoice: any - Gain/Loss Account: any - Sell Issue: - User Error : You are not allowed to modify res.company records... Cause: - Setting this Gain/Loss Account in the wizard set it for the company. - Yet, an accountant doesn't have the required administrator right to modify company records. Solution: - Bypass this restriction using "sudo". opw-2659355 Forward-Port-Of: odoo/enterprise#22388
fix the bug introduced from commit: b6e0f26745872483fe77330e38fb8ed18dc54bd0 task-2510209 odoo/enterprise#18384 before this commit: the template share flow will be blocked, since it will try to change signer from False to a real one Forward-Port-Of: odoo/enterprise#22688
Original PR description
fix the bug introduced from commit: b6e0f26745872483fe77330e38fb8ed18dc54bd0 task-2510209 odoo/enterprise#18384 before this commit: the template share flow will be blocked, since it will try to change signer from False to a real one Forward-Port-Of: odoo/enterprise#22688
### What's the issue? When we sync orders placed on Amazon, we use the 'Title' field returned by Amazon's API to populate the product description field in the generated sale order (see [amazon_account.py](https://github.com/odoo/enterprise/blob/2806af49ee489e8d411fa97587d80119786369e0/sale_amazon/models/amazon_account.py#L576-L578)). The data in this 'Title' field sometimes contains HTML escape sequences (e.g. `̈` for 'ä'), which are then used as-is in the product description without
Original PR description
### What's the issue? When we sync orders placed on Amazon, we use the 'Title' field returned by Amazon's API to populate the product description field in the generated sale order (see…
### What's the issue?
When we sync orders placed on Amazon, we use the 'Title' field returned by Amazon's API to populate the product description field in the generated sale order (see [amazon_account.py](https://github.com/odoo/enterprise/blob/2806af49ee489e8d411fa97587d80119786369e0/sale_amazon/models/amazon_account.py#L576-L578)).
The data in this 'Title' field sometimes contains HTML escape sequences (e.g. `̈` for 'ä'), which are then used as-is in the product description without being converted back to Unicode.
For example, this is an issue in support ticket no. [2637289](https://www.odoo.com/web#id=2637289&cids=1&menu_id=4720&action=333&active_id=49&model=project.task&view_type=form). As you can see in the screenshots posted by the customer, the escape sequence `̈` appears in the product description.
I'm not sure why these escape sequences were present in the data sent by Amazon. Perhaps the client had inadvertently used these escape sequences when defining the product in Seller Central? However, the [product page](https://www.amazon.de/Duschfilter-R%C3%A4yn-Krankheitserreger-Vollsta%CC%88ndig-ru%CC%88ckstandsfrei/dp/B08THWRB1F?th=1) on Amazon does not contain these escape sequences in its HTML.
### What's the proposed solution?
Call Python's built-in `html.unescape()` on the text returned by Amazon.
### How can I test that it works?
Open `odoo-bin shell`.
Execute the following commands:
```
# To be executed in odoo-bin shell.
# Note: line 10 below assumes a particular location for the mws_connector module, you may need to adapt this to your installation.
# This was the items_data retrieved in the AmazonAccount._process_order() method (see amazon_account.py:436)
# https://github.com/odoo/enterprise/blob/2806af49ee489e8d411fa97587d80119786369e0/sale_amazon/models/amazon_account.py#L436
items_data = [{'value': '\n ', 'QuantityOrdered': {'value': '1'}, 'Title': {'value': 'Example product with HTML ̈scape sequence.'}, 'ShippingTax': {'value': '\n ', 'Amount': {'value': '0.00'}, 'CurrencyCode': {'value': 'EUR'}}, 'PromotionDiscount': {'value': '\n ', 'Amount': {'value': '0.00'}, 'CurrencyCode': {'value': 'EUR'}}, 'ConditionId': {'value': 'New'}, 'IsGift': {'value': 'false'}, 'ASIN': {'value': 'dummy-value'}, 'SellerSKU': {'value': 'dummy-value'}, 'OrderItemId': {'value': 'dummy-value'}, 'ShippingDiscountTax': {'value': '\n ', 'Amount': {'value': '0.00'}, 'CurrencyCode': {'value': 'EUR'}}, 'IsTransparency': {'value': 'false'}, 'ProductInfo': {'value': '\n ', 'NumberOfItems': {'value': '1'}}, 'QuantityShipped': {'value': '1'}, 'ShippingPrice': {'value': '\n ', 'Amount': {'value': '5.00'}, 'CurrencyCode': {'value': 'EUR'}}, 'ConditionSubtypeId': {'value': 'New'}, 'ItemPrice': {'value': '\n ', 'Amount': {'value': '10.00'}, 'CurrencyCode': {'value': 'EUR'}}, 'ItemTax': {'value': '\n ', 'Amount': {'value': '0.00'}, 'CurrencyCode': {'value': 'EUR'}}, 'ShippingDiscount': {'value': '\n ', 'Amount': {'value': '0.00'}, 'CurrencyCode': {'value': 'EUR'}}, 'PromotionDiscountTax': {'value': '\n ', 'Amount': {'value': '0.00'}, 'CurrencyCode': {'value': 'EUR'}}}]
item_data = items_data[0]
# Import the mws_connector module ()
import importlib.util
spec = importlib.util.spec_from_file_location("mws_connector", "~/src/enterprise/sale_amazon/models/mws_connector.py")
mws_connector = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mws_connector)
# This corresponds to what we do in amazon_account:L576
# https://github.com/odoo/enterprise/blob/2806af49ee489e8d411fa97587d80119786369e0/sale_amazon/models/amazon_account.py#L576-L578
mws_connector.get_string_value(item_data, 'Title')
# The HTML escape sequences should now be unescaped.
```
In my case, I tested this using user data obtained from a customer's database. Please see this [doc](https://drive.google.com/file/d/1pyG2-8bR5cC8HkN62ZMS5uJjcrDKGU_S/view?usp=sharing) (accessible only to Odoo employees).
Forward-Port-Of: odoo/enterprise#22625
Forward-Port-Of: odoo/enterprise#22338Purpose of this commit to show only helpdesk customer ratings in helpdesk customer rating menu(action). So, In this commit add domain for rating action in helpdesk module to show only helpdesk.ticket rating in helpdesk module. TaskId-2682065 Forward-Port-Of: odoo/enterprise#22026
Original PR description
Purpose of this commit to show only helpdesk customer ratings in helpdesk customer rating menu(action). So, In this commit add domain for rating action in helpdesk module to show only helpdesk.ticket rating in helpdesk module. TaskId-2682065 Forward-Port-Of: odoo/enterprise#22026
Steps: - Install Field Service - Field Service > any Task > select a project Issue: It is possible to select not fsm projects Cause: industry_fsm/project_task_views inherits from project/project_views, and add attributes to project_id Yet, there are two fields project_id, and only one is overridden. Fix: Override the second one too. opw-2699543 Forward-Port-Of: odoo/enterprise#22687
Original PR description
Steps: - Install Field Service - Field Service > any Task > select a project Issue: It is possible to select not fsm projects Cause: industry_fsm/project_task_views inherits from project/project_views, and add attributes to project_id Yet, there are two fields project_id, and only one is overridden. Fix: Override the second one too. opw-2699543 Forward-Port-Of: odoo/enterprise#22687