Add do button on stock move form & list
issue5042 review21471002
This commit is contained in:
1 parent
c911cb0495
commit
8abae7a97d
4 files changed
+16
No files matched your search
@@ -1,3 +1,4 @@
|
||||
* Add do button on stock move form & list
|
||||
* Add warehouse address on internal shipment
|
||||
|
||||
Version 3.8.0 - 2015-11-02
|
||||
|
||||
@@ -238,6 +238,9 @@ class Move(Workflow, ModelSQL, ModelView):
|
||||
unit_price_required = fields.Function(
|
||||
fields.Boolean('Unit Price Required'),
|
||||
'on_change_with_unit_price_required')
|
||||
assignation_required = fields.Function(
|
||||
fields.Boolean('Assignation Required'),
|
||||
'on_change_with_assignation_required')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
@@ -299,6 +302,9 @@ class Move(Workflow, ModelSQL, ModelView):
|
||||
},
|
||||
'do': {
|
||||
'invisible': ~Eval('state').in_(['draft', 'assigned']),
|
||||
'readonly': (Eval('shipment')
|
||||
| (Eval('assignation_required', True)
|
||||
& (Eval('state') == 'draft'))),
|
||||
},
|
||||
})
|
||||
|
||||
@@ -461,6 +467,11 @@ class Move(Workflow, ModelSQL, ModelView):
|
||||
return True
|
||||
return False
|
||||
|
||||
@fields.depends('from_location')
|
||||
def on_change_with_assignation_required(self, name=None):
|
||||
if self.from_location:
|
||||
return self.from_location.type == 'storage'
|
||||
|
||||
@staticmethod
|
||||
def _get_shipment():
|
||||
'Return list of Model names for shipment Reference'
|
||||
|
||||
@@ -30,7 +30,9 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<group col="20" colspan="2" id="buttons">
|
||||
<button name="cancel" string="Cancel" icon="tryton-cancel"/>
|
||||
<button name="draft" string="Reset to Draft" icon="tryton-clear"/>
|
||||
<button name="do" string="Do" icon="tryton-go-next"/>
|
||||
</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>
|
||||
@@ -13,5 +13,7 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="state"/>
|
||||
<button name="cancel" string="Cancel"/>
|
||||
<button name="draft" string="Reset to Draft"/>
|
||||
<button name="do" string="Do"/>
|
||||
<field name="unit_digits" tree_invisible="1"/>
|
||||
<field name="assignation_required" tree_invisible="1"/>
|
||||
</tree>
|
||||
Reference in new issue
Block a user