From 86900a1f9d89e459b5015fc8d1ddc554634df99c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Lodeiros?= Date: Wed, 16 Nov 2022 09:38:48 +0100 Subject: [PATCH] [IMP]pms: inherited _is_downpayment move to resolve invoice with downpayment folio sale lines --- pms/models/account_move.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pms/models/account_move.py b/pms/models/account_move.py index c490be93a..6eab0114a 100644 --- a/pms/models/account_move.py +++ b/pms/models/account_move.py @@ -400,3 +400,17 @@ class AccountMove(models.Model): "#%s" % anchor if anchor else "", ) return url + + def _is_downpayment(self): + self.ensure_one() + if self.folio_ids: + return ( + self.line_ids.folio_line_ids + and all( + folio_line.is_downpayment + for folio_line in self.line_ids.folio_line_ids + ) + or False + ) + else: + return super(AccountMove, self)._is_downpayment()