[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:
Holger Brunn
2016-05-02 12:08:06 +02:00
committed by Martin Trigaux
parent d6563f91b9
commit a4c4c43bd9
+2 -1
View File
@@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
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 = {}