From 54c7269e7f931e8c0187fb1b6804856c6ae50309 Mon Sep 17 00:00:00 2001 From: Carmen Bianca BAKKER Date: Mon, 21 Oct 2024 11:10:12 +0200 Subject: [PATCH] [FIX] shift: Recompute partner's can_shop when dependencies change Because this field is a stored computed field, this was previously broken. It wouldn't change, because `cooperative_status_ids` always remains identical---a single record. Signed-off-by: Carmen Bianca BAKKER --- shift/models/res_partner.py | 2 +- shift/readme/newsfragments/535.bugfix.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 shift/readme/newsfragments/535.bugfix.rst diff --git a/shift/models/res_partner.py b/shift/models/res_partner.py index ca9052faa..5e911122d 100644 --- a/shift/models/res_partner.py +++ b/shift/models/res_partner.py @@ -88,7 +88,7 @@ class ResPartner(models.Model): store=True, ) - @api.depends("cooperative_status_ids") + @api.depends("cooperative_status_ids.can_shop") def _compute_can_shop(self): """ Shopping authorisation may vary on the can_shop status of the diff --git a/shift/readme/newsfragments/535.bugfix.rst b/shift/readme/newsfragments/535.bugfix.rst new file mode 100644 index 000000000..6cacd8344 --- /dev/null +++ b/shift/readme/newsfragments/535.bugfix.rst @@ -0,0 +1,2 @@ +Correctly recompute ``can_shop`` on partner when the value changes in the +``cooperative_status``.