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
58fea6af
Commit
58fea6af
authored
Aug 23, 2022
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error if inventory custom list products has no shelf
parent
aa44fc84
Pipeline
#2350
passed with stage
in 1 minute 27 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
+4
-1
models.py
inventory/models.py
+4
-1
No files found.
inventory/models.py
View file @
58fea6af
...
@@ -90,16 +90,19 @@ class CagetteInventory(models.Model):
...
@@ -90,16 +90,19 @@ class CagetteInventory(models.Model):
p
[
k
]
=
''
p
[
k
]
=
''
# Get shelf sortorder
# Get shelf sortorder
if
p
[
'shelf_id'
]
is
not
False
:
if
p
[
'shelf_id'
]
is
not
False
and
len
(
p
[
'shelf_id'
])
>
0
:
c
=
[[
'id'
,
'='
,
p
[
'shelf_id'
][
0
]]]
c
=
[[
'id'
,
'='
,
p
[
'shelf_id'
][
0
]]]
f
=
[
'id'
,
'sort_order'
]
f
=
[
'id'
,
'sort_order'
]
res_sortorder
=
api
.
search_read
(
'product.shelfs'
,
c
,
f
)
res_sortorder
=
api
.
search_read
(
'product.shelfs'
,
c
,
f
)
if
res_sortorder
:
if
res_sortorder
:
p
[
'shelf_sortorder'
]
=
res_sortorder
[
0
][
'sort_order'
]
p
[
'shelf_sortorder'
]
=
res_sortorder
[
0
][
'sort_order'
]
else
:
p
[
'shelf_sortorder'
]
=
''
res
[
'data'
]
=
pdts
res
[
'data'
]
=
pdts
except
Exception
as
e
:
except
Exception
as
e
:
coop_logger
.
error
(
"get_custom_list_products -> Erreur lors de la récupération des produits :
%
s"
,
str
(
e
))
res
[
'error'
]
=
"Erreur lors de la récupération des produits ("
+
str
(
e
)
+
")"
res
[
'error'
]
=
"Erreur lors de la récupération des produits ("
+
str
(
e
)
+
")"
return
res
return
res
...
...
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