From 5174a64ad67ebbb7237247b01aaa7e4b01dc4d22 Mon Sep 17 00:00:00 2001 From: Albert Cervera i Areny Date: Fri, 27 Dec 2019 19:40:46 +0100 Subject: [PATCH] Use account_receivable_used property to obtain the party's account. --- sale.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sale.py b/sale.py index b28fc70..b199af7 100644 --- a/sale.py +++ b/sale.py @@ -239,8 +239,8 @@ class WizardSalePayment(Wizard): if not sale.number: Sale.set_number([sale]) - account = (sale.party.account_receivable - and sale.party.account_receivable.id) + with Transaction().set_context(date=Date.today()): + account = sale.party.account_receivable_used if not account: raise UserError(gettext(