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
e4c07d53
Commit
e4c07d53
authored
Jul 27, 2021
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add supplier ref in order line product name
parent
e84119f3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
models.py
orders/models.py
+6
-1
orders_helper.js
orders/static/js/orders_helper.js
+3
-1
models.py
products/models.py
+3
-2
No files found.
orders/models.py
View file @
e4c07d53
...
...
@@ -258,6 +258,11 @@ class Order(models.Model):
}
for
line
in
order_lines
:
product_line_name
=
line
[
"name"
]
if
line
[
"product_code"
]
is
not
False
:
product_code
=
str
(
line
[
"product_code"
])
product_line_name
=
f
"[{product_code}] {product_line_name}"
order_data
[
"order_line"
]
.
append
(
[
0
,
...
...
@@ -267,7 +272,7 @@ class Order(models.Model):
"price_policy"
:
"uom"
,
"indicative_package"
:
True
,
"product_id"
:
line
[
"product_variant_ids"
][
0
],
"name"
:
line
[
"name"
]
,
"name"
:
product_line_name
,
"date_planned"
:
date_planned
,
"account_analytic_id"
:
False
,
"product_qty_package"
:
line
[
"product_qty_package"
],
...
...
orders/static/js/orders_helper.js
View file @
e4c07d53
...
...
@@ -939,6 +939,7 @@ function create_orders() {
// If a qty is set for a supplier for a product
if
(
'qty'
in
p_supplierinfo
&&
p_supplierinfo
.
qty
!=
0
)
{
const
supplier_id
=
p_supplierinfo
.
supplier_id
;
const
product_code
=
p_supplierinfo
.
product_code
;
orders_data
.
suppliers_data
[
supplier_id
].
lines
.
push
({
'package_qty'
:
p_supplierinfo
.
package_qty
,
...
...
@@ -949,7 +950,8 @@ function create_orders() {
'product_uom'
:
p
.
uom_id
[
0
],
'price_unit'
:
p_supplierinfo
.
price
,
'supplier_taxes_id'
:
p
.
supplier_taxes_id
,
'product_variant_ids'
:
p
.
product_variant_ids
'product_variant_ids'
:
p
.
product_variant_ids
,
'product_code'
:
product_code
});
}
}
...
...
products/models.py
View file @
e4c07d53
...
...
@@ -486,7 +486,7 @@ class CagetteProducts(models.Model):
if
supplier_ids
is
not
None
and
len
(
supplier_ids
)
>
0
:
# Get products/supplier relation
f
=
[
"product_tmpl_id"
,
'date_start'
,
'date_end'
,
'package_qty'
,
'price'
,
'name'
]
f
=
[
"product_tmpl_id"
,
'date_start'
,
'date_end'
,
'package_qty'
,
'price'
,
'name'
,
'product_code'
]
c
=
[[
'name'
,
'in'
,
[
int
(
x
)
for
x
in
supplier_ids
]]]
psi
=
api
.
search_read
(
'product.supplierinfo'
,
c
,
f
)
...
...
@@ -543,7 +543,8 @@ class CagetteProducts(models.Model):
filtered_products_t
[
i
][
'suppliersinfo'
]
.
append
({
'supplier_id'
:
int
(
psi_item
[
"name"
][
0
]),
'package_qty'
:
psi_item
[
"package_qty"
],
'price'
:
psi_item
[
"price"
]
'price'
:
psi_item
[
"price"
],
'product_code'
:
psi_item
[
"product_code"
]
})
for
s
in
sales
:
...
...
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