diff --git a/base_multi_image/README.rst b/base_multi_image/README.rst index 8e8217106..51952c8a1 100644 --- a/base_multi_image/README.rst +++ b/base_multi_image/README.rst @@ -121,6 +121,7 @@ Contributors * Rafael Blasco * Jairo Llopis * Sodexis +* Dave Lasley Maintainer ---------- diff --git a/base_multi_image/__openerp__.py b/base_multi_image/__openerp__.py index 77159b11f..919593e26 100644 --- a/base_multi_image/__openerp__.py +++ b/base_multi_image/__openerp__.py @@ -9,8 +9,9 @@ "name": "Multiple images base", "summary": "Allow multiple images for database objects", "version": "9.0.1.1.0", - "author": "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "author": "Tecnativa, " "Antiun IngenierĂ­a, S.L., Sodexis, " + "LasLabs, " "Odoo Community Association (OCA)", "license": "AGPL-3", "website": "http://www.antiun.com", diff --git a/base_multi_image/models/owner.py b/base_multi_image/models/owner.py index 1f85bc03c..94b1f53a9 100644 --- a/base_multi_image/models/owner.py +++ b/base_multi_image/models/owner.py @@ -90,9 +90,12 @@ class Owner(models.AbstractModel): @api.multi def unlink(self): - """Mimic `ondelete="cascade"` for multi images.""" + """Mimic `ondelete="cascade"` for multi images. + + Will be skipped if ``env.context['bypass_image_removal']`` == True + """ 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