diff --git a/sale.py b/sale.py index 7e36409..3c63fab 100644 --- a/sale.py +++ b/sale.py @@ -84,7 +84,12 @@ class Sale(metaclass=PoolMeta): if self.payment_type and self.payment_type.kind == 'both': return self.payment_type - if invoice.untaxed_amount >= ZERO: + if hasattr(invoice, 'untaxed_amount'): + untaxed_amount = invoice.untaxed_amount + else: + untaxed_amount = sum(l.on_change_with_amount() for l in invoice.lines) + + if untaxed_amount >= ZERO: kind = 'receivable' name = 'customer_payment_type' else: