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
d53e7003
Commit
d53e7003
authored
Feb 01, 2022
by
Damien Moulard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1989-refresh-order-after-action' into 'dev_cooperatic'
refresh order data after action See merge request
!110
parents
beada0b2
412f96f7
Pipeline
#1739
passed with stage
in 1 minute 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
orders_helper.js
orders/static/js/orders_helper.js
+20
-14
No files found.
orders/static/js/orders_helper.js
View file @
d53e7003
...
@@ -700,6 +700,8 @@ function save_products_npa_minimal_stock(product, inputs) {
...
@@ -700,6 +700,8 @@ function save_products_npa_minimal_stock(product, inputs) {
actions
.
minimal_stock
=
input
.
val
()
actions
.
minimal_stock
=
input
.
val
()
}
}
});
});
openModal
();
$
.
ajax
({
$
.
ajax
({
type
:
"POST"
,
type
:
"POST"
,
url
:
"/products/update_npa_and_minimal_stock"
,
url
:
"/products/update_npa_and_minimal_stock"
,
...
@@ -710,26 +712,30 @@ function save_products_npa_minimal_stock(product, inputs) {
...
@@ -710,26 +712,30 @@ function save_products_npa_minimal_stock(product, inputs) {
success
:
()
=>
{
success
:
()
=>
{
const
index
=
products
.
findIndex
(
p
=>
p
.
id
==
product
.
id
);
const
index
=
products
.
findIndex
(
p
=>
p
.
id
==
product
.
id
);
// Give time for modal to fade
setTimeout
(
function
()
{
$
(
".actions_buttons_area .right_action_buttons"
).
notify
(
"Actions enregistrées !"
,
{
elementPosition
:
"bottom right"
,
className
:
"success"
,
arrowShow
:
false
}
);
},
500
);
products
[
index
].
minimal_stock
=
actions
.
minimal_stock
;
products
[
index
].
minimal_stock
=
actions
.
minimal_stock
;
if
(
actions
.
npa
.
length
>
0
)
{
if
(
actions
.
npa
.
length
>
0
)
{
// Remove NPA products
// Remove NPA products
products
.
splice
(
index
,
1
);
products
.
splice
(
index
,
1
);
update_main_screen
();
update_cdb_order
();
}
}
closeModal
();
check_products_data
()
.
then
(()
=>
{
update_cdb_order
();
update_main_screen
();
closeModal
();
// Give time for modal to fade
setTimeout
(
function
()
{
$
(
".actions_buttons_area .right_action_buttons"
).
notify
(
"Actions enregistrées !"
,
{
elementPosition
:
"bottom right"
,
className
:
"success"
,
arrowShow
:
false
}
);
},
500
);
});
},
},
error
:
function
(
data
)
{
error
:
function
(
data
)
{
let
msg
=
"erreur serveur lors de la sauvegarde"
.
let
msg
=
"erreur serveur lors de la sauvegarde"
.
...
...
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