Skip to content

Commit

Permalink
[8.0.1.0.1] stock_inventory_workflow_policy
Browse files Browse the repository at this point in the history
  • Loading branch information
andhit-r committed Nov 11, 2018
1 parent 2080e95 commit a5ec8db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion stock_inventory_workflow_policy/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 7 additions & 9 deletions stock_inventory_workflow_policy/models/stock_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit a5ec8db

Please sign in to comment.