Daily updates from Odoo
Friday, February 23, 2024
2 changes
Resolved issues and error corrections
This fix resolves a critical error that occurred when previewing draft invoices with multi-line payment terms. The issue prevented users from viewing invoices when payment terms included multiple installment lines without early payment discounts. The fix ensures the system properly handles these payment term configurations.
Original PR description
Description of the issue this PR addresses: --- On obtains a 500: Internal Server Error when creating an invoice with a 2 lines payment term. Error while rendering the template…
Description of the issue this PR addresses: --- On obtains a 500: Internal Server Error when creating an invoice with a 2 lines payment term. Error while rendering the template "account.report_invoice_document". Steps to reproduce: --- - Accounting > Configuration > invoicing > Payment Terms - New > Create and save a payment term with 2 lines: - name 80/20 test - line_1 : 80% after 0 days - line_2 : 20% after 30 days - Sales > Orders > Quotations - Chose any > use payment terms 80/20 test - Save and create associated invoice > chose regular invoice - Create draft invoice > preview > 500: Internal Server Error Cause of the issue: --- The method "_get_amount_due_after_discount" called during the rendering of the template does not return a value in case self.early_discount is False. Fix: --- Return total_amount by default since no discount is applied. opw-3683708 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#149934
This fix resolves a critical issue that prevented Odoo from starting up during system updates. When removing accounting report expressions, the system now properly cleans up related external values, preventing database constraint violations that would crash the upgrade process.
Original PR description
Cascade removal of account.report.expression records to corresponding account.report.external.value, avoiding the following issue when upgrading: ``` Traceback (most recent call last): File…
Cascade removal of account.report.expression records to corresponding account.report.external.value, avoiding the following issue when upgrading:
```
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 536, in load_modules
env['ir.model.data']._process_end(processed_modules)
File "/tmp/tmpwrjjshgf/migrations/base/0.0.0/pre-models-no-model-data-delete.py", line 103, in _process_end
return super(IrModelData, self)._process_end(modules)
File "/home/odoo/src/odoo/17.0/odoo/addons/base/models/ir_model.py", line 2562, in _process_end
self._process_end_unlink_record(record)
File "/home/odoo/src/odoo/17.0/addons/website/models/ir_model_data.py", line 36, in _process_end_unlink_record
return super()._process_end_unlink_record(record)
File "/home/odoo/src/odoo/17.0/odoo/addons/base/models/ir_model.py", line 2491, in _process_end_unlink_record
record.unlink()
File "/home/odoo/src/odoo/17.0/odoo/models.py", line 4218, in unlink
cr.execute(SQL(
File "/home/odoo/src/odoo/17.0/odoo/sql_db.py", line 332, in execute
res = self._obj.execute(query, params)
psycopg2.errors.ForeignKeyViolation: update or delete on table "account_report_expression" violates foreign key constraint "account_report_external_value_target_report_expression_id_fkey" on table "account_report_external_value"
DETAIL: Key (id)=(94) is still referenced from table "account_report_external_value".
```
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#154191