From 35cfc4c6efba26b13a7b6578fdfd3551c71a6dc6 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Thu, 15 Jul 2021 16:57:16 +0200 Subject: [PATCH] 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. --- .../i18n/stock_packaging_calculator.pot | 44 ------------------- stock_packaging_calculator/tests/utils.py | 5 ++- 2 files changed, 4 insertions(+), 45 deletions(-) delete mode 100644 stock_packaging_calculator/i18n/stock_packaging_calculator.pot diff --git a/stock_packaging_calculator/i18n/stock_packaging_calculator.pot b/stock_packaging_calculator/i18n/stock_packaging_calculator.pot deleted file mode 100644 index 664b39319..000000000 --- a/stock_packaging_calculator/i18n/stock_packaging_calculator.pot +++ /dev/null @@ -1,44 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * stock_packaging_calculator -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 14.0\n" -"Report-Msgid-Bugs-To: \n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: stock_packaging_calculator -#: model:ir.model.fields,field_description:stock_packaging_calculator.field_product_product__display_name -msgid "Display Name" -msgstr "" - -#. module: stock_packaging_calculator -#: model:ir.model.fields,field_description:stock_packaging_calculator.field_product_product__id -msgid "ID" -msgstr "" - -#. module: stock_packaging_calculator -#: model:ir.model.fields,field_description:stock_packaging_calculator.field_product_product____last_update -msgid "Last Modified on" -msgstr "" - -#. module: stock_packaging_calculator -#: model:ir.model.fields,field_description:stock_packaging_calculator.field_product_product__packaging_contained_mapping -msgid "Packaging Contained Mapping" -msgstr "" - -#. module: stock_packaging_calculator -#: model:ir.model,name:stock_packaging_calculator.model_product_product -msgid "Product" -msgstr "" - -#. module: stock_packaging_calculator -#: model:ir.model.fields,help:stock_packaging_calculator.field_product_product__packaging_contained_mapping -msgid "Technical field to store contained packaging. " -msgstr "" diff --git a/stock_packaging_calculator/tests/utils.py b/stock_packaging_calculator/tests/utils.py index cd9e12560..8c885894c 100644 --- a/stock_packaging_calculator/tests/utils.py +++ b/stock_packaging_calculator/tests/utils.py @@ -5,6 +5,7 @@ def make_pkg_values(record, **kw): """Helper to generate test values for packaging. """ + name = record.name if record._name == "uom.uom": is_unit = True barcode = None @@ -13,9 +14,11 @@ def make_pkg_values(record, **kw): qty = record.qty is_unit = False barcode = record.barcode + if record.product_id: + name = record.product_id._packaging_name_getter(record) values = { "id": record.id, - "name": record.name, + "name": name, "qty": qty, "barcode": barcode, "is_unit": is_unit,