Skip to content
Snippets Groups Projects
Commit 34db511c authored by Jeremy Kersten's avatar Jeremy Kersten
Browse files

[FIX] base: compute name for all ir_attachments


Before this commit, and since the new orm, we cannot open a record that have
no res_model and res_id.

With new orm, we should return a value for all records.
Now, we can open attachement form view without the error:

    ir.attachement(<id>).res_name traceback

closes odoo/odoo#36446

Signed-off-by: default avatarJérémy Kersten (jke) <jke@openerp.com>
parent 2b6ebb3d
Branches
Tags
No related merge requests found
......@@ -41,6 +41,8 @@ class IrAttachment(models.Model):
if attachment.res_model and attachment.res_id:
record = self.env[attachment.res_model].browse(attachment.res_id)
attachment.res_name = record.display_name
else:
attachment.res_name = False
@api.model
def _storage(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment