From 7ce817cfc28a8ccc7bbf7356ae7b34d5d8f4ffdb Mon Sep 17 00:00:00 2001 From: "Yoshi Tashiro (Quartile)" Date: Fri, 29 Mar 2024 13:40:21 +0900 Subject: [PATCH] [4457][IMP] inventory_reporting: show product default_code in valuation (#76) --- inventory_reporting/i18n/ja.po | 25 ++++++++++++------- .../reports/inventory_report.py | 12 +++++---- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/inventory_reporting/i18n/ja.po b/inventory_reporting/i18n/ja.po index 9c735547..caa290de 100644 --- a/inventory_reporting/i18n/ja.po +++ b/inventory_reporting/i18n/ja.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 02:23+0000\n" -"PO-Revision-Date: 2023-12-13 02:23+0000\n" +"POT-Creation-Date: 2024-03-29 03:30+0000\n" +"PO-Revision-Date: 2024-03-29 03:30+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -43,6 +43,13 @@ msgstr "分析" msgid "Cancel" msgstr "取消" +#. module: inventory_reporting +#. odoo-python +#: code:addons/inventory_reporting/reports/inventory_report.py:0 +#, python-format +msgid "Component Flush" +msgstr "出庫" + #. module: inventory_reporting #: model:ir.model.fields,field_description:inventory_reporting.field_inventory_report_wizard__create_uid msgid "Created by" @@ -58,13 +65,6 @@ msgstr "作成日" msgid "Date Period" msgstr "期間" -#. module: inventory_reporting -#. odoo-python -#: code:addons/inventory_reporting/reports/inventory_report.py:0 -#, python-format -msgid "Component Flush" -msgstr "出庫" - #. module: inventory_reporting #. odoo-python #: code:addons/inventory_reporting/reports/inventory_report.py:0 @@ -98,6 +98,13 @@ msgstr "" msgid "Include in Inventory Report" msgstr "在庫評価出力対象" +#. module: inventory_reporting +#. odoo-python +#: code:addons/inventory_reporting/reports/inventory_report.py:0 +#, python-format +msgid "Internal Reference" +msgstr "内部参照" + #. module: inventory_reporting #. odoo-python #: code:addons/inventory_reporting/reports/inventory_report.py:0 diff --git a/inventory_reporting/reports/inventory_report.py b/inventory_reporting/reports/inventory_report.py index ae216026..2dbcff65 100644 --- a/inventory_reporting/reports/inventory_report.py +++ b/inventory_reporting/reports/inventory_report.py @@ -42,6 +42,7 @@ def generate_valuation_report(self, workbook, wizard): # Write the header headers = [ _("Product Name"), + _("Internal Reference"), _("Quantity"), _("Unit of Measurement"), _("Unit Price"), @@ -83,15 +84,16 @@ def generate_valuation_report(self, workbook, wizard): rounding_method="UP", ) ws.write(row, 0, product.name) - ws.write(row, 1, valuation_data["quantity"]) - ws.write(row, 2, product.uom_id.name) - ws.write(row, 3, unit_cost) - ws.write(row, 4, valuation_data["value"]) + ws.write(row, 1, product.default_code) + ws.write(row, 2, valuation_data["quantity"]) + ws.write(row, 3, product.uom_id.name) + ws.write(row, 4, unit_cost) + ws.write(row, 5, valuation_data["value"]) # Convert the date to the desired format (YYYY-MM-DD) last_purchase_date = fields.Date.from_string(product.last_purchase_date) if last_purchase_date: - ws.write(row, 5, last_purchase_date.strftime("%Y-%m-%d")) + ws.write(row, 6, last_purchase_date.strftime("%Y-%m-%d")) row += 1 def generate_storable_report(self, workbook, wizard):