[FIX] agreement_legal: fix action open agreement

This commit is contained in:
ps-tubtim
2022-09-21 10:06:58 +07:00
parent bd786d8a5e
commit ff543b5697

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