Commit ac49ee0c by Yvon Kerdoncuff

fix error handling and debug

parent 7dd9afc6
Pipeline #3902 canceled with stage
......@@ -417,17 +417,22 @@ class CagetteInventory(models.Model):
# Set inventory as 'done' even if some products missed
res = api.execute('stock.inventory', 'action_validate', [inv])
if not res:
action_validate_issue = "Action validate did not return True"
if res is True:
done.append('Closed inventory')
else:
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(
if isinstance(res, dict) and 'name' in res:
coop_logger.error('Action validate wanted to return wizard named %s which is not possible from third-party app.', res['name'])
error.extend([
'Action validate wanted to return wizard named :',
res['name'],
'which is not possible from third-party app.'
)
])
else: #well, in that case, just try to print the value returned by res to help debugging...
coop_logger.error(res)
errors.append(res)
done.append('Closed inventory')
except Exception as 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