diff --git a/CHANGELOG b/CHANGELOG index 559446d054..5c2dd7cea1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/move.py b/move.py index db806e78e0..503b8ad79d 100644 --- a/move.py +++ b/move.py @@ -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' diff --git a/view/move_form.xml b/view/move_form.xml index 4b95808bb3..a06955651e 100644 --- a/view/move_form.xml +++ b/view/move_form.xml @@ -30,7 +30,9 @@ this repository contains the full copyright notices and license terms. -->