Skip to content

Commit

Permalink
[4457][IMP] inventory_reporting: show product default_code in valuati…
Browse files Browse the repository at this point in the history
…on (#76)
  • Loading branch information
yostashiro committed Mar 29, 2024
1 parent 8a3ca00 commit 7ce817c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
25 changes: 16 additions & 9 deletions inventory_reporting/i18n/ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions inventory_reporting/reports/inventory_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 7ce817c

Please sign in to comment.