diff --git a/stock_inventory_valuation_report/README.rst b/stock_inventory_valuation_report/README.rst new file mode 100644 index 000000000..4aa532bd9 --- /dev/null +++ b/stock_inventory_valuation_report/README.rst @@ -0,0 +1,104 @@ +================================ +Stock Inventory Valuation Report +================================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:2a6d3655c0a99ec506c950b1a9d6912bd87920b595e4005c110adfa431ab16c6 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--reporting-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-reporting/tree/17.0/stock_inventory_valuation_report + :alt: OCA/stock-logistics-reporting +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-reporting-17-0/stock-logistics-reporting-17-0-stock_inventory_valuation_report + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-reporting&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Stock Inventory Valuation Report is the report that display value of all +products in internal location. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +1. Go to Inventory > Reporting > Valuation > Click on + "Valuation at Date" button +2. Select Inventory At Date. +3. You can now choose a few additional options: "View report", "Export + PDF" and "Export XLSX". + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Ecosoft + +Contributors +------------ + +- `Pimolnat Suntian `__ + +- `Ooops404 `__ + + - `Francesco Foresti `__ + +- `Cetmix `__ + + - `Andrey Solodovnikov `__ + +- `PyTech SRL `__ + + - `Alessandro Uffreduzzi `__ + +- `TradeSolutions.Digital GmbH `__ + + - `Mitul Shah `__ + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/stock-logistics-reporting `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_inventory_valuation_report/__init__.py b/stock_inventory_valuation_report/__init__.py new file mode 100644 index 000000000..2873ef602 --- /dev/null +++ b/stock_inventory_valuation_report/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2019 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import wizard +from . import reports diff --git a/stock_inventory_valuation_report/__manifest__.py b/stock_inventory_valuation_report/__manifest__.py new file mode 100644 index 000000000..b73eb9509 --- /dev/null +++ b/stock_inventory_valuation_report/__manifest__.py @@ -0,0 +1,30 @@ +# Copyright 2019 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Stock Inventory Valuation Report", + "summary": "Add report button on Inventory Valuation.", + "version": "17.0.1.0.0", + "category": "Warehouse", + "website": "https://github.com/OCA/stock-logistics-reporting", + "author": "Ecosoft,Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": [ + "stock_account", + "report_xlsx_helper", + ], + "data": [ + "data/paperformat_data.xml", + "security/ir.model.access.csv", + "reports/stock_inventory_valuation_report.xml", + "wizard/stock_quantity_history_view.xml", + ], + "assets": { + "web.assets_backend": [ + "stock_inventory_valuation_report/static/src/css/report.css", + "stock_inventory_valuation_report/static/src/js/stock_inventory_valuation_report_backend.esm.js", + "stock_inventory_valuation_report/static/src/xml/stock_inventory_valuation_report_backend.xml", + ], + }, + "installable": True, +} diff --git a/stock_inventory_valuation_report/data/paperformat_data.xml b/stock_inventory_valuation_report/data/paperformat_data.xml new file mode 100644 index 000000000..c362be68f --- /dev/null +++ b/stock_inventory_valuation_report/data/paperformat_data.xml @@ -0,0 +1,18 @@ + + + + Inventory Valuation Report A4 + + A4 + 0 + 0 + Portrait + 28 + 28 + 7 + 7 + + 24 + 90 + + diff --git a/stock_inventory_valuation_report/i18n/fr.po b/stock_inventory_valuation_report/i18n/fr.po new file mode 100644 index 000000000..dd8301ff6 --- /dev/null +++ b/stock_inventory_valuation_report/i18n/fr.po @@ -0,0 +1,233 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_inventory_valuation_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-01-22 15:46+0000\n" +"Last-Translator: Yann Papouin \n" +"Language-Team: none\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_buttons +msgid "Export" +msgstr "Exporter" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_buttons +msgid "Print" +msgstr "Imprimer" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__barcode +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Barcode" +msgstr "Code Barre" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__company_id +msgid "Company" +msgstr "Société" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__compute_at_date +msgid "Compute At Date" +msgstr "Calculer à la date" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Cost" +msgstr "Coût" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__cost_currency_id +msgid "Cost Currency" +msgstr "Devise de coût" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__cost_method +msgid "Cost Method" +msgstr "Méthode de détermination du coût des stocks" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__create_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__create_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__create_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__create_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__create_date +msgid "Created on" +msgstr "Créé le" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__currency_id +msgid "Currency" +msgstr "Devise" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__date +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_filters +msgid "Date" +msgstr "Date" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__display_name +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__display_name +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.view_stock_quantity_history_inherit +msgid "Export PDF" +msgstr "Exporter en PDF" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.view_stock_quantity_history_inherit +msgid "Export XLSX" +msgstr "Exporter en XLSX" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__id +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__id +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__id +msgid "ID" +msgstr "ID" + +#. module: stock_inventory_valuation_report +#: model:ir.actions.client,name:stock_inventory_valuation_report.action_stock_inventory_valuation_report_html +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_base +msgid "Inventory Valuation Report" +msgstr "Rapport de valorisation d'inventaire" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx____last_update +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report____last_update +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__write_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__write_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__write_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__write_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__name +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Name" +msgstr "Nom" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_filters +msgid "Partner" +msgstr "Partenaire" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__qty_at_date +msgid "Qty At Date" +msgstr "Qté à la date" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Quantity" +msgstr "Quantité" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__reference +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Reference" +msgstr "Référence" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__results +msgid "Results" +msgstr "Résultats" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__standard_price +msgid "Standard Price" +msgstr "Prix standard" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_report_stock_inventory_valuation_report +msgid "Stock Inventory Valuation Report" +msgstr "Rapport de valorisation d'inventaire de stock" + +#. module: stock_inventory_valuation_report +#: model:ir.actions.report,name:stock_inventory_valuation_report.action_stock_inventory_valuation_report_pdf +msgid "Stock Inventory Valuation Report PDF" +msgstr "Rapport PDF de valorisation d'inventaire de stock" + +#. module: stock_inventory_valuation_report +#: model:ir.actions.report,name:stock_inventory_valuation_report.action_stock_inventory_valuation_report_xlsx +msgid "Stock Inventory Valuation Report XLSX" +msgstr "Rapport XLSX de valorisation d'inventaire de stock" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_stock_inventory_valuation_view +msgid "Stock Inventory Valuation View" +msgstr "Vue de la valorisation d'inventaire de stock" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_stock_quantity_history +msgid "Stock Quantity History" +msgstr "Historique des quantités en stock" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__stock_value +msgid "Stock Value" +msgstr "Valeur du stock" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_filters +msgid "Tax ID" +msgstr "N° TVA" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__uom_id +msgid "Uom" +msgstr "UdM" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,help:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__results +msgid "Use compute fields, so there is nothing store in database" +msgstr "" +"Utilise des champs calculés, il n'y a donc rien de stocké dans la base de " +"données" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Value" +msgstr "Valeur" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.view_stock_quantity_history_inherit +msgid "View report" +msgstr "Voir le rapport" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx +msgid "report.s_i_v_r.report_stock_inventory_valuation_report_xlsx" +msgstr "report.s_i_v_r.report_stock_inventory_valuation_report_xlsx" diff --git a/stock_inventory_valuation_report/i18n/it.po b/stock_inventory_valuation_report/i18n/it.po new file mode 100644 index 000000000..440116b25 --- /dev/null +++ b/stock_inventory_valuation_report/i18n/it.po @@ -0,0 +1,231 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_inventory_valuation_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-03-19 15:41+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_buttons +msgid "Export" +msgstr "Esporta" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_buttons +msgid "Print" +msgstr "Stampa" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__barcode +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Barcode" +msgstr "Codice a barre" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__company_id +msgid "Company" +msgstr "Azienda" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__compute_at_date +msgid "Compute At Date" +msgstr "Calcola alla data" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Cost" +msgstr "Costo" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__cost_currency_id +msgid "Cost Currency" +msgstr "Valuta costo" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__cost_method +msgid "Cost Method" +msgstr "Metodo costo" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__create_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__create_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__create_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__create_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__currency_id +msgid "Currency" +msgstr "Valuta" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__date +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_filters +msgid "Date" +msgstr "Data" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__display_name +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__display_name +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.view_stock_quantity_history_inherit +msgid "Export PDF" +msgstr "Esporta PDF" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.view_stock_quantity_history_inherit +msgid "Export XLSX" +msgstr "Esporta XLSX" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__id +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__id +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__id +msgid "ID" +msgstr "ID" + +#. module: stock_inventory_valuation_report +#: model:ir.actions.client,name:stock_inventory_valuation_report.action_stock_inventory_valuation_report_html +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_base +msgid "Inventory Valuation Report" +msgstr "Stampa valorizzazione magazzino" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx____last_update +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report____last_update +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__write_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__write_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__write_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__write_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__name +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Name" +msgstr "Nome" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_filters +msgid "Partner" +msgstr "Partner" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__qty_at_date +msgid "Qty At Date" +msgstr "Qtà alla data" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Quantity" +msgstr "Quantità" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__reference +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Reference" +msgstr "Riferimento" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__results +msgid "Results" +msgstr "Risultati" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__standard_price +msgid "Standard Price" +msgstr "Prezzo standard" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_report_stock_inventory_valuation_report +msgid "Stock Inventory Valuation Report" +msgstr "Stampa valorizzazione magazzino" + +#. module: stock_inventory_valuation_report +#: model:ir.actions.report,name:stock_inventory_valuation_report.action_stock_inventory_valuation_report_pdf +msgid "Stock Inventory Valuation Report PDF" +msgstr "Stampa PDF valorizzazione magazzino" + +#. module: stock_inventory_valuation_report +#: model:ir.actions.report,name:stock_inventory_valuation_report.action_stock_inventory_valuation_report_xlsx +msgid "Stock Inventory Valuation Report XLSX" +msgstr "Stampa XLSX valorizzazione magazzino" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_stock_inventory_valuation_view +msgid "Stock Inventory Valuation View" +msgstr "Vista valorizzazione magazzino" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_stock_quantity_history +msgid "Stock Quantity History" +msgstr "Storico quantità giacenza" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__stock_value +msgid "Stock Value" +msgstr "Valore inventario" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_filters +msgid "Tax ID" +msgstr "Partita IVA" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__uom_id +msgid "Uom" +msgstr "UdM" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,help:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__results +msgid "Use compute fields, so there is nothing store in database" +msgstr "Usa campi calcolati, così non viene conservato nulla nel database" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Value" +msgstr "Valore" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.view_stock_quantity_history_inherit +msgid "View report" +msgstr "Vedi resoconto" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx +msgid "report.s_i_v_r.report_stock_inventory_valuation_report_xlsx" +msgstr "report.s_i_v_r.report_stock_inventory_valuation_report_xlsx" diff --git a/stock_inventory_valuation_report/i18n/pt.po b/stock_inventory_valuation_report/i18n/pt.po new file mode 100644 index 000000000..8f5dcc8ae --- /dev/null +++ b/stock_inventory_valuation_report/i18n/pt.po @@ -0,0 +1,232 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_inventory_valuation_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-11-06 13:08+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: none\n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 3.10\n" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_buttons +msgid "Export" +msgstr "Exportar" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_buttons +msgid "Print" +msgstr "Imprimir" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__barcode +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Barcode" +msgstr "Código de barras" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__company_id +msgid "Company" +msgstr "Empresa" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__compute_at_date +msgid "Compute At Date" +msgstr "Calcular à Data" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Cost" +msgstr "Custo" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__cost_currency_id +msgid "Cost Currency" +msgstr "Moeda do Custo" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__cost_method +msgid "Cost Method" +msgstr "Método de Custeio" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__create_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__create_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__create_uid +msgid "Created by" +msgstr "Criado por" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__create_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__create_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__create_date +msgid "Created on" +msgstr "Criado em" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__currency_id +msgid "Currency" +msgstr "Moeda" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__date +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_filters +msgid "Date" +msgstr "Data" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__display_name +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__display_name +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__display_name +msgid "Display Name" +msgstr "Nome a Apresentar" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.view_stock_quantity_history_inherit +msgid "Export PDF" +msgstr "Exportar PDF" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.view_stock_quantity_history_inherit +msgid "Export XLSX" +msgstr "Exportar XLSX" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__id +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__id +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__id +msgid "ID" +msgstr "Id" + +#. module: stock_inventory_valuation_report +#: model:ir.actions.client,name:stock_inventory_valuation_report.action_stock_inventory_valuation_report_html +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_base +msgid "Inventory Valuation Report" +msgstr "Relatório de Avaliação de Inventário" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx____last_update +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report____last_update +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view____last_update +msgid "Last Modified on" +msgstr "Última Modificação em" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__write_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__write_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__write_uid +msgid "Last Updated by" +msgstr "Última Atualização por" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__write_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__write_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__write_date +msgid "Last Updated on" +msgstr "Última Atualização em" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__name +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Name" +msgstr "Nome" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_filters +msgid "Partner" +msgstr "Parceiro" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__qty_at_date +msgid "Qty At Date" +msgstr "Qtd. na Data" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Quantity" +msgstr "Quantidade" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__reference +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Reference" +msgstr "Referência" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__results +msgid "Results" +msgstr "Resultados" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__standard_price +msgid "Standard Price" +msgstr "Custo Padrão" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_report_stock_inventory_valuation_report +msgid "Stock Inventory Valuation Report" +msgstr "Relatório de Avaliação de Inventário" + +#. module: stock_inventory_valuation_report +#: model:ir.actions.report,name:stock_inventory_valuation_report.action_stock_inventory_valuation_report_pdf +msgid "Stock Inventory Valuation Report PDF" +msgstr "Relatório de Avaliação de Inventário PDF" + +#. module: stock_inventory_valuation_report +#: model:ir.actions.report,name:stock_inventory_valuation_report.action_stock_inventory_valuation_report_xlsx +msgid "Stock Inventory Valuation Report XLSX" +msgstr "Relatório de Avaliação de Inventário XLSX" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_stock_inventory_valuation_view +msgid "Stock Inventory Valuation View" +msgstr "Vista de Avaliação do Inventário" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_stock_quantity_history +msgid "Stock Quantity History" +msgstr "Histórico da Quantidade em Stock" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__stock_value +msgid "Stock Value" +msgstr "Valor do Stock" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_filters +msgid "Tax ID" +msgstr "NIF" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__uom_id +msgid "Uom" +msgstr "UdM" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,help:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__results +msgid "Use compute fields, so there is nothing store in database" +msgstr "" +"Usar campos calculados para que não haja nada armazenado na base de dados" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Value" +msgstr "Valor" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.view_stock_quantity_history_inherit +msgid "View report" +msgstr "Exibir relatório" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx +msgid "report.s_i_v_r.report_stock_inventory_valuation_report_xlsx" +msgstr "" diff --git a/stock_inventory_valuation_report/i18n/sl.po b/stock_inventory_valuation_report/i18n/sl.po new file mode 100644 index 000000000..297e1c580 --- /dev/null +++ b/stock_inventory_valuation_report/i18n/sl.po @@ -0,0 +1,232 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_inventory_valuation_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-08-13 19:59+0000\n" +"Last-Translator: Matjaz Mozetic \n" +"Language-Team: none\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || " +"n%100==4 ? 2 : 3;\n" +"X-Generator: Weblate 3.10\n" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_buttons +msgid "Export" +msgstr "Izvoz" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_buttons +msgid "Print" +msgstr "Natisni" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__barcode +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Barcode" +msgstr "Črtna koda" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__company_id +msgid "Company" +msgstr "Družba" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__compute_at_date +msgid "Compute At Date" +msgstr "Obdelaj na datum" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Cost" +msgstr "Lastna cena" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__cost_currency_id +msgid "Cost Currency" +msgstr "Valuta lastne cene" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__cost_method +msgid "Cost Method" +msgstr "Metoda vrednotenja" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__create_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__create_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__create_uid +msgid "Created by" +msgstr "Ustvaril" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__create_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__create_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__create_date +msgid "Created on" +msgstr "Ustvarjeno" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__currency_id +msgid "Currency" +msgstr "Valuta" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__date +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_filters +msgid "Date" +msgstr "Datum" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__display_name +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__display_name +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__display_name +msgid "Display Name" +msgstr "Prikazani naziv" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.view_stock_quantity_history_inherit +msgid "Export PDF" +msgstr "Izvoz v PDF" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.view_stock_quantity_history_inherit +msgid "Export XLSX" +msgstr "Izvoz v XLSX" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__id +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__id +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__id +msgid "ID" +msgstr "ID" + +#. module: stock_inventory_valuation_report +#: model:ir.actions.client,name:stock_inventory_valuation_report.action_stock_inventory_valuation_report_html +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_base +msgid "Inventory Valuation Report" +msgstr "Poročilo o vrednotenju zalog" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx____last_update +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report____last_update +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view____last_update +msgid "Last Modified on" +msgstr "Zadnjič spremenjeno" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__write_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__write_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__write_uid +msgid "Last Updated by" +msgstr "Zadnji posodobil" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__write_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__write_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__write_date +msgid "Last Updated on" +msgstr "Zadnjič posodobljeno" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__name +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Name" +msgstr "Naziv" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_filters +msgid "Partner" +msgstr "Partner" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__qty_at_date +msgid "Qty At Date" +msgstr "Kol na datum" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Quantity" +msgstr "Količina" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__reference +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Reference" +msgstr "Sklic" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__results +msgid "Results" +msgstr "Rezultati" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__standard_price +msgid "Standard Price" +msgstr "Standardna cena" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_report_stock_inventory_valuation_report +msgid "Stock Inventory Valuation Report" +msgstr "Poročilo o vrednotenju zalog" + +#. module: stock_inventory_valuation_report +#: model:ir.actions.report,name:stock_inventory_valuation_report.action_stock_inventory_valuation_report_pdf +msgid "Stock Inventory Valuation Report PDF" +msgstr "Poročilo o vrednotenju zalog PDF" + +#. module: stock_inventory_valuation_report +#: model:ir.actions.report,name:stock_inventory_valuation_report.action_stock_inventory_valuation_report_xlsx +msgid "Stock Inventory Valuation Report XLSX" +msgstr "Poročilo o vrednotenju zalog XLSX" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_stock_inventory_valuation_view +msgid "Stock Inventory Valuation View" +msgstr "Prikaz vrednotenja zalog" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_stock_quantity_history +msgid "Stock Quantity History" +msgstr "Zgodovina količin zalog" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__stock_value +msgid "Stock Value" +msgstr "Vrednost zaloge" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_filters +msgid "Tax ID" +msgstr "Davčna ID" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__uom_id +msgid "Uom" +msgstr "EM" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,help:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__results +msgid "Use compute fields, so there is nothing store in database" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Value" +msgstr "Vrednost" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.view_stock_quantity_history_inherit +msgid "View report" +msgstr "Prikaz poročila" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx +msgid "report.s_i_v_r.report_stock_inventory_valuation_report_xlsx" +msgstr "report.s_i_v_r.report_stock_inventory_valuation_report_xlsx" diff --git a/stock_inventory_valuation_report/i18n/stock_inventory_valuation_report.pot b/stock_inventory_valuation_report/i18n/stock_inventory_valuation_report.pot new file mode 100644 index 000000000..2c63c36cd --- /dev/null +++ b/stock_inventory_valuation_report/i18n/stock_inventory_valuation_report.pot @@ -0,0 +1,251 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_inventory_valuation_report +# +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_inventory_valuation_report +#: model:ir.actions.report,print_report_name:stock_inventory_valuation_report.action_stock_inventory_valuation_report_pdf +msgid "'Inventory Valuation Report - [%s]' % object.inventory_datetime" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_buttons +msgid "Export" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_buttons +msgid "Print" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__barcode +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Barcode" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__company_id +msgid "Company" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Cost" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__cost_currency_id +msgid "Cost Currency" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__cost_method +msgid "Cost Method" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__create_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__create_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__create_uid +msgid "Created by" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__create_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__create_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__create_date +msgid "Created on" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__currency_id +msgid "Currency" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_filters +msgid "Date" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__display_name +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__display_name +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__display_name +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_quantity_history__display_name +msgid "Display Name" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.view_stock_valuation_quantity_history +msgid "Export PDF" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.view_stock_valuation_quantity_history +msgid "Export XLSX" +msgstr "" + +#. module: stock_inventory_valuation_report +#: code:addons/stock_inventory_valuation_report/wizard/stock_quantity_history.py:0 +#, python-format +msgid "Failed context evaluation: %(context)s" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__id +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__id +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__id +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_quantity_history__id +msgid "ID" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__inventory_datetime +msgid "Inventory Datetime" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.actions.client,name:stock_inventory_valuation_report.action_stock_inventory_valuation_report_html +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_base +msgid "Inventory Valuation Report" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx____last_update +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report____last_update +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view____last_update +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_quantity_history____last_update +msgid "Last Modified on" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__write_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__write_uid +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx__write_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__write_date +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__write_date +msgid "Last Updated on" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__name +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Name" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_filters +msgid "Partner" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__qty_at_date +msgid "Qty At Date" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Quantity" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__reference +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Reference" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__report_id +msgid "Report" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx +msgid "Report Stock Inventory Valuation xlsx" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_report_stock_inventory_valuation_report__results +msgid "Results" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.view_stock_valuation_quantity_history +msgid "Retrieve the Inventory Quantities" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__standard_price +msgid "Standard Price" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_report_stock_inventory_valuation_report +msgid "Stock Inventory Valuation Report" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.actions.report,name:stock_inventory_valuation_report.action_stock_inventory_valuation_report_pdf +msgid "Stock Inventory Valuation Report PDF" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.actions.report,name:stock_inventory_valuation_report.action_stock_inventory_valuation_report_xlsx +msgid "Stock Inventory Valuation Report XLSX" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_stock_inventory_valuation_view +msgid "Stock Inventory Valuation View" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model,name:stock_inventory_valuation_report.model_stock_quantity_history +msgid "Stock Quantity History" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__stock_value +msgid "Stock Value" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_report_filters +msgid "Tax ID" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "UoM" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model:ir.model.fields,field_description:stock_inventory_valuation_report.field_stock_inventory_valuation_view__uom_id +msgid "Uom" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.report_stock_inventory_valuation_lines_header +msgid "Value" +msgstr "" + +#. module: stock_inventory_valuation_report +#: model_terms:ir.ui.view,arch_db:stock_inventory_valuation_report.view_stock_valuation_quantity_history +msgid "View report" +msgstr "" diff --git a/stock_inventory_valuation_report/pyproject.toml b/stock_inventory_valuation_report/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/stock_inventory_valuation_report/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/stock_inventory_valuation_report/readme/CONTRIBUTORS.md b/stock_inventory_valuation_report/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..b1d0758ba --- /dev/null +++ b/stock_inventory_valuation_report/readme/CONTRIBUTORS.md @@ -0,0 +1,13 @@ +- [Pimolnat Suntian](pimolnats@ecosoft.co.th) + +- [Ooops404](https://ooops404.com) + - [Francesco Foresti](francesco.foresti@ooops404.com) + +- [Cetmix](https://cetmix.com) + - [Andrey Solodovnikov](andrejsolodovnikov@gmail.com) + +- [PyTech SRL](https://www.pytech.it) + - [Alessandro Uffreduzzi](alessandro.uffreduzzi@pytech.it) + +- [TradeSolutions.Digital GmbH](https://www.tradesolutions.digital) + - [Mitul Shah](mitul@tradesolutions.digital) diff --git a/stock_inventory_valuation_report/readme/DESCRIPTION.md b/stock_inventory_valuation_report/readme/DESCRIPTION.md new file mode 100644 index 000000000..05ad4a081 --- /dev/null +++ b/stock_inventory_valuation_report/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +Stock Inventory Valuation Report is the report that display value of all +products in internal location. diff --git a/stock_inventory_valuation_report/readme/USAGE.md b/stock_inventory_valuation_report/readme/USAGE.md new file mode 100644 index 000000000..a50d01f4f --- /dev/null +++ b/stock_inventory_valuation_report/readme/USAGE.md @@ -0,0 +1,6 @@ +To use this module, you need to: + +1. Go to Inventory \> Reporting \> Inventory Valuation. +2. Select Inventory At Date. +3. You can now choose a few additional options: "View report", "Export + PDF" and "Export XLSX". diff --git a/stock_inventory_valuation_report/reports/__init__.py b/stock_inventory_valuation_report/reports/__init__.py new file mode 100644 index 000000000..696cd6883 --- /dev/null +++ b/stock_inventory_valuation_report/reports/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2019 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import stock_inventory_valuation_report +from . import stock_inventory_valuation_report_xlsx diff --git a/stock_inventory_valuation_report/reports/stock_inventory_valuation_report.py b/stock_inventory_valuation_report/reports/stock_inventory_valuation_report.py new file mode 100644 index 000000000..45006b284 --- /dev/null +++ b/stock_inventory_valuation_report/reports/stock_inventory_valuation_report.py @@ -0,0 +1,190 @@ +# Copyright 2019 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models +from odoo.osv import expression + + +class StockInventoryValuationView(models.TransientModel): + _name = "stock.inventory.valuation.view" + _description = "Stock Inventory Valuation View" + + report_id = fields.Many2one("report.stock.inventory.valuation.report") + + name = fields.Char() + reference = fields.Char() + barcode = fields.Char() + qty_at_date = fields.Float() + uom_id = fields.Many2one( + comodel_name="uom.uom", + ) + currency_id = fields.Many2one( + comodel_name="res.currency", + ) + cost_currency_id = fields.Many2one( + comodel_name="res.currency", + ) + standard_price = fields.Float() + stock_value = fields.Float() + cost_method = fields.Char() + + +class StockInventoryValuationReport(models.TransientModel): + _name = "report.stock.inventory.valuation.report" + _description = "Stock Inventory Valuation Report" + + # Filters fields, used for data computation + company_id = fields.Many2one( + comodel_name="res.company", + ) + inventory_datetime = fields.Datetime(required=True, default=fields.Datetime.now) + + results = fields.One2many( + comodel_name="stock.inventory.valuation.view", + inverse_name="report_id", + compute="_compute_results", + ) + + @api.depends("inventory_datetime") + def _compute_results(self): + """ + Generate report lines, one per product with stock at the given date. + + For databases migrated from older versions to Odoo 17, we need to calculate + historical quantities from stock.move.line instead of stock_valuation_layer + because SVL.sum(quantity) gives accumulated historical total, not actual stock. + """ + self.ensure_one() + + # Build domain for products + domain = [("type", "=", "product")] + product_id = self.env.context.get("product_id") + product_tmpl_id = self.env.context.get("product_tmpl_id") + if product_id: + domain = expression.AND([domain, [("id", "=", product_id)]]) + elif product_tmpl_id: + domain = expression.AND( + [domain, [("product_tmpl_id", "=", product_tmpl_id)]] + ) + + products = self.env["product.product"].search(domain) + + if not products: + self.results = self.env["stock.inventory.valuation.view"] + return + + # Flush pending changes to database before SQL query + self.env.flush_all() + + # Query historical quantities from stock.move.line + # This gives accurate results for migrated databases + # Note: We use m.date instead of ml.date because tests may modify + # move dates after validation + query = """ + SELECT ml.product_id, + COALESCE( + SUM(CASE WHEN loc_dest.usage = 'internal' + THEN ml.quantity ELSE 0 END), 0 + ) as qty_in, + COALESCE( + SUM(CASE WHEN loc_src.usage = 'internal' + THEN ml.quantity ELSE 0 END), 0 + ) as qty_out + FROM stock_move_line ml + INNER JOIN stock_location loc_src ON ml.location_id = loc_src.id + INNER JOIN stock_location loc_dest + ON ml.location_dest_id = loc_dest.id + INNER JOIN stock_move m ON ml.move_id = m.id + WHERE ml.product_id IN %s + AND ml.state = 'done' + AND m.date <= %s + AND m.company_id = %s + GROUP BY ml.product_id + """ + + self.env.cr.execute( + query, (tuple(products.ids), self.inventory_datetime, self.env.company.id) + ) + + qty_data = { + row[0]: row[1] - row[2] # qty_in - qty_out + for row in self.env.cr.fetchall() + } + + # Generate result lines + results = self.env["stock.inventory.valuation.view"] + products_with_stock = products.filtered( + lambda p: p.id in qty_data and qty_data[p.id] > 0 + ) + + # Apply context to get historical SVL values + products_at_date = products_with_stock.with_context( + to_date=self.inventory_datetime, + company_owned=True, + ) + + for product, product_at_date in zip( + products_with_stock, products_at_date, strict=False + ): + qty_at_date = qty_data[product.id] + + # Calculate historical cost from SVL (same as Odoo 12 get_history_price) + # Use value_svl / quantity_svl from product with to_date context + if product_at_date.quantity_svl: + standard_price = ( + product_at_date.value_svl / product_at_date.quantity_svl + ) + else: + standard_price = product_at_date.standard_price + + stock_value = qty_at_date * standard_price + + vals = { + "name": product.with_context(display_default_code=False).display_name, + "reference": product.default_code, + "barcode": product.barcode, + "qty_at_date": qty_at_date, + "uom_id": product.uom_id.id, + "currency_id": product.currency_id.id, + "cost_currency_id": product.cost_currency_id.id, + "standard_price": standard_price, + "stock_value": stock_value, + "cost_method": product.cost_method, + } + results |= results.new(vals) + + self.results = results + + def print_report(self, report_type="qweb"): + self.ensure_one() + action = ( + report_type == "xlsx" + and self.env.ref( + "stock_inventory_valuation_report." + "action_stock_inventory_valuation_report_xlsx", + raise_if_not_found=False, + ) + or self.env.ref( + "stock_inventory_valuation_report." + "action_stock_inventory_valuation_report_pdf", + raise_if_not_found=False, + ) + ) + return action.report_action(self, config=False) + + def _get_html(self): + result = {} + rcontext = {} + report = self.browse(self._context.get("active_id")) + if report: + rcontext["o"] = report + result["html"] = self.env["ir.ui.view"]._render_template( + "stock_inventory_valuation_report." + "report_stock_inventory_valuation_report_html", + values=rcontext, + ) + return result + + @api.model + def get_html(self, given_context=None): + return self.with_context(**given_context)._get_html() diff --git a/stock_inventory_valuation_report/reports/stock_inventory_valuation_report.xml b/stock_inventory_valuation_report/reports/stock_inventory_valuation_report.xml new file mode 100644 index 000000000..126f1afa9 --- /dev/null +++ b/stock_inventory_valuation_report/reports/stock_inventory_valuation_report.xml @@ -0,0 +1,229 @@ + + + + Inventory Valuation Report + stock_inventory_valuation_report_backend + + + + + Stock Inventory Valuation Report PDF + report.stock.inventory.valuation.report + qweb-pdf + stock_inventory_valuation_report.report_stock_inventory_valuation_report_pdf + stock_inventory_valuation_report.report_stock_inventory_valuation_report_pdf + 'Inventory Valuation Report - [%s]' % object.inventory_datetime + + report + + + + + Stock Inventory Valuation Report XLSX + report.stock.inventory.valuation.report + xlsx + s_i_v_r.report_stock_inventory_valuation_report_xlsx + Inventory Valuation Report + + report + False + + + + + + + + + + + + + + + + + + + + diff --git a/stock_inventory_valuation_report/reports/stock_inventory_valuation_report_xlsx.py b/stock_inventory_valuation_report/reports/stock_inventory_valuation_report_xlsx.py new file mode 100644 index 000000000..77d442418 --- /dev/null +++ b/stock_inventory_valuation_report/reports/stock_inventory_valuation_report_xlsx.py @@ -0,0 +1,169 @@ +# Copyright 2019 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + +from odoo.addons.report_xlsx_helper.report.report_xlsx_format import ( + FORMATS, + XLS_HEADERS, +) + + +class ReportStockInventoryValuationReportXlsx(models.TransientModel): + _name = "report.s_i_v_r.report_stock_inventory_valuation_report_xlsx" + _description = "Report Stock Inventory Valuation xlsx" + _inherit = "report.report_xlsx.abstract" + + def _get_ws_params(self, wb, data, objects): + stock_inventory_valuation_template = { + "1_number": { + "header": { + "value": "#", + }, + "data": { + "value": self._render("n"), + }, + "width": 12, + }, + "2_reference": { + "header": { + "value": "Reference", + }, + "data": { + "value": self._render("reference"), + }, + "width": 15, + }, + "3_name": { + "header": { + "value": "Name", + }, + "data": { + "value": self._render("name"), + }, + "width": 36, + }, + "4_barcode": { + "header": { + "value": "Barcode", + }, + "data": { + "value": self._render("barcode"), + }, + "width": 15, + }, + "5_qty_at_date": { + "header": { + "value": "Quantity", + }, + "data": { + "value": self._render("qty_at_date"), + "format": FORMATS["format_tcell_amount_conditional_right"], + }, + "width": 18, + }, + "6_uom": { + "header": { + "value": "UoM", + }, + "data": { + "value": self._render("uom"), + }, + "width": 11, + }, + "7_standard_price": { + "header": { + "value": "Cost", + }, + "data": { + "value": self._render("standard_price"), + "format": FORMATS["format_tcell_amount_conditional_right"], + }, + "width": 18, + }, + "8_stock_value": { + "header": { + "value": "Value", + }, + "data": { + "value": self._render("stock_value"), + "format": FORMATS["format_tcell_amount_conditional_right"], + }, + "width": 18, + }, + } + + ws_params = { + "ws_name": "Inventory Valuation Report", + "generate_ws_method": "_inventory_valuation_report", + "title": "Inventory Valuation Report", + "wanted_list": [ + k for k in sorted(stock_inventory_valuation_template.keys()) + ], + "col_specs": stock_inventory_valuation_template, + } + return [ws_params] + + def _inventory_valuation_report(self, wb, ws, ws_params, data, objects): + ws.set_portrait() + ws.fit_to_pages(1, 0) + ws.set_header(XLS_HEADERS["xls_headers"]["standard"]) + ws.set_footer(XLS_HEADERS["xls_footers"]["standard"]) + + self._set_column_width(ws, ws_params) + + row_pos = 0 + row_pos = self._write_ws_title(ws, row_pos, ws_params, True) + + for o in objects: + ws.write_row( + row_pos, + 0, + ["Date", "Partner", "Tax ID"], + FORMATS["format_theader_blue_center"], + ) + ws.write_row( + row_pos + 1, + 0, + [o.inventory_datetime or ""], + FORMATS["format_tcell_date_center"], + ) + ws.write_row( + row_pos + 1, + 1, + [o.company_id.name or "", o.company_id.vat or ""], + FORMATS["format_tcell_center"], + ) + + row_pos += 3 + row_pos = self._write_line( + ws, + row_pos, + ws_params, + col_specs_section="header", + default_format=FORMATS["format_theader_blue_center"], + ) + ws.freeze_panes(row_pos, 0) + + total = 0.00 + for line in o.results: + row_pos = self._write_line( + ws, + row_pos, + ws_params, + col_specs_section="data", + render_space={ + "n": row_pos - 5, + "name": line.name or "", + "reference": line.reference or "", + "barcode": line.barcode or "", + "qty_at_date": line.qty_at_date or 0.000, + "uom": line.uom_id.name or "", + "standard_price": line.standard_price or 0.00, + "stock_value": line.stock_value or 0.00, + }, + default_format=FORMATS["format_tcell_left"], + ) + total += line.stock_value + + ws.write(row_pos, 7, total, FORMATS["format_theader_blue_amount_right"]) diff --git a/stock_inventory_valuation_report/security/ir.model.access.csv b/stock_inventory_valuation_report/security/ir.model.access.csv new file mode 100644 index 000000000..09e9bb735 --- /dev/null +++ b/stock_inventory_valuation_report/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_report_stock_inventory_valuation_report,report.stock.inventory.valuation.report,model_report_stock_inventory_valuation_report,stock.group_stock_user,1,1,1,1 +access_stock_inventory_valuation_view,stock_inventory_valuation_view,model_stock_inventory_valuation_view,stock.group_stock_user,1,1,1,1 +access_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx,report.s_i_v_r.report_stock_inventory_valuation_report_xlsx,model_report_s_i_v_r_report_stock_inventory_valuation_report_xlsx,stock.group_stock_user,1,1,1,1 diff --git a/stock_inventory_valuation_report/static/description/icon.png b/stock_inventory_valuation_report/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/stock_inventory_valuation_report/static/description/icon.png differ diff --git a/stock_inventory_valuation_report/static/description/index.html b/stock_inventory_valuation_report/static/description/index.html new file mode 100644 index 000000000..5be39a813 --- /dev/null +++ b/stock_inventory_valuation_report/static/description/index.html @@ -0,0 +1,451 @@ + + + + + +Stock Inventory Valuation Report + + + +
+

Stock Inventory Valuation Report

+ + +

Beta License: AGPL-3 OCA/stock-logistics-reporting Translate me on Weblate Try me on Runboat

+

Stock Inventory Valuation Report is the report that display value of all +products in internal location.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  1. Go to Inventory > Reporting > Inventory Valuation.
  2. +
  3. Select Inventory At Date.
  4. +
  5. You can now choose a few additional options: “View report”, “Export +PDF” and “Export XLSX”.
  6. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Ecosoft
  • +
+
+ +
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/stock-logistics-reporting project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/stock_inventory_valuation_report/static/src/css/report.css b/stock_inventory_valuation_report/static/src/css/report.css new file mode 100644 index 000000000..8b2b949bc --- /dev/null +++ b/stock_inventory_valuation_report/static/src/css/report.css @@ -0,0 +1,75 @@ +.act_as_table { + display: table !important; + background-color: white; +} +.act_as_row { + display: table-row !important; + page-break-inside: avoid; +} +.act_as_cell { + display: table-cell !important; + page-break-inside: avoid; +} +.act_as_thead { + display: table-header-group !important; +} +.data_table { + width: 100% !important; +} +.act_as_row.labels { + background-color: #f0f0f0 !important; +} +.data_table, +.total_row, +.act_as_row { + border-left: 0px; + border-right: 0px; + text-align: center; + font-size: 10px; + padding-right: 3px; + padding-left: 3px; + padding-top: 2px; + padding-bottom: 2px; + border-collapse: collapse; +} +.data_table .act_as_cell { + border: 1px solid lightGrey; + text-align: center; +} +.data_table .act_as_cell { + word-wrap: break-word; +} +.data_table .act_as_row.labels { + font-weight: bold; +} +.data_table .total_row { + background-color: #f0f0f0 !important; + border-left: 1px solid lightGrey; + border-right: 1px solid lightGrey; + border-bottom: 1px solid lightGrey; + text-align: right; + font-weight: bold; +} +.act_as_cell.amount { + word-wrap: normal; + text-align: right; +} +.act_as_cell.left { + text-align: left; +} +.act_as_cell.right { + text-align: right; +} +.custom_footer { + font-size: 7px !important; +} +.button_row { + padding-bottom: 10px; +} +.o_stock_inventory_valuation_report_page { + padding-top: 10px; + width: 90%; + margin-right: auto; + margin-left: auto; + font-family: Helvetica, Arial; +} diff --git a/stock_inventory_valuation_report/static/src/js/stock_inventory_valuation_report_backend.esm.js b/stock_inventory_valuation_report/static/src/js/stock_inventory_valuation_report_backend.esm.js new file mode 100644 index 000000000..d993e2112 --- /dev/null +++ b/stock_inventory_valuation_report/static/src/js/stock_inventory_valuation_report_backend.esm.js @@ -0,0 +1,99 @@ +/* @odoo-module */ + +import {Component, markup, onMounted, onWillStart, useRef, useState} from "@odoo/owl"; +import {registry} from "@web/core/registry"; +import {useService} from "@web/core/utils/hooks"; + +class StockInventoryValuationReportBackend extends Component { + static template = "stock_inventory_valuation_report.ClientAction"; + + setup() { + this.orm = useService("orm"); + this.action = useService("action"); + this.rootRef = useRef("root"); + this.state = useState({ + html: markup(""), + }); + + this.given_context = {}; + this.odoo_context = this.props.action.context; + + if (this.props.action.context.context) { + this.given_context = this.props.action.context.context; + } + + this.given_context.active_id = + this.props.action.context.active_id || + (this.props.action.params && this.props.action.params.active_id); + this.given_context.model = this.props.action.context.active_model || false; + this.given_context.ttype = this.props.action.context.ttype || false; + + onWillStart(async () => { + await this.getHtml(); + }); + + onMounted(() => { + this.attachEventListeners(); + }); + } + + attachEventListeners() { + // Los botones vienen del HTML del servidor, necesitamos adjuntar event listeners + const printBtn = this.rootRef.el.querySelector( + ".o_stock_inventory_valuation_report_print" + ); + const exportBtn = this.rootRef.el.querySelector( + ".o_stock_inventory_valuation_report_export" + ); + + if (printBtn) { + printBtn.addEventListener("click", this.onClickPrint.bind(this)); + } + if (exportBtn) { + exportBtn.addEventListener("click", this.onClickExport.bind(this)); + } + } + + async getHtml() { + const result = await this.orm.call( + this.given_context.model, + "get_html", + [this.given_context], + {context: this.odoo_context} + ); + this.state.html = markup(result.html || ""); + } + + async onClickPrint(ev) { + if (ev) { + ev.preventDefault(); + } + const result = await this.orm.call( + this.given_context.model, + "print_report", + [this.given_context.active_id, "qweb-pdf"], + {context: this.odoo_context} + ); + return this.action.doAction(result); + } + + async onClickExport(ev) { + if (ev) { + ev.preventDefault(); + } + const result = await this.orm.call( + this.given_context.model, + "print_report", + [this.given_context.active_id, "xlsx"], + {context: this.odoo_context} + ); + return this.action.doAction(result); + } +} + +registry + .category("actions") + .add( + "stock_inventory_valuation_report_backend", + StockInventoryValuationReportBackend + ); diff --git a/stock_inventory_valuation_report/static/src/js/stock_inventory_valuation_report_backend.js b/stock_inventory_valuation_report/static/src/js/stock_inventory_valuation_report_backend.js new file mode 100644 index 000000000..1b1196180 --- /dev/null +++ b/stock_inventory_valuation_report/static/src/js/stock_inventory_valuation_report_backend.js @@ -0,0 +1,116 @@ +odoo.define( + "stock_inventory_valuation_report.stock_inventory_valuation_report_backend", + function (require) { + "use strict"; + + var core = require("web.core"); + var AbstractAction = require("web.AbstractAction"); + var ReportWidget = require("web.Widget"); + + var report_backend = AbstractAction.extend({ + hasControlPanel: true, + // Stores all the parameters of the action. + events: { + "click .o_stock_inventory_valuation_report_print": "print", + "click .o_stock_inventory_valuation_report_export": "export", + }, + init: function (parent, action) { + this._super.apply(this, arguments); + this.actionManager = parent; + this.given_context = {}; + this.odoo_context = action.context; + this.controller_url = action.context.url; + if (action.context.context) { + this.given_context = action.context.context; + } + this.given_context.active_id = + action.context.active_id || action.params.active_id; + this.given_context.model = action.context.active_model || false; + this.given_context.ttype = action.context.ttype || false; + }, + willStart: function () { + return Promise.all([ + this._super.apply(this, arguments), + this.get_html(), + ]); + }, + set_html: function () { + const self = this; + var def = Promise.resolve(); + if (!self.report_widget) { + self.report_widget = new ReportWidget(self, self.given_context); + def = self.report_widget.appendTo(self.$(".o_content")); + } + def.then(function () { + self.report_widget.$el.html(self.html); + }); + }, + start: function () { + this.set_html(); + return this._super(); + }, + // Fetches the html and is previous report.context if any, + // else create it + get_html: function () { + var self = this; + var defs = []; + return this._rpc({ + model: this.given_context.model, + method: "get_html", + args: [self.given_context], + context: self.odoo_context, + }).then(function (result) { + self.html = result.html; + defs.push(self.update_cp()); + return Promise.all(defs); + }); + }, + // Updates the control panel and render the elements that have yet + // to be rendered + update_cp: function () { + if (this.$buttons) { + var status = { + breadcrumbs: this.actionManager.get_breadcrumbs(), + cp_content: {$buttons: this.$buttons}, + }; + return this.update_control_panel(status); + } + }, + do_show: function () { + this._super(); + this.update_cp(); + }, + print: function () { + var self = this; + this._rpc({ + model: this.given_context.model, + method: "print_report", + args: [this.given_context.active_id, "qweb-pdf"], + context: self.odoo_context, + }).then(function (result) { + self.do_action(result); + }); + }, + export: function () { + var self = this; + this._rpc({ + model: this.given_context.model, + method: "print_report", + args: [this.given_context.active_id, "xlsx"], + context: self.odoo_context, + }).then(function (result) { + self.do_action(result); + }); + }, + canBeRemoved: function () { + return Promise.resolve(); + }, + }); + + core.action_registry.add( + "stock_inventory_valuation_report_backend", + report_backend + ); + return report_backend; + } +); diff --git a/stock_inventory_valuation_report/static/src/xml/stock_inventory_valuation_report_backend.xml b/stock_inventory_valuation_report/static/src/xml/stock_inventory_valuation_report_backend.xml new file mode 100644 index 000000000..9dfeaec5d --- /dev/null +++ b/stock_inventory_valuation_report/static/src/xml/stock_inventory_valuation_report_backend.xml @@ -0,0 +1,10 @@ + + + + +
+
+
+ + + diff --git a/stock_inventory_valuation_report/tests/__init__.py b/stock_inventory_valuation_report/tests/__init__.py new file mode 100644 index 000000000..47ec5a2b4 --- /dev/null +++ b/stock_inventory_valuation_report/tests/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2019 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_stock_inventory_valuation_report diff --git a/stock_inventory_valuation_report/tests/test_stock_inventory_valuation_report.py b/stock_inventory_valuation_report/tests/test_stock_inventory_valuation_report.py new file mode 100644 index 000000000..37c85c84f --- /dev/null +++ b/stock_inventory_valuation_report/tests/test_stock_inventory_valuation_report.py @@ -0,0 +1,515 @@ +# Copyright 2019 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +import datetime + +from dateutil.relativedelta import relativedelta + +from odoo.tests import common +from odoo.tools import mute_logger, test_reports + + +class TestStockInventoryValuation(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) + + cls.inv_valuation_report_model = cls.env[ + "report.stock.inventory.valuation.report" + ] + + cls.qweb_report_name = ( + "stock_inventory_valuation_report." + "report_stock_inventory_valuation_report_pdf" + ) + cls.xlsx_report_name = "s_i_v_r.report_stock_inventory_valuation_report_xlsx" + cls.xlsx_action_name = ( + "stock_inventory_valuation_report." + "action_stock_inventory_valuation_report_xlsx" + ) + + cls.report_title = "Inventory Valuation Report" + + cls.base_filters = { + "company_id": cls.env.user.company_id.id, + } + + cls.report = cls.inv_valuation_report_model.create(cls.base_filters) + + def test_html(self): + test_reports.try_report( + self.env.cr, + self.env.uid, + self.qweb_report_name, + [self.report.id], + report_type="qweb-html", + ) + + def test_qweb(self): + test_reports.try_report( + self.env.cr, + self.env.uid, + self.qweb_report_name, + [self.report.id], + report_type="qweb-pdf", + ) + + @mute_logger("odoo.tools.test_reports") + def test_xlsx(self): + test_reports.try_report( + self.env.cr, + self.env.uid, + self.xlsx_report_name, + [self.report.id], + report_type="xlsx", + ) + + def test_print(self): + self.report.print_report("qweb") + self.report.print_report("xlsx") + + +class TestStockInventoryValuationReport(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) + cls.company_id = cls.env.ref("base.main_company") + cls.date = datetime.datetime.now() + + cls.location_stock_id = cls.env.ref("stock.stock_location_stock") + cls.location_customers_id = cls.env.ref("stock.stock_location_customers") + cls.location_suppliers_id = cls.env.ref("stock.stock_location_suppliers") + + cls.picking_type_in_id = cls.env.ref("stock.picking_type_in") + cls.picking_type_out_id = cls.env.ref("stock.picking_type_out") + cls.product_category_all = cls.env.ref("product.product_category_all") + + def test_get_report_html(self): + report = self.env["report.stock.inventory.valuation.report"].create( + { + "company_id": self.company_id.id, + "inventory_datetime": self.date, + } + ) + report._compute_results() + report.get_html(given_context={"active_id": report.id}) + + def test_wizard(self): + wizard = self.env["stock.quantity.history"].create({}) + wizard._export("qweb-pdf") + wizard.button_export_html() + wizard.button_export_pdf() + wizard.button_export_xlsx() + + def test_wizard_with_inventory_datetime(self): + """ + Test wizard with inventory_datetime set + to cover line 49 where inventory_datetime is checked. + """ + inventory_datetime = datetime.datetime.now() + relativedelta(days=-7) + wizard = self.env["stock.quantity.history"].create( + {"inventory_datetime": inventory_datetime} + ) + + # Test _prepare_stock_inventory_valuation_report with datetime + vals = wizard._prepare_stock_inventory_valuation_report() + self.assertEqual( + vals["inventory_datetime"], + inventory_datetime, + msg="inventory_datetime should be included in prepared values", + ) + + # Test export methods with datetime + wizard._export("qweb-pdf") + result = wizard.button_export_html() + self.assertIn( + "context", result, msg="HTML export should return action with context" + ) + + @mute_logger( + "odoo.addons.stock_inventory_valuation_report.wizard.stock_quantity_history" + ) + def test_wizard_button_export_html_with_string_context(self): + """ + Test button_export_html when action context is a string + to cover lines 22-29 including the safe_eval exception handling. + """ + wizard = self.env["stock.quantity.history"].create({}) + + # Mock the action to have a string context (normal case) + action = self.env.ref( + "stock_inventory_valuation_report." + "action_stock_inventory_valuation_report_html" + ) + + # Store original context + original_context = action.context + + try: + # Test with valid string context + action.context = "{'test_key': 'test_value'}" + result = wizard.button_export_html() + self.assertIsInstance( + result, dict, msg="button_export_html should return a dict" + ) + self.assertIn("context", result, msg="Result should contain context") + + # Test with invalid string context to trigger exception (lines 22-26) + action.context = "invalid python code {" + result = wizard.button_export_html() + # Should handle exception gracefully and return empty context + self.assertIsInstance( + result, dict, msg="Should return dict even with invalid context" + ) + + finally: + # Restore original context + action.context = original_context + + def test_wizard_export_methods_coverage(self): + """ + Test all export methods to ensure full coverage + of wizard functionality. + """ + inventory_datetime = datetime.datetime.now() + wizard = self.env["stock.quantity.history"].create( + {"inventory_datetime": inventory_datetime} + ) + + # Test PDF export + pdf_result = wizard.button_export_pdf() + self.assertTrue(pdf_result, msg="PDF export should return a result") + + # Test XLSX export + xlsx_result = wizard.button_export_xlsx() + self.assertTrue(xlsx_result, msg="XLSX export should return a result") + + # Test HTML export + html_result = wizard.button_export_html() + self.assertIsInstance(html_result, dict, msg="HTML export should return a dict") + self.assertIn("context", html_result, msg="HTML result should have context") + # Verify that active_id and active_ids are in context (line 29) + context = html_result.get("context", {}) + if isinstance(context, dict): + self.assertIn( + "active_id", + context, + msg="Context should contain active_id after update", + ) + + def test_date_report_result(self): + """ + Check that report shows the correct product quantity + when specifying a date in the past. + """ + product = self.env["product.product"].create( + { + "name": "test valuation report date", + "type": "product", + "company_id": self.company_id.id, + "categ_id": self.product_category_all.id, + } + ) + + partner_id = self.env["res.partner"].create({"name": "Test Partner"}) + product_qty = 100 + date_with_stock = self.date + relativedelta(days=-1) + + # Receive the product + receipt = self.env["stock.picking"].create( + { + "location_id": self.location_suppliers_id.id, + "location_dest_id": self.location_stock_id.id, + "picking_type_id": self.picking_type_in_id.id, + "partner_id": partner_id.id, + "company_id": self.company_id.id, + "move_ids": [ + ( + 0, + 0, + { + "name": "Receive product", + "product_id": product.id, + "product_uom": product.uom_id.id, + "product_uom_qty": product_qty, + "location_id": self.location_suppliers_id.id, + "location_dest_id": self.location_stock_id.id, + }, + ) + ], + } + ) + receipt.action_confirm() + for move_line in receipt.move_line_ids: + move_line.quantity = product_qty + receipt.button_validate() + move = receipt.move_ids + move.date = date_with_stock + move.stock_valuation_layer_ids._write({"create_date": date_with_stock}) + self.assertEqual( + product.with_context(to_date=date_with_stock).quantity_svl, + product_qty, + msg="Product should be present in stock at this date", + ) + self.assertEqual( + product.quantity_svl, + product_qty, + msg="Product should be present in stock at this date", + ) + + # Report should have a line with the product and its quantity + report = self.env["report.stock.inventory.valuation.report"].create( + { + "company_id": self.company_id.id, + } + ) + product_row = report.results.filtered(lambda r: r.name == product.name) + self.assertEqual( + len(product_row), + 1, + msg="There should be one line for this produce in the report", + ) + self.assertEqual( + product_row.qty_at_date, + product_qty, + msg="The product should have full quantity", + ) + + # Deliver the product + delivery = self.env["stock.picking"].create( + { + "location_id": self.location_stock_id.id, + "location_dest_id": self.location_customers_id.id, + "partner_id": partner_id.id, + "company_id": self.company_id.id, + "picking_type_id": self.picking_type_out_id.id, + "move_ids": [ + ( + 0, + 0, + { + "name": "Deliver product", + "product_id": product.id, + "product_uom": product.uom_id.id, + "product_uom_qty": product_qty, + "location_id": self.location_stock_id.id, + "location_dest_id": self.location_customers_id.id, + }, + ) + ], + } + ) + delivery.action_confirm() + for move_line in delivery.move_line_ids: + move_line.quantity = product_qty + delivery.button_validate() + date_no_stock = self.date + relativedelta(hours=-6) + move = delivery.move_ids + move.date = date_no_stock + move.stock_valuation_layer_ids._write({"create_date": date_no_stock}) + self.assertEqual( + product.with_context(to_date=date_with_stock).quantity_svl, + product_qty, + msg="The product should have full quantity at this date.", + ) + self.assertEqual( + product.with_context(to_date=self.date).quantity_svl, + 0, + msg="The product should not be present at this date.", + ) + + report = self.env["report.stock.inventory.valuation.report"].create( + { + "company_id": self.company_id.id, + "inventory_datetime": date_no_stock, + } + ) + product_row = report.results.filtered(lambda r: r.name == product.name) + self.assertFalse( + product_row, + msg="Product should not be present in this report " + "for this date, because it was delivered.", + ) + + report = self.env["report.stock.inventory.valuation.report"].create( + { + "company_id": self.company_id.id, + "inventory_datetime": date_with_stock, + } + ) + product_row = report.results.filtered(lambda r: r.name == product.name) + self.assertEqual( + len(product_row), + 1, + msg="Report for this date should have one line for the product.", + ) + self.assertEqual( + product_row.qty_at_date, + product_qty, + msg="Report for this date should show full quantity for the product", + ) + + def test_report_with_product_id_context(self): + """ + Test report generation with product_id in context + to cover the product_id filtering branch. + """ + product = self.env["product.product"].create( + { + "name": "test product_id filter", + "type": "product", + "company_id": self.company_id.id, + "categ_id": self.product_category_all.id, + } + ) + + # Create stock movement for the product + partner_id = self.env["res.partner"].create({"name": "Test Partner"}) + receipt = self.env["stock.picking"].create( + { + "location_id": self.location_suppliers_id.id, + "location_dest_id": self.location_stock_id.id, + "picking_type_id": self.picking_type_in_id.id, + "partner_id": partner_id.id, + "company_id": self.company_id.id, + "move_ids": [ + ( + 0, + 0, + { + "name": "Receive product", + "product_id": product.id, + "product_uom": product.uom_id.id, + "product_uom_qty": 50, + "location_id": self.location_suppliers_id.id, + "location_dest_id": self.location_stock_id.id, + }, + ) + ], + } + ) + receipt.action_confirm() + for move_line in receipt.move_line_ids: + move_line.quantity = 50 + receipt.button_validate() + + # Generate report with product_id in context + report = ( + self.env["report.stock.inventory.valuation.report"] + .with_context(product_id=product.id) + .create( + { + "company_id": self.company_id.id, + } + ) + ) + + # Should have exactly one line for this product + self.assertEqual( + len(report.results), + 1, + msg="Report should have exactly one line when filtered by product_id", + ) + self.assertEqual( + report.results[0].name, + product.name, + msg="Report line should be for the filtered product", + ) + + def test_report_with_product_tmpl_id_context(self): + """ + Test report generation with product_tmpl_id in context + to cover the product_tmpl_id filtering branch. + """ + product = self.env["product.product"].create( + { + "name": "test product_tmpl_id filter", + "type": "product", + "company_id": self.company_id.id, + "categ_id": self.product_category_all.id, + } + ) + + # Create stock movement for the product + partner_id = self.env["res.partner"].create({"name": "Test Partner"}) + receipt = self.env["stock.picking"].create( + { + "location_id": self.location_suppliers_id.id, + "location_dest_id": self.location_stock_id.id, + "picking_type_id": self.picking_type_in_id.id, + "partner_id": partner_id.id, + "company_id": self.company_id.id, + "move_ids": [ + ( + 0, + 0, + { + "name": "Receive product", + "product_id": product.id, + "product_uom": product.uom_id.id, + "product_uom_qty": 30, + "location_id": self.location_suppliers_id.id, + "location_dest_id": self.location_stock_id.id, + }, + ) + ], + } + ) + receipt.action_confirm() + for move_line in receipt.move_line_ids: + move_line.quantity = 30 + receipt.button_validate() + + # Generate report with product_tmpl_id in context + report = ( + self.env["report.stock.inventory.valuation.report"] + .with_context(product_tmpl_id=product.product_tmpl_id.id) + .create( + { + "company_id": self.company_id.id, + } + ) + ) + + # Should have exactly one line for products of this template + product_row = report.results.filtered(lambda r: r.name == product.name) + self.assertEqual( + len(product_row), + 1, + msg="Report should have line for product with filtered template", + ) + + def test_report_with_no_storable_products(self): + """ + Test report generation when no storable products exist + to cover the early return branch when products list is empty. + """ + # Create a non-storable product + product = self.env["product.product"].create( + { + "name": "test non-storable product", + "type": "service", + "company_id": self.company_id.id, + "categ_id": self.product_category_all.id, + } + ) + + # Generate report with this non-storable product in context + report = ( + self.env["report.stock.inventory.valuation.report"] + .with_context(product_id=product.id) + .create( + { + "company_id": self.company_id.id, + } + ) + ) + + # Should have no results since the product is not storable + self.assertEqual( + len(report.results), + 0, + msg="Report should have no results for non-storable products", + ) diff --git a/stock_inventory_valuation_report/wizard/__init__.py b/stock_inventory_valuation_report/wizard/__init__.py new file mode 100644 index 000000000..be5aee7cf --- /dev/null +++ b/stock_inventory_valuation_report/wizard/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2019 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import stock_quantity_history diff --git a/stock_inventory_valuation_report/wizard/stock_quantity_history.py b/stock_inventory_valuation_report/wizard/stock_quantity_history.py new file mode 100644 index 000000000..bc727e04f --- /dev/null +++ b/stock_inventory_valuation_report/wizard/stock_quantity_history.py @@ -0,0 +1,56 @@ +# Copyright 2019 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +import logging + +from odoo import _, models +from odoo.tools.safe_eval import safe_eval + +_logger = logging.getLogger(__name__) + + +class StockQuantityHistory(models.TransientModel): + _inherit = "stock.quantity.history" + + def button_export_html(self): + self.ensure_one() + action = self.env.ref( + "stock_inventory_valuation_report." + "action_stock_inventory_valuation_report_html" + ) + vals = action.read()[0] + new_context = vals.get("context", {}) + if isinstance(new_context, str): + try: + new_context = safe_eval(new_context) + except (TypeError, SyntaxError, NameError, ValueError): + _logger.warning( + _("Failed context evaluation: %(context)s", context=new_context) + ) + new_context = {} + model = self.env["report.stock.inventory.valuation.report"] + report = model.create(self._prepare_stock_inventory_valuation_report()) + new_context.update(active_id=report.id, active_ids=report.ids) + vals["context"] = new_context + return vals + + def button_export_pdf(self): + self.ensure_one() + return self._export(report_type="qweb-pdf") + + def button_export_xlsx(self): + self.ensure_one() + return self._export(report_type="xlsx") + + def _prepare_stock_inventory_valuation_report(self): + self.ensure_one() + vals = { + "company_id": self.env.user.company_id.id, + } + if self.inventory_datetime: + vals["inventory_datetime"] = self.inventory_datetime + return vals + + def _export(self, report_type): + model = self.env["report.stock.inventory.valuation.report"] + report = model.create(self._prepare_stock_inventory_valuation_report()) + return report.print_report(report_type) diff --git a/stock_inventory_valuation_report/wizard/stock_quantity_history_view.xml b/stock_inventory_valuation_report/wizard/stock_quantity_history_view.xml new file mode 100644 index 000000000..c2b36d780 --- /dev/null +++ b/stock_inventory_valuation_report/wizard/stock_quantity_history_view.xml @@ -0,0 +1,19 @@ + + + + Valuation Report + stock.quantity.history + + + + + + +