diff --git a/addons/account/invoice.py b/addons/account/invoice.py index e550c33729c..87245488168 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -257,9 +257,15 @@ class account_invoice(osv.osv): res.append(line['id']) return res - def copy(self, cr, uid, id, default=None, context={}): - if not default: default = {} - default.update({'state':'draft', 'number':False, 'move_id':False, 'date_invoice': time.strftime('%Y-%m-%d'), 'date_due':False}) + def copy(self, cr, uid, id, default=None, context=None): + if default is None: + default = {} + default = default.copy() + default.update({'state':'draft', 'number':False, 'move_id':False,}) + if 'date_invoice' not in default: + default['date_invoice'] = time.strftime('%Y-%m-%d') + if 'date_due' not in default: + default['date_due'] = False return super(account_invoice, self).copy(cr, uid, id, default, context) def test_paid(self, cr, uid, ids, *args):