Daily updates from Odoo
Thursday, June 25, 2026
1 change
Resolved issues and error corrections
This update fixes an error that could block users from opening the settings menu on a vendor bill when an image had been posted in the chatter. It also ensures printing the original bill works correctly, improving reliability for users who review and process bills.
Original PR description
**Steps to reproduce:** - Install the `accountant` module and log in as admin. - Create and confirm a vendor bill. - Send an image in the chatter of the vendor bill. - Open a new tab and log in as a…
**Steps to reproduce:** - Install the `accountant` module and log in as admin. - Create and confirm a vendor bill. - Send an image in the chatter of the vendor bill. - Open a new tab and log in as a demo user. - Open the same vendor bill. - Click the gear icon. **Observation:** An access error is raised, and the gear icon is not accessible. **Root Cause:** At [1], the method `_should_attach_to_record` incorrectly excludes image attachments, causing them to be treated as `extra_files_data` at [2]. As a result, in `_fix_attachments_on_record_from_files_data` at [3], these attachments are assigned `res_model=False` and `res_id=0`. When the code tries to access these attachments at [4], it leads to an access error. Additionally, when we try to print `Original Bills`, we get the same access error at [5], and later the code calls the `browse` function on `self.env[attachment.res_model]`, but for `extra_files_data` we set the `res_model=False`, which results in a `KeyError`(see [6]). **Fix:** This commit prevents the error and ensures that users can access the gear icon when an image is attached in the chatter and print the `Original Bills`. [1]: https://github.com/odoo/odoo/blob/95864190a71b68eb10ae59ae8f38ac35b0cb6a97/addons/account/models/account_document_import_mixin.py#L416-L429 [2]: https://github.com/odoo/odoo/blob/95864190a71b68eb10ae59ae8f38ac35b0cb6a97/addons/account/models/account_move.py#L6668-L6672 [3]: https://github.com/odoo/odoo/blob/95864190a71b68eb10ae59ae8f38ac35b0cb6a97/addons/account/models/account_document_import_mixin.py#L409-L414 [4]: https://github.com/odoo/odoo/blob/7e874e7db30e05a02d6eeb26d9d67ed6176b9704/addons/account/models/account_move.py#L6944-L6949 [5]: https://github.com/odoo/odoo/blob/7e874e7db30e05a02d6eeb26d9d67ed6176b9704/addons/account/models/ir_actions_report.py#L30-L34 [6]: https://github.com/odoo/odoo/pull/261463#issuecomment-4602692978 opw-6119155 Forward-Port-Of: odoo/odoo#261463