Wednesday, January 31, 2024
4 changes · 17.0
Resolved issues and error corrections
This update resolves access errors that branch-limited users encounter when working with accounting reports, invoices, and point-of-sale dashboards. The fix improves how user permissions are validated for parent company fields and journal access, allowing branch users to perform their daily tasks without encountering permission errors. Additionally, the journal filter styling has been improved to clarify which elements are clickable.
Original PR description
When a user only has access to a branch of a company, there is a lot of places where AccessError pops up because of how the domain was previously set on them. This commit aims to be a part of…
When a user only has access to a branch of a company, there is a lot of places where AccessError pops up because of how the domain was previously set on them. This commit aims to be a part of frequent small PR in the future to fix these problems. This also includes small style improvement for report's dropdown button for Journal filter, to make it clear that company name is not clickable These PRs fixes: - Unaccessible parent company's fields (now accessible) in - Sales/Purchase Orders/Quotation form: product variant, product (product_template), and tax - Account Move (invoice/bill/etc) line, when filling product - Access Error as user with only access to branch when: - opening Accounting reports (BS / PL) - opening PoS dashboard - trying to add product when creating new invoice - Improves Journal access rules. Instead of making all parent's journal public, base the user access on: (explicitly granted access from user allowed companies) or (all self&parent's journal AND journal type is not Bank/Cash) - Improves styling on report's Journal dropdown button's style (in enterprise PR) community-PR: https://github.com/odoo/odoo/pull/140078 enterprise-PR: https://github.com/odoo/enterprise/pull/49820 [task-id: 3551305](https://www.odoo.com/web#id=3551305&cids=1&menu_id=4720&action=333&active_id=967&model=project.task&view_type=form) Forward-Port-Of: odoo/enterprise#49820
This fix resolves a critical issue where the French Reports module would fail during system upgrades if certain data was missing. The upgrade process now handles missing data gracefully instead of crashing, ensuring smooth updates for businesses using French localization features.
Original PR description
During an upgrade if data doesn't exist it fail. ``` 2024-01-31 00:43:51,712 25658 INFO db_1264342 odoo.modules.loading: Loading module l10n_fr_reports (159/193) 2024-01-31 00:43:52,007 25658 INFO…
During an upgrade if data doesn't exist it fail.
```
2024-01-31 00:43:51,712 25658 INFO db_1264342 odoo.modules.loading: Loading module l10n_fr_reports (159/193)
2024-01-31 00:43:52,007 25658 INFO db_1264342 odoo.modules.migration: module l10n_fr_reports: Running migration [>0.0.0] pre-migrate
2024-01-31 00:43:52,008 25658 INFO db_1264342 odoo.modules.migration: module l10n_fr_reports: Running migration [>1.2] pre-remove-report-expression
2024-01-31 00:43:52,016 25658 WARNING db_1264342 odoo.modules.loading: Transient module states were reset
2024-01-31 00:43:52,017 25658 ERROR db_1264342 odoo.modules.registry: Failed to load registry
Traceback (most recent call last):
File "/home/odoo/src/odoo/17.0/odoo/tools/cache.py", line 99, in lookup
r = d[key]
File "<decorator-gen-5>", line 2, in __getitem__
File "/home/odoo/src/odoo/17.0/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "/home/odoo/src/odoo/17.0/odoo/tools/lru.py", line 34, in __getitem__
a = self.d[obj]
KeyError: ('ir.model.data', <function IrModelData._xmlid_lookup at 0x7fa43490b880>, 'l10n_fr_reports.account_financial_report_line_02_0_6_fr_bilan_passif_balance')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/odoo/src/odoo/17.0/odoo/modules/registry.py", line 113, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/home/odoo/src/odoo/17.0/odoo/modules/loading.py", line 476, in load_modules
processed_modules += load_marked_modules(env, graph,
File "/home/odoo/src/odoo/17.0/odoo/modules/loading.py", line 364, in load_marked_modules
loaded, processed = load_module_graph(
File "/home/odoo/src/odoo/17.0/odoo/modules/loading.py", line 181, in load_module_graph
migrations.migrate_module(package, 'pre')
File "/home/odoo/src/odoo/17.0/odoo/modules/migration.py", line 240, in migrate_module
migrate(self.cr, installed_version)
File "/home/odoo/src/enterprise/17.0/l10n_fr_reports/migrations/1.2/pre-remove-report-expression.py", line 5, in migrate
env.ref('l10n_fr_reports.account_financial_report_line_02_0_6_fr_bilan_passif_balance').unlink()
File "/home/odoo/src/odoo/17.0/odoo/api.py", line 579, in ref
res_model, res_id = self['ir.model.data']._xmlid_to_res_model_res_id(
File "/home/odoo/src/odoo/17.0/odoo/addons/base/models/ir_model.py", line 2189, in _xmlid_to_res_model_res_id
return self._xmlid_lookup(xmlid)
File "<decorator-gen-43>", line 2, in _xmlid_lookup
File "/home/odoo/src/odoo/17.0/odoo/tools/cache.py", line 104, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/home/odoo/src/odoo/17.0/odoo/addons/base/models/ir_model.py", line 2182, in _xmlid_lookup
raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: External ID not found in the system: l10n_fr_reports.account_financial_report_line_02_0_6_fr_bilan_passif_balance
2024-01-31 00:43:52,019 25658 CRITICAL db_1264342 odoo.service.server: Failed to initialize database `db_1264342`.
Traceback (most recent call last):
File "/home/odoo/src/odoo/17.0/odoo/tools/cache.py", line 99, in lookup
r = d[key]
File "<decorator-gen-5>", line 2, in __getitem__
File "/home/odoo/src/odoo/17.0/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "/home/odoo/src/odoo/17.0/odoo/tools/lru.py", line 34, in __getitem__
a = self.d[obj]
KeyError: ('ir.model.data', <function IrModelData._xmlid_lookup at 0x7fa43490b880>, 'l10n_fr_reports.account_financial_report_line_02_0_6_fr_bilan_passif_balance')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/odoo/src/odoo/17.0/odoo/service/server.py", line 1302, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "<decorator-gen-16>", line 2, in new
File "/home/odoo/src/odoo/17.0/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "/home/odoo/src/odoo/17.0/odoo/modules/registry.py", line 113, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/home/odoo/src/odoo/17.0/odoo/modules/loading.py", line 476, in load_modules
processed_modules += load_marked_modules(env, graph,
File "/home/odoo/src/odoo/17.0/odoo/modules/loading.py", line 364, in load_marked_modules
loaded, processed = load_module_graph(
File "/home/odoo/src/odoo/17.0/odoo/modules/loading.py", line 181, in load_module_graph
migrations.migrate_module(package, 'pre')
File "/home/odoo/src/odoo/17.0/odoo/modules/migration.py", line 240, in migrate_module
migrate(self.cr, installed_version)
File "/home/odoo/src/enterprise/17.0/l10n_fr_reports/migrations/1.2/pre-remove-report-expression.py", line 5, in migrate
env.ref('l10n_fr_reports.account_financial_report_line_02_0_6_fr_bilan_passif_balance').unlink()
File "/home/odoo/src/odoo/17.0/odoo/api.py", line 579, in ref
res_model, res_id = self['ir.model.data']._xmlid_to_res_model_res_id(
File "/home/odoo/src/odoo/17.0/odoo/addons/base/models/ir_model.py", line 2189, in _xmlid_to_res_model_res_id
return self._xmlid_lookup(xmlid)
File "<decorator-gen-43>", line 2, in _xmlid_lookup
File "/home/odoo/src/odoo/17.0/odoo/tools/cache.py", line 104, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/home/odoo/src/odoo/17.0/odoo/addons/base/models/ir_model.py", line 2182, in _xmlid_lookup
raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: External ID not found in the system: l10n_fr_reports.account_financial_report_line_02_0_6_fr_bilan_passif_balance
```This update resolves access errors that branch company users encounter when viewing accounting reports, point-of-sale dashboards, and creating invoices or orders. The fix allows branch users to properly access parent company data (like products, taxes, and journals) that they need for their daily operations, while maintaining appropriate privacy controls for sensitive information like journal balances.
Original PR description
When a user only has access to a branch of a company, there is a lot of places where AccessError pops up because of how the domain was previously set on them. This commit aims to be a part of…
When a user only has access to a branch of a company, there is a lot of places where AccessError pops up because of how the domain was previously set on them. This commit aims to be a part of frequent small PR in the future to fix these problems. These PRs fixes: - Unaccessible parent company's fields (now accessible) in - Sales/Purchase Orders/Quotation form: product variant, product (product_template), and tax - Account Move (invoice/bill/etc) line, when filling product - Access Error as user with only access to branch when: - opening Accounting reports (BS / PL) - opening PoS dashboard - trying to add product when creating new invoice - Improves Journal access rules. Instead of making all parent's journal public, base the user access on: (explicitly granted access from user allowed companies) or (all self&parent's journal AND journal type is not Bank/Cash) - Improves styling on report's Journal dropdown button's style (in enterprise PR) community-PR: https://github.com/odoo/odoo/pull/140078 enterprise-PR: https://github.com/odoo/enterprise/pull/49820 [task-id: 3551305](https://www.odoo.com/web?debug=#id=3551305&cids=1&menu_id=4720&action=333&active_id=967&model=project.task&view_type=form) Forward-Port-Of: odoo/odoo#140078
A recent update to the website search feature assumed all models have a website_id field, causing the system to crash when accessing certain pages like Appointments. This fix handles models that don't have a website_id field, preventing crashes and ensuring the search feature works properly across all model types.
Original PR description
*: test_website Commit [1] modified the custom page search model so it is adding the current website in the search domain. But it was not considering the case of models not having a website_id field. The only case was the appoitment.type model. Steps to reproduce: - Install website_appointment (enterprise) - Click on Website > Site > Appointments - Crash [1]: https://github.com/odoo/odoo/commit/db670f64f4c2190f1655f9077ea62885049a3c84 Forward-Port-Of: odoo/odoo#151453 Forward-Port-Of: odoo/odoo#150927