IMP benefit

This commit is contained in:
younes 2025-08-18 15:03:26 +01:00
parent 28a306c0e9
commit 1dc9764bb4
1 changed files with 0 additions and 8 deletions

View File

@ -293,14 +293,6 @@ class FamilyMemberProfile(models.Model):
for order in self:
if order.state not in ['draft']:
raise UserError(_('You cannot delete this record'))
# if order.attachment_ids:
# order.attachment_ids.unlink()
# if order.hobbies_attachment_ids:
# order.hobbies_attachment_ids.unlink()
# if order.diseases_attachment_ids:
# order.diseases_attachment_ids.unlink()
# if order.disabilities_attachment_ids:
# order.disabilities_attachment_ids.unlink()
self.env['ir.attachment'].search([('member_id', 'in', order.id)]).unlink()
if order.hobbies_ids:
order.hobbies_ids.unlink()