Friday, December 6, 2024
2 changes · saas-17.4
Resolved issues and error corrections
Fixes a regression that caused key DIN 5008 layout sections to disappear from request for quotation and purchase order documents. This ensures vendors receive complete, correctly formatted purchasing documents again.
Original PR description
Commit a94321b7e3eb5d056ca58d3d1b81c22999292ffb introduced a bug where purchase DIN 5008 templates for RFQs and purchase orders failed to render `din5008_document_information`, `din5008_address_block`, `din5008_document_title` because of incorrect use of `t-set` within the template inheritance structure, which prevented the values from being displayed. This fix relocates the `t-set` declarations to a scope where they can be properly executed and used. task-4089521
Fixes an accounting issue where removing deferred dates from a supplier bill line could leave those dates on related tax journal items. This keeps invoice and tax lines consistent, reducing confusion and preventing incorrect deferred accounting information from remaining visible.
Original PR description
Steps to reproduce: 1) Via Studio, modify the 'Journal Items' tab to add 'Start date' and 'End date' to the list view 2) Create a group tax (purchase type - see joined screenshots for extra info) 3)…
Steps to reproduce: 1) Via Studio, modify the 'Journal Items' tab to add 'Start date' and 'End date' to the list view 2) Create a group tax (purchase type - see joined screenshots for extra info) 3) Create a bill with the group tax created in step 2) 4) Select deferred dates in the future 5) Check the journal items (two lines with deferred dates) 6) Go back to the 'Invoice lines' tab, delete the deferred dates and check the journal items again => one line still present the deferred dates!! Reason: When removing the `deferred_start_date` and the `deferred_end_date` from the invoice line, the newly computed `tax_key` for the tax line(s) will not have the `deferred_start_date` and the `deferred_end_date` fields, by [_get_deferred_tax_key](https://github.com/odoo-dev/enterprise/blob/c2c3a8591b3a5dfa402acb981564e46e0ff4ced9/account_accountant/models/account_move.py#L582). However, since when updating the tax line(s), we merge the old values with the new values (obtained in part from the before mentioned updated key), by this code in [_sync_dynamic_line](https://github.com/odoo/odoo/blob/f3d3e0c612392f1a35b9c131d29b4f3bd70a9d36/addons/account/models/account_move.py#L2599-L2602), and since the new key values of the tax line(s) does not have the `deferred_start_date` and the `deferred_end_date` explicitly set to `False`, and since the old key values have those fields set, merging new values with the old values will keep the old `deferred_start_date` and the `deferred_end_date`, resulting in a mismatch between the deferred dates on the invoice line and the tax lines. Fix: Now, `_get_deferred_tax_key` explicitly set `deferred_start_date` and the `deferred_end_date` to `False`, to make sure they override any old `deferred_start_date` and the `deferred_end_date` existing in the old keys. opw-4328465