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
1f24de45
Commit
1f24de45
authored
Nov 07, 2024
by
Yvon Kerdoncuff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
properly control return value of action_validate
parent
21bdf00e
Pipeline
#3904
canceled with stage
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
models.py
inventory/models.py
+2
-3
No files found.
inventory/models.py
View file @
1f24de45
...
@@ -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
Tru
e
:
if
res
is
Non
e
:
done
.
append
(
'Closed inventory'
)
done
.
append
(
'Closed inventory'
)
else
:
else
:
action_validate_issue
=
"Action validate did not return
Tru
e."
action_validate_issue
=
"Action validate did not return
Non
e."
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
:
...
@@ -433,7 +433,6 @@ class CagetteInventory(models.Model):
...
@@ -433,7 +433,6 @@ class CagetteInventory(models.Model):
else
:
#well, in that case, just try to print the value returned by res to help debugging...
else
:
#well, in that case, just try to print the value returned by res to help debugging...
coop_logger
.
error
(
res
)
coop_logger
.
error
(
res
)
errors
.
append
(
res
)
errors
.
append
(
res
)
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
)):
coop_logger
.
error
(
"update_stock_with_shelf_inventory_data
%
s"
,
str
(
e
))
coop_logger
.
error
(
"update_stock_with_shelf_inventory_data
%
s"
,
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