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
2d478df2
Commit
2d478df2
authored
Jun 08, 2021
by
Arnaud B
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Affichage de la colonne Autres seulement pour La Cagette
parent
08e17076
Pipeline
#1033
passed with stage
in 25 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
4 deletions
+29
-4
reception_produits.js
reception/static/js/reception_produits.js
+24
-0
views.py
reception/views.py
+4
-4
reception_produits.html
templates/reception/reception_produits.html
+1
-0
No files found.
reception/static/js/reception_produits.js
View file @
2d478df2
...
...
@@ -126,6 +126,7 @@ function fetch_data() {
contentType
:
"application/json; charset=utf-8"
,
data
:
JSON
.
stringify
({
'po_ids'
:
group_ids
}),
success
:
function
(
data
)
{
console
.
log
(
data
);
// for each order
for
(
order_data
of
data
.
orders
)
{
// for each product in order
...
...
@@ -270,6 +271,14 @@ function initLists() {
defaultContent
:
"<a class='btn' id='toProcess_line_valid' href='#'><i class='far fa-check-square'></i></a>"
,
className
:
"dt-body-center"
,
orderable
:
false
},
{
title
:
"Autres"
,
defaultContent
:
"<select class='select_product_action'><option value=''></option><option value='supplier_shortage'>Rupture fournisseur</option></select>"
,
className
:
"dt-body-center"
,
orderable
:
false
,
visible
:
display_autres
}
],
rowId
:
"product_id.0"
,
...
...
@@ -335,6 +344,21 @@ function initLists() {
defaultContent
:
"<a class='btn' id='processed_line_edit' href='#'><i class='far fa-edit'></i></a>"
,
className
:
"dt-body-center"
,
orderable
:
false
},
{
title
:
"Autres"
,
className
:
"dt-body-center"
,
orderable
:
false
,
render
:
function
(
data
,
type
,
full
)
{
//console.log(full);
let
disabled
=
(
full
.
supplier_shortage
)
?
"disabled"
:
''
;
return
"<select class='select_product_action'>"
+
"<option value=''></option>"
+
"<option value='supplier_shortage' "
+
disabled
+
">Rupture fournisseur</option>"
+
"</select>"
;
},
visible
:
display_autres
}
],
rowId
:
"product_id.0"
,
...
...
reception/views.py
View file @
2d478df2
...
...
@@ -2,7 +2,6 @@
from
outils.common_imports
import
*
from
outils.for_view_imports
import
*
from
django.views.generic
import
View
import
os
from
datetime
import
date
from
openpyxl
import
Workbook
...
...
@@ -14,7 +13,6 @@ from outils.common import OdooAPI
from
members.models
import
CagetteUser
from
products.models
import
CagetteProduct
def
as_text
(
value
):
""" Utils """
return
str
(
value
)
if
value
is
not
None
else
""
...
...
@@ -71,9 +69,12 @@ def get_list_orders(request):
def
produits
(
request
,
id
):
""" Gets Order details """
context
=
{
'title'
:
'Réception des produits'
,
"TOOLS_SERVER"
:
settings
.
TOOLS_SERVER
}
"TOOLS_SERVER"
:
settings
.
TOOLS_SERVER
,
"DISPLAY_AUTRES"
:
"false"
if
(
settings
.
COMPANY_NAME
==
"La Cagette"
)
else
"true"
,
}
fixed_barcode_prefix
=
'0490'
if
hasattr
(
settings
,
'RECEPTION_PB_EMAIL'
):
context
[
'RECEPTION_PB_EMAIL'
]
=
settings
.
RECEPTION_PB_EMAIL
else
:
...
...
@@ -97,7 +98,6 @@ def produits(request, id):
def
get_order_lines
(
request
,
id_po
):
"""Send content of an order"""
order_lines
=
CagetteReception
.
get_order_lines_by_po
(
int
(
id_po
))
return
JsonResponse
({
'id_po'
:
id_po
,
'po'
:
order_lines
})
def
get_orders_lines
(
request
):
...
...
templates/reception/reception_produits.html
View file @
2d478df2
...
...
@@ -185,6 +185,7 @@
<script
type=
"text/javascript"
>
var
tools_server
=
'{{TOOLS_SERVER}}'
var
fixed_barcode_prefix
=
'{{FIXED_BARCODE_PREFIX}}'
var
display_autres
=
{{
DISPLAY_AUTRES
}};
</script>
<script
src=
"{% static "
js
/
all_common
.
js
"
%}?
v=
"></script>
<script src='{% static "
js
/
barcodes
.
js
"
%}?
v=
'></script>
...
...
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