Use used property for account receivable

issue6561
review43311002
This commit is contained in:
Sergi Almacellas Abellana
2017-09-28 10:17:12 +02:00
parent dd7f60db0a
commit 6407bfe647
+1 -7
View File
@@ -204,8 +204,6 @@ class Sale(Workflow, ModelSQL, ModelView, TaxableMixin):
'defined for the quotation of sale "%s".'),
'warehouse_required': ('Warehouse must be defined for the '
'quotation of sale "%s".'),
'missing_account_receivable': ('It misses '
'an "Account Receivable" on the party "%s".'),
'delete_cancel': ('Sale "%s" must be cancelled before '
'deletion.'),
})
@@ -755,7 +753,7 @@ class Sale(Workflow, ModelSQL, ModelView, TaxableMixin):
party=self.party,
invoice_address=self.invoice_address,
currency=self.currency,
account=self.party.account_receivable,
account=self.party.account_receivable_used,
)
invoice.on_change_type()
invoice.payment_term = self.payment_term
@@ -768,10 +766,6 @@ class Sale(Workflow, ModelSQL, ModelView, TaxableMixin):
if self.invoice_method == 'manual':
return
if not self.party.account_receivable:
self.raise_user_error('missing_account_receivable',
(self.party.rec_name,))
invoice_lines = []
for line in self.lines:
invoice_lines.append(line.get_invoice_line())