[IMP]pms: inherited _is_downpayment move to resolve invoice with downpayment folio sale lines

This commit is contained in:
Darío Lodeiros
2022-11-16 09:38:48 +01:00
parent ff93534112
commit 86900a1f9d

View File

@@ -400,3 +400,17 @@ class AccountMove(models.Model):
"#%s" % anchor if anchor else "", "#%s" % anchor if anchor else "",
) )
return url 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()