Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions account_reporting_product_template/README.rst
Original file line number Diff line number Diff line change
@@ -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
<https://github.com/avanzosc/odoo-addons/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 <https://www.avanzosc.es>`_:

* Oihane Crucelaegui
1 change: 1 addition & 0 deletions account_reporting_product_template/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import reports
18 changes: 18 additions & 0 deletions account_reporting_product_template/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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,
}
Original file line number Diff line number Diff line change
@@ -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 ""
32 changes: 32 additions & 0 deletions account_reporting_product_template/i18n/es.po
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 3 additions & 0 deletions account_reporting_product_template/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions account_reporting_product_template/reports/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_invoice_report
Original file line number Diff line number Diff line change
@@ -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(),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="account_invoice_report_view_search" model="ir.ui.view">
<field name="inherit_id" ref="account.view_account_invoice_report_search" />
<field name="model">account.invoice.report</field>
<field name="arch" type="xml">
<field name="product_id" position="before">
<field name="product_tmpl_id" />
</field>
<filter name="category_product" position="after">
<filter
string="Product Template"
name="product_template"
context="{'group_by':'product_tmpl_id'}"
/>
<filter string="Product" name="product" context="{'group_by':'product_id'}" />
</filter>
</field>
</record>
</odoo>