From 65d2c896b01372cb03c3ea4e6c202250c01b032c Mon Sep 17 00:00:00 2001 From: skh Date: Tue, 29 Mar 2011 16:31:35 +0530 Subject: [PATCH] [FIX] Account: Problem for duplicating a record lp bug: https://launchpad.net/bugs/740134 fixed bzr revid: skh@tinyerp.com-20110329110135-yemxfqb4hyyeiljk --- addons/account/invoice.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index dfce8a0682d..e14a41ce448 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -1610,7 +1610,13 @@ class res_partner(osv.osv): 'invoice_ids': fields.one2many('account.invoice.line', 'partner_id', 'Invoices', readonly=True), } - def copy(self, cr, uid, id, default={}, context={}): + def copy(self, cr, uid, id, default=None, context=None): + if default is None: + default = {} + + if context is None: + context = {} + default.update({'invoice_ids' : []}) return super(res_partner, self).copy(cr, uid, id, default, context)