[FIX] project: add misssing decorator on onchange method

The onchange should have the signature with `ids` instead of `id` for a proper
guess.
Without this, the method can not be overriden with an api.multi (the return
result is a list of dictionnary which is not understood by the ORM as a proper
return format).

Fixes #12856
This commit is contained in:
Martin Trigaux 2016-07-20 17:19:58 +02:00
parent d7f1270050
commit 8b83119fad
No known key found for this signature in database
GPG Key ID: 7B0E288E7C0F83A7
1 changed files with 2 additions and 1 deletions

View File

@ -23,7 +23,7 @@ from datetime import datetime, date
from lxml import etree
import time
from openerp import SUPERUSER_ID
from openerp import SUPERUSER_ID, api
from openerp import tools
from openerp.addons.resource.faces import task as Task
from openerp.osv import fields, osv
@ -673,6 +673,7 @@ class task(osv.osv):
def onchange_planned(self, cr, uid, ids, planned=0.0, effective=0.0):
return {'value': {'remaining_hours': planned - effective}}
@api.cr_uid_ids_context
def onchange_project(self, cr, uid, id, project_id, context=None):
if project_id:
project = self.pool.get('project.project').browse(cr, uid, project_id, context=context)