[14.0][FIX] attachment_category: fix read

This commit is contained in:
Núria Sancho 2023-02-03 12:06:57 +01:00
parent 927f705d2c
commit 6367f2f3ef

View File

@ -58,7 +58,7 @@ class IrAttachmentCategory(models.Model):
def action_attachment_view(self):
self.ensure_one()
action = self.env.ref("base.action_attachment").read()[0]
action = self.env["ir.actions.act_window"]._for_xml_id("base.action_attachment")
action["domain"] = [("category_ids", "child_of", self.id)]
context = self.env.context.copy()
context.update({"default_category_ids": [self.id]})