On 2016-02-02 01:16, Markus Bala wrote:
> Hi All,
> 
> I had inherit 'stock.location', and add a new boolean field  called 
> 'staging'.
> 
> I try to change the original 'storage.location' field as below:
>     storage_location = fields.Many2One(
>         "stock.location", "Storage", states={
>             'invisible': Eval('type') != 'warehouse',
>             'readonly': ~Eval('active'),
>             'required': Eval('type') == 'warehouse',
>         },
>         domain=[
>             ('type', 'in', ['storage', 'view']),*('staging','=', False),*
>             ['OR',
>                 ('parent', 'child_of', [Eval('id')]),
>                 ('parent', '=', None)]],
>         depends=['type', 'active', 'id'])
> 
> At the domain, I add ('staging','=',False). 
> When I checked the result, seem like it do not override the field?

It breaks compatibility to completely replace a field. You have to
customize the field in the __setup__ method.

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

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/20160202102903.GS20880%40tetsuo.

Reply via email to