diff --git a/stock_inventory_workflow_policy/__openerp__.py b/stock_inventory_workflow_policy/__openerp__.py index 7aeace2..216e3ac 100644 --- a/stock_inventory_workflow_policy/__openerp__.py +++ b/stock_inventory_workflow_policy/__openerp__.py @@ -4,7 +4,7 @@ # pylint: disable=locally-disabled, manifest-required-author { "name": "Stock Inventory Workflow Policy", - "version": "8.0.1.0.0", + "version": "8.0.1.0.1", "category": "Accounting & Finance", "website": "https://opensynergy-indonesia.com", "author": "OpenSynergy Indonesia", diff --git a/stock_inventory_workflow_policy/models/stock_inventory.py b/stock_inventory_workflow_policy/models/stock_inventory.py index 299a47c..4f34ae3 100644 --- a/stock_inventory_workflow_policy/models/stock_inventory.py +++ b/stock_inventory_workflow_policy/models/stock_inventory.py @@ -14,22 +14,20 @@ class StockInventory(models.Model): ) def _compute_policy(self): for inventory in self: - if self.env.user.id == SUPERUSER_ID: - inventory.validate_ok = inventory.restart_ok = \ - inventory.restart_ok = \ - inventory.start_ok = inventory.cancel_ok = True - continue - if inventory.location_id: location = inventory.location_id for policy in location.\ _get_inventory_adjustment_button_policy_map(): + if self.env.user.id == SUPERUSER_ID: + result = True + else: + result = location.\ + _get_inventory_adjustment_button_policy( + policy[1]) setattr( inventory, policy[0], - location. - _get_inventory_adjustment_button_policy( - policy[1]), + result, ) start_ok = fields.Boolean(