[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
This commit is contained in:
parent
d6563f91b9
commit
a4c4c43bd9
|
@ -18,7 +18,7 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
from openerp import api
|
||||||
from openerp.osv import fields,osv
|
from openerp.osv import fields,osv
|
||||||
|
|
||||||
class res_partner(osv.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'),
|
'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):
|
def copy(self, cr, uid, record_id, default=None, context=None):
|
||||||
if default is None:
|
if default is None:
|
||||||
default = {}
|
default = {}
|
||||||
|
|
Loading…
Reference in New Issue