mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[IMP] rma_sale: rollback sale refund on deleted invoice
TT44043
This commit is contained in:
@@ -22,3 +22,9 @@ class AccountMove(models.Model):
|
||||
if rma.sale_line_id:
|
||||
rma._link_refund_with_reception_move()
|
||||
return super().button_draft()
|
||||
|
||||
def unlink(self):
|
||||
"""If the invoice is removed, rollback the quantities correction"""
|
||||
for rma in self.invoice_line_ids.rma_id.filtered("sale_line_id"):
|
||||
rma._unlink_refund_with_reception_move()
|
||||
return super().unlink()
|
||||
|
||||
Reference in New Issue
Block a user