diff --git a/account_reporting_product_template/README.rst b/account_reporting_product_template/README.rst new file mode 100644 index 0000000000..7a12801ec6 --- /dev/null +++ b/account_reporting_product_template/README.rst @@ -0,0 +1,52 @@ +============================================== +Product template in the invoices analysis view +============================================== + +.. |badge1| 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 + +|badge1| + +This module adds "Product template" in the invoices analysis view. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +You need to be at least "Accountant" on "Accounting & Finance" role for +seeing the report. + +Usage +===== + +#. Go to *Invoicing > Reporting > Management > Invoice Analysis*. + +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 smash it by providing detailed and welcomed feedback. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* AvanzOSC + +Contributors +~~~~~~~~~~~~ + +* `AvanzOSC `_: + + * Oihane Crucelaegui diff --git a/account_reporting_product_template/__init__.py b/account_reporting_product_template/__init__.py new file mode 100644 index 0000000000..65323532b3 --- /dev/null +++ b/account_reporting_product_template/__init__.py @@ -0,0 +1 @@ +from . import reports diff --git a/account_reporting_product_template/__manifest__.py b/account_reporting_product_template/__manifest__.py new file mode 100644 index 0000000000..574854be6c --- /dev/null +++ b/account_reporting_product_template/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2024 Oihane Crucelaegui - AvanzOSC +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + "name": "Product template in the invoices analysis view", + "version": "18.0.1.0.0", + "category": "Account", + "license": "AGPL-3", + "author": "AvanzOSC", + "website": "https://github.com/avanzosc/odoo-addons", + "depends": [ + "account", + ], + "data": [ + "reports/account_invoice_report_views.xml", + ], + "installable": True, +} diff --git a/account_reporting_product_template/i18n/account_reporting_product_template.pot b/account_reporting_product_template/i18n/account_reporting_product_template.pot new file mode 100644 index 0000000000..0637dafa37 --- /dev/null +++ b/account_reporting_product_template/i18n/account_reporting_product_template.pot @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_reporting_product_template +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-08-07 12:46+0000\n" +"PO-Revision-Date: 2024-08-07 12:46+0000\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: account_reporting_product_template +#: model:ir.model,name:account_reporting_product_template.model_account_invoice_report +msgid "Invoices Statistics" +msgstr "" + +#. module: account_reporting_product_template +#: model_terms:ir.ui.view,arch_db:account_reporting_product_template.account_invoice_report_view_search +msgid "Product" +msgstr "" + +#. module: account_reporting_product_template +#: model:ir.model.fields,field_description:account_reporting_product_template.field_account_invoice_report__product_tmpl_id +#: model_terms:ir.ui.view,arch_db:account_reporting_product_template.account_invoice_report_view_search +msgid "Product Template" +msgstr "" diff --git a/account_reporting_product_template/i18n/es.po b/account_reporting_product_template/i18n/es.po new file mode 100644 index 0000000000..26c0f0321d --- /dev/null +++ b/account_reporting_product_template/i18n/es.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_reporting_product_template +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-08-07 12:46+0000\n" +"PO-Revision-Date: 2024-08-07 12:46+0000\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: account_reporting_product_template +#: model:ir.model,name:account_reporting_product_template.model_account_invoice_report +msgid "Invoices Statistics" +msgstr "Estadísticas de facturación" + +#. module: account_reporting_product_template +#: model_terms:ir.ui.view,arch_db:account_reporting_product_template.account_invoice_report_view_search +msgid "Product" +msgstr "Producto" + +#. module: account_reporting_product_template +#: model:ir.model.fields,field_description:account_reporting_product_template.field_account_invoice_report__product_tmpl_id +#: model_terms:ir.ui.view,arch_db:account_reporting_product_template.account_invoice_report_view_search +msgid "Product Template" +msgstr "Plantilla de producto" diff --git a/account_reporting_product_template/pyproject.toml b/account_reporting_product_template/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/account_reporting_product_template/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_reporting_product_template/reports/__init__.py b/account_reporting_product_template/reports/__init__.py new file mode 100644 index 0000000000..52e62702b3 --- /dev/null +++ b/account_reporting_product_template/reports/__init__.py @@ -0,0 +1 @@ +from . import account_invoice_report diff --git a/account_reporting_product_template/reports/account_invoice_report.py b/account_reporting_product_template/reports/account_invoice_report.py new file mode 100644 index 0000000000..9129daef3c --- /dev/null +++ b/account_reporting_product_template/reports/account_invoice_report.py @@ -0,0 +1,24 @@ +# Copyright 2024 Oihane Crucelaegui - AvanzOSC +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models +from odoo.tools import SQL + + +class AccountInvoiceReport(models.Model): + _inherit = "account.invoice.report" + + product_tmpl_id = fields.Many2one( + comodel_name="product.template", + string="Product Template", + ) + + @api.model + def _select(self): + return SQL( + """ + %s, + product.product_tmpl_id AS product_tmpl_id + """, + super()._select(), + ) diff --git a/account_reporting_product_template/reports/account_invoice_report_views.xml b/account_reporting_product_template/reports/account_invoice_report_views.xml new file mode 100644 index 0000000000..d4a3584303 --- /dev/null +++ b/account_reporting_product_template/reports/account_invoice_report_views.xml @@ -0,0 +1,20 @@ + + + + + account.invoice.report + + + + + + + + + + +