Skip to content

Commit

Permalink
[FIX] shift: Recompute partner's can_shop when dependencies change
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
carmenbianca committed Oct 29, 2024
1 parent 227bca5 commit 54c7269
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion shift/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions shift/readme/newsfragments/535.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Correctly recompute ``can_shop`` on partner when the value changes in the
``cooperative_status``.

0 comments on commit 54c7269

Please sign in to comment.