Files
odoo_source/addons/test_xlsx_export
Preksha Chouhan 46016e33ea [FIX] web: return updated list of fields in export template
When user access template at the time of export with deleted field.
The traceback will be generated.

To reproduce the issue(any model, here- 'account.move.line'):

- Install 'account_accountant' module
- Go to Settings > Technical > Database Structure > Fields
- Create a new field with model as 'Journal Item' and save
- Go to Accounting > Miscellaneous > Journal Items
- Select any record in list view and click on export and generate a new export
template with newly created field
- Go to 'ir.model.fields' and delete that field
- Go to 'Journal Items' and select that template while export

Error: A traceback appears: KeyError: 'tax_audit'

When a field gets deleted from 'ir.model.fields' but it does not get deleted
from export template. And selecting that template to export the records will
lead to traceback.

See -
https://github.com/odoo/odoo/blob/59669e9943158e51dcbb9ae69ad758df8f7c7976/addons/web/controllers/main.py#L1815-L1818

sentry-4331986723

closes odoo/odoo#134605

X-original-commit: e458a4c164820c3ccf00b0520c5f86c49238fb2a
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-09-07 09:00:34 +00:00
..
…