From 587f1f336398742f353a5cdb2e96a618f217fd01 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Thu, 28 Sep 2017 10:16:55 +0200 Subject: [PATCH] Use used property for account payable issue6561 review36481002 --- purchase.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/purchase.py b/purchase.py index a15bb6abf8..f52d5f789b 100644 --- a/purchase.py +++ b/purchase.py @@ -170,8 +170,6 @@ class Purchase(Workflow, ModelSQL, ModelView, TaxableMixin): cls._error_messages.update({ 'warehouse_required': ('A warehouse must be defined for ' 'quotation of purchase "%s".'), - 'missing_account_payable': ('Missing "Account Payable" on ' - 'party "%s".'), 'delete_cancel': ('Purchase "%s" must be cancelled before ' 'deletion.'), }) @@ -692,7 +690,7 @@ class Purchase(Workflow, ModelSQL, ModelView, TaxableMixin): party=self.party, invoice_address=self.invoice_address, currency=self.currency, - account=self.party.account_payable, + account=self.party.account_payable_used, payment_term=self.payment_term, ) @@ -704,10 +702,6 @@ class Purchase(Workflow, ModelSQL, ModelView, TaxableMixin): if self.invoice_method == 'manual': return - if not self.party.account_payable: - self.raise_user_error('missing_account_payable', - error_args=(self.party.rec_name,)) - invoice_lines = [] for line in self.lines: invoice_lines.append(line.get_invoice_line())