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):
self.ensure_one()
action = self.env.ref("agreement.agreement_action")
result = action.read()[0]
result["domain"] = [("partner_id", "=", self.id)]
result["context"] = {
"default_partner_id": self.id,
}
return result
action = self.env["ir.actions.actions"]._for_xml_id(
"agreement.agreement_action"
)
action.update(
{
"domain": [("partner_id", "=", self.id)],
"context": {"default_partner_id": self.id},
}
)
return action