Skip to content

Commit abb523b

Browse files
[18.0][MIG] account_reporting_product_template: Migration to 18.0
1 parent 650c4b3 commit abb523b

File tree

4 files changed

+25
-27
lines changed

4 files changed

+25
-27
lines changed

account_reporting_product_template/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
{
55
"name": "Product template in the invoices analysis view",
6-
"version": "16.0.1.0.0",
6+
"version": "18.0.1.0.0",
77
"category": "Account",
88
"license": "AGPL-3",
99
"author": "AvanzOSC",

account_reporting_product_template/pyproject.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

account_reporting_product_template/reports/account_invoice_report.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
33

44
from odoo import api, fields, models
5+
from odoo.tools import SQL
56

67

78
class AccountInvoiceReport(models.Model):
@@ -14,14 +15,10 @@ class AccountInvoiceReport(models.Model):
1415

1516
@api.model
1617
def _select(self):
17-
select_str = super()._select()
18-
select_str += """
19-
, template.id as product_tmpl_id
18+
return SQL(
2019
"""
21-
return select_str
22-
23-
@api.model
24-
def _group_by(self):
25-
group_by_str = super()._group_by()
26-
group_by_str += ", template.id"
27-
return group_by_str
20+
%s,
21+
product.product_tmpl_id AS product_tmpl_id
22+
""",
23+
super()._select(),
24+
)
Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<odoo>
3-
<record id="account_invoice_report_view_search" model="ir.ui.view">
4-
<field name="inherit_id" ref="account.view_account_invoice_report_search" />
5-
<field name="model">account.invoice.report</field>
6-
<field name="arch" type="xml">
7-
<field name="product_id" position="before">
8-
<field name="product_tmpl_id" />
9-
</field>
10-
<filter name="category_product" position="after">
11-
<filter
3+
<record id="account_invoice_report_view_search" model="ir.ui.view">
4+
<field name="inherit_id" ref="account.view_account_invoice_report_search" />
5+
<field name="model">account.invoice.report</field>
6+
<field name="arch" type="xml">
7+
<field name="product_id" position="before">
8+
<field name="product_tmpl_id" />
9+
</field>
10+
<filter name="category_product" position="after">
11+
<filter
1212
string="Product Template"
1313
name="product_template"
1414
context="{'group_by':'product_tmpl_id'}"
1515
/>
16-
<filter string="Product" name="product" context="{'group_by':'product_id'}" />
17-
</filter>
18-
</field>
19-
</record>
16+
<filter
17+
string="Product"
18+
name="product"
19+
context="{'group_by':'product_id'}"
20+
/>
21+
</filter>
22+
</field>
23+
</record>
2024
</odoo>

0 commit comments

Comments
 (0)