diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 5e693af94fd..5350bb1bc64 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -561,10 +561,14 @@ class account_invoice(osv.osv): def onchange_payment_term_date_invoice(self, cr, uid, ids, payment_term_id, date_invoice): res = {} + if isinstance(ids, (int, long)): + ids = [ids] if not date_invoice: date_invoice = time.strftime('%Y-%m-%d') if not payment_term_id: - return {'value':{'date_due': date_invoice}} #To make sure the invoice has a due date when no payment term + inv = self.browse(cr, uid, ids[0]) + #To make sure the invoice due date should contain due date which is entered by user when there is no payment term defined + return {'value':{'date_due': inv.date_due and inv.date_due or 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/edi/invoice.py b/addons/account/edi/invoice.py index 91913920bac..2c2a754de3b 100644 --- a/addons/account/edi/invoice.py +++ b/addons/account/edi/invoice.py @@ -266,7 +266,7 @@ class account_invoice(osv.osv, EDIMixin): params = { "cmd": "_xclick", "business": inv.company_id.paypal_account, - "item_name": inv.company_id.name + " Invoice " + inv.number, + "item_name": "%s Invoice %s" % (inv.company_id.name, inv.number or ''), "invoice": inv.number, "amount": inv.residual, "currency_code": inv.currency_id.name, diff --git a/addons/account/wizard/account_report_aged_partner_balance_view.xml b/addons/account/wizard/account_report_aged_partner_balance_view.xml index 77ebf02570f..be1d710c09d 100644 --- a/addons/account/wizard/account_report_aged_partner_balance_view.xml +++ b/addons/account/wizard/account_report_aged_partner_balance_view.xml @@ -11,7 +11,8 @@