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
6a11389e
Commit
6a11389e
authored
Dec 08, 2022
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix reception bug (if product are not configured with indicative_package, and order creation fails)
parent
e180c8f7
Pipeline
#2531
passed with stage
in 2 minutes 0 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
3 deletions
+5
-3
views.py
orders/views.py
+3
-0
models.py
reception/models.py
+1
-1
reception_produits.js
reception/static/js/reception_produits.js
+1
-1
views.py
reception/views.py
+0
-1
No files found.
orders/views.py
View file @
6a11389e
...
...
@@ -97,6 +97,9 @@ def create_orders(request):
supplier_data
[
"date_planned"
],
supplier_data
[
"lines"
]
)
if
'error'
in
res_created
:
res
[
"error"
]
=
res_created
[
'error'
]
return
JsonResponse
(
res
,
status
=
500
)
res
[
"created"
]
.
append
(
res_created
)
except
Exception
as
e
:
...
...
reception/models.py
View file @
6a11389e
...
...
@@ -42,7 +42,7 @@ class CagetteReception(models.Model):
orders
=
api
.
search_read
(
'purchase.order'
,
c
,
f
)
except
Exception
as
e
:
print
(
str
(
e
))
coop_logger
.
error
(
"get_orders :
%
s"
,
str
(
e
))
return
orders
def
get_order_unprocessable_products
(
id_po
):
...
...
reception/static/js/reception_produits.js
View file @
6a11389e
...
...
@@ -2095,6 +2095,7 @@ function create_orders() {
data
:
JSON
.
stringify
(
orders_data
),
success
:
(
result
)
=>
{
po_ids
=
[];
//WARNING : if result.res.created content is rubbishes (as error dump for exemple) couchDB database will be filled with all available orders, with updated quantities equal to original order quantities !!
for
(
let
po
of
result
.
res
.
created
)
{
po_ids
.
push
(
po
.
id_po
);
}
...
...
@@ -2679,7 +2680,6 @@ $(document).ready(function() {
// find order
let
order_id
=
group_ids
[
i
];
let
order
=
result
.
rows
.
find
(
el
=>
el
.
id
==
'order_'
+
order_id
);
order
=
order
.
doc
;
order
.
key
=
parseInt
(
i
)
+
1
;
orders
[
order_id
]
=
order
;
...
...
reception/views.py
View file @
6a11389e
...
...
@@ -46,7 +46,6 @@ def get_list_orders(request):
poids
=
[
int
(
i
)
for
i
in
request
.
GET
.
getlist
(
'poids'
,
[])]
get_order_lines
=
request
.
GET
.
get
(
'get_order_lines'
,
False
)
get_order_lines
=
get_order_lines
==
"true"
ordersOdoo
=
CagetteReception
.
get_orders
(
poids
)
orders
=
[]
for
order
in
ordersOdoo
:
...
...
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