Commit 9737d421 by Yvon Kerdoncuff

really properly control return value of action_validate

parent 1f24de45
Pipeline #3905 canceled with stage
...@@ -417,10 +417,10 @@ class CagetteInventory(models.Model): ...@@ -417,10 +417,10 @@ class CagetteInventory(models.Model):
# Set inventory as 'done' even if some products missed # Set inventory as 'done' even if some products missed
res = api.execute('stock.inventory', 'action_validate', [inv]) res = api.execute('stock.inventory', 'action_validate', [inv])
if res is None: if not res:
done.append('Closed inventory') done.append('Closed inventory')
else: else:
action_validate_issue = "Action validate did not return None." action_validate_issue = "Action validate returned something."
coop_logger.error(action_validate_issue) coop_logger.error(action_validate_issue)
errors.append(action_validate_issue) errors.append(action_validate_issue)
if isinstance(res, dict) and 'name' in res: if isinstance(res, dict) and 'name' in res:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment