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
7d950b93
Commit
7d950b93
authored
Nov 03, 2022
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve user experience after click 'print product labels'
parent
6417e7e9
Pipeline
#2483
passed with stage
in 1 minute 24 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
models.py
products/models.py
+2
-0
reception_produits.js
reception/static/js/reception_produits.js
+13
-2
No files found.
products/models.py
View file @
7d950b93
...
...
@@ -91,6 +91,8 @@ class CagetteProduct(models.Model):
v
=
round
(
float
(
price
)
/
float
(
product
[
'weight_net'
]),
2
)
if
k
==
'price_volume'
and
len
(
v
)
>
0
and
len
(
price
)
>
0
and
float
(
price
)
>
0
:
v
=
round
(
float
(
price
)
/
float
(
product
[
'volume'
]),
2
)
if
directory
!=
"/product_labels/"
or
(
directory
==
"/product_labels/"
and
k
!=
"meal_voucher_ok"
):
# add parameter to text unless it's for a product label and parameter is meal_voucher_ok
txt
+=
k
+
'='
+
str
(
v
)
.
strip
()
+
"
\r\n
"
if
not
(
nb
is
None
)
and
len
(
nb
)
>
0
:
txt
+=
'nb_impression='
+
str
(
nb
)
+
"
\r\n
"
...
...
reception/static/js/reception_produits.js
View file @
7d950b93
...
...
@@ -1484,8 +1484,19 @@ function print_product_labels() {
try
{
if
(
is_time_to
(
'print_pdt_labels'
,
10000
))
{
$
.
ajax
(
"../../orders/print_product_labels?oids="
+
group_ids
.
join
(
','
))
.
done
(
function
()
{
alert
(
'Impression des étiquettes à coller sur les articles lancée.'
);
.
done
(
function
(
data
)
{
let
success
=
false
;
if
(
typeof
data
.
res
!==
"undefined"
)
{
if
(
typeof
data
.
res
.
error
===
"undefined"
)
{
success
=
true
;
}
}
if
(
success
==
true
)
{
alert
(
"l' impression des étiquettes à coller sur les articles vient d'être lancée."
);
$
(
'#barcodesToPrint'
).
hide
();
}
else
{
alert
(
"Une erreur est survenue."
)
}
});
}
else
{
alert
(
"Vous avez cliqué il y a moins de 10s... Patience, la demande est en cours de traitement."
);
...
...
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