From dbd673a374923e98b84fcf6fb380c7d56fd58a67 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Thu, 28 Sep 2017 10:16:05 +0200 Subject: [PATCH] Use used properties for account payable and receivable issue6561 review39521002 --- statement.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/statement.py b/statement.py index 121a38b804..a40abf65cf 100644 --- a/statement.py +++ b/statement.py @@ -690,9 +690,9 @@ class Line( if self.party: if self.amount: if self.amount > Decimal("0.0"): - self.account = self.party.account_receivable + self.account = self.party.account_receivable_used else: - self.account = self.party.account_payable + self.account = self.party.account_payable_used if self.invoice: if self.party: @@ -707,14 +707,15 @@ class Line( Currency = Pool().get('currency.currency') if self.party: if self.account and self.account not in ( - self.party.account_receivable, self.party.account_payable): + self.party.account_receivable_used, + self.party.account_payable_used): # The user has entered a non-default value, we keep it. pass elif self.amount: if self.amount > Decimal("0.0"): - self.account = self.party.account_receivable + self.account = self.party.account_receivable_used else: - self.account = self.party.account_payable + self.account = self.party.account_payable_used if self.invoice: if self.amount and self.statement and self.statement.journal: invoice = self.invoice