Add depends on Button
issue6919 review40811002
This commit is contained in:
@@ -71,12 +71,15 @@ class Inventory(Workflow, ModelSQL, ModelView):
|
||||
cls._buttons.update({
|
||||
'confirm': {
|
||||
'invisible': Eval('state').in_(['done', 'cancel']),
|
||||
'depends': ['state'],
|
||||
},
|
||||
'cancel': {
|
||||
'invisible': Eval('state').in_(['cancel', 'done']),
|
||||
'depends': ['state'],
|
||||
},
|
||||
'complete_lines': {
|
||||
'readonly': Eval('state') != 'draft',
|
||||
'depends': ['state'],
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -294,19 +294,23 @@ class Move(Workflow, ModelSQL, ModelView):
|
||||
'cancel': {
|
||||
'invisible': ~Eval('state').in_(['draft', 'assigned']),
|
||||
'readonly': Eval('shipment'),
|
||||
'depends': ['state', 'shipment'],
|
||||
},
|
||||
'draft': {
|
||||
'invisible': ~Eval('state').in_(['assigned']),
|
||||
'readonly': Eval('shipment'),
|
||||
'depends': ['state', 'shipment'],
|
||||
},
|
||||
'assign': {
|
||||
'invisible': ~Eval('state').in_(['assigned']),
|
||||
'depends': ['state'],
|
||||
},
|
||||
'do': {
|
||||
'invisible': ~Eval('state').in_(['draft', 'assigned']),
|
||||
'readonly': (Eval('shipment')
|
||||
| (Eval('assignation_required', True)
|
||||
& (Eval('state') == 'draft'))),
|
||||
'depends': ['state', 'assignation_required', 'shipment'],
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -48,9 +48,11 @@ class Period(Workflow, ModelSQL, ModelView):
|
||||
cls._buttons.update({
|
||||
'draft': {
|
||||
'invisible': Eval('state') == 'draft',
|
||||
'depends': ['state'],
|
||||
},
|
||||
'close': {
|
||||
'invisible': Eval('state') == 'closed',
|
||||
'depends': ['state'],
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
+24
@@ -188,15 +188,19 @@ class ShipmentIn(Workflow, ModelSQL, ModelView):
|
||||
cls._buttons.update({
|
||||
'cancel': {
|
||||
'invisible': Eval('state').in_(['cancel', 'done']),
|
||||
'depends': ['state'],
|
||||
},
|
||||
'draft': {
|
||||
'invisible': Eval('state') != 'cancel',
|
||||
'depends': ['state'],
|
||||
},
|
||||
'receive': {
|
||||
'invisible': Eval('state') != 'draft',
|
||||
'depends': ['state'],
|
||||
},
|
||||
'done': {
|
||||
'invisible': Eval('state') != 'received',
|
||||
'depends': ['state'],
|
||||
},
|
||||
})
|
||||
|
||||
@@ -623,22 +627,27 @@ class ShipmentInReturn(Workflow, ModelSQL, ModelView):
|
||||
cls._buttons.update({
|
||||
'cancel': {
|
||||
'invisible': Eval('state').in_(['cancel', 'done']),
|
||||
'depends': ['state'],
|
||||
},
|
||||
'draft': {
|
||||
'invisible': ~Eval('state').in_(['waiting', 'cancel']),
|
||||
'icon': If(Eval('state') == 'cancel', 'tryton-clear',
|
||||
'tryton-go-previous'),
|
||||
'depends': ['state'],
|
||||
},
|
||||
'wait': {
|
||||
'invisible': ~Eval('state').in_(['assigned', 'draft']),
|
||||
'icon': If(Eval('state') == 'assigned',
|
||||
'tryton-go-previous', 'tryton-go-next'),
|
||||
'depends': ['state'],
|
||||
},
|
||||
'done': {
|
||||
'invisible': Eval('state') != 'assigned',
|
||||
'depends': ['state'],
|
||||
},
|
||||
'assign_wizard': {
|
||||
'invisible': Eval('state') != 'waiting',
|
||||
'depends': ['state'],
|
||||
},
|
||||
'assign_try': {},
|
||||
'assign_force': {},
|
||||
@@ -978,11 +987,13 @@ class ShipmentOut(Workflow, ModelSQL, ModelView):
|
||||
cls._buttons.update({
|
||||
'cancel': {
|
||||
'invisible': Eval('state').in_(['cancel', 'done']),
|
||||
'depends': ['state'],
|
||||
},
|
||||
'draft': {
|
||||
'invisible': ~Eval('state').in_(['waiting', 'cancel']),
|
||||
'icon': If(Eval('state') == 'cancel', 'tryton-clear',
|
||||
'tryton-go-previous'),
|
||||
'depends': ['state'],
|
||||
},
|
||||
'wait': {
|
||||
'invisible': ~Eval('state').in_(['assigned', 'waiting',
|
||||
@@ -992,12 +1003,15 @@ class ShipmentOut(Workflow, ModelSQL, ModelView):
|
||||
If(Eval('state') == 'waiting',
|
||||
'tryton-clear',
|
||||
'tryton-go-next')),
|
||||
'depends': ['state'],
|
||||
},
|
||||
'pack': {
|
||||
'invisible': If(Eval('warehouse_storage')
|
||||
== Eval('warehouse_output'),
|
||||
~Eval('state').in_(['assigned', 'waiting']),
|
||||
Eval('state') != 'assigned'),
|
||||
'depends': ['state', 'warehouse_storage',
|
||||
'warehouse_output'],
|
||||
},
|
||||
'done': {
|
||||
'invisible': Eval('state') != 'packed',
|
||||
@@ -1561,15 +1575,19 @@ class ShipmentOutReturn(Workflow, ModelSQL, ModelView):
|
||||
cls._buttons.update({
|
||||
'cancel': {
|
||||
'invisible': Eval('state').in_(['cancel', 'done']),
|
||||
'depends': ['state'],
|
||||
},
|
||||
'draft': {
|
||||
'invisible': Eval('state') != 'cancel',
|
||||
'depends': ['state'],
|
||||
},
|
||||
'receive': {
|
||||
'invisible': Eval('state') != 'draft',
|
||||
'depends': ['state'],
|
||||
},
|
||||
'done': {
|
||||
'invisible': Eval('state') != 'received',
|
||||
'depends': ['state'],
|
||||
},
|
||||
})
|
||||
|
||||
@@ -2076,6 +2094,7 @@ class ShipmentInternal(Workflow, ModelSQL, ModelView):
|
||||
'cancel': {
|
||||
'invisible': Eval('state').in_(
|
||||
['cancel', 'shipped', 'done']),
|
||||
'depends': ['state'],
|
||||
},
|
||||
'draft': {
|
||||
'invisible': ~Eval('state').in_(
|
||||
@@ -2085,6 +2104,7 @@ class ShipmentInternal(Workflow, ModelSQL, ModelView):
|
||||
If(Eval('state') == 'request',
|
||||
'tryton-go-next',
|
||||
'tryton-go-previous')),
|
||||
'depends': ['state'],
|
||||
},
|
||||
'wait': {
|
||||
'invisible': ~Eval('state').in_(['assigned', 'waiting',
|
||||
@@ -2094,19 +2114,23 @@ class ShipmentInternal(Workflow, ModelSQL, ModelView):
|
||||
If(Eval('state') == 'waiting',
|
||||
'tryton-clear',
|
||||
'tryton-go-next')),
|
||||
'depends': ['state'],
|
||||
},
|
||||
'ship': {
|
||||
'invisible': ((Eval('state') != 'assigned') |
|
||||
~Eval('transit_location')),
|
||||
'depends': ['state', 'transit_location'],
|
||||
},
|
||||
'done': {
|
||||
'invisible': If(
|
||||
~Eval('transit_location'),
|
||||
Eval('state') != 'assigned',
|
||||
Eval('state') != 'shipped'),
|
||||
'depends': ['state', 'transit_location'],
|
||||
},
|
||||
'assign_wizard': {
|
||||
'invisible': Eval('state') != 'waiting',
|
||||
'depends': ['state'],
|
||||
},
|
||||
'assign_try': {},
|
||||
'assign_force': {},
|
||||
|
||||
@@ -35,5 +35,4 @@ this repository contains the full copyright notices and license terms. -->
|
||||
</group>
|
||||
<field name="unit_price_required" invisible="1" colspan="4"/>
|
||||
<field name="unit_digits" invisible="1" colspan="4"/>
|
||||
<field name="assignation_required" invisible="1" colspan="4"/>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user