Missing invoice_type in depends of InvoiceLine.account and PEP8

This commit is contained in:
Cédric Krier
2012-10-10 15:44:33 +02:00
parent 515f5fbbd7
commit cdba4e10dc
+4 -3
View File
@@ -1330,9 +1330,10 @@ class InvoiceLine(ModelSQL, ModelView):
'out_credit_note']),
('kind', '=', 'revenue'),
('kind', '=', 'expense')),
If(Eval('invoice_type').in_(['out_invoice', 'out_credit_note']),
If(Eval('invoice_type').in_(['out_invoice',
'out_credit_note']),
('kind', '=', 'revenue'),
('kind', '=', 'expense')))
('kind', '=', 'expense')))
],
on_change=['account', 'product', '_parent_invoice.party',
'_parent_invoice.type'],
@@ -1340,7 +1341,7 @@ class InvoiceLine(ModelSQL, ModelView):
'invisible': Eval('type') != 'line',
'required': Eval('type') == 'line',
},
depends=['type'])
depends=['type', 'invoice_type'])
unit_price = fields.Numeric('Unit Price', digits=(16, 4),
states={
'invisible': Eval('type') != 'line',