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