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
086a1ea0
Commit
086a1ea0
authored
Apr 02, 2024
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Aide à la commande: Option arrêt au stade Brouillon (pour besoin de La Chouette)
parent
3f1b6284
Pipeline
#3370
failed with stage
in 1 minute 6 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
4 deletions
+19
-4
models.py
orders/models.py
+5
-2
orders_helper.js
orders/static/js/orders_helper.js
+5
-2
views.py
orders/views.py
+2
-0
helper.html
templates/orders/helper.html
+7
-0
No files found.
orders/models.py
View file @
086a1ea0
...
@@ -308,11 +308,14 @@ class Order(models.Model):
...
@@ -308,11 +308,14 @@ class Order(models.Model):
api
=
OdooAPI
()
api
=
OdooAPI
()
id_po
=
api
.
create
(
'purchase.order'
,
order_data
)
id_po
=
api
.
create
(
'purchase.order'
,
order_data
)
res_confirm
=
api
.
execute
(
'purchase.order'
,
'button_confirm'
,
[
id_po
])
confirmed
=
False
if
getattr
(
settings
,
'AUTO_CONFIRM_PURCHASE_ORDER'
,
True
)
is
True
:
api
.
execute
(
'purchase.order'
,
'button_confirm'
,
[
id_po
])
confirmed
=
True
res
=
{
res
=
{
'id_po'
:
id_po
,
'id_po'
:
id_po
,
'confirm_po'
:
True
,
'confirm_po'
:
confirmed
,
'supplier_id'
:
supplier_id
,
'supplier_id'
:
supplier_id
,
'date_planned'
:
date_planned
'date_planned'
:
date_planned
}
}
...
...
orders/static/js/orders_helper.js
View file @
086a1ea0
...
@@ -1342,17 +1342,20 @@ function create_orders() {
...
@@ -1342,17 +1342,20 @@ function create_orders() {
});
});
let
new_order_template
=
$
(
"#templates #new_order_item_template"
);
let
new_order_template
=
$
(
"#templates #new_order_item_template"
);
new_order_template
.
find
(
".new_order_supplier_name"
).
text
(
supplier_name
);
new_order_template
.
find
(
".new_order_supplier_name"
).
text
(
supplier_name
);
new_order_template
.
find
(
".new_order_po"
).
text
(
`PO
${
new_order
.
id_po
}
`
);
new_order_template
.
find
(
".new_order_po"
).
text
(
`PO
${
new_order
.
id_po
}
`
);
new_order_template
.
find
(
".new_order_date_planned"
).
text
(
`Date de livraison prévue:
${
date_planned
}
`
);
new_order_template
.
find
(
".new_order_date_planned"
).
text
(
`Date de livraison prévue:
${
date_planned
}
`
);
if
(
order_auto_confirm
===
true
)
{
new_order_template
.
find
(
".download_order_file_button"
).
attr
(
'id'
,
`download_attachment_
${
new_order
.
id_po
}
`
);
new_order_template
.
find
(
".download_order_file_button"
).
attr
(
'id'
,
`download_attachment_
${
new_order
.
id_po
}
`
);
}
else
{
$
(
'.download_order_file'
).
remove
()
}
$
(
'#created_orders_area'
).
append
(
new_order_template
.
html
());
$
(
'#created_orders_area'
).
append
(
new_order_template
.
html
());
}
}
// Prepare buttons to download order attachment
// Prepare buttons to download order attachment
get_order_attachments
();
if
(
order_auto_confirm
===
true
)
get_order_attachments
();
// Clear data
// Clear data
delete_cdb_order
().
finally
(()
=>
{
delete_cdb_order
().
finally
(()
=>
{
...
...
orders/views.py
View file @
086a1ea0
...
@@ -22,6 +22,8 @@ def helper(request):
...
@@ -22,6 +22,8 @@ def helper(request):
'db'
:
settings
.
COUCHDB
[
'dbs'
][
'orders'
],
'db'
:
settings
.
COUCHDB
[
'dbs'
][
'orders'
],
'odoo_server'
:
getattr
(
settings
,
'ODOO_PUBLIC_URL'
,
settings
.
ODOO
[
'url'
]),
'odoo_server'
:
getattr
(
settings
,
'ODOO_PUBLIC_URL'
,
settings
.
ODOO
[
'url'
]),
'metabase_url'
:
getattr
(
settings
,
'ORDERS_HELPER_METABASE_URL'
,
''
),
'metabase_url'
:
getattr
(
settings
,
'ORDERS_HELPER_METABASE_URL'
,
''
),
'order_auto_confirm'
:
getattr
(
settings
,
'AUTO_CONFIRM_PURCHASE_ORDER'
,
True
),
'display_mail_example'
:
getattr
(
settings
,
'DISPLAY_PURCHASE_MAIL_EXAMPLE'
,
True
),
'nb_past_days_to_compute_sales_average'
:
OdooAPI
()
.
get_system_param
(
'lacagette_products.nb_past_days_to_compute_sales_average'
),
'nb_past_days_to_compute_sales_average'
:
OdooAPI
()
.
get_system_param
(
'lacagette_products.nb_past_days_to_compute_sales_average'
),
'nb_of_consecutive_non_sale_days_considered_as_break'
:
OdooAPI
()
.
get_system_param
(
'lacagette_products.nb_of_consecutive_non_sale_days_considered_as_break'
)
'nb_of_consecutive_non_sale_days_considered_as_break'
:
OdooAPI
()
.
get_system_param
(
'lacagette_products.nb_of_consecutive_non_sale_days_considered_as_break'
)
}
}
...
...
templates/orders/helper.html
View file @
086a1ea0
...
@@ -148,6 +148,7 @@
...
@@ -148,6 +148,7 @@
</div>
</div>
<div
id=
"created_orders_area"
></div>
<div
id=
"created_orders_area"
></div>
<br/><br/><hr/><br/>
<br/><br/><hr/><br/>
{% if display_mail_example %}
<div
class=
"mail_example_container"
>
<div
class=
"mail_example_container"
>
<p
class=
"mail_type_text"
>
Mail type :
</p>
<p
class=
"mail_type_text"
>
Mail type :
</p>
<div
class=
"mail_example"
>
<div
class=
"mail_example"
>
...
@@ -161,6 +162,7 @@
...
@@ -161,6 +162,7 @@
Bonne journée
Bonne journée
</div>
</div>
</div>
</div>
{% endif %}
</div>
</div>
<div
id=
"templates"
style=
"display:none;"
>
<div
id=
"templates"
style=
"display:none;"
>
...
@@ -369,6 +371,11 @@
...
@@ -369,6 +371,11 @@
var
couchdb_server
=
'{{couchdb_server}}'
+
couchdb_dbname
;
var
couchdb_server
=
'{{couchdb_server}}'
+
couchdb_dbname
;
var
odoo_server
=
'{{odoo_server}}'
;
var
odoo_server
=
'{{odoo_server}}'
;
var
metabase_url
=
'{{metabase_url}}'
;
var
metabase_url
=
'{{metabase_url}}'
;
{
%
if
order_auto_confirm
%
}
var
order_auto_confirm
=
true
;
{
%
else
%
}
var
order_auto_confirm
=
false
;
{
%
endif
%
}
</script>
</script>
<script
src=
"{% static "
js
/
all_common
.
js
"
%}?
v=
1651853225"
></script>
<script
src=
"{% static "
js
/
all_common
.
js
"
%}?
v=
1651853225"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/orders_helper.js' %}?v=1651853225"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/orders_helper.js' %}?v=1651853225"
></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