Skip to content

Commit

Permalink
T2220 FIX household members when no sponsored child is found
Browse files Browse the repository at this point in the history
  • Loading branch information
ecino committed Mar 3, 2025
1 parent c112d8d commit 7619120
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion child_compassion/models/child_compassion.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,9 @@ def child_departed(self):

def _get_last_pictures(self):
self.ensure_one()

pictures_obj = self.env["compassion.child.pictures"]
if not self.image_url:
return pictures_obj
existing = self.pictures_ids
pictures = pictures_obj.create(
{"child_id": self.id, "image_url": self.image_url}
Expand Down
2 changes: 1 addition & 1 deletion child_compassion/models/household.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class HouseholdMembers(models.Model):

beneficiary_local_id = fields.Char()
child_id = fields.Many2one(
"compassion.child", "Child", ondelete="cascade", readonly=False
"compassion.child", "Child", ondelete="set null", readonly=False
)
household_id = fields.Many2one(
"compassion.household",
Expand Down

0 comments on commit 7619120

Please sign in to comment.