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
bc64ef6d
Commit
bc64ef6d
authored
Jul 16, 2021
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctifs reception_index.js suite erreur affichage bouton 'commandes groupées'
parent
b83db634
Pipeline
#1228
passed with stage
in 1 minute 25 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
13 deletions
+22
-13
reception_index.js
reception/static/js/reception_index.js
+6
-4
views.py
reception/views.py
+16
-9
No files found.
reception/static/js/reception_index.js
View file @
bc64ef6d
...
@@ -287,7 +287,7 @@ function group_action() {
...
@@ -287,7 +287,7 @@ function group_action() {
function
display_grouped_orders
()
{
function
display_grouped_orders
()
{
if
(
table_orders
!==
null
)
{
if
(
table_orders
!==
null
)
{
var
display_something
=
tru
e
;
var
display_something
=
fals
e
;
$
(
'#groups_items'
).
empty
();
$
(
'#groups_items'
).
empty
();
let
groups_display_content
=
"<ul>"
;
let
groups_display_content
=
"<ul>"
;
...
@@ -310,8 +310,10 @@ function display_grouped_orders() {
...
@@ -310,8 +310,10 @@ function display_grouped_orders() {
}
}
}
}
}
}
if
(
group_orders
.
length
>
0
)
{
if
(
group_orders
.
length
>
0
)
{
// Display group
// Display group
display_something
=
true
;
document
.
getElementById
(
"container_groups"
).
hidden
=
false
;
document
.
getElementById
(
"container_groups"
).
hidden
=
false
;
let
group_row
=
`<li class="group_line"> Commandes de `
;
let
group_row
=
`<li class="group_line"> Commandes de `
;
...
@@ -335,8 +337,6 @@ function display_grouped_orders() {
...
@@ -335,8 +337,6 @@ function display_grouped_orders() {
group_row
+=
"</li>"
;
group_row
+=
"</li>"
;
groups_display_content
+=
group_row
;
groups_display_content
+=
group_row
;
}
else
{
display_something
=
false
;
// occured making test form local django and preprod (couchdb, odoo)
}
}
}
}
if
(
display_something
===
true
)
{
if
(
display_something
===
true
)
{
...
@@ -354,7 +354,9 @@ function display_orders_table() {
...
@@ -354,7 +354,9 @@ function display_orders_table() {
table_orders
.
clear
().
destroy
();
table_orders
.
clear
().
destroy
();
$
(
'#orders'
).
empty
();
$
(
'#orders'
).
empty
();
}
}
for
(
let
j
in
orders
)
{
console
.
log
(
orders
[
j
].
id
)
}
table_orders
=
$
(
'#orders'
).
DataTable
({
table_orders
=
$
(
'#orders'
).
DataTable
({
data
:
orders
,
data
:
orders
,
columns
:[
columns
:[
...
...
reception/views.py
View file @
bc64ef6d
...
@@ -305,6 +305,8 @@ def save_error_report(request):
...
@@ -305,6 +305,8 @@ def save_error_report(request):
}
}
data
[
'orders'
]
.
append
(
group_order
)
data
[
'orders'
]
.
append
(
group_order
)
else
:
coop_logger
.
info
(
"data['orders'] is a single PO (not inside group)"
)
except
Exception
as
e2
:
except
Exception
as
e2
:
coop_logger
.
error
(
"Save reception report : Error while create group_order
%
s"
,
str
(
e2
))
coop_logger
.
error
(
"Save reception report : Error while create group_order
%
s"
,
str
(
e2
))
...
@@ -457,6 +459,8 @@ def save_error_report(request):
...
@@ -457,6 +459,8 @@ def save_error_report(request):
error_total_abs
+=
abs
(
item
[
'error_line'
])
error_total_abs
+=
abs
(
item
[
'error_line'
])
data_full
.
append
(
item
)
data_full
.
append
(
item
)
else
:
coop_logger
.
info
(
"Save reception error doc : no 'updated_products' in order (
%
s)"
,
str
(
order
))
except
Exception
as
e5
:
except
Exception
as
e5
:
coop_logger
.
error
(
"Save reception report : Error while updating products
%
s"
,
str
(
e5
))
coop_logger
.
error
(
"Save reception report : Error while updating products
%
s"
,
str
(
e5
))
# no updated products, do nothing
# no updated products, do nothing
...
@@ -592,8 +596,11 @@ def save_error_report(request):
...
@@ -592,8 +596,11 @@ def save_error_report(request):
else
:
else
:
m
=
CagetteReception
(
order
[
'id'
])
m
=
CagetteReception
(
order
[
'id'
])
m
.
attach_file
(
fileName
)
m
.
attach_file
(
fileName
)
coop_logger
.
info
(
"
%
s attached to order id
%
s"
,
fileName
,
str
(
order
[
'id'
]))
except
Exception
as
e8
:
except
Exception
as
e8
:
coop_logger
.
error
(
"PO save report Error while saving file
%
s (
%
s)"
,
fileName
,
str
(
e8
))
coop_logger
.
error
(
"PO save report Error while saving file
%
s (
%
s)"
,
fileName
,
str
(
e8
))
else
:
coop_logger
.
error
(
"Save reception error report : unknown state
%
s (
%
s) "
,
str
(
data
[
'update_type'
]),
str
(
data
))
else
:
else
:
coop_logger
.
error
(
"Cant find 'orders' in data (
%
s)"
,
str
(
data
))
coop_logger
.
error
(
"Cant find 'orders' in data (
%
s)"
,
str
(
data
))
else
:
else
:
...
@@ -650,28 +657,28 @@ def send_mail_no_barcode(request):
...
@@ -650,28 +657,28 @@ def send_mail_no_barcode(request):
if
request
.
method
==
'POST'
:
if
request
.
method
==
'POST'
:
data
=
None
data
=
None
try
:
try
:
myJson
=
request
.
body
myJson
=
request
.
body
data
=
json
.
loads
(
myJson
.
decode
())
data
=
json
.
loads
(
myJson
.
decode
())
data_partner
=
CagetteReception
.
get_mail_create_po
(
int
(
data
[
'order'
][
'id'
]))
data_partner
=
CagetteReception
.
get_mail_create_po
(
int
(
data
[
'order'
][
'id'
]))
msg
=
settings
.
NO_BARCODE_MAIL_MSG
msg
=
settings
.
NO_BARCODE_MAIL_MSG
for
barcode
in
data
[
"no_barcode_list"
]:
for
barcode
in
data
[
"no_barcode_list"
]:
msg
=
msg
+
' -'
+
str
(
barcode
[
0
])
+
'---'
+
str
(
barcode
[
1
])
+
'
\n
'
msg
=
msg
+
' -'
+
str
(
barcode
[
0
])
+
'---'
+
str
(
barcode
[
1
])
+
'
\n
'
send_mail
(
settings
.
NO_BARCODE_MAIL_SUBJECT
.
format
(
data
[
'order'
][
'name'
]),
send_mail
(
settings
.
NO_BARCODE_MAIL_SUBJECT
.
format
(
data
[
'order'
][
'name'
]),
msg
.
format
(
data_partner
[
0
][
'display_name'
],
data
[
'order'
][
'name'
],
data
[
'order'
][
'date_order'
],
data
[
'order'
][
'partner'
]),
msg
.
format
(
data_partner
[
0
][
'display_name'
],
data
[
'order'
][
'name'
],
data
[
'order'
][
'date_order'
],
data
[
'order'
][
'partner'
]),
settings
.
DEFAULT_FROM_EMAIL
,
settings
.
DEFAULT_FROM_EMAIL
,
[
data_partner
[
0
][
'email'
]],
[
data_partner
[
0
][
'email'
]],
fail_silently
=
False
,)
fail_silently
=
False
,)
except
Exception
as
e1
:
except
Exception
as
e1
:
coop_logger
.
error
(
"Send_mail_no_barcode : Unable to load data
%
s (
%
s)"
,
str
(
e1
),
str
(
myJson
))
coop_logger
.
error
(
"Send_mail_no_barcode : Unable to load data
%
s (
%
s)"
,
str
(
e1
),
str
(
myJson
))
print
(
str
(
e1
)
+
'
\n
'
+
str
(
myJson
))
print
(
str
(
e1
)
+
'
\n
'
+
str
(
myJson
))
return
JsonResponse
(
"ok"
,
safe
=
False
)
return
JsonResponse
(
"ok"
,
safe
=
False
)
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