Skip to content

Commit

Permalink
[IMP] switch to api.ondelete for unlink
Browse files Browse the repository at this point in the history
  • Loading branch information
AungKoKoLin1997 committed Sep 15, 2023
1 parent cc4bc77 commit 4ba122d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions purchase_invoice_plan/models/purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ def _get_plan_qty(self, order_line, percent):
plan_qty = order_line.product_qty * (percent / 100)
return plan_qty

def unlink(self):
@api.ondelete(at_uninstall=False)
def _unlink_except_no_edit(self):
lines = self.filtered("no_edit")
if lines:
installments = [str(x) for x in lines.mapped("installment")]
Expand All @@ -324,4 +325,3 @@ def unlink(self):
)
% ", ".join(installments)
)
return super().unlink()

0 comments on commit 4ba122d

Please sign in to comment.