Friday, May 3, 2024
2 changes
Resolved issues and error corrections
This update fixes a critical error that occurred during the Luxembourg localization module upgrade. The tax loading script was running too early in the system startup process, before all required modules were fully initialized. By moving the script to run at the end of the startup sequence, the system can now successfully complete the upgrade without errors.
Original PR description
Load taxes in an end script when all modules are loaded. Move script to end. ``` Traceback (most recent call last): File "/home/odoo/src/odoo/saas-17.1/odoo/service/server.py", line 1286, in…
Load taxes in an end script when all modules are loaded.
Move script to end.
```
Traceback (most recent call last):
File "/home/odoo/src/odoo/saas-17.1/odoo/service/server.py", line
1286, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "<decorator-gen-14>", line 2, in new
File "/home/odoo/src/odoo/saas-17.1/odoo/tools/func.py", line 87, in
locked
return func(inst, *args, **kwargs)
File "/home/odoo/src/odoo/saas-17.1/odoo/modules/registry.py", line
119, in new
odoo.modules.load_modules(registry, force_demo, status,
update_module)
File "/home/odoo/src/odoo/saas-17.1/odoo/modules/loading.py", line
476, in load_modules
processed_modules += load_marked_modules(env, graph,
File "/home/odoo/src/odoo/saas-17.1/odoo/modules/loading.py", line
364, in load_marked_modules
loaded, processed = load_module_graph(
File "/home/odoo/src/odoo/saas-17.1/odoo/modules/loading.py", line
232, in load_module_graph
migrations.migrate_module(package, 'post')
File "/home/odoo/src/odoo/saas-17.1/odoo/modules/migration.py", line
240, in migrate_module
migrate(self.cr, installed_version)
File
"/home/odoo/src/odoo/saas-17.1/addons/l10n_lu/migrations/2.2/post-migrate_update_taxes.py",
line 7, in migrate
env['account.chart.template'].try_loading('lu', company)
File
"/home/odoo/src/odoo/saas-17.1/addons/account/models/chart_template.py",
line 144, in try_loading
return self._load(template_code, company, install_demo)
File
"/home/odoo/src/odoo/saas-17.1/addons/account/models/chart_template.py",
line 195, in _load
self._post_load_data(template_code, company, template_data)
File
"/home/odoo/src/enterprise/saas-17.1/account_reports/models/chart_template.py",
line 31, in _post_load_data
company._get_and_update_tax_closing_moves(fields.Date.today(),
include_domestic=True)
File
"/home/odoo/src/enterprise/saas-17.1/account_reports/models/res_company.py",
line 162, in _get_and_update_tax_closing_moves
report, tax_closing_options =
tax_closing_move._get_report_options_from_tax_closing_entry()
File
"/home/odoo/src/enterprise/saas-17.1/account_reports/models/account_move.py",
line 209, in _get_report_options_from_tax_closing_entry
report_options =
tax_report.with_context(allowed_company_ids=company_ids).get_options(previous_options=options)
File
"/home/odoo/src/enterprise/saas-17.1/account_reports/models/account_report.py",
line 1631, in get_options
return
self.env['account.report'].browse(options['report_id']).get_options(variant_options)
File
"/home/odoo/src/enterprise/saas-17.1/account_reports/models/account_report.py",
line 1636, in get_options
initializer(options, previous_options=previous_options)
File
"/home/odoo/src/enterprise/saas-17.1/account_reports/models/account_report.py",
line 1470, in _init_options_section_buttons
options['buttons'] =
sections_source.get_options(previous_options={**options,
'no_report_reroute': True})['buttons']
File
"/home/odoo/src/enterprise/saas-17.1/account_reports/models/account_report.py",
line 1636, in get_options
initializer(options, previous_options=previous_options)
File
"/home/odoo/src/enterprise/saas-17.1/account_reports/models/account_report.py",
line 1585, in _init_options_custom
self.env[custom_handler_model]._custom_options_initializer(self,
options, previous_options)
File "/home/odoo/src/odoo/saas-17.1/odoo/api.py", line 534, in
__getitem__
return self.registry[model_name](self, (), ())
File "/home/odoo/src/odoo/saas-17.1/odoo/modules/registry.py", line
224, in __getitem__
return self.models[model_name]
KeyError: 'l10n_lu.tax.report.handler'
```
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#163114This update fixes two critical issues that prevented users from properly creating repair orders from returned items. Previously, repair parts would incorrectly link to the return transfer instead of the repair order, making them unavailable, and users would encounter validation errors when creating repairs immediately after processing returns. These fixes ensure repair orders work seamlessly in the return workflow.
Original PR description
This PR addresses two issues related to creating repair orders from return transfers: ### The First issue: Steps to reproduce the issue: - Activate `is_repairable` option on any picking type, let's…
This PR addresses two issues related to creating repair orders from return transfers: ### The First issue: Steps to reproduce the issue: - Activate `is_repairable` option on any picking type, let's say "Receipts" - Create a delivery order with any product(s). - Validate it. - Return it. - Validate the generated receipt transfer. - From the generated receipt, click on "Repair" button on the top. - Fill the required fields of the repair order and confirm it. - Add any part (`stock.move`) to the repair order. Expected behavior: - The new `stock.move` is created and the availability is determined based on quantities in stock. Current behavior: - The created `stock.move` is not only attached to the repair order, but is also attached to the related return transfer. - Since the return transfer may be done, no stock move lines are assigned to the newly linked move, which affects the availability making it unavailable. - This availablity status also affects the repair order making it unable to reserve any quantity for its parts. The issue is because clicking on "Repair" button from `stock.picking` form, adds `default_picking_id` to the context variable to be used on the `repair.order` form. When creating stock moves from the repair order form, the `default_picking_id` key in the context is propagated and used to link the new move to a picking, hence, leading to this undesired behavior. ### The Second Issue: Steps to reproduce the issue: - Create a delivery order. - Validate it. - Return it. - Without navigating to another page, validate the generated receipt order. - Click on "Repair" button. - Select any product on the RO form. Expected behavior: - Form is saved and the repair order is created. Current behavior: - Validation error shows: "A mandatory field is not set", `parts_location_id`. The issue is caused by `default_picking_type_id` key that exists in the context variable when a return order is created from another transfer. This variable propagates to the creation of the repair order and is used instead of the correct picking type which is "Repairs" in that case. Task-3877625 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#162452