From 572e7d08c7e5c9427465bc3ca951a03372c877b1 Mon Sep 17 00:00:00 2001 From: skh Date: Mon, 28 Mar 2011 15:59:12 +0530 Subject: [PATCH 1/5] [FIX] Account: Problem for duplicating a record bzr revid: skh@tinyerp.com-20110328102912-fr1qz4e4hcahxfsh --- addons/account/invoice.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 269a4a0c0f4..21b4170388c 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -1609,7 +1609,11 @@ class res_partner(osv.osv): _columns = { 'invoice_ids': fields.one2many('account.invoice.line', 'partner_id', 'Invoices', readonly=True), } - + + def copy(self, cr, uid, id, default={}, context={}): + default.update({'invoice_ids' : False}) + return super(res_partner, self).copy(cr, uid, id, default, context) + res_partner() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From c5fbe2198f0111db569a00d403bc8f3dd919f4c1 Mon Sep 17 00:00:00 2001 From: skh Date: Mon, 28 Mar 2011 16:20:19 +0530 Subject: [PATCH 2/5] [FIX] Account: Problem for duplicating a record bzr revid: skh@tinyerp.com-20110328105019-0dlsdgg93l0rlje4 --- addons/account/invoice.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 21b4170388c..7f8c06b0d39 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -1610,10 +1610,7 @@ 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={}): - default.update({'invoice_ids' : False}) - return super(res_partner, self).copy(cr, uid, id, default, context) - + res_partner() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From d38f743abbf9edff8243ddc5b7b2ab18b64e0021 Mon Sep 17 00:00:00 2001 From: skh Date: Tue, 29 Mar 2011 15:41:09 +0530 Subject: [PATCH 3/5] [FIX] Account: Problem for duplicating a record bzr revid: skh@tinyerp.com-20110329101109-8nuny0wmrsooroxa --- addons/account/invoice.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 7f8c06b0d39..7a1ff15a2e5 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -1610,6 +1610,9 @@ 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={}): + default.update({'invoice_ids' : False}) + return super(res_partner, self).copy(cr, uid, id, default, context) res_partner() From 994b44db40825a53d1cb04697ec51f221234372c Mon Sep 17 00:00:00 2001 From: skh Date: Tue, 29 Mar 2011 16:10:36 +0530 Subject: [PATCH 4/5] [FIX] Account: Problem for duplicating a record lp bug: https://launchpad.net/bugs/740134 fixed bzr revid: skh@tinyerp.com-20110329104036-2h9eaunt4keitw4n --- addons/account/invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 7a1ff15a2e5..dfce8a0682d 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -1611,7 +1611,7 @@ class res_partner(osv.osv): } def copy(self, cr, uid, id, default={}, context={}): - default.update({'invoice_ids' : False}) + default.update({'invoice_ids' : []}) return super(res_partner, self).copy(cr, uid, id, default, context) res_partner() From 65d2c896b01372cb03c3ea4e6c202250c01b032c Mon Sep 17 00:00:00 2001 From: skh Date: Tue, 29 Mar 2011 16:31:35 +0530 Subject: [PATCH 5/5] [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)