On 22/07/15 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 use these states in account_invoice_purchase_relation module [1] that
filters some purchase fields depending on the type of invoice:
_STATES = {
'invisible': If(Bool(Eval('_parent_invoice')),
~Eval('_parent_invoice', {}).get('type')
.in_(['in_invoice', 'in_credit_note']),
~Eval('invoice_type')
.in_(['in_invoice', 'in_credit_note'])),
}
[1]
http://bitbucket.org/zikzakmedia/trytond-account_invoice_purchase_relation
--
Jordi Esteve
Consultor Zikzakmedia SL
[email protected]
Mòbil 679 170 693
Zikzakmedia SL
St. Jaume, 9, baixos, 2a
08720 Vilafranca del Penedès
Tel 93 890 2108