Commit 0225baf2 by Yvon Kerdoncuff

call inventory action_validate instead of action_done which has been renamed…

call inventory action_validate instead of action_done which has been renamed _action_done and add error handler
parent af10b939
Pipeline #3900 canceled with stage
...@@ -416,7 +416,18 @@ class CagetteInventory(models.Model): ...@@ -416,7 +416,18 @@ class CagetteInventory(models.Model):
missed.append({'product': p, 'msg': str(e)}) missed.append({'product': p, 'msg': str(e)})
# Set inventory as 'done' even if some products missed # Set inventory as 'done' even if some products missed
api.execute('stock.inventory', 'action_done', [inv]) res = api.execute('stock.inventory', 'action_validate', [inv])
if not res:
action_validate_issue = "Action validate did not return True"
coop_logger.error(action_validate_issue)
errors.append(action_validate_issue)
if name in res:
coop_logger.error('Action validate returned wizard named %s', res['name'])
error.extend(
'Action validate wanted to return wizard named :',
res['name'],
'which is not possible from third-party app.'
)
done.append('Closed inventory') done.append('Closed inventory')
except Exception as e: except Exception as e:
if not (MARSHALL_ERROR in str(e)): if not (MARSHALL_ERROR in str(e)):
......
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