[IMP] mrp: remove linked attachement on removing mrp document

Steps to Reproduce Bug:

- Add Attachment on Bom Line
- Delete Attachment

Bug:
- Attachment is still present on `ir.attachment`

With this commit, we are removing linked attachment on deleting `mrp.document`

closes odoo/odoo#74595

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
This commit is contained in:
Swapnesh Shah
2021-08-04 18:17:56 +00:00
committed by Swapnesh
parent 7eeb65e41f
commit 9c9b7d7c37
+4
View File
@@ -22,3 +22,7 @@ class MrpDocument(models.Model):
('1', 'Low'),
('2', 'High'),
('3', 'Very High')], string="Priority", help='Gives the sequence order when displaying a list of MRP documents.')
def unlink(self):
self.mapped('ir_attachment_id').unlink()
return super(MrpDocument, self).unlink()