On 21 Nov 18:29, Jordi Esteve (Zikzakmedia) wrote:
> How can I define a domain that evaluates a reference field?
> 
> For example, if you want to create an action keyword to open the stock moves
> related to a shipment out, the action window could be:
> 
>         <record model="ir.action.act_window" id="act_moves_of_shipment">
>             <field name="name">Moves</field>
>             <field name="res_model">stock.move</field>
>             <field name="domain">[('shipment', '=',
> Eval('active_id'))]</field>
>         </record>
> 
> but this does not work because the shipment field in stock moves is a
> reference field, so they values are like 'shipment.out,3'. PYSON does not
> have any string concatenation operator to join 'shipment.out' with the
> Eval('active_id').
> 
> Maybe there is other way to solve this issue.

You can use a tuple: ('model', id)

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

Attachment: pgpquiABa6KQn.pgp
Description: PGP signature

Reply via email to