[IMP] account : Improve overdue message and set due date on invoice or current date accordingly.

bzr revid: mdi@tinyerp.com-20120504063559-bl57pxfysn4850cd
This commit is contained in:
Divyesh Makwana (Open ERP) 2012-05-04 12:05:59 +05:30
parent d8c903365d
commit 8f99388391
2 changed files with 12 additions and 8 deletions

View File

@ -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]

View File

@ -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.
'''
}