Skip to content

Commit

Permalink
add kind on write condition
Browse files Browse the repository at this point in the history
  • Loading branch information
emjay0921 authored and kneckinator committed Sep 18, 2024
1 parent 50f8daf commit 350284c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spp_farmer_registry_base/models/farm.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def update_group_head_member(self, new_group_head):
def write(self, vals):
farm = super().write(vals)
for rec in self:
if rec.is_group:
if rec.is_group and rec.kind == self.env.ref("spp_farmer_registry_base.kind_farm").id:
head_member = rec.get_group_head_member()
if not head_member:
raise ValidationError(_("Farm must have a head member."))
Expand Down

0 comments on commit 350284c

Please sign in to comment.