Skip to content

Commit 5b328a6

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

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
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/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+
)

0 commit comments

Comments
 (0)