diff --git a/account.py b/account.py index e53c366ef7..e2401ddbf6 100644 --- a/account.py +++ b/account.py @@ -2,6 +2,7 @@ #this repository contains the full copyright notices and license terms. from trytond.model import ModelSQL, fields from trytond.pool import Pool, PoolMeta +from trytond.pyson import Eval __all__ = ['InvoiceLineStockMove', 'InvoiceLine'] @@ -21,7 +22,11 @@ class InvoiceLineStockMove(ModelSQL): class InvoiceLine: __name__ = 'account.invoice.line' stock_moves = fields.Many2Many('account.invoice.line-stock.move', - 'invoice_line', 'stock_move', 'Stock Moves') + 'invoice_line', 'stock_move', 'Stock Moves', + states={ + 'invisible': Eval('type') != 'line', + }, + depends=['type']) @property def moved_quantity(self): diff --git a/view/invoice_line_form.xml b/view/invoice_line_form.xml index 5743cfa823..ab0fb802a1 100644 --- a/view/invoice_line_form.xml +++ b/view/invoice_line_form.xml @@ -3,7 +3,8 @@ this repository contains the full copyright notices and license terms. --> - +