Merge PR #877 into 14.0

Signed-off-by rousseldenis
This commit is contained in:
OCA-git-bot
2022-10-05 08:37:53 +00:00

View File

@@ -22,10 +22,13 @@ class Partner(models.Model):
def action_open_agreement(self): def action_open_agreement(self):
self.ensure_one() self.ensure_one()
action = self.env.ref("agreement.agreement_action") action = self.env["ir.actions.actions"]._for_xml_id(
result = action.read()[0] "agreement.agreement_action"
result["domain"] = [("partner_id", "=", self.id)] )
result["context"] = { action.update(
"default_partner_id": self.id, {
} "domain": [("partner_id", "=", self.id)],
return result "context": {"default_partner_id": self.id},
}
)
return action