Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
third-party
Commits
ac49ee0c
Commit
ac49ee0c
authored
Nov 07, 2024
by
Yvon Kerdoncuff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix error handling and debug
parent
7dd9afc6
Pipeline
#3902
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
models.py
inventory/models.py
+11
-6
No files found.
inventory/models.py
View file @
ac49ee0c
...
...
@@ -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
)):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment