From a4c4c43bd9a7cdb0420ec8acd44518f2134a43d9 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Tue, 19 Apr 2016 08:28:25 +0200 Subject: [PATCH] [FIX] project: make copy overridable in v8 api Without the proper decorator, the method is matched as `cr_ui_context`. This is because the `guess` mechanism expects a name `res_id` instead of `record_id`. For stability reason it is better to add the decorator than modify the signature of the method. Closes #11735 --- addons/project/res_partner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/project/res_partner.py b/addons/project/res_partner.py index dd0c5fe0767..79c58edf824 100644 --- a/addons/project/res_partner.py +++ b/addons/project/res_partner.py @@ -18,7 +18,7 @@ # along with this program. If not, see . # ############################################################################## - +from openerp import api from openerp.osv import fields,osv class res_partner(osv.osv): @@ -36,6 +36,7 @@ class res_partner(osv.osv): 'task_count': fields.function(_task_count, string='# Tasks', type='integer'), } + @api.cr_uid_id_context def copy(self, cr, uid, record_id, default=None, context=None): if default is None: default = {}