Monday, May 16, 2022
14 changes · master
Enhancements to existing features
This update replaces masculine wording with gender-neutral language in several Odoo modules, including text that may be visible to users. The change supports a more inclusive product experience and helps ensure shared code and demo data avoid reinforcing gender assumptions.
Original PR description
Purpose ======== Change all masculine nouns in Odoo's code to neutral nouns (when possible), making sure that demo data is correctly handled. This is particularly important since our code is open source, and nowadays lots of machine learning models are trained on open source repositories. With this small change we contribute to training more "fair" models, and teaching models that "employee" or "user" != "he". This also affects some text visible by the user, hence making it more inclusive for Odoo users. Task-2853046
Resolved issues and error corrections
Spreadsheet document search menu items now show the same visual highlight when selected with a keyboard as they do when hovered with a mouse. This improves consistency and accessibility for users navigating budget, sales, CRM, and dashboard templates.
Original PR description
As result of [1], control panel's search menu-items were highlighted correctly on ':hover', but not using a keyboard. This commit assigns the default <Dropdown> 'focus' class on both circumstances. [1] https://github.com/odoo/odoo/pull/87448 task#2852217
Features or functions removed from Odoo
Obsolete handling code was removed from invoice OCR import because related accounting validation now shows warnings instead of blocking errors. This keeps the invoice extraction flow simpler without changing expected user behavior.
Original PR description
Due to the commit "[IMP] account: change hard constraints to displayed warning" done in the community repository, the error raised by the constrains won't occure anymore during the OCR document import which makes the code deleted by this commit obsolete. community-PR: https://github.com/odoo/odoo/pull/81765 enterprise-PR: https://github.com/odoo/enterprise/pull/23275 task: 2612299
Code cleanup and technical improvements
This update aligns several Point of Sale enterprise add-ons with a broader cleanup in the core Point of Sale system. It improves the internal structure of certification, blackbox, and restaurant IoT flows so future changes are easier to maintain, with limited direct impact for day-to-day users.
Original PR description
Adapting the code based on the refactor of the community version https://github.com/odoo/odoo/pull/85956
Miscellaneous changes
`default_get()` of account.tax uses `self.env.company` to determine the default `country_id`. If a user belongs to a company other than the company of the invoice then the new tax is in the right company but the wrong country leading to: ``` File ".../odoo/models.py", line 1367, in _validate_fields check(self) File ".../odoo/addons/account/models/account_move.py", line 2099, in _validate_taxes_country raise ValidationError(_("This entry contains some tax from an unall
Original PR description
`default_get()` of account.tax uses `self.env.company` to determine the default `country_id`. If a user belongs to a company other than the company of the invoice then the new tax is in the right…
`default_get()` of account.tax uses `self.env.company` to determine the
default `country_id`.
If a user belongs to a company other than the company of the invoice
then the new tax is in the right company but the wrong country leading
to:
```
File ".../odoo/models.py", line 1367, in _validate_fields
check(self)
File ".../odoo/addons/account/models/account_move.py", line 2099, in _validate_taxes_country
raise ValidationError(_("This entry contains some tax from an
unallowed country. Please check its fiscal position and your tax
configuration."))
odoo.exceptions.ValidationError: This entry contains some tax from an
unallowed country. Please check its fiscal position and your tax
configuration.
```
This could happen when the public user renewed via
`/my/subscription/<id>` and the public user was in a different company
than the subscription and resulting invoice.
task-2824272
PR note: v14 is not affected by this because it doesn't have country_id on `account.tax`.
Forward-Port-Of: odoo/enterprise#27294The Planning test data now includes the missing role color value, preventing automated tests from failing unexpectedly. This helps keep quality checks reliable without changing day-to-day user behavior.
Original PR description
Prior to this commit: - The color field was not set on role in the tests data. After this commit: - The color field is added to the role int the tests data and the tests are no more crashing. Related PR: odoo/odoo#91147
`warehouse_id` may point to a record from a different company than the current company list. This does not fail with the standard view because the record warehouse_id is fetched first and it puts its `display_name` in cache before this compute is run. If we create a new form view for res.company that shows _just_ `intercompany_transaction_message` then the view will fail for companies not in the list. A simpler reproducer (which does similarly as the webclient does) is as below: with st
Original PR description
`warehouse_id` may point to a record from a different company than the current company list. This does not fail with the standard view because the record warehouse_id is fetched first and it puts its…
`warehouse_id` may point to a record from a different company than the
current company list. This does not fail with the standard view because
the record warehouse_id is fetched first and it puts its `display_name`
in cache before this compute is run.
If we create a new form view for res.company that shows _just_
`intercompany_transaction_message` then the view will fail for companies
not in the list. A simpler reproducer (which does similarly as the
webclient does) is as below: with standard
sale_purchase_inter_company_rules installed and two companies setup with
`rule_type='purchase'`.
Read first `intercompany_transaction_message` -> fails:
```py
In [1]: self.env["res.company"].with_context(allowed_company_ids=[1]).with_user(self.env.ref('base.user_admin')).browse(2).read(["intercompany_transaction_message","warehouse_id"])
2022-05-16 09:48:46,123 128859 INFO test_15 odoo.addons.base.models.ir_rule: Access Denied by record rules for operation: read on record ids: [2], uid: 2, model: stock.warehouse
```
Read first `warehouse_id` -> OK:
```py
In [1]: self.env["res.company"].with_context(allowed_company_ids=[1]).with_user(self.env.ref('base.user_admin')).browse(2).read(["warehouse_id","intercompany_transaction_message"])
Out[1]:
[{'id': 2,
'warehouse_id': (2, 'Company2'),
'intercompany_transaction_message': 'Generate a draft sales order using warehouse Company2 when a company confirms a purchase order for Company2.'}]
```
This issue was raised during migrations when the list of fields fetched
on the view tests was non-deterministic hence it fails when reading
`intercompany_transaction_message` before `warehouse_id`.
Forward-Port-Of: odoo/enterprise#27354Recently, partner field `unreconciled_aml_ids` was changed to a computed one on 76dc8ed7 and its domain was moved from the field itself to inside the compute method. Unfortunately, that made the domain to be harcoded into that method. This commit moves the domain to a separate method, so it may be inherited or reused. Forward-Port-Of: odoo/enterprise#27163
Original PR description
Recently, partner field `unreconciled_aml_ids` was changed to a computed one on 76dc8ed7 and its domain was moved from the field itself to inside the compute method. Unfortunately, that made the domain to be harcoded into that method. This commit moves the domain to a separate method, so it may be inherited or reused. Forward-Port-Of: odoo/enterprise#27163
Steps to reproduce (on mobile device): - Install stock_barcode module - Create a product A with a barcode - Create a stock picking B - Add at least 10 products then add the product A - Change all 'Demand' quantity to 2 then save - Go to Barcode -> Operations -> Receipt and select the stock picking B - Ensure the product A is not visible (because must scroll) - Scan the barcode of the product A Issue: Not scrolling to or focused on the sc
Original PR description
Steps to reproduce (on mobile device):
- Install stock_barcode module
- Create a product A with a barcode
- Create a stock picking B
- Add at least 10 products then add the product A
- Change all 'Demand' quantity to 2 then save
- Go to Barcode -> Operations -> Receipt and select the stock
picking B
- Ensure the product A is not visible (because must scroll)
- Scan the barcode of the product A
Issue:
Not scrolling to or focused on the scanned product.
Cause:
On mobile, the overflow is on the whole body (instead of the lines
container on desktop).
Solution:
Use body element as anchor if on mobile.
opw-2792384
Forward-Port-Of: odoo/enterprise#27281
Forward-Port-Of: odoo/enterprise#26369The other taxes line in the german profit and loss statement is moved to its correct position in the taxes group. opw-2801602 Forward-Port-Of: odoo/enterprise#26479 Forward-Port-Of: odoo/enterprise#26158
Original PR description
The other taxes line in the german profit and loss statement is moved to its correct position in the taxes group. opw-2801602 Forward-Port-Of: odoo/enterprise#26479 Forward-Port-Of: odoo/enterprise#26158
To reproduce ============ - Turn on Accounting file centralization in Documents > Settings - Sync two unique journals to two unique workspaces - Upload a document for Vendor Bill. Change the Journal in the form view from default (Journal1) to Journal 2. - Documents go to Workspace for Journal 1 and not Journal 2 that was chosen. Purpose ======= when we change the journal, the `write` function doesn't take it in account so the attachment remains in the folder linked to the default
Original PR description
To reproduce ============ - Turn on Accounting file centralization in Documents > Settings - Sync two unique journals to two unique workspaces - Upload a document for Vendor Bill. Change the Journal in the form view from default (Journal1) to Journal 2. - Documents go to Workspace for Journal 1 and not Journal 2 that was chosen. Purpose ======= when we change the journal, the `write` function doesn't take it in account so the attachment remains in the folder linked to the default journal. Specification ============= to solve the issue we update the folder, when the journal was changed. opw-2794392 Forward-Port-Of: odoo/enterprise#27346 Forward-Port-Of: odoo/enterprise#26515
This commit is a follow-up of its community counterpart in PR https://github.com/odoo/odoo/pull/87633 , in which this rule was moved. task-2792884 Counterpart of https://github.com/odoo/odoo/pull/87633 Forward-Port-Of: odoo/enterprise#27309
Original PR description
This commit is a follow-up of its community counterpart in PR https://github.com/odoo/odoo/pull/87633 , in which this rule was moved. task-2792884 Counterpart of https://github.com/odoo/odoo/pull/87633 Forward-Port-Of: odoo/enterprise#27309
Step to reproduce: - Go to timesheet - Create a line and choose a task - Open the task wizard and write in the description Current behaviour: - Timesheet timer are triggered and you cannot write Behaviour after PR: - Timesheet are not trigger and you can write in the note opw-2759838 Forward-Port-Of: odoo/enterprise#27023 Forward-Port-Of: odoo/enterprise#26881
Original PR description
Step to reproduce: - Go to timesheet - Create a line and choose a task - Open the task wizard and write in the description Current behaviour: - Timesheet timer are triggered and you cannot write Behaviour after PR: - Timesheet are not trigger and you can write in the note opw-2759838 Forward-Port-Of: odoo/enterprise#27023 Forward-Port-Of: odoo/enterprise#26881
Created new localization for Kenya, adding Balance Sheet and Profit & Loss Task-2809108 Forward-Port-Of: odoo/enterprise#25903
Original PR description
Created new localization for Kenya, adding Balance Sheet and Profit & Loss Task-2809108 Forward-Port-Of: odoo/enterprise#25903