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
0
Merge Requests
0
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
Alexis AOUN
third-party
Commits
2e9aacb6
Commit
2e9aacb6
authored
Jun 24, 2021
by
François C.
Committed by
Alexis Aoun
Jul 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
After ESLint --fix on last merge
parent
130904b7
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
100 additions
and
80 deletions
+100
-80
custom_lists.js
inventory/static/js/custom_lists.js
+3
-2
prepa_odoo.js
members/static/js/prepa_odoo.js
+6
-6
orders_helper.js
orders/static/js/orders_helper.js
+31
-28
barcodes.js
products/static/js/barcodes.js
+4
-1
reception_index.js
reception/static/js/reception_index.js
+28
-28
reception_produits.js
reception/static/js/reception_produits.js
+8
-2
sales.js
sales/static/js/sales.js
+6
-3
shop.js
shop/static/js/shop.js
+13
-10
stock_movements.js
stock/static/js/stock_movements.js
+1
-0
No files found.
inventory/static/js/custom_lists.js
View file @
2e9aacb6
...
...
@@ -7,10 +7,10 @@ function init_datatable() {
// For a smooth migration...
for
(
const
i
in
lists
)
{
if
((
'partners'
in
lists
[
i
])
===
false
)
{
lists
[
i
][
'partners'
]
=
[
lists
[
i
][
'partner'
]]
lists
[
i
][
'partners'
]
=
[
lists
[
i
][
'partner'
]]
;
}
}
return
$
(
'#lists'
).
DataTable
({
data
:
lists
,
// data passed at page loading
rowId
:
'id'
,
...
...
@@ -31,6 +31,7 @@ function init_datatable() {
for
(
const
i
in
data
)
{
res
+=
`
${
data
[
i
]}
<br/>`
;
}
return
res
;
}
},
...
...
members/static/js/prepa_odoo.js
View file @
2e9aacb6
...
...
@@ -258,21 +258,21 @@ function save_current_coop(callback) {
sex_error
=
false
;
if
(
/
([
0-9
]{2})\/([
0-9
]{2})\/([
0-9
]{4})
/
.
exec
(
birthdate
))
{
try
{
try
{
var
jj
=
RegExp
.
$1
,
mm
=
RegExp
.
$2
,
aaaa
=
RegExp
.
$3
;
mm
=
RegExp
.
$2
,
aaaa
=
RegExp
.
$3
;
let
tmp_date
=
aaaa
+
"-"
+
mm
+
"-"
+
jj
;
// try to create a date object
date_test
=
new
Date
(
tmp_date
);
// if date is invalid a correction is apply in date object. Check it
// january start at 0, so we add + 1 for the month
if
((
date_test
.
getDate
()
!==
parseInt
(
jj
))
||
((
date_test
.
getMonth
()
+
1
)
!==
parseInt
(
mm
))
||
(
date_test
.
getFullYear
()
!==
parseInt
(
aaaa
))
||
!
date_test
.
isValid
())
{
if
((
date_test
.
getDate
()
!==
parseInt
(
jj
))
||
((
date_test
.
getMonth
()
+
1
)
!==
parseInt
(
mm
))
||
(
date_test
.
getFullYear
()
!==
parseInt
(
aaaa
))
||
!
date_test
.
isValid
())
{
birthdate_error
=
true
;
}
}
catch
(
Exception
)
{
}
catch
(
Exception
)
{
birthdate_error
=
true
;
}
...
...
orders/static/js/orders_helper.js
View file @
2e9aacb6
...
...
@@ -9,7 +9,7 @@ var suppliers_list = [],
_id
:
null
,
last_update
:
{
timestamp
:
null
,
fingerprint
:
null
,
fingerprint
:
null
},
products
:
[],
selected_suppliers
:
[],
...
...
@@ -31,7 +31,7 @@ function reset_data() {
_id
:
null
,
last_update
:
{
timestamp
:
null
,
fingerprint
:
null
,
fingerprint
:
null
},
products
:
[],
selected_suppliers
:
[]
...
...
@@ -40,26 +40,26 @@ function reset_data() {
/**
* Difference between two dates
* @param {Date} date1
* @param {Date} date2
* @param {Date} date1
* @param {Date} date2
* @returns difference object
*/
function
dates_diff
(
date1
,
date2
)
{
var
diff
=
{}
var
diff
=
{}
;
var
tmp
=
date2
-
date1
;
tmp
=
Math
.
floor
(
tmp
/
1000
);
diff
.
sec
=
tmp
%
60
;
tmp
=
Math
.
floor
((
tmp
-
diff
.
sec
)
/
60
);
diff
.
min
=
tmp
%
60
;
tmp
=
Math
.
floor
((
tmp
-
diff
.
min
)
/
60
);
diff
.
hours
=
tmp
%
24
;
tmp
=
Math
.
floor
((
tmp
-
diff
.
hours
)
/
24
);
diff
.
days
=
tmp
;
return
diff
;
}
...
...
@@ -676,6 +676,7 @@ function update_order_selection_screen() {
$
(
".order_pill"
).
off
();
let
existing_orders_container
=
$
(
"#existing_orders"
);
existing_orders_container
.
empty
();
dbc
.
allDocs
({
...
...
@@ -686,8 +687,9 @@ function update_order_selection_screen() {
}
else
{
for
(
let
row
of
result
.
rows
)
{
let
template
=
$
(
"#templates #order_pill_template"
);
template
.
find
(
".pill_order_name"
).
text
(
row
.
id
);
existing_orders_container
.
append
(
template
.
html
());
}
...
...
@@ -739,7 +741,7 @@ function goto_main_screen(doc) {
products
=
order_doc
.
products
;
selected_suppliers
=
order_doc
.
selected_suppliers
;
update_order
()
update_order
()
;
update_main_screen
();
switch_screen
();
}
...
...
@@ -749,9 +751,9 @@ function back() {
update_order_selection_screen
();
switch_screen
(
'order_selection'
);
}
/**
* Event fct: on click on an order button
* Event fct: on click on an order button
*/
function
order_pill_on_click
()
{
let
order_name_container
=
$
(
this
).
find
(
'.pill_order_name'
);
...
...
@@ -759,38 +761,39 @@ function order_pill_on_click() {
dbc
.
get
(
doc_id
).
then
((
doc
)
=>
{
if
(
doc
.
last_update
.
fingerprint
!==
fingerprint
)
{
time_diff
=
dates_diff
(
new
Date
(
doc
.
last_update
.
timestamp
),
new
Date
())
diff_str
=
``
time_diff
=
dates_diff
(
new
Date
(
doc
.
last_update
.
timestamp
),
new
Date
())
;
diff_str
=
``
;
if
(
time_diff
.
days
!==
0
)
{
diff_str
+=
`
${
time_diff
.
days
}
jour(s), `
diff_str
+=
`
${
time_diff
.
days
}
jour(s), `
;
}
if
(
time_diff
.
hours
!==
0
)
{
diff_str
+=
`
${
time_diff
.
hours
}
heure(s), `
diff_str
+=
`
${
time_diff
.
hours
}
heure(s), `
;
}
if
(
time_diff
.
min
!==
0
)
{
diff_str
+=
`
${
time_diff
.
min
}
min, `
diff_str
+=
`
${
time_diff
.
min
}
min, `
;
}
diff_str
+=
`
${
time_diff
.
sec
}
s`
diff_str
+=
`
${
time_diff
.
sec
}
s`
;
let
modal_order_access
=
$
(
'#templates #modal_order_access'
);
modal_order_access
.
find
(
".order_last_update"
).
text
(
diff_str
);
openModal
(
modal_order_access
.
html
(),
()
=>
{
goto_main_screen
(
doc
)
goto_main_screen
(
doc
)
;
},
'Valider'
);
}
else
{
goto_main_screen
(
doc
)
goto_main_screen
(
doc
)
;
}
})
.
catch
(
function
(
err
)
{
alert
(
'Erreur lors de la récupération de la commande. Si l
\'
erreur persiste, contactez un administrateur svp.'
);
console
.
log
(
err
);
});
.
catch
(
function
(
err
)
{
alert
(
'Erreur lors de la récupération de la commande. Si l
\'
erreur persiste, contactez un administrateur svp.'
);
console
.
log
(
err
);
});
}
/**
...
...
@@ -823,7 +826,7 @@ function update_order() {
// Save that current user last updated the order
order_doc
.
last_update
=
{
timestamp
:
Date
.
now
(),
fingerprint
:
fingerprint
,
fingerprint
:
fingerprint
};
dbc
.
put
(
order_doc
,
function
callback
(
err
,
result
)
{
...
...
@@ -872,7 +875,7 @@ $(document).ready(function() {
if
(
err
.
status
===
409
)
{
alert
(
"Une erreur de synchronisation s'est produite, la commande a sûrement été modifiée sur un autre navigateur. Vous allez être redirigé.e."
);
back
();
}
}
console
.
log
(
'erreur sync'
);
console
.
log
(
err
);
});
...
...
products/static/js/barcodes.js
View file @
2e9aacb6
...
...
@@ -37,6 +37,7 @@ IFCBarcodes = {
try
{
let
price
=
parseFloat
(
value
);
if
(
currency
==
'FF'
)
price
=
price
/
6.55957
;
...
...
@@ -131,6 +132,7 @@ IFCBarcodes = {
if
(
product_data
!==
null
)
{
p_uom
=
(
this
.
uoms
)[
product_data
[
this
.
keys
.
uom_id
]];
let
qty
=
1
;
if
(
encoded_value
.
length
>
0
&&
!
isNaN
(
encoded_value
))
{
qty
=
0
;
//if no rule is found it will advise user that there is a problem
/*
...
...
@@ -149,7 +151,8 @@ IFCBarcodes = {
}
else
{
let
list_price
=
product_data
[
this
.
keys
.
list_price
];
let
currency
=
null
;
if
(
pattern_type
==
'FF_price_to_weight'
)
currency
=
'FF'
if
(
pattern_type
==
'FF_price_to_weight'
)
currency
=
'FF'
;
qty
=
parseFloat
(
this
.
get_quantity_eq_to_encoded_price
(
encoded_value
,
list_price
,
currency
));
}
...
...
reception/static/js/reception_index.js
View file @
2e9aacb6
...
...
@@ -376,34 +376,34 @@ $(document).ready(function() {
render
:
function
(
data
)
{
switch
(
data
)
{
case
'qty_valid'
:
return
"<span class='btn--success'>Mettre à jour les prix</span>"
;
case
'br_valid'
:
return
"<span class='btn'><i class='far fa-check-circle'></i> Réception OK</span>"
;
case
'False'
:
return
"<span class='btn--primary'>Compter les produits</span>"
;
case
'done'
:
return
"<span class='btn'><i class='far fa-check-circle'></i> Terminé</span>"
;
case
'uprice_valid'
:
return
"<span class='btn--primary'>Mise à jour du prix OK</span>"
;
case
"valid_pending"
:
return
"<span class='btn--info'>En attente de validation</span>"
;
case
'legacy'
:
return
"<span class='btn--success'>Legacy</span>"
;
case
'error_pack_op'
:
return
"<span class='btn--danger'>Erreur pack operations</span>"
;
case
'error_transfer'
:
return
"<span class='btn--danger'>Erreur de transfert</span>"
;
case
'error_picking'
:
return
"<span class='btn--danger'>Erreur validation quantité</span>"
;
case
'/error_uprice'
:
return
"<span class='btn--danger'>Erreur mise à jour du prix</span>"
;
default
:
return
"<span class='btn--warning'>Status inconnu : "
+
data
+
"</span>"
;
case
'qty_valid'
:
return
"<span class='btn--success'>Mettre à jour les prix</span>"
;
case
'br_valid'
:
return
"<span class='btn'><i class='far fa-check-circle'></i> Réception OK</span>"
;
case
'False'
:
return
"<span class='btn--primary'>Compter les produits</span>"
;
case
'done'
:
return
"<span class='btn'><i class='far fa-check-circle'></i> Terminé</span>"
;
case
'uprice_valid'
:
return
"<span class='btn--primary'>Mise à jour du prix OK</span>"
;
case
"valid_pending"
:
return
"<span class='btn--info'>En attente de validation</span>"
;
case
'legacy'
:
return
"<span class='btn--success'>Legacy</span>"
;
case
'error_pack_op'
:
return
"<span class='btn--danger'>Erreur pack operations</span>"
;
case
'error_transfer'
:
return
"<span class='btn--danger'>Erreur de transfert</span>"
;
case
'error_picking'
:
return
"<span class='btn--danger'>Erreur validation quantité</span>"
;
case
'/error_uprice'
:
return
"<span class='btn--danger'>Erreur mise à jour du prix</span>"
;
default
:
return
"<span class='btn--warning'>Status inconnu : "
+
data
+
"</span>"
;
}
},
width
:
"20%"
...
...
reception/static/js/reception_produits.js
View file @
2e9aacb6
...
...
@@ -326,8 +326,13 @@ function initLists() {
className
:
"dt-head-center dt-body-center"
,
visible
:
(
reception_status
==
"False"
),
render
:
function
(
data
,
type
,
full
)
{
let
disp
=
[
full
.
product_qty
,
(
full
.
old_qty
!==
undefined
)?
full
.
old_qty
:
full
.
product_qty
].
join
(
"/"
);
return
disp
;
let
disp
=
[
full
.
product_qty
,
(
full
.
old_qty
!==
undefined
)?
full
.
old_qty
:
full
.
product_qty
].
join
(
"/"
);
return
disp
;
},
orderable
:
false
},
...
...
@@ -1355,6 +1360,7 @@ function openErrorReport() {
// this is necessary because default behavior is overwritten by the listener defined in jquery.pos.js;
$
(
"#error_report"
).
keypress
(
function
(
e
)
{
var
key
=
e
.
keyCode
;
if
(
key
===
13
)
{
this
.
value
+=
"
\
n"
;
}
...
...
sales/static/js/sales.js
View file @
2e9aacb6
...
...
@@ -63,10 +63,12 @@ function display_orders(orders) {
orderable
:
false
,
render
:
function
(
data
)
{
let
res
=
'<ul>'
;
for
(
p
of
data
)
{
res
+=
`<li>
${
p
.
journal_id
[
1
]}
:
${
p
.
amount
}
€</li>`
res
+=
`<li>
${
p
.
journal_id
[
1
]}
:
${
p
.
amount
}
€</li>`
;
}
res
+=
"</ul>"
res
+=
"</ul>"
;
return
res
;
}
}
...
...
@@ -97,6 +99,7 @@ function get_sales() {
openModal
();
var
url
=
"/sales/get_sales"
;
url
+=
'?from='
+
encodeURIComponent
(
from_datepicker
.
val
());
url
+=
'&to='
+
encodeURIComponent
(
to_datepicker
.
val
());
...
...
@@ -189,7 +192,7 @@ $(document).ready(function() {
enable_validation
();
});
$
(
"#sales_form"
).
submit
(
function
(
event
)
{
$
(
"#sales_form"
).
submit
(
function
(
event
)
{
event
.
preventDefault
();
get_sales
();
});
...
...
shop/static/js/shop.js
View file @
2e9aacb6
...
...
@@ -1067,16 +1067,18 @@ var shouldCategoryBeShown = function (cat_id) {
answer
=
false
;
}
if
(
typeof
cat_nb_pdts
!=
"undefined"
)
{
let
list
=
cat_nb_pdts
.
list
;
let
cat_ids
=
Object
.
keys
(
list
).
map
(
x
=>
parseInt
(
x
,
10
));
let
list
=
cat_nb_pdts
.
list
;
let
cat_ids
=
Object
.
keys
(
list
).
map
(
x
=>
parseInt
(
x
,
10
));
//cat_ids is now an array of category ids which have product
if
(
cat_ids
.
indexOf
(
cat_id
)
<
0
)
{
// cat_id is corresponding to a category which have no product
answer
=
false
;
}
}
return
answer
;
}
}
;
var
appendChildrenCatToMenu
=
function
(
catdiv
,
children
)
{
var
ul
=
catdiv
.
find
(
'ul'
);
...
...
@@ -1400,28 +1402,29 @@ var showSentCart = function() {
content
=
$
(
'<div>'
),
table
=
$
(
'<table>'
);
let
header
=
$
(
'<tr><th>Article</th><th>Qté</th><th>Prix Total (T.T.C)</th></tr>'
);
let
bottom_msg
=
$
(
'<p>'
).
html
(
"<em>Contenu non modifiable.</em>"
)
let
bottom_msg
=
$
(
'<p>'
).
html
(
"<em>Contenu non modifiable.</em>"
);
table
.
append
(
header
);
$
.
each
(
my_sent_orders
,
function
(
i
,
e
)
{
$
.
each
(
my_sent_orders
,
function
(
i
,
e
)
{
if
(
e
.
_id
==
id
)
{
$
.
each
(
e
.
products
,
function
(
j
,
p
)
{
$
.
each
(
e
.
products
,
function
(
j
,
p
)
{
let
tr
=
$
(
'<tr>'
),
name
=
$
(
'<td>'
).
text
(
p
.
name
),
qty
=
$
(
'<td>'
).
text
(
p
.
qty
),
total
=
$
(
'<td>'
).
text
(
p
.
total
)
total
=
$
(
'<td>'
).
text
(
p
.
total
)
;
tr
.
append
(
name
);
tr
.
append
(
qty
);
tr
.
append
(
total
);
table
.
append
(
tr
);
})
})
;
}
})
})
;
content
.
append
(
table
);
content
.
append
(
bottom_msg
);
displayMsg
(
content
.
html
());
}
}
;
var
destroySentCart
=
function
()
{
var
clicked
=
$
(
this
);
...
...
stock/static/js/stock_movements.js
View file @
2e9aacb6
...
...
@@ -318,6 +318,7 @@ function fetch_product_from_bc(barcode) {
if
(
p_existing
!==
null
)
{
without_consent_update_product
(
p_existing
,
product
.
qty
);
return
0
;
}
else
{
add_product
(
product
);
...
...
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