Skip to content

Commit

Permalink
[ADD][10.0] Add shopinvader_sale_report module
Browse files Browse the repository at this point in the history
  • Loading branch information
acsonefho committed Apr 3, 2019
1 parent f15c181 commit 624dd37
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions setup/shopinvader_sale_report/odoo/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
1 change: 1 addition & 0 deletions setup/shopinvader_sale_report/odoo/addons/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
6 changes: 6 additions & 0 deletions setup/shopinvader_sale_report/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
3 changes: 3 additions & 0 deletions shopinvader_sale_report/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2019 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import reports
16 changes: 16 additions & 0 deletions shopinvader_sale_report/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2019 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': "Shopinvader sale report",
'description': """Shopinvader addons to extend sale report with backend""",
'author': 'ACSONE SA/NV',
'website': "http://acsone.eu",
'category': 'e-commerce',
'version': '10.0.1.0.0',
'license': 'AGPL-3',
'depends': [
'sale',
'shopinvader',
],
}
4 changes: 4 additions & 0 deletions shopinvader_sale_report/reports/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# Copyright 2019 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import sale_report
26 changes: 26 additions & 0 deletions shopinvader_sale_report/reports/sale_report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Copyright 2019 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models


class SaleReport(models.Model):
_inherit = 'sale.report'

shopinvader_backend_id = fields.Many2one(
comodel_name="shopinvader.backend",
string="Shopinvader backend",
)

@api.model
def _select(self):
select_query = super(SaleReport, self)._select()
select_backend = "s.shopinvader_backend_id AS shopinvader_backend_id"
select_query += ", " + select_backend
return select_query

@api.model
def _group_by(self):
group_by_query = super(SaleReport, self)._group_by()
group_by_query += ", s.shopinvader_backend_id"
return group_by_query

0 comments on commit 624dd37

Please sign in to comment.