Hide stock moves when line type is not line
issue4300 review10601002
This commit is contained in:
1 parent
0fb1545707
commit
017b5f9cb6
2 files changed
+8
-2
No files matched your search
+6
-1
@@ -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):
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="/form/notebook/page[@id='general']" position="after">
|
||||
<page string="Stock" id="stock">
|
||||
<page string="Stock" id="stock"
|
||||
states="{'invisible': Eval('type') != 'line'}">
|
||||
<field name="stock_moves" colspan="4"/>
|
||||
</page>
|
||||
</xpath>
|
||||
|
||||
Reference in new issue
Block a user