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..bbe3570f13a 100644 --- a/addons/account/company.py +++ b/addons/account/company.py @@ -39,10 +39,10 @@ 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 your 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. + \nThank you in advance for your cooperation. ''' } diff --git a/addons/account/report/account_print_overdue.rml b/addons/account/report/account_print_overdue.rml index 2c2b6f5954d..0b10a0c8be4 100644 --- a/addons/account/report/account_print_overdue.rml +++ b/addons/account/report/account_print_overdue.rml @@ -153,25 +153,26 @@ - Dear Sir/Madam, + [[ not getLines(o) and removeParentNode('para') or 'Dear Sir/Madam,']] + [[ not getLines(o) and removeParentNode('para') or message(o, company) ]] - [[ message(o, company) ]] + [[ getLines(o) and removeParentNode('para') or 'There is nothing due with this customer.']] - Best regards. + [[ not getLines(o) and removeParentNode('para') or 'Best regards.']] - + - Date + Date[[ not getLines(o) and removeParentNode('blockTable') ]] Description @@ -198,7 +199,7 @@
[[repeatIn(getLines(o), 'line') ]] - + [[ formatLang(line['date'],date=True) ]] @@ -219,7 +220,7 @@ [[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]] - [[ time.strftime('%Y-%m-%d') > formatLang((line['date_maturity'])) and formatLang(line['debit'] - line['credit']) ]] [[ company.currency_id.symbol ]] + [[ time.strftime('%Y-%m-%d') > formatLang((line['date_maturity'])) and formatLang(line['debit'] - line['credit']) ]] [[ company.currency_id.symbol ]] [[ line['blocked'] and 'X' or '' ]] @@ -227,7 +228,7 @@
- + @@ -235,7 +236,7 @@ - Sub-Total : + [[ not getLines(o) and removeParentNode('blockTable') or 'Sub-Total :']] [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]] @@ -244,7 +245,7 @@ [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] - [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0)), currency_obj=company.currency_id) ]] + [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]] [[ company.currency_id.symbol ]] @@ -261,10 +262,10 @@ - Balance : + [[ not getLines(o) and removeParentNode('blockTable') or 'Balance :']] - [[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0)), currency_obj=company.currency_id) ]] + [[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.symbol ]] @@ -279,7 +280,7 @@ - Total amount due: [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0)), currency_obj=company.currency_id) ]]. + Total amount due: [[ not getLines(o) and removeParentNode('blockTable') or formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0)), currency_obj=company.currency_id) ]].