mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
s_packaging_calculator: improve test util
This way no matter who's changing the behavior of the name getter we'll get the right name.
This commit is contained in:
committed by
nguyen hoang hiep
parent
6ce14df9c6
commit
72997319a2
@@ -5,6 +5,7 @@
|
|||||||
def make_pkg_values(record, **kw):
|
def make_pkg_values(record, **kw):
|
||||||
"""Helper to generate test values for packaging.
|
"""Helper to generate test values for packaging.
|
||||||
"""
|
"""
|
||||||
|
name = record.name
|
||||||
if record._name == "uom.uom":
|
if record._name == "uom.uom":
|
||||||
is_unit = True
|
is_unit = True
|
||||||
barcode = None
|
barcode = None
|
||||||
@@ -13,9 +14,11 @@ def make_pkg_values(record, **kw):
|
|||||||
qty = record.qty
|
qty = record.qty
|
||||||
is_unit = False
|
is_unit = False
|
||||||
barcode = record.barcode
|
barcode = record.barcode
|
||||||
|
if record.product_id:
|
||||||
|
name = record.product_id._packaging_name_getter(record)
|
||||||
values = {
|
values = {
|
||||||
"id": record.id,
|
"id": record.id,
|
||||||
"name": record.name,
|
"name": name,
|
||||||
"qty": qty,
|
"qty": qty,
|
||||||
"barcode": barcode,
|
"barcode": barcode,
|
||||||
"is_unit": is_unit,
|
"is_unit": is_unit,
|
||||||
|
|||||||
Reference in New Issue
Block a user