diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index d06ba70bf02..d0f7579a86e 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -467,15 +467,12 @@ class account_invoice(osv.osv): return result def onchange_payment_term_date_invoice(self, cr, uid, ids, payment_term_id, date_invoice): - if not payment_term_id: - return {} res = {} - pt_obj = self.pool.get('account.payment.term') + if not payment_term_id: + return res if not date_invoice: date_invoice = time.strftime('%Y-%m-%d') - - pterm_list = pt_obj.compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice) - + pterm_list = self.pool.get('account.payment.term').compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice) if pterm_list: pterm_list = [line[0] for line in pterm_list] pterm_list.sort() diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 462e7d56937..5a9e808bf2d 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -53,7 +53,7 @@
-