We want to change this by a new behavior:
- adding by default a function field rec_name the return the value from
name_get
- allow to use in the call of read, some fields like this party.name
where party is a many2one
- change the client to add in the read call the field "many2one".rec_name
- and finaly, removing the get function on many2one so it will no more
return a tuple (id, name)
To acheive this we had some issues that we must fix:
- the name_get and name_search function doesn't have a signature for a
function field.
- the name_get and name_search have not a good name, we would prefere
get_rec_name and search_rec_name
So those changes will force to fix all the modules but I think it will
clarify the situation.
What do you think?
--
Cédric Krier
B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email: cedric...@b2ck.com
Jabber: cedric...@b2ck.com
Website: http://www.b2ck.com/
There will be a new field on every Models:
rec_name = fields.Function('get_rec_name', type='char', string='Name',
fnct_search='search_rec_name')
the name_get function:
def name_get(self, cursor, user, ids, context=None):
will become:
def get_rec_name(self, cursor, user, ids, name, arg, context=None):
and the name_search function:
def name_search(self, cursor, user, name='', args=None, operator='ilike',
context=None, limit=None):
will become
def search_rec_name(self, cursor, user, name, args, context):
This is the external API that will change.
It is pushed.
So please test it as it is a big change and report issue to
http://bugs.tryton.org/