diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index d06ba70bf02..d8014fbdb02 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -467,14 +467,17 @@ 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: + if date_invoice: + res = {'value':{'date_due': date_invoice}} + else: + res = {'value':{'date_due': time.strftime('%Y-%m-%d')}} + 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] diff --git a/addons/account/company.py b/addons/account/company.py index e961fa563e4..8907f46c868 100644 --- a/addons/account/company.py +++ b/addons/account/company.py @@ -39,10 +39,11 @@ class res_company(osv.osv): _defaults = { 'expects_chart_of_accounts': True, - 'overdue_msg': '''Our records indicate that the following payments are still due. If the amount -has already been paid, please disregard this notice. However, if you have any -queries regarding your account, please contact us. -Thank you in advance. + 'overdue_msg': '''Our records indicate that the payments on you account are still due. Please find details below. + If the amount has already been paid,please disregard this notice. + Otherwise, please forward us the total amount stated below. + If you have any queries regarding your account, + Please contact us.Thank you in advance for your cooperation. ''' }