On 2015-07-22 12:37, Sergi Almacellas Abellana wrote:
> El 22/07/15 a les 11:55, Cédric Krier ha escrit:
> >On 2015-07-22 10:32, Sergi Almacellas Abellana wrote:
> >>>Hi,
> >>>
> >>>I want to add some fields on invoice_lines_tree, that are only relevant for
> >>>supplier invoices (and supplier credit notes), so I added the following
> >>>states on the field:
> >>>
> >>> {
> >>> 'invisible': ~Eval('context', {}).get('type','').in_(
> >>>['in_invoice','in_credit_note']),
> >>> }
> >>>
> >>>But this fields are showin also on customer invoices.
> >>>
> >>>What I am doing anything wrong?
> >>>
> >>>Have anyone faced the same problem? There is some way to achieve what I
> >>>want?
> >I don't think the act_window context is passed to the one2many.
> >Anyway, using context is probably a bad idea but instead use the
> >_parent_invoice.type or defines two different views.
>
> Tested with this definition and it doesn't work also.
>
> BTW i tested on the form view and it works correctly (with both definitions)
> but not on tree view.
What do you mean by it doesn't work?
Normally, if a field is invisible on a list view, the cell will be
empty. Do you see values instead?
--
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/