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
a6f73d2a
Commit
a6f73d2a
authored
Jun 21, 2022
by
Félicie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alert changed
parent
edd0e0df
Pipeline
#2255
passed with stage
in 1 minute 27 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
22 deletions
+20
-22
shelfs_admin.js
shelfs/static/js/shelfs_admin.js
+20
-22
No files found.
shelfs/static/js/shelfs_admin.js
View file @
a6f73d2a
...
...
@@ -396,32 +396,30 @@ var addProductToList = async function(barcode) {
//It could also be a wrong reading one
odoo_product
=
barcodes
.
get_corresponding_odoo_product
(
barcode
);
if
(
odoo_product
)
{
if
(
odoo_product
===
null
)
{
alert
(
barcode
+
" : ce code-barre est inconnu, merci d'apporter le produit à un salarié."
);
}
else
{
if
(
is_product_in_shelf_adding_queue_list
(
odoo_product
.
data
[
barcodes
.
keys
.
id
]))
{
alert
(
"Produit déjà présent dans la liste."
);
}
else
{
add_to_shelf_product_ids
.
push
(
odoo_product
.
data
[
4
]);
if
(
odoo_product
===
null
)
{
alert
(
barcode
+
' : Code-barre inconnu'
);
}
else
{
var
pdt_line
=
$
(
'<tr>'
).
attr
(
'data-id'
,
odoo_product
.
data
[
barcodes
.
keys
.
id
])
.
attr
(
'data-bc'
,
odoo_product
.
barcode
)
.
addClass
(
'obc'
);
$
(
'<td>'
).
text
(
barcode
)
.
appendTo
(
pdt_line
);
$
(
'<td>'
).
text
(
odoo_product
.
barcode
)
.
appendTo
(
pdt_line
);
$
(
'<td>'
).
text
(
odoo_product
.
data
[
barcodes
.
keys
.
name
])
.
appendTo
(
pdt_line
);
$
(
'<td>'
).
html
(
odoo_product
.
data
[
barcodes
.
keys
.
list_price
]
+
" €"
)
.
appendTo
(
pdt_line
);
$
(
'<td>'
).
html
(
delete_icon
+
" "
+
print_icon
)
.
appendTo
(
pdt_line
);
adding_pdts_tpl
.
find
(
'#added_products tbody'
).
append
(
pdt_line
);
main_content
.
find
(
'button.add-products'
).
css
(
'display'
,
'block'
)
.
html
(
add_pdts_btn_text
);
}
var
pdt_line
=
$
(
'<tr>'
).
attr
(
'data-id'
,
odoo_product
.
data
[
barcodes
.
keys
.
id
])
.
attr
(
'data-bc'
,
odoo_product
.
barcode
)
.
addClass
(
'obc'
);
$
(
'<td>'
).
text
(
barcode
)
.
appendTo
(
pdt_line
);
$
(
'<td>'
).
text
(
odoo_product
.
barcode
)
.
appendTo
(
pdt_line
);
$
(
'<td>'
).
text
(
odoo_product
.
data
[
barcodes
.
keys
.
name
])
.
appendTo
(
pdt_line
);
$
(
'<td>'
).
html
(
odoo_product
.
data
[
barcodes
.
keys
.
list_price
]
+
" €"
)
.
appendTo
(
pdt_line
);
$
(
'<td>'
).
html
(
delete_icon
+
" "
+
print_icon
)
.
appendTo
(
pdt_line
);
adding_pdts_tpl
.
find
(
'#added_products tbody'
).
append
(
pdt_line
);
main_content
.
find
(
'button.add-products'
).
css
(
'display'
,
'block'
)
.
html
(
add_pdts_btn_text
);
}
}
};
...
...
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