Updating form_relate title

17 views
Skip to first unread message

Maxime Richez

unread,
May 22, 2018, 9:40:34 AM5/22/18
to tryton-dev
Hi,

In some form_relate, i would add specific informations in the title (default_uom for instance). The suggestion is to update rec_name which is displayed after the form_relate action name in the title. But, i don't want this rec_name in all my forms...
So another suggestion is to update this rec_name following the context...
Indeed, but how? It seems context used by form_relate to get_rec_name with RPCExecute use a default context that can't be updated

Here's the context used when getting rec_name with RPCExecute:

{"params":[[1],["rec_name"],{"language":"en","employee.rec_name":"Maxime Richez","locale":{"date":"%m/%d/%Y","thousands_sep":",","grouping":[3,3,0],"decimal_point":"."},"language_direction":"ltr","company.rec_name":"Saluc","groups":[5,6,18,1,15,2,3,4,11,10,12,14,13,16,17,8,7,9],"employee":1,"company":1}],"id":36,"method":"model.product.product.read"}

Context manually added in ir.action.act_window (XML) is in the context after the get_rec_name call when displaying the form.

Could we have some more details in the default context like "origin_action"?
Or updating ir.action to pass context here :
http://hg.tryton.org/tryton/file/default/tryton/action/main.py#l91

Thanks for help!


Cédric Krier

unread,
May 22, 2018, 9:55:05 AM5/22/18
to tryton-dev
I think the RPC call to get the rec_name should use the action_ctx.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Maxime Richez

unread,
May 23, 2018, 4:42:15 AM5/23/18
to tryton-dev

> I think the RPC call to get the rec_name should use the action_ctx.
>

Added an issue: https://bugs.tryton.org/issue7454

Reply all
Reply to author
Forward
0 new messages