Browse Source

[IMP] base_multi_image: Allow to bypass image removal

pull/418/merge
Pedro M. Baeza 9 years ago
parent
commit
1594593e03
  1. 2
      base_multi_image/models/owner.py

2
base_multi_image/models/owner.py

@ -93,6 +93,6 @@ class Owner(models.AbstractModel):
"""Mimic `ondelete="cascade"` for multi images."""
images = self.mapped("image_ids")
result = super(Owner, self).unlink()
if result:
if result and not self.env.context.get('bypass_image_removal'):
images.unlink()
return result
Loading…
Cancel
Save