@ -0,0 +1,42 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
||||
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
||||
|
:alt: License: AGPL-3 |
||||
|
|
||||
|
Sale Purchase mixed Report V15 |
||||
|
============================== |
||||
|
Provides mixed reports related to Sales and Purchase in both Sales and Purchase. |
||||
|
Reports are provided in Pivot view and Graph view. Pdf and Excel reports can be printed. |
||||
|
|
||||
|
Configuration |
||||
|
============= |
||||
|
The users should be in any of the Administration security groups to view the Reporting menu from Sales and Purchase. |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
Developer: Mohammed Ajmal P @cybrosys, Contact: odoo@cybrosys.com |
||||
|
version 15: Mohammed Ajmal P @cybrosys, Contact: odoo@cybrosys.com |
||||
|
|
||||
|
Contacts |
||||
|
-------- |
||||
|
* Mail Contact : odoo@cybrosys.com |
||||
|
* Website : https://cybrosys.com |
||||
|
|
||||
|
Bug Tracker |
||||
|
----------- |
||||
|
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
||||
|
|
||||
|
Maintainer |
||||
|
========== |
||||
|
.. image:: https://cybrosys.com/images/logo.png |
||||
|
:target: https://cybrosys.com |
||||
|
This module is maintained by Cyborsys Technologies. |
||||
|
|
||||
|
For support and more information, please visit https://www.cybrosys.com |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,26 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Mohammed Ajmal P (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributes in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along this program. |
||||
|
# If not, see <http://www.gnu.org/license/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
|
||||
|
from . import models |
||||
|
from . import reports |
||||
|
from . import wizards |
||||
|
from . import controllers |
@ -0,0 +1,49 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Mohammed Ajmal P (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributes in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along this program. |
||||
|
# If not, see <http://www.gnu.org/license/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
{ |
||||
|
'name': "Sale Purchase mixed Report", |
||||
|
'summary': """Mixed reports of Sale and Purchase data""", |
||||
|
'description': """Mixed reports of Sale and Purchase data""", |
||||
|
'category': 'Technical', |
||||
|
'version': '15.0.1.0.0', |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': 'https://www.cybrosys.com', |
||||
|
'images': ['static/description/banner.png'], |
||||
|
'depends': ['base', 'sale', 'purchase', 'stock'], |
||||
|
'data': [ |
||||
|
'security/ir.model.access.csv', |
||||
|
'reports/sale_purchase_report_views.xml', |
||||
|
'reports/sale_purchase_pdf_template.xml', |
||||
|
'wizards/wizard_views.xml', |
||||
|
], |
||||
|
'assets': { |
||||
|
'web.assets_backend': [ |
||||
|
'/sale_purchase_mixed_report/static/src/js/action_manager.js', |
||||
|
], |
||||
|
}, |
||||
|
'license': 'AGPL-3', |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False, |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Mohammed Ajmal P (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributes in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along this program. |
||||
|
# If not, see <http://www.gnu.org/license/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
|
||||
|
from . import main |
@ -0,0 +1,58 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Mohammed Ajmal P (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributes in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along this program. |
||||
|
# If not, see <http://www.gnu.org/license/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
|
||||
|
import json |
||||
|
from odoo import http |
||||
|
from odoo.http import content_disposition, request |
||||
|
from odoo.addons.web.controllers.main import _serialize_exception |
||||
|
from odoo.tools import html_escape |
||||
|
|
||||
|
|
||||
|
class XLSXReportController(http.Controller): |
||||
|
"""Controller Class for xlsx report""" |
||||
|
|
||||
|
@http.route('/xlsx_reports', type='http', auth='user', methods=['POST'], |
||||
|
csrf=False) |
||||
|
def get_report_xlsx(self, model, options, output_format, report_name, **kw): |
||||
|
"""Method for passing data to xlsx report""" |
||||
|
uid = request.session.uid |
||||
|
report_obj = request.env[model].with_user(uid) |
||||
|
options = json.loads(options) |
||||
|
token = 'dummy-because-api-expects-one' |
||||
|
try: |
||||
|
if output_format == 'xlsx_controller': |
||||
|
response = request.make_response( |
||||
|
None, |
||||
|
headers=[('Content-Type', 'application/vnd.ms-excel'), ( |
||||
|
'Content-Disposition', |
||||
|
content_disposition(report_name + '.xlsx'))]) |
||||
|
report_obj.get_xlsx_report(options, response) |
||||
|
response.set_cookie('fileToken', token) |
||||
|
return response |
||||
|
except Exception as err: |
||||
|
exception = _serialize_exception(err) |
||||
|
error = { |
||||
|
'code': 200, |
||||
|
'message': 'Odoo Server Error', |
||||
|
'data': exception |
||||
|
} |
||||
|
return request.make_response(html_escape(json.dumps(error))) |
@ -0,0 +1,6 @@ |
|||||
|
## Module <sale_purchase_mixed_report> |
||||
|
|
||||
|
#### 14.05.2022 |
||||
|
#### Version 15.0.1.0.0 |
||||
|
##### ADD |
||||
|
- Initial commit for Sale Purchase mixed Report |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Mohammed Ajmal P (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributes in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along this program. |
||||
|
# If not, see <http://www.gnu.org/license/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
from . import sale |
||||
|
from . import purchase |
@ -0,0 +1,30 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Mohammed Ajmal P (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributes in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along this program. |
||||
|
# If not, see <http://www.gnu.org/license/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
|
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class PurchaseOrder(models.Model): |
||||
|
"""Field to identify the type of Order in to Sale Purchase Report""" |
||||
|
_inherit = 'purchase.order' |
||||
|
|
||||
|
is_purchase_order = fields.Boolean(default=True) |
@ -0,0 +1,30 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Mohammed Ajmal P (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributes in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along this program. |
||||
|
# If not, see <http://www.gnu.org/license/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
|
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class SaleOrder(models.Model): |
||||
|
"""Field to identify the type of Order in to Sale Purchase Report""" |
||||
|
_inherit = 'sale.order' |
||||
|
|
||||
|
is_sale_order = fields.Boolean(default=True) |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Mohammed Ajmal P (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributes in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along this program. |
||||
|
# If not, see <http://www.gnu.org/license/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
from . import sale_purchase_report |
||||
|
from . import sale_purchase_pdf_report |
@ -0,0 +1,272 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Mohammed Ajmal P (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributes in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along this program. |
||||
|
# If not, see <http://www.gnu.org/license/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
|
||||
|
from odoo import fields, models, api |
||||
|
|
||||
|
|
||||
|
class SalePurchasePdfReport(models.AbstractModel): |
||||
|
"""Class for PDF Report""" |
||||
|
_name = 'report.sale_purchase_mixed_report.report_sale_purchase' |
||||
|
_description = 'Sale Purchase mixed Pdf Report' |
||||
|
|
||||
|
@api.model |
||||
|
def _get_report_values(self, docids, data=None): |
||||
|
"""Returns PDF Report Values to template""" |
||||
|
company_id = self.env.company |
||||
|
where_sale = """so.company_id = %s""" % ( |
||||
|
company_id.id) |
||||
|
where_purchase = """po.company_id = %s""" % ( |
||||
|
company_id.id) |
||||
|
if data['form']['date_from']: |
||||
|
where_sale += """AND so.date_order >= '%s'""" % ( |
||||
|
data['form']['date_from']) |
||||
|
where_purchase += """AND po.date_order >= '%s'""" % ( |
||||
|
data['form']['date_from']) |
||||
|
if data['form']['date_to']: |
||||
|
where_sale += """AND so.date_order <= '%s'""" % ( |
||||
|
data['form']['date_to']) |
||||
|
where_purchase += """AND po.date_order <= '%s'""" % ( |
||||
|
data['form']['date_to']) |
||||
|
if data['form']['partner_ids']: |
||||
|
if len(data['form']['partner_ids']) == 1: |
||||
|
where_sale += """AND so.partner_id = %s""" % ( |
||||
|
data['form']['partner_ids'][0]) |
||||
|
where_purchase += """AND po.partner_id = %s""" % ( |
||||
|
data['form']['partner_ids'][0]) |
||||
|
else: |
||||
|
where_sale += """AND so.partner_id in %s""" % ( |
||||
|
str(tuple(data['form']['partner_ids']))) |
||||
|
where_purchase += """AND po.partner_id in %s""" % ( |
||||
|
str(tuple(data['form']['partner_ids']))) |
||||
|
if data['form']['sale_order_ids']: |
||||
|
if len(data['form']['sale_order_ids']) == 1: |
||||
|
where_sale += """AND so.id = %s""" % ( |
||||
|
data['form']['sale_order_ids'][0]) |
||||
|
else: |
||||
|
where_sale += """AND so.id in %s""" % ( |
||||
|
str(tuple(data['form']['sale_order_ids']))) |
||||
|
if data['form']['purchase_order_ids']: |
||||
|
if len(data['form']['purchase_order_ids']) == 1: |
||||
|
where_purchase += """AND po.id = %s""" % ( |
||||
|
data['form']['purchase_order_ids'][0]) |
||||
|
else: |
||||
|
where_purchase += """AND po.id in %s""" % ( |
||||
|
str(tuple(data['form']['purchase_order_ids']))) |
||||
|
self.env.cr.execute(""" |
||||
|
select macro.id as id, |
||||
|
macro.order_type as order_type, |
||||
|
macro.order_state as order_state, |
||||
|
macro.order_date as order_date, |
||||
|
macro.partner_id as partner_id, |
||||
|
macro.product_id as product_id, |
||||
|
macro.order_ref as order_ref, |
||||
|
macro.unit_price_sale as unit_price_sale, |
||||
|
macro.unit_price_purchase as unit_price_purchase, |
||||
|
macro.price_total_sale as price_total_sale, |
||||
|
macro.price_total_purchase as price_total_purchase, |
||||
|
macro.price_subtotal_sale as price_subtotal_sale, |
||||
|
macro.price_subtotal_purchase as price_subtotal_purchase, |
||||
|
macro.product_type as product_type, |
||||
|
macro.qty_invoiced as qty_invoiced, |
||||
|
macro.qty_billed as qty_billed, |
||||
|
macro.qty_ordered_to as qty_ordered_to, |
||||
|
macro.qty_ordered_by as qty_ordered_by, |
||||
|
macro.qty_delivered as qty_delivered, |
||||
|
macro.qty_received as qty_received, |
||||
|
macro.company_id as company_id, |
||||
|
macro.product_uom as product_uom |
||||
|
from(( |
||||
|
with currency_rate as (%s)""" % self.env[ |
||||
|
'res.currency']._select_companies_rates() + |
||||
|
""" |
||||
|
select |
||||
|
po.id as id, |
||||
|
po.date_order as order_date, |
||||
|
po.partner_id as partner_id, |
||||
|
po.company_id as company_id, |
||||
|
po.currency_id, |
||||
|
t.uom_id as product_uom, |
||||
|
case |
||||
|
when po.state='draft' then 'draft_rfq' |
||||
|
when po.state='sent' then 'rfq_sent' |
||||
|
when po.state='to_approve' then 'to_approve' |
||||
|
when po.state='purchase' then 'purchase' |
||||
|
when po.state='done' then 'done' else |
||||
|
'cancel' end as order_state, |
||||
|
case when po.is_purchase_order=True then |
||||
|
'Purchase' else '' end as order_type, |
||||
|
l.product_id as product_id, |
||||
|
t.detailed_type as product_type, |
||||
|
po.name as order_ref, |
||||
|
0 as unit_price_sale, |
||||
|
case when l.product_id is not null then |
||||
|
sum(l.price_unit) |
||||
|
else 0 end as unit_price_purchase, |
||||
|
0 as price_total_sale, |
||||
|
sum(l.price_total / coalesce(po.currency_rate, 1.0))::decimal(16,2) * currency_table.rate as price_total_purchase, |
||||
|
0 as price_subtotal_sale, |
||||
|
sum(l.price_subtotal / coalesce(po.currency_rate, 1.0))::decimal(16, 2) * currency_table.rate as price_subtotal_purchase, |
||||
|
case when l.product_id is not null then |
||||
|
sum(l.product_qty/ u.factor * u2.factor) else 0 |
||||
|
end as qty_ordered_to, |
||||
|
case when l.product_id is not null then |
||||
|
sum(l.qty_received / u.factor * u2.factor) |
||||
|
else 0 end as qty_received, |
||||
|
case when l.product_id is not null then |
||||
|
sum(l.qty_invoiced / u.factor * u2.factor) |
||||
|
else 0 end as qty_billed, |
||||
|
0 as qty_ordered_by, |
||||
|
0 as qty_delivered, |
||||
|
0 as qty_invoiced |
||||
|
from |
||||
|
(purchase_order_line l |
||||
|
join purchase_order po on (l.order_id=po.id) |
||||
|
join res_partner partner on (po.partner_id=partner.id) |
||||
|
left join product_product p on (l.product_id=p.id) |
||||
|
left join product_template t on (p.product_tmpl_id=t.id) |
||||
|
left join uom_uom u on (l.product_uom=u.id) |
||||
|
left join uom_uom u2 on (t.uom_id=u2.id)) |
||||
|
left join currency_rate cr on |
||||
|
(cr.currency_id = po.currency_id |
||||
|
and cr.company_id = po.company_id and |
||||
|
cr.date_start <= coalesce(po.date_order, now()) |
||||
|
and (cr.date_end is null or cr.date_end > coalesce(po.date_order, now()))) |
||||
|
left join {currency_table} on |
||||
|
currency_table.company_id = po.company_id |
||||
|
""".format( |
||||
|
currency_table=self.env[ |
||||
|
'res.currency']._get_query_currency_table( |
||||
|
{'multi_company': True, |
||||
|
'date': { |
||||
|
'date_to': fields.Date.today()}}), ) + |
||||
|
""" |
||||
|
where %s |
||||
|
group by |
||||
|
po.partner_id, |
||||
|
po.date_order, |
||||
|
l.product_id, |
||||
|
t.uom_id, |
||||
|
t.detailed_type, |
||||
|
po.id, |
||||
|
currency_table.rate |
||||
|
order by l.product_id) |
||||
|
UNION ALL |
||||
|
(select |
||||
|
so.id as id, |
||||
|
so.date_order as order_date, |
||||
|
so.partner_id as partner_id, |
||||
|
so.company_id as company_id, |
||||
|
so.currency_id, |
||||
|
t.uom_id as product_uom, |
||||
|
case |
||||
|
when so.state='draft' then 'draft_sale' |
||||
|
when so.state='sent' then 'sent_sale' |
||||
|
when so.state='sale' then 'sale' |
||||
|
when so.state='done' then 'done' else |
||||
|
'cancel' end as order_state, |
||||
|
case when so.is_sale_order=True then |
||||
|
'Sale' else '' end as order_type, |
||||
|
s.product_id as product_id, |
||||
|
t.detailed_type as product_type, |
||||
|
so.name as order_ref, |
||||
|
case when s.product_id is not null |
||||
|
then sum(s.price_unit) |
||||
|
else 0 end as unit_price_sale, |
||||
|
0 as unit_price_purchase, |
||||
|
case when s.product_id is not null then |
||||
|
sum(s.price_total / case coalesce(so.currency_rate, 0) |
||||
|
when 0 then 1.0 else so.currency_rate end) else |
||||
|
0 end as price_total_sale, |
||||
|
0 as price_total_purchase, |
||||
|
case when s.product_id is not null then |
||||
|
sum(s.price_subtotal / case coalesce(so.currency_rate, 0) |
||||
|
when 0 then 1.0 else so.currency_rate end) else |
||||
|
0 end as price_subtotal_sale, |
||||
|
0 as price_subtotal_purchase, |
||||
|
0 as qty_ordered_to, |
||||
|
0 as qty_received, |
||||
|
0 as qty_billed, |
||||
|
case when s.product_id is not null |
||||
|
then sum(s.product_uom_qty / u.factor * u2.factor) else 0 end as |
||||
|
qty_ordered_by, |
||||
|
case when s.product_id is not null |
||||
|
then sum(s.qty_delivered / u.factor * u2.factor) else 0 end as |
||||
|
qty_delivered, |
||||
|
case when s.product_id is not null |
||||
|
then sum(s.qty_invoiced / u.factor * u2.factor) else 0 end as |
||||
|
qty_invoiced |
||||
|
from |
||||
|
(sale_order_line s |
||||
|
join sale_order so on |
||||
|
(s.order_id=so.id) |
||||
|
join res_partner partner on |
||||
|
(so.partner_id=partner.id) |
||||
|
left join product_product p on |
||||
|
(s.product_id=p.id) |
||||
|
left join product_template t on |
||||
|
(p.product_tmpl_id=t.id) |
||||
|
left join uom_uom u on |
||||
|
(s.product_uom=u.id) |
||||
|
left join uom_uom u2 on |
||||
|
(t.uom_id=u2.id)) |
||||
|
where %s |
||||
|
group by |
||||
|
so.partner_id, |
||||
|
so.date_order, |
||||
|
s.product_id, |
||||
|
t.uom_id, |
||||
|
t.detailed_type, |
||||
|
so.id |
||||
|
order by s.product_id)) |
||||
|
macro |
||||
|
group by |
||||
|
macro.partner_id, |
||||
|
macro.order_date, |
||||
|
macro.order_state, |
||||
|
macro.product_id, |
||||
|
macro.id, |
||||
|
macro.order_ref, |
||||
|
macro.order_type, |
||||
|
macro.unit_price_sale, |
||||
|
macro.unit_price_purchase, |
||||
|
macro.product_type, |
||||
|
macro.qty_invoiced, |
||||
|
macro.qty_billed, |
||||
|
macro.qty_delivered, |
||||
|
macro.qty_received, |
||||
|
macro.qty_ordered_to, |
||||
|
macro.qty_ordered_by, |
||||
|
macro.price_total_sale, |
||||
|
macro.price_total_purchase, |
||||
|
macro.price_subtotal_sale, |
||||
|
macro.price_subtotal_purchase, |
||||
|
macro.company_id, |
||||
|
macro.currency_id, |
||||
|
macro.product_uom |
||||
|
order by macro.product_id""" % ( |
||||
|
where_purchase, where_sale)) |
||||
|
rec = self.env.cr.fetchall() |
||||
|
return { |
||||
|
'docs': rec, |
||||
|
'date_from': data['form']['date_from'], |
||||
|
'date_to': data['form']['date_to'], |
||||
|
} |
@ -0,0 +1,151 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<template id="report_sale_purchase"> |
||||
|
<t t-call="web.html_container"> |
||||
|
<t t-call="web.external_layout"> |
||||
|
<div class="page"> |
||||
|
<h2>Sale Purchase Report</h2> |
||||
|
<br t-if="date_from or data_to"/> |
||||
|
<div> |
||||
|
<t t-if="date_from"> |
||||
|
<span> |
||||
|
<strong>Date From:</strong> |
||||
|
<span style="margin-left:3px;margin-right:17px;margin-bottom:3px" |
||||
|
t-esc="date_from"/> |
||||
|
</span> |
||||
|
</t> |
||||
|
<t t-if="date_to"> |
||||
|
<span> |
||||
|
<strong>Date To:</strong> |
||||
|
<span style="margin-left:3px;margin-right:17px;margin-bottom:3px" |
||||
|
t-esc="date_to"/> |
||||
|
</span> |
||||
|
</t> |
||||
|
</div> |
||||
|
<br/> |
||||
|
<table class="table table-sm o_main_table"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th>Order Date</th> |
||||
|
<th>Order Type</th> |
||||
|
<th>Order Ref</th> |
||||
|
<th>Partner</th> |
||||
|
<th>Product</th> |
||||
|
<th>Product Type</th> |
||||
|
<th>Qty Ordered</th> |
||||
|
<th>Qty Received/Delivered</th> |
||||
|
<th>Qty Billed/Invoiced</th> |
||||
|
<th>Unit Price</th> |
||||
|
<th>Price Total</th> |
||||
|
<th>Order State</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<t t-foreach="docs" t-as="line"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<span t-esc="line[3]" t-options="{'widget': 'date'}"/> |
||||
|
</td> |
||||
|
<td> |
||||
|
<span t-esc="line[1]"/> |
||||
|
</td> |
||||
|
<td> |
||||
|
<span t-esc="line[6]"/> |
||||
|
</td> |
||||
|
<td> |
||||
|
<span t-esc="request.env['res.partner'].sudo().browse(line[4]).name"/> |
||||
|
</td> |
||||
|
<td> |
||||
|
<span t-esc="request.env['product.product'].sudo().browse(line[5]).display_name"/> |
||||
|
</td> |
||||
|
<td> |
||||
|
<t t-esc="{ |
||||
|
'service': 'Service', |
||||
|
'consu': 'Consumable', |
||||
|
'product': 'Product' |
||||
|
}[line[13]]"/> |
||||
|
</td> |
||||
|
<td> |
||||
|
<t t-if="line[1] == 'Sale' and line[17]"> |
||||
|
<span t-esc="line[17]"/> |
||||
|
<span t-esc="request.env['uom.uom'].sudo().browse(line[21]).name" |
||||
|
groups="uom.group_uom"/> |
||||
|
</t> |
||||
|
<t t-if="line[1] == 'Purchase' and line[16] != 0"> |
||||
|
<span t-esc="line[16]"/> |
||||
|
<span t-esc="request.env['uom.uom'].sudo().browse(line[21]).name" |
||||
|
groups="uom.group_uom"/> |
||||
|
</t> |
||||
|
<t t-else=""> |
||||
|
<span/> |
||||
|
</t> |
||||
|
</td> |
||||
|
<td> |
||||
|
<t t-if="line[1] == 'Sale' and line[18] != 0"> |
||||
|
<span t-esc="line[18]"/> |
||||
|
<span t-esc="request.env['uom.uom'].sudo().browse(line[21]).name" |
||||
|
groups="uom.group_uom"/> |
||||
|
</t> |
||||
|
<t t-if="line[1] == 'Purchase' and line[19] != 0"> |
||||
|
<span t-esc="line[19]"/> |
||||
|
<span t-esc="request.env['uom.uom'].sudo().browse(line[21]).name" |
||||
|
groups="uom.group_uom"/> |
||||
|
</t> |
||||
|
<t t-else=""> |
||||
|
<span/> |
||||
|
</t> |
||||
|
</td> |
||||
|
<td> |
||||
|
<t t-if="line[1] == 'Sale' and line[14] != 0"> |
||||
|
<span t-esc="line[14]"/> |
||||
|
<span t-esc="request.env['uom.uom'].sudo().browse(line[21]).name" |
||||
|
groups="uom.group_uom"/> |
||||
|
</t> |
||||
|
<t t-if="line[1] == 'Purchase' and line[15] != 0"> |
||||
|
<span t-esc="line[15]"/> |
||||
|
<span t-esc="request.env['uom.uom'].sudo().browse(line[21]).name" |
||||
|
groups="uom.group_uom"/> |
||||
|
</t> |
||||
|
<t t-else=""> |
||||
|
<span/> |
||||
|
</t> |
||||
|
</td> |
||||
|
<td> |
||||
|
<t t-if="line[1] == 'Sale' and line[7]"> |
||||
|
<span t-esc="line[7]"/> |
||||
|
</t> |
||||
|
<t t-else="line[8]"> |
||||
|
<span t-esc="line[8]"/> |
||||
|
</t> |
||||
|
</td> |
||||
|
<td> |
||||
|
<t t-if="line[1] == 'Sale' and line[11]"> |
||||
|
<span t-esc="line[11]" |
||||
|
t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> |
||||
|
</t> |
||||
|
<t t-else="line[12]"> |
||||
|
<span t-esc="line[12]" |
||||
|
t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/> |
||||
|
</t> |
||||
|
</td> |
||||
|
<td> |
||||
|
<t t-esc="{ |
||||
|
'draft_sale': 'Quotation', |
||||
|
'draft_rfq': 'RFQ', |
||||
|
'sent_sale': 'Quotation Sent', |
||||
|
'rfq_sent': 'RFQ Sent', |
||||
|
'to_approve': 'To Approve', |
||||
|
'sale': 'Sale Order', |
||||
|
'purchase': 'Purchase Order', |
||||
|
'done': 'Done', |
||||
|
'cancel': 'Cancelled'}[line[2]]"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</t> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
</t> |
||||
|
</t> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,334 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Mohammed Ajmal P (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributes in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along this program. |
||||
|
# If not, see <http://www.gnu.org/license/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
|
||||
|
from odoo import fields, models, tools |
||||
|
|
||||
|
|
||||
|
class SalePurchaseReport(models.Model): |
||||
|
"""Fields and Functions for graph and pivot view""" |
||||
|
_name = 'sale.purchase.report' |
||||
|
_description = 'Sale Purchase Report' |
||||
|
_order = 'order_date desc' |
||||
|
_auto = False |
||||
|
|
||||
|
product_tmpl_id = fields.Many2one('product.template', string='Product', |
||||
|
readonly=True) |
||||
|
product_id = fields.Many2one('product.product', string='Variant', |
||||
|
readonly=True) |
||||
|
partner_id = fields.Many2one('res.partner', string='Partner', readonly=True) |
||||
|
product_type = fields.Selection( |
||||
|
[('cosnsu', 'Consumable'), ('service', 'Service'), |
||||
|
('product', 'Product')]) |
||||
|
category_id = fields.Many2one('product.category', 'Product Category', |
||||
|
readonly=True) |
||||
|
qty_invoiced = fields.Float(string='Qty Invoiced', readonly=True) |
||||
|
qty_billed = fields.Float(string='Qty Billed', readonly=True) |
||||
|
qty_delivered = fields.Float(string='Qty Delivered', readonly=True) |
||||
|
qty_received = fields.Float(string='Qty Received', readonly=True) |
||||
|
qty_ordered_by = fields.Float('Qty Ordered by Customer', readonly=True) |
||||
|
qty_ordered_to = fields.Float('Qty Ordered to Vendor', readonly=True) |
||||
|
qty_to_deliver = fields.Float('Qty to Deliver', readonly=True) |
||||
|
qty_to_receive = fields.Float('Qty to Receive', readonly=True) |
||||
|
qty_to_invoice = fields.Float('Qty to Invoice', readonly=True) |
||||
|
qty_to_bill = fields.Float('Qty to Bill', readonly=True) |
||||
|
unit_price_sale = fields.Float(string='Unit Price Sale', readonly=True) |
||||
|
unit_price_purchase = fields.Float(string='Unit Price Purchase', |
||||
|
readonly=True) |
||||
|
order_type = fields.Char('Order Type', readonly=True) |
||||
|
order_date = fields.Datetime('Order Date', readonly=True) |
||||
|
order_ref = fields.Char('Order Reference', readonly=True) |
||||
|
order_state = fields.Selection( |
||||
|
[('draft_sale', 'Quotation'), ('draft_rfq', 'RFQ'), |
||||
|
('sent_sale', 'Quotation Sent'), ('rfq_sent', 'RFQ Sent'), |
||||
|
('to_approve', 'To Approve'), |
||||
|
('sale', 'Sale Order'), ('purchase', 'Purchase Order'), |
||||
|
('done', 'Done'), |
||||
|
('cancel', 'Cancelled')], string='Order Status') |
||||
|
company_id = fields.Many2one('res.company', 'Company', readonly=True) |
||||
|
price_total_sale = fields.Float('Total Sale', readonly=True) |
||||
|
price_total_purchase = fields.Float('Total Purchase', readonly=True) |
||||
|
price_subtotal_sale = fields.Float('Untaxed Total Sale', readonly=True) |
||||
|
price_subtotal_purchase = fields.Float('Untaxed Total Purchase', |
||||
|
readonly=True) |
||||
|
user_id = fields.Many2one('res.users', 'Representative', readonly=True) |
||||
|
currency_id = fields.Many2one('res.currency', 'Currency', readonly=True) |
||||
|
weight_sale = fields.Float('Gross Weight Sale', readonly=True) |
||||
|
weight_purchase = fields.Float('Gross Weight Purchase', readonly=True) |
||||
|
volume_sale = fields.Float('Volume Sale', readonly=True) |
||||
|
volume_purchase = fields.Float('Volume Purchase', readonly=True) |
||||
|
product_uom = fields.Many2one('uom.uom', 'Unit of Measure', required=True) |
||||
|
|
||||
|
def init(self): |
||||
|
tools.drop_view_if_exists(self._cr, 'sale_purchase_report') |
||||
|
self._cr.execute(""" |
||||
|
CREATE or REPLACE VIEW sale_purchase_report as( |
||||
|
select macro.id as id, |
||||
|
macro.order_type as order_type, |
||||
|
macro.order_state as order_state, |
||||
|
macro.order_date as order_date, |
||||
|
macro.partner_id as partner_id, |
||||
|
macro.product_id as product_id, |
||||
|
macro.product_tmpl_id as product_tmpl_id, |
||||
|
macro.order_ref as order_ref, |
||||
|
macro.unit_price_sale as unit_price_sale, |
||||
|
macro.unit_price_purchase as unit_price_purchase, |
||||
|
macro.price_total_sale as price_total_sale, |
||||
|
macro.price_total_purchase as price_total_purchase, |
||||
|
macro.price_subtotal_sale as price_subtotal_sale, |
||||
|
macro.price_subtotal_purchase as price_subtotal_purchase, |
||||
|
macro.product_type as product_type, |
||||
|
macro.qty_invoiced as qty_invoiced, |
||||
|
macro.qty_billed as qty_billed, |
||||
|
macro.qty_ordered_to as qty_ordered_to, |
||||
|
macro.qty_ordered_by as qty_ordered_by, |
||||
|
macro.qty_delivered as qty_delivered, |
||||
|
macro.qty_received as qty_received, |
||||
|
macro.qty_to_invoice as qty_to_invoice, |
||||
|
macro.qty_to_bill as qty_to_bill, |
||||
|
macro.qty_to_deliver as qty_to_deliver, |
||||
|
macro.qty_to_receive as qty_to_receive, |
||||
|
macro.company_id as company_id, |
||||
|
macro.currency_id as currency_id, |
||||
|
macro.product_uom as product_uom, |
||||
|
macro.category_id as category_id, |
||||
|
macro.user_id as user_id, |
||||
|
macro.weight_sale as weight_sale, |
||||
|
macro.weight_purchase as weight_purchase, |
||||
|
macro.volume_sale as volume_sale, |
||||
|
macro.volume_purchase as volume_purchase |
||||
|
from(( |
||||
|
with currency_rate as (%s)""" % self.env[ |
||||
|
'res.currency']._select_companies_rates() + |
||||
|
""" |
||||
|
select |
||||
|
po.id as id, |
||||
|
po.date_order as order_date, |
||||
|
po.partner_id as partner_id, |
||||
|
po.company_id as company_id, |
||||
|
po.currency_id, |
||||
|
t.categ_id as category_id, |
||||
|
t.uom_id as product_uom, |
||||
|
po.user_id as user_id, |
||||
|
case |
||||
|
when po.state='draft' then 'draft_rfq' |
||||
|
when po.state='sent' then 'rfq_sent' |
||||
|
when po.state='to_approve' then 'to_approve' |
||||
|
when po.state='purchase' then 'purchase' |
||||
|
when po.state='done' then 'done' else |
||||
|
'cancel' end as order_state, |
||||
|
case when po.is_purchase_order=True then |
||||
|
'Purchase' else '' end as order_type, |
||||
|
l.product_id as product_id, |
||||
|
p.product_tmpl_id as product_tmpl_id, |
||||
|
t.detailed_type as product_type, |
||||
|
po.name as order_ref, |
||||
|
0 as unit_price_sale, |
||||
|
case when l.product_id is not null then |
||||
|
sum(l.price_unit) else 0 end as unit_price_purchase, |
||||
|
0 as price_total_sale, |
||||
|
sum(l.price_total / coalesce(po.currency_rate, 1.0))::decimal(16,2) * currency_table.rate as price_total_purchase, |
||||
|
0 as price_subtotal_sale, |
||||
|
sum(l.price_subtotal / coalesce(po.currency_rate, 1.0))::decimal(16, 2) * currency_table.rate as price_subtotal_purchase, |
||||
|
case when l.product_id is not null then |
||||
|
sum(l.product_qty/ u.factor * u2.factor) else 0 |
||||
|
end as qty_ordered_to, |
||||
|
case when l.product_id is not null then |
||||
|
sum(l.qty_received / u.factor * u2.factor) else 0 |
||||
|
end as qty_received, |
||||
|
case when l.product_id is not null then |
||||
|
sum(l.qty_invoiced / u.factor * u2.factor) |
||||
|
else 0 end as qty_billed, |
||||
|
case when t.purchase_method = 'purchase' then |
||||
|
sum(l.product_qty / u.factor * u2.factor) - sum(l.qty_invoiced / u.factor * u2.factor) |
||||
|
else sum(l.qty_received / u.factor * u2.factor) - sum(l.qty_invoiced / u.factor * u2.factor) |
||||
|
end as qty_to_bill, |
||||
|
case when l.product_id is not null then |
||||
|
sum((l.product_qty - l.qty_received) / u.factor * u2.factor) |
||||
|
else 0 end as qty_to_receive, |
||||
|
0 as weight_sale, |
||||
|
sum(p.weight * l.product_qty / u.factor * u2.factor) as weight_purchase, |
||||
|
0 as volume_sale, |
||||
|
sum(p.volume * l.product_qty / u.factor * u2.factor) as volume_purchase, |
||||
|
0 as qty_ordered_by, |
||||
|
0 as qty_delivered, |
||||
|
0 as qty_invoiced, |
||||
|
0 as qty_to_invoice, |
||||
|
0 as qty_to_deliver |
||||
|
from |
||||
|
(purchase_order_line l |
||||
|
join purchase_order po on (l.order_id=po.id) |
||||
|
join res_partner partner on |
||||
|
(po.partner_id=partner.id) |
||||
|
left join product_product p on (l.product_id=p.id) |
||||
|
left join product_template t on |
||||
|
(p.product_tmpl_id=t.id) |
||||
|
left join uom_uom u on (l.product_uom=u.id) |
||||
|
left join uom_uom u2 on (t.uom_id=u2.id)) |
||||
|
left join currency_rate cr on |
||||
|
(cr.currency_id = po.currency_id |
||||
|
and cr.company_id = po.company_id and cr.date_start <= coalesce(po.date_order, now()) and |
||||
|
(cr.date_end is null or cr.date_end > coalesce(po.date_order, now()))) |
||||
|
left join {currency_table} on |
||||
|
currency_table.company_id = po.company_id |
||||
|
""".format( |
||||
|
currency_table=self.env[ |
||||
|
'res.currency']._get_query_currency_table( |
||||
|
{'multi_company': True, |
||||
|
'date': { |
||||
|
'date_to': fields.Date.today()}}), ) + |
||||
|
""" |
||||
|
group by |
||||
|
po.partner_id, |
||||
|
p.product_tmpl_id, |
||||
|
po.date_order, |
||||
|
l.product_id, |
||||
|
t.uom_id, |
||||
|
t.detailed_type, |
||||
|
po.id, |
||||
|
currency_table.rate, |
||||
|
t.purchase_method, |
||||
|
t.categ_id |
||||
|
order by l.product_id) |
||||
|
UNION ALL |
||||
|
(select |
||||
|
so.id as id, |
||||
|
so.date_order as order_date, |
||||
|
so.partner_id as partner_id, |
||||
|
so.company_id as company_id, |
||||
|
so.currency_id, |
||||
|
t.categ_id as category_id, |
||||
|
t.uom_id as product_uom, |
||||
|
so.user_id as user_id, |
||||
|
case |
||||
|
when so.state='draft' then 'draft_sale' |
||||
|
when so.state='sent' then 'sent_sale' |
||||
|
when so.state='sale' then 'sale' |
||||
|
when so.state='done' then 'done' else |
||||
|
'cancel' end as order_state, |
||||
|
case when so.is_sale_order=True then |
||||
|
'Sale' else '' end as order_type, |
||||
|
s.product_id as product_id, |
||||
|
p.product_tmpl_id as product_tmpl_id, |
||||
|
t.detailed_type as product_type, |
||||
|
so.name as order_ref, |
||||
|
case when s.product_id is not null then |
||||
|
sum(s.price_unit) else 0 end |
||||
|
as unit_price_sale, |
||||
|
0 as unit_price_purchase, |
||||
|
case when s.product_id is not null then |
||||
|
sum(s.price_total / case coalesce(so.currency_rate, 0) |
||||
|
when 0 then 1.0 else so.currency_rate end) else |
||||
|
0 end as price_total_sale, |
||||
|
0 as price_total_purchase, |
||||
|
case when s.product_id is not null then |
||||
|
sum(s.price_subtotal / case coalesce(so.currency_rate, 0) |
||||
|
when 0 then 1.0 else so.currency_rate end) else |
||||
|
0 end as price_subtotal_sale, |
||||
|
0 as price_subtotal_purchase, |
||||
|
0 as qty_ordered_to, |
||||
|
0 as qty_received, |
||||
|
0 as qty_billed, |
||||
|
0 as qty_to_bill, |
||||
|
0 as qty_to_receive, |
||||
|
case when s.product_id is not null then |
||||
|
sum(p.weight * s.product_uom_qty / u.factor * u2.factor) else 0 end as weight_sale, |
||||
|
0 as weight_purchase, |
||||
|
case when s.product_id is not null then |
||||
|
sum(p.volume * s.product_uom_qty / u.factor * u2.factor) else 0 end as volume_sale, |
||||
|
0 as volume_purchase, |
||||
|
case when s.product_id is not null then |
||||
|
sum(s.product_uom_qty / u.factor * u2.factor) else 0 end as |
||||
|
qty_ordered_by, |
||||
|
case when s.product_id is not null then |
||||
|
sum(s.qty_delivered / u.factor * u2.factor) else 0 end as |
||||
|
qty_delivered, |
||||
|
case when s.product_id is not null then |
||||
|
sum(s.qty_invoiced / u.factor * u2.factor) else 0 end as |
||||
|
qty_invoiced, |
||||
|
case when s.product_id is not null then |
||||
|
sum(s.qty_to_invoice / u.factor * u2.factor) else 0 end as |
||||
|
qty_to_invoice, |
||||
|
case when s.product_id is not null then |
||||
|
sum((s.product_uom_qty - s.qty_delivered) / u.factor * u2.factor) |
||||
|
else 0 end as qty_to_deliver |
||||
|
from |
||||
|
(sale_order_line s |
||||
|
join sale_order so on (s.order_id=so.id) |
||||
|
join res_partner partner on |
||||
|
(so.partner_id=partner.id) |
||||
|
left join product_product p on |
||||
|
(s.product_id=p.id) |
||||
|
left join product_template t on |
||||
|
(p.product_tmpl_id=t.id) |
||||
|
left join uom_uom u on |
||||
|
(s.product_uom=u.id) |
||||
|
left join uom_uom u2 on |
||||
|
(t.uom_id=u2.id)) |
||||
|
group by |
||||
|
so.partner_id, |
||||
|
p.product_tmpl_id, |
||||
|
so.date_order, |
||||
|
s.product_id, |
||||
|
t.uom_id, |
||||
|
t.detailed_type, |
||||
|
so.id, |
||||
|
t.categ_id |
||||
|
order by s.product_id)) |
||||
|
macro |
||||
|
group by |
||||
|
macro.partner_id, |
||||
|
macro.product_tmpl_id, |
||||
|
macro.order_date, |
||||
|
macro.order_state, |
||||
|
macro.product_id, |
||||
|
macro.id, |
||||
|
macro.order_ref, |
||||
|
macro.order_type, |
||||
|
macro.unit_price_sale, |
||||
|
macro.unit_price_purchase, |
||||
|
macro.product_type, |
||||
|
macro.qty_invoiced, |
||||
|
macro.qty_billed, |
||||
|
macro.qty_delivered, |
||||
|
macro.qty_received, |
||||
|
macro.qty_ordered_to, |
||||
|
macro.qty_ordered_by, |
||||
|
macro.qty_to_deliver, |
||||
|
macro.qty_to_receive, |
||||
|
macro.qty_to_invoice, |
||||
|
macro.qty_to_bill, |
||||
|
macro.price_total_sale, |
||||
|
macro.price_total_purchase, |
||||
|
macro.price_subtotal_sale, |
||||
|
macro.price_subtotal_purchase, |
||||
|
macro.company_id, |
||||
|
macro.currency_id, |
||||
|
macro.product_uom, |
||||
|
macro.user_id, |
||||
|
macro.weight_sale, |
||||
|
macro.weight_purchase, |
||||
|
macro.volume_sale, |
||||
|
macro.volume_purchase, |
||||
|
macro.category_id |
||||
|
order by macro.product_id |
||||
|
); |
||||
|
""") |
@ -0,0 +1,85 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<record id="sale_purchase_report_view_pivot" model="ir.ui.view"> |
||||
|
<field name="name">sale.purchase.report.view.pivot</field> |
||||
|
<field name="model">sale.purchase.report</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<pivot string="Sale Purchase Report" disable_linking="True" |
||||
|
sample="1"> |
||||
|
<field name="partner_id" type="col"/> |
||||
|
<field name="product_id" type="row"/> |
||||
|
<field name="qty_invoiced" type="measure"/> |
||||
|
</pivot> |
||||
|
</field> |
||||
|
</record> |
||||
|
<record id="sale_purchase_report_view_graph" model="ir.ui.view"> |
||||
|
<field name="name">sale.purchase.report.view.graph</field> |
||||
|
<field name="model">sale.purchase.report</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<graph string="Sale Purchase Report" sample="1"> |
||||
|
<field name="order_date" interval="day"/> |
||||
|
<field name="qty_invoiced" type="measure"/> |
||||
|
</graph> |
||||
|
</field> |
||||
|
</record> |
||||
|
<record id="sale_purchase_report_view_search" model="ir.ui.view"> |
||||
|
<field name="name">sale.purchase.report.view.search</field> |
||||
|
<field name="model">sale.purchase.report</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<search string="Sale Purchase Report"> |
||||
|
<field name="order_date"/> |
||||
|
<filter string="Order Date" name="year" invisible="1" |
||||
|
date="order_date" default_period="this_year"/> |
||||
|
<filter string="Sale Orders" name="Sale Orders" |
||||
|
domain="[('order_state', 'not in', ('draft_sale', 'draft_rfq', 'sent_sale', 'rfq_sent', 'to_approve', 'purchase', 'cancel'))]"/> |
||||
|
<filter string="Purchase Orders" name="Purchase Orders" |
||||
|
domain="[('order_state', 'not in', ('draft_sale', 'draft_rfq', 'sent_sale', 'rfq_sent', 'to_approve', 'sale', 'cancel'))]"/> |
||||
|
<separator/> |
||||
|
<filter name="filter_date" date="order_date" default_period="this_month"/> |
||||
|
<separator/> |
||||
|
<field name="user_id"/> |
||||
|
<field name="product_id"/> |
||||
|
<field name="category_id"/> |
||||
|
<field name="partner_id"/> |
||||
|
<group expand="0" string="Extended Filters"> |
||||
|
<field name="category_id" |
||||
|
filter_domain="[('category_id', 'child_of', self)]"/> |
||||
|
<field name="company_id" groups="base.group_multi_company"/> |
||||
|
</group> |
||||
|
<group expand="1" string="Group By"> |
||||
|
<filter string="Partner" name="Partner" |
||||
|
context="{'group_by': 'partner_id'}"/> |
||||
|
<filter string="Representative" name="User" |
||||
|
context="{'group_by': 'user_id'}"/> |
||||
|
<filter string="Product" name="Product" |
||||
|
context="{'group_by': 'product_id'}"/> |
||||
|
<filter string="Product Category" name="Category" |
||||
|
context="{'group_by': 'category_id'}"/> |
||||
|
<filter string="Order Status" name="Status" |
||||
|
context="{'group_by': 'order_state'}"/> |
||||
|
<filter string="Company" name="Company" |
||||
|
context="{'group_by': 'company_id'}" |
||||
|
groups="base.group_multi_company"/> |
||||
|
<filter string="Order Date" name="order_date" |
||||
|
context="{'group_by': 'order_date:month'}"/> |
||||
|
</group> |
||||
|
</search> |
||||
|
</field> |
||||
|
</record> |
||||
|
<record id="action_sale_purchase_report" model="ir.actions.act_window"> |
||||
|
<field name="name">Sale Purchase Report</field> |
||||
|
<field name="res_model">sale.purchase.report</field> |
||||
|
<field name="view_mode">graph,pivot</field> |
||||
|
<field name="target">current</field> |
||||
|
</record> |
||||
|
<menuitem name="Sale Purchase Report" id="menu_sale_purchase_report_root_sale" |
||||
|
parent="sale.menu_sale_report" sequence="100" groups="sales_team.group_sale_manager"> |
||||
|
<menuitem name="Sale Purchase Report" id="menu_sale_purchase_report_sale" |
||||
|
sequence="1" action="action_sale_purchase_report"/> |
||||
|
</menuitem> |
||||
|
<menuitem name="Sale Purchase Report" id="menu_sale_purchase_report_root_purchase" |
||||
|
parent="purchase.purchase_report_main" sequence="100" groups="purchase.group_purchase_manager"> |
||||
|
<menuitem name="Sale Purchase Report" id="menu_sale_purchase_report_purchase" |
||||
|
sequence="1" action="action_sale_purchase_report"/> |
||||
|
</menuitem> |
||||
|
</odoo> |
|
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 147 KiB |
After Width: | Height: | Size: 246 KiB |
After Width: | Height: | Size: 301 KiB |
After Width: | Height: | Size: 137 KiB |
After Width: | Height: | Size: 150 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 292 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 18 KiB |
@ -0,0 +1,691 @@ |
|||||
|
<div class="container" |
||||
|
style="padding: 1rem !important; margin-bottom: 1rem !important;"> |
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12 col-md-12 col-lg-12 d-flex justify-content-between" |
||||
|
style="border-bottom: 1px solid #d5d5d5;"> |
||||
|
<div class="my-3"> |
||||
|
<img src="./assets/icons/logo.png" |
||||
|
style="width: auto !important; height: 40px !important;"> |
||||
|
</div> |
||||
|
<div class="my-3 d-flex align-items-center"> |
||||
|
<div |
||||
|
style="background-color: #7C7BAD !important; color: #fff !important; font-weight: 600 !important; padding: 5px 15px 8px !important; margin: 0 5px !important;"> |
||||
|
<i class="fa fa-check mr-1"></i>Community |
||||
|
</div> |
||||
|
<div |
||||
|
style="background-color: #875A7B !important; color: #fff !important; font-weight: 600 !important; padding: 5px 15px 8px !important; margin: 0 5px !important;"> |
||||
|
<i class="fa fa-check mr-1"></i>Enterprise |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="container" style="padding: 0rem 1.5rem 4rem !important"> |
||||
|
<div class="row" style="height: 900px !important;"> |
||||
|
<div class="col-sm-12 col-md-12 col-lg-12" |
||||
|
style="padding: 4rem 1rem !important; background-color: #714B67 !important; height: 600px !important; border-radius: 20px !important;"> |
||||
|
<h1 |
||||
|
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #FFFFFF !important; font-size: 3.5rem !important; text-align: center !important;"> |
||||
|
Sales Purchase Mixed Report</h1> |
||||
|
<p |
||||
|
style="font-family: 'Montserrat', sans-serif !important; font-weight: 300 !important; color: #FFFFFF !important; font-size: 1.4rem !important; text-align: center !important;"> |
||||
|
A Module For getting the mixed report from Sales and Purchase |
||||
|
</p> |
||||
|
<img src="./assets/screenshots/hero.png" class="img-responsive" |
||||
|
width="100%" height="auto"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="row"> |
||||
|
<div class="col-md-12" |
||||
|
style="border-bottom: 1px solid #d5d5d5 !important; margin-bottom: 2rem !important"> |
||||
|
<h2 |
||||
|
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;"> |
||||
|
<i class="fa fa-compass mr-2"></i>Explore this module |
||||
|
</h2> |
||||
|
<div class="row"> |
||||
|
<div class="col-md-6"> |
||||
|
<a href="#overview" |
||||
|
style="text-decoration: none !important;"> |
||||
|
<div class="row" |
||||
|
style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;"> |
||||
|
<div class="col-8"> |
||||
|
<h3 |
||||
|
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;"> |
||||
|
Overview</h3> |
||||
|
<p |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;"> |
||||
|
Learn more about this module</p> |
||||
|
</div> |
||||
|
<div class="col-4 text-right d-flex justify-content-end align-items-center"> |
||||
|
<i class="fa fa-chevron-right" |
||||
|
style="color: #714B67 !important;"></i> |
||||
|
</div> |
||||
|
</div> |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="col-md-6"> |
||||
|
<a href="#features" |
||||
|
style="text-decoration: none !important;"> |
||||
|
<div class="row" |
||||
|
style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;"> |
||||
|
<div class="col-8"> |
||||
|
<h3 |
||||
|
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;"> |
||||
|
Features</h3> |
||||
|
<p |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;"> |
||||
|
View features of this module</p> |
||||
|
</div> |
||||
|
<div class="col-4 text-right d-flex justify-content-end align-items-center"> |
||||
|
<i class="fa fa-chevron-right" |
||||
|
style="color: #714B67 !important;"></i> |
||||
|
</div> |
||||
|
</div> |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="col-md-6"> |
||||
|
<a href="#screenshots" |
||||
|
style="text-decoration: none !important;"> |
||||
|
<div class="row" |
||||
|
style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;"> |
||||
|
<div class="col-8"> |
||||
|
<h3 |
||||
|
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;"> |
||||
|
Screenshots</h3> |
||||
|
<p |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;"> |
||||
|
See key screenshots of this module</p> |
||||
|
</div> |
||||
|
<div class="col-4 text-right d-flex justify-content-end align-items-center"> |
||||
|
<i class="fa fa-chevron-right" |
||||
|
style="color: #714B67 !important;"></i> |
||||
|
</div> |
||||
|
</div> |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<div class="row" id="overview"> |
||||
|
<div class="col-md-12" |
||||
|
style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important"> |
||||
|
<h2 |
||||
|
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;"> |
||||
|
<i class="fa fa-pie-chart mr-2"></i>Overview |
||||
|
</h2> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-mg-12 pl-3"> |
||||
|
<p |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important; line-height: 30px !important;"> |
||||
|
In the Sales Purchase Mixed Report module, we can have mixed |
||||
|
reports from the Sales and Purchase orders. There are Pivot, |
||||
|
Graph views to explore the mixed report. Moreover, we can print |
||||
|
the PDF and XLSX reports. |
||||
|
</p> |
||||
|
</div> |
||||
|
</p> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="row" id="features"> |
||||
|
<div class="col-md-12" |
||||
|
style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important"> |
||||
|
<h2 |
||||
|
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;"> |
||||
|
<i class="fa fa-star mr-2"></i>Features |
||||
|
</h2> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-md-6 pl-3 py-3 d-flex"> |
||||
|
<div> |
||||
|
<img src="assets/icons/check.png"> |
||||
|
</div> |
||||
|
<div> |
||||
|
<h4 |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;"> |
||||
|
No additional configuration required.</h4> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-md-6 pl-3 py-3 d-flex"> |
||||
|
<div> |
||||
|
<img src="assets/icons/check.png"> |
||||
|
</div> |
||||
|
<div> |
||||
|
<h4 |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;"> |
||||
|
Reports are available from both Sales and Purchase modules under Reporting menu.</h4> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-md-6 pl-3 py-3 d-flex"> |
||||
|
<div> |
||||
|
<img src="assets/icons/check.png"> |
||||
|
</div> |
||||
|
<div> |
||||
|
<h4 |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;"> |
||||
|
Graph and Pivot views are available with several Measures and Filters.</h4> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-md-6 pl-3 py-3 d-flex"> |
||||
|
<div> |
||||
|
<img src="assets/icons/check.png"> |
||||
|
</div> |
||||
|
<div> |
||||
|
<h4 |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;"> |
||||
|
Extra wizard for filtering and Printing the PDF, XLSX Reports.</h4> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<div class="row" id="screenshots"> |
||||
|
<div class="col-md-12" |
||||
|
style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important"> |
||||
|
<h2 |
||||
|
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;"> |
||||
|
<i class="fa fa-image mr-2"></i>Screenshots |
||||
|
</h2> |
||||
|
</div> |
||||
|
<div class="col-lg-12 my-2"> |
||||
|
<h4 class="mt-2" |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;"> |
||||
|
Menu available from Sale</h4> |
||||
|
<p |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> |
||||
|
Menus are available from Sale in order to view and print them in PDF, XLSX formats.</p> |
||||
|
<img src="assets/screenshots/menu_sale.png" |
||||
|
class="img-responsive img-thumbnail border" width="100%" |
||||
|
height="auto"/> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-12 my-3"> |
||||
|
<h4 class="mt-3" |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;"> |
||||
|
Menu available from Purchase</h4> |
||||
|
<p |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> |
||||
|
Menus are available from Purchase in order to view and print them in PDF, XLSX formats. |
||||
|
</p> |
||||
|
<img src="assets/screenshots/menu_purchase.png" |
||||
|
class="img-responsive img-thumbnail border" width="100%" |
||||
|
height="auto"/> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-12 my-3"> |
||||
|
<h4 class="mt-3" |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;"> |
||||
|
Graph View</h4> |
||||
|
<img src="assets/screenshots/graph_view.png" |
||||
|
class="img-responsive img-thumbnail border" width="100%" |
||||
|
height="auto"/> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="col-lg-12 my-3"> |
||||
|
<h4 class="mt-3" |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;"> |
||||
|
Pivot View</h4> |
||||
|
<img src="assets/screenshots/pivot_view.png" |
||||
|
class="img-responsive img-thumbnail border" width="100%" |
||||
|
height="auto"/> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="col-lg-12 my-3"> |
||||
|
<h4 class="mt-3" |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;"> |
||||
|
Wizard to Print Report</h4> |
||||
|
<p |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;"> |
||||
|
Wizard to print mixed report in PDF and XLSX formats are |
||||
|
available in which we can filter the orders based on Partner, |
||||
|
Order Reference and Order Dates. |
||||
|
</p> |
||||
|
<img src="assets/screenshots/print_wizard.png" |
||||
|
class="img-responsive img-thumbnail border" width="100%" |
||||
|
height="auto"/> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="col-lg-12 my-3"> |
||||
|
<h4 class="mt-3" |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;"> |
||||
|
PDF Report</h4> |
||||
|
<img src="assets/screenshots/pdf_report.png" |
||||
|
class="img-responsive img-thumbnail border" width="100%" |
||||
|
height="auto"/> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-12 my-3"> |
||||
|
<h4 class="mt-3" |
||||
|
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;"> |
||||
|
XLSX Report</h4> |
||||
|
<img src="assets/screenshots/xlsx_report.png" |
||||
|
class="img-responsive img-thumbnail border" width="100%" |
||||
|
height="auto"/> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
<!-- SUGGESTED PRODUCTS --> |
||||
|
<div class="row"> |
||||
|
<div class="col-lg-12 d-flex flex-column justify-content-center" |
||||
|
style="text-align: center; padding: 2.5rem 1rem !important;"> |
||||
|
<h2 style="color: #212529 !important;">Suggested Products</h2> |
||||
|
<hr |
||||
|
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/> |
||||
|
|
||||
|
<div id="demo1" class="row carousel slide" data-ride="carousel"> |
||||
|
<!-- The slideshow --> |
||||
|
<div class="carousel-inner"> |
||||
|
<div class="carousel-item active" style="min-height:0px"> |
||||
|
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" |
||||
|
style="float:left"> |
||||
|
<a href="https://apps.odoo.com/apps/modules/15.0/export_stockinfo_xls/" |
||||
|
target="_blank"> |
||||
|
<div style="border-radius:10px"> |
||||
|
<img class="img img-responsive center-block" |
||||
|
style="border-top-left-radius:10px; border-top-right-radius:10px" |
||||
|
src="./assets/modules/export_image.png"> |
||||
|
</div> |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" |
||||
|
style="float:left"> |
||||
|
<a href="https://apps.odoo.com/apps/modules/15.0/custom_gantt_view/" |
||||
|
target="_blank"> |
||||
|
<div style="border-radius:10px"> |
||||
|
<img class="img img-responsive center-block" |
||||
|
style="border-top-left-radius:10px; border-top-right-radius:10px" |
||||
|
src="./assets/modules/gantt_image.png"> |
||||
|
</div> |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" |
||||
|
style="float:left"> |
||||
|
<a href="https://apps.odoo.com/apps/modules/15.0/sales_credit_limit/" |
||||
|
target="_blank"> |
||||
|
<div style="border-radius:10px"> |
||||
|
<img class="img img-responsive center-block" |
||||
|
style="border-top-left-radius:10px; border-top-right-radius:10px" |
||||
|
src="./assets/modules/credit_image.png"> |
||||
|
</div> |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="carousel-item" style="min-height:0px"> |
||||
|
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" |
||||
|
style="float:left"> |
||||
|
<a href="https://apps.odoo.com/apps/modules/15.0/base_account_budget/" |
||||
|
target="_blank"> |
||||
|
<div style="border-radius:10px"> |
||||
|
<img class="img img-responsive center-block" |
||||
|
style="border-top-left-radius:10px; border-top-right-radius:10px" |
||||
|
src="./assets/modules/budget_image.png"> |
||||
|
</div> |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" |
||||
|
style="float:left"> |
||||
|
<a href="https://apps.odoo.com/apps/modules/15.0/product_to_quotation/" |
||||
|
target="_blank"> |
||||
|
<div style="border-radius:10px"> |
||||
|
<img class="img img-responsive center-block" |
||||
|
style="border-top-left-radius:10px; border-top-right-radius:10px" |
||||
|
src="./assets/modules/quotation_image.png"> |
||||
|
</div> |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" |
||||
|
style="float:left"> |
||||
|
<a href="https://apps.odoo.com/apps/modules/15.0/employee_documents_expiry/" |
||||
|
target="_blank"> |
||||
|
<div style="border-radius:10px"> |
||||
|
<img class="img img-responsive center-block" |
||||
|
style="border-top-left-radius:10px; border-top-right-radius:10px" |
||||
|
src="./assets/modules/employee_image.png"> |
||||
|
</div> |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- Left and right controls --> |
||||
|
<a class="carousel-control-prev" href="#demo1" data-slide="prev" |
||||
|
style="left:-25px;width: 35px;color: #000;"> |
||||
|
<span class="carousel-control-prev-icon"><i |
||||
|
class="fa fa-chevron-left" |
||||
|
style="font-size:24px"></i></span> </a> |
||||
|
<a class="carousel-control-next" href="#demo1" data-slide="next" |
||||
|
style="right:-25px;width: 35px;color: #000;"> |
||||
|
<span class="carousel-control-next-icon"><i |
||||
|
class="fa fa-chevron-right" |
||||
|
style="font-size:24px"></i></span> |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- END OF SUGGESTED PRODUCTS --> |
||||
|
|
||||
|
<!-- OUR SERVICES --> |
||||
|
<section class="container" style="margin-top: 6rem !important;"> |
||||
|
<div class="row"> |
||||
|
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center"> |
||||
|
<h2 style="color: #212529 !important;">Our Services</h2> |
||||
|
<hr |
||||
|
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> |
||||
|
<div class="d-flex justify-content-center align-items-center mx-3 my-3" |
||||
|
style="background-color: #1dd1a1 !important; border-radius: 15px !important; height: 80px; width: 80px;"> |
||||
|
<img src="assets/icons/cogs.png" class="img-responsive" |
||||
|
height="48px" width="48px"> |
||||
|
</div> |
||||
|
<h6 class="text-center" |
||||
|
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;"> |
||||
|
Odoo |
||||
|
Customization</h6> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> |
||||
|
<div class="d-flex justify-content-center align-items-center mx-3 my-3" |
||||
|
style="background-color: #ff6b6b !important; border-radius: 15px !important; height: 80px; width: 80px;"> |
||||
|
<img src="assets/icons/wrench.png" class="img-responsive" |
||||
|
height="48px" width="48px"> |
||||
|
</div> |
||||
|
<h6 class="text-center" |
||||
|
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;"> |
||||
|
Odoo |
||||
|
Implementation</h6> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> |
||||
|
<div class="d-flex justify-content-center align-items-center mx-3 my-3" |
||||
|
style="background-color: #6462CD !important; border-radius: 15px !important; height: 80px; width: 80px;"> |
||||
|
<img src="assets/icons/lifebuoy.png" class="img-responsive" |
||||
|
height="48px" width="48px"> |
||||
|
</div> |
||||
|
<h6 class="text-center" |
||||
|
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;"> |
||||
|
Odoo |
||||
|
Support</h6> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> |
||||
|
<div class="d-flex justify-content-center align-items-center mx-3 my-3" |
||||
|
style="background-color: #ffa801 !important; border-radius: 15px !important; height: 80px; width: 80px;"> |
||||
|
<img src="assets/icons/user.png" class="img-responsive" |
||||
|
height="48px" width="48px"> |
||||
|
</div> |
||||
|
<h6 class="text-center" |
||||
|
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;"> |
||||
|
Hire |
||||
|
Odoo |
||||
|
Developer</h6> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> |
||||
|
<div class="d-flex justify-content-center align-items-center mx-3 my-3" |
||||
|
style="background-color: #54a0ff !important; border-radius: 15px !important; height: 80px; width: 80px;"> |
||||
|
<img src="assets/icons/puzzle.png" class="img-responsive" |
||||
|
height="48px" width="48px"> |
||||
|
</div> |
||||
|
<h6 class="text-center" |
||||
|
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;"> |
||||
|
Odoo |
||||
|
Integration</h6> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> |
||||
|
<div class="d-flex justify-content-center align-items-center mx-3 my-3" |
||||
|
style="background-color: #6d7680 !important; border-radius: 15px !important; height: 80px; width: 80px;"> |
||||
|
<img src="assets/icons/update.png" class="img-responsive" |
||||
|
height="48px" width="48px"> |
||||
|
</div> |
||||
|
<h6 class="text-center" |
||||
|
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;"> |
||||
|
Odoo |
||||
|
Migration</h6> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> |
||||
|
<div class="d-flex justify-content-center align-items-center mx-3 my-3" |
||||
|
style="background-color: #786fa6 !important; border-radius: 15px !important; height: 80px; width: 80px;"> |
||||
|
<img src="assets/icons/consultation.png" |
||||
|
class="img-responsive" height="48px" width="48px"> |
||||
|
</div> |
||||
|
<h6 class="text-center" |
||||
|
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;"> |
||||
|
Odoo |
||||
|
Consultancy</h6> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> |
||||
|
<div class="d-flex justify-content-center align-items-center mx-3 my-3" |
||||
|
style="background-color: #f8a5c2 !important; border-radius: 15px !important; height: 80px; width: 80px;"> |
||||
|
<img src="assets/icons/training.png" class="img-responsive" |
||||
|
height="48px" width="48px"> |
||||
|
</div> |
||||
|
<h6 class="text-center" |
||||
|
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;"> |
||||
|
Odoo |
||||
|
Implementation</h6> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> |
||||
|
<div class="d-flex justify-content-center align-items-center mx-3 my-3" |
||||
|
style="background-color: #e6be26 !important; border-radius: 15px !important; height: 80px; width: 80px;"> |
||||
|
<img src="assets/icons/license.png" class="img-responsive" |
||||
|
height="48px" width="48px"> |
||||
|
</div> |
||||
|
<h6 class="text-center" |
||||
|
style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;"> |
||||
|
Odoo |
||||
|
Licensing Consultancy</h6> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
<!-- END OF END OF OUR SERVICES --> |
||||
|
|
||||
|
<!-- OUR INDUSTRIES --> |
||||
|
<section class="container" style="margin-top: 6rem !important;"> |
||||
|
<div class="row"> |
||||
|
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center"> |
||||
|
<h2 style="color: #212529 !important;">Our Industries</h2> |
||||
|
<hr |
||||
|
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-3"> |
||||
|
<div class="my-4 d-flex flex-column justify-content-center" |
||||
|
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;"> |
||||
|
<img src="./assets/icons/trading-black.png" |
||||
|
class="img-responsive mb-3" height="48px" width="48px"> |
||||
|
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;"> |
||||
|
Trading |
||||
|
</h5> |
||||
|
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;"> |
||||
|
Easily procure |
||||
|
and |
||||
|
sell your products</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-3"> |
||||
|
<div class="my-4 d-flex flex-column justify-content-center" |
||||
|
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;"> |
||||
|
<img src="./assets/icons/pos-black.png" |
||||
|
class="img-responsive mb-3" height="48px" width="48px"> |
||||
|
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;"> |
||||
|
POS |
||||
|
</h5> |
||||
|
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;"> |
||||
|
Easy |
||||
|
configuration |
||||
|
and convivial experience</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-3"> |
||||
|
<div class="my-4 d-flex flex-column justify-content-center" |
||||
|
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;"> |
||||
|
<img src="./assets/icons/education-black.png" |
||||
|
class="img-responsive mb-3" height="48px" width="48px"> |
||||
|
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;"> |
||||
|
Education |
||||
|
</h5> |
||||
|
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;"> |
||||
|
A platform for |
||||
|
educational management</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-3"> |
||||
|
<div class="my-4 d-flex flex-column justify-content-center" |
||||
|
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;"> |
||||
|
<img src="./assets/icons/manufacturing-black.png" |
||||
|
class="img-responsive mb-3" height="48px" width="48px"> |
||||
|
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;"> |
||||
|
Manufacturing |
||||
|
</h5> |
||||
|
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;"> |
||||
|
Plan, track and |
||||
|
schedule your operations</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-3"> |
||||
|
<div class="my-4 d-flex flex-column justify-content-center" |
||||
|
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;"> |
||||
|
<img src="./assets/icons/ecom-black.png" |
||||
|
class="img-responsive mb-3" height="48px" width="48px"> |
||||
|
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;"> |
||||
|
E-commerce & Website |
||||
|
</h5> |
||||
|
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;"> |
||||
|
Mobile |
||||
|
friendly, |
||||
|
awe-inspiring product pages</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-3"> |
||||
|
<div class="my-4 d-flex flex-column justify-content-center" |
||||
|
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;"> |
||||
|
<img src="./assets/icons/service-black.png" |
||||
|
class="img-responsive mb-3" height="48px" width="48px"> |
||||
|
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;"> |
||||
|
Service Management |
||||
|
</h5> |
||||
|
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;"> |
||||
|
Keep track of |
||||
|
services and invoice</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-3"> |
||||
|
<div class="my-4 d-flex flex-column justify-content-center" |
||||
|
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;"> |
||||
|
<img src="./assets/icons/restaurant-black.png" |
||||
|
class="img-responsive mb-3" height="48px" width="48px"> |
||||
|
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;"> |
||||
|
Restaurant |
||||
|
</h5> |
||||
|
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;"> |
||||
|
Run your bar or |
||||
|
restaurant methodically</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-lg-3"> |
||||
|
<div class="my-4 d-flex flex-column justify-content-center" |
||||
|
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;"> |
||||
|
<img src="./assets/icons/hotel-black.png" |
||||
|
class="img-responsive mb-3" height="48px" width="48px"> |
||||
|
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;"> |
||||
|
Hotel Management |
||||
|
</h5> |
||||
|
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;"> |
||||
|
An |
||||
|
all-inclusive |
||||
|
hotel management application</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</section> |
||||
|
|
||||
|
<!-- END OF END OF OUR INDUSTRIES --> |
||||
|
|
||||
|
<!-- FOOTER --> |
||||
|
<!-- Footer Section --> |
||||
|
<section class="container" style="margin: 5rem auto 2rem;"> |
||||
|
<div class="row" style="max-width:1540px;"> |
||||
|
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center"> |
||||
|
<h2 style="color: #212529 !important;">Need Help?</h2> |
||||
|
<hr |
||||
|
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<!-- Contact Cards --> |
||||
|
<div class="row d-flex justify-content-center align-items-center" |
||||
|
style="max-width:1540px; margin: 0 auto 2rem auto;"> |
||||
|
|
||||
|
<div class="col-lg-12" |
||||
|
style="padding: 0rem 3rem 2rem; border-radius: 10px; margin-right: 3rem; "> |
||||
|
|
||||
|
<div class="row mt-4"> |
||||
|
<div class="col-lg-6"> |
||||
|
<a href="mailto:odoo@cybrosys.com" target="_blank" |
||||
|
class="btn btn-block mb-2 deep_hover" |
||||
|
style="text-decoration: none; background-color: #4d4d4d; color: #FFF; border-radius: 4px;"><i |
||||
|
class="fa fa-envelope mr-2"></i>odoo@cybrosys.com</a> |
||||
|
</div> |
||||
|
<div class="col-lg-6"> |
||||
|
<a href="https://api.whatsapp.com/send?phone=918606827707" |
||||
|
target="_blank" |
||||
|
class="btn btn-block mb-2 deep_hover" |
||||
|
style="text-decoration: none; background-color: #25D366; color: #FFF; border-radius: 4px;"><i |
||||
|
class="fa fa-whatsapp mr-2"></i>+91 86068 27707</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
<!-- End of Contact Cards --> |
||||
|
</section> |
||||
|
<!-- Footer --> |
||||
|
<section class="oe_container" style="padding: 2rem 3rem 1rem;"> |
||||
|
<div class="row" |
||||
|
style="max-width:1540px; margin: 0 auto; margin-right: 3rem; "> |
||||
|
<!-- Logo --> |
||||
|
<div class="col-lg-12 d-flex justify-content-center align-items-center" |
||||
|
style="margin-top: 3rem;"> |
||||
|
<img src="https://www.cybrosys.com/images/logo.png" |
||||
|
width="200px" height="auto"/> |
||||
|
</div> |
||||
|
<!-- End of Logo --> |
||||
|
<div class="col-lg-12"> |
||||
|
<hr |
||||
|
style="margin-top: 3rem;background: linear-gradient(90deg, rgba(2,0,36,0) 0%, rgba(229,229,229,1) 33%, rgba(229,229,229,1) 58%, rgba(0,212,255,0) 100%); height: 2px; border-style: none;"> |
||||
|
<!-- End of Footer Section --> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
<!-- END OF FOOTER --> |
||||
|
|
||||
|
</div> |
@ -0,0 +1,21 @@ |
|||||
|
/** @odoo-module */ |
||||
|
|
||||
|
import { registry } from "@web/core/registry"; |
||||
|
import { download } from "@web/core/network/download"; |
||||
|
import framework from 'web.framework'; |
||||
|
import session from 'web.session'; |
||||
|
|
||||
|
registry.category('ir.actions.report handlers').add('xlsx_controller', async (action) => { |
||||
|
if (action.report_type == 'xlsx_controller') { |
||||
|
framework.blockUI(); |
||||
|
var def = $.Deferred(); |
||||
|
session.get_file({ |
||||
|
url: '/xlsx_reports', |
||||
|
data: action.data, |
||||
|
success: def.resolve.bind(def), |
||||
|
error: (error) => this.call('crash_manager', 'rpc_error', error), |
||||
|
complete: framework.unblockUI, |
||||
|
}); |
||||
|
return def; |
||||
|
} |
||||
|
}); |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Mohammed Ajmal P (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributes in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along this program. |
||||
|
# If not, see <http://www.gnu.org/license/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
|
||||
|
from . import wizard |
@ -0,0 +1,396 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################ |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Mohammed Ajmal P (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributes in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along this program. |
||||
|
# If not, see <http://www.gnu.org/license/>. |
||||
|
# |
||||
|
################################################################################ |
||||
|
import io |
||||
|
import json |
||||
|
|
||||
|
import datetime |
||||
|
from odoo import fields, models |
||||
|
from odoo.exceptions import ValidationError |
||||
|
from odoo.tools import date_utils |
||||
|
|
||||
|
try: |
||||
|
from odoo.tools.misc import xlsxwriter |
||||
|
except ImportError: |
||||
|
import xlsxwriter |
||||
|
|
||||
|
|
||||
|
class SalePurchasePrintReport(models.TransientModel): |
||||
|
"""Fields and functions for the wizard for filtering""" |
||||
|
_name = 'wizard.sale.purchase.report' |
||||
|
_description = 'Sale Purchase Report Print' |
||||
|
|
||||
|
date_from = fields.Datetime('Date From') |
||||
|
date_to = fields.Datetime('Date To') |
||||
|
partner_ids = fields.Many2many( |
||||
|
'res.partner', string='Partners', |
||||
|
domain=lambda self: [('company_id', 'in', |
||||
|
[False, self.env.company.id])]) |
||||
|
sale_order_ids = fields.Many2many( |
||||
|
'sale.order', string='Sale Orders', |
||||
|
domain=lambda self: [('company_id', 'in', |
||||
|
[False, self.env.company.id])] |
||||
|
) |
||||
|
purchase_order_ids = fields.Many2many( |
||||
|
'purchase.order', string='Purchase Orders', domain=lambda self: [ |
||||
|
('company_id', 'in', [False, self.env.company.id])] |
||||
|
) |
||||
|
|
||||
|
def print_pdf_report(self): |
||||
|
"""Button function to print PDF Report""" |
||||
|
if self.date_from and self.date_to and self.date_from > self.date_to: |
||||
|
raise ValidationError('From Date must be less than of To Date!!!') |
||||
|
data = { |
||||
|
'model': self._name, |
||||
|
'form': self.read()[0], |
||||
|
} |
||||
|
return self.env.ref( |
||||
|
'sale_purchase_mixed_report.action_report_sale_purchase' |
||||
|
).report_action(self, data=data) |
||||
|
|
||||
|
def print_xlsx_report(self): |
||||
|
"""Button function to print Xlsx Report""" |
||||
|
if self.date_from and self.date_to and self.date_from > self.date_to: |
||||
|
raise ValidationError('From Date must be less than of To Date!!!') |
||||
|
data = { |
||||
|
'model': self._name, |
||||
|
'form': self.read()[0], |
||||
|
} |
||||
|
return { |
||||
|
'type': 'ir.actions.report', |
||||
|
'data': {'model': self._name, |
||||
|
'options': json.dumps(data, |
||||
|
default=date_utils.json_default), |
||||
|
'output_format': 'xlsx_controller', |
||||
|
'report_name': 'Sales Purchase Report', |
||||
|
}, |
||||
|
'report_type': 'xlsx_controller', |
||||
|
} |
||||
|
|
||||
|
def get_xlsx_report(self, data, response): |
||||
|
"""Create and add data to the excel sheet""" |
||||
|
company_id = self.env.company |
||||
|
output = io.BytesIO() |
||||
|
workbook = xlsxwriter.Workbook(output, {'in_memory': True}) |
||||
|
sheet = workbook.add_worksheet() |
||||
|
head_format = workbook.add_format({ |
||||
|
'align': 'center', |
||||
|
'bold': True, |
||||
|
'font_size': '10px' |
||||
|
}) |
||||
|
data_format = workbook.add_format({ |
||||
|
'font_size': '10px' |
||||
|
}) |
||||
|
sheet.write(0, 0, 'Order Date', head_format) |
||||
|
sheet.write(0, 1, 'Order Type', head_format) |
||||
|
sheet.write(0, 2, 'Order Ref', head_format) |
||||
|
sheet.write(0, 3, 'Partner', head_format) |
||||
|
sheet.write(0, 4, 'Product', head_format) |
||||
|
sheet.write(0, 5, 'Product Type', head_format) |
||||
|
sheet.write(0, 6, 'Qty Ordered', head_format) |
||||
|
sheet.write(0, 7, 'Qty Delivered/Received', head_format) |
||||
|
sheet.write(0, 8, 'Qty To Deliver/To Receive', head_format) |
||||
|
sheet.write(0, 9, 'Qty Invoiced/Billed', head_format) |
||||
|
sheet.write(0, 10, 'UOM', head_format) |
||||
|
sheet.write(0, 11, 'Unit Price', head_format) |
||||
|
sheet.write(0, 12, 'Total Price', head_format) |
||||
|
sheet.write(0, 13, 'Currency', head_format) |
||||
|
sheet.write(0, 14, 'Order State', head_format) |
||||
|
where_sale = """so.company_id = %s""" % ( |
||||
|
company_id.id) |
||||
|
where_purchase = """po.company_id = %s""" % ( |
||||
|
company_id.id) |
||||
|
if data['form']['date_from']: |
||||
|
where_sale += """AND so.date_order >= '%s'""" % ( |
||||
|
data['form']['date_from']) |
||||
|
where_purchase += """AND po.date_order >= '%s'""" % ( |
||||
|
data['form']['date_from']) |
||||
|
if data['form']['date_to']: |
||||
|
where_sale += """AND so.date_order <= '%s'""" % ( |
||||
|
data['form']['date_to']) |
||||
|
where_purchase += """AND po.date_order <= '%s'""" % ( |
||||
|
data['form']['date_to']) |
||||
|
if data['form']['partner_ids']: |
||||
|
if len(data['form']['partner_ids']) == 1: |
||||
|
where_sale += """AND so.partner_id = %s""" % ( |
||||
|
data['form']['partner_ids'][0]) |
||||
|
where_purchase += """AND po.partner_id = %s""" % ( |
||||
|
data['form']['partner_ids'][0]) |
||||
|
else: |
||||
|
where_sale += """AND so.partner_id in %s""" % ( |
||||
|
str(tuple(data['form']['partner_ids']))) |
||||
|
where_purchase += """AND po.partner_id in %s""" % ( |
||||
|
str(tuple(data['form']['partner_ids']))) |
||||
|
if data['form']['sale_order_ids']: |
||||
|
if len(data['form']['sale_order_ids']) == 1: |
||||
|
where_sale += """AND so.id = %s""" % ( |
||||
|
data['form']['sale_order_ids'][0]) |
||||
|
else: |
||||
|
where_sale += """AND so.id in %s""" % ( |
||||
|
str(tuple(data['form']['sale_order_ids']))) |
||||
|
if data['form']['purchase_order_ids']: |
||||
|
if len(data['form']['purchase_order_ids']) == 1: |
||||
|
where_purchase += """AND po.id = %s""" % ( |
||||
|
data['form']['purchase_order_ids'][0]) |
||||
|
else: |
||||
|
where_purchase += """AND po.id in %s""" % ( |
||||
|
str(tuple(data['form']['purchase_order_ids']))) |
||||
|
self.env.cr.execute(""" |
||||
|
select macro.id as id, |
||||
|
macro.order_type as order_type, |
||||
|
macro.order_state as order_state, |
||||
|
macro.order_date as order_date, |
||||
|
macro.partner_id as partner_id, |
||||
|
macro.product_id as product_id, |
||||
|
macro.order_ref as order_ref, |
||||
|
macro.unit_price_sale as unit_price_sale, |
||||
|
macro.unit_price_purchase as unit_price_purchase, |
||||
|
macro.price_total_sale as price_total_sale, |
||||
|
macro.price_total_purchase as price_total_purchase, |
||||
|
macro.price_subtotal_sale as price_subtotal_sale, |
||||
|
macro.price_subtotal_purchase as price_subtotal_purchase, |
||||
|
macro.product_type as product_type, |
||||
|
macro.qty_invoiced as qty_invoiced, |
||||
|
macro.qty_billed as qty_billed, |
||||
|
macro.qty_ordered_to as qty_ordered_to, |
||||
|
macro.qty_ordered_by as qty_ordered_by, |
||||
|
macro.qty_delivered as qty_delivered, |
||||
|
macro.qty_received as qty_received, |
||||
|
macro.qty_to_deliver as qty_to_deliver, |
||||
|
macro.qty_to_receive as qty_to_receive, |
||||
|
macro.company_id as company_id, |
||||
|
macro.currency_id as currency_id, |
||||
|
macro.product_uom as product_uom |
||||
|
from(( |
||||
|
with currency_rate as (%s)""" % self.env[ |
||||
|
'res.currency']._select_companies_rates() + |
||||
|
""" |
||||
|
select |
||||
|
po.id as id, |
||||
|
po.date_order as order_date, |
||||
|
po.partner_id as partner_id, |
||||
|
po.company_id as company_id, |
||||
|
po.currency_id, |
||||
|
t.uom_id as product_uom, |
||||
|
po.state as order_state, |
||||
|
case when po.is_purchase_order=True then |
||||
|
'Purchase' else '' end as order_type, |
||||
|
l.product_id as product_id, |
||||
|
t.detailed_type as product_type, |
||||
|
po.name as order_ref, |
||||
|
0 as unit_price_sale, |
||||
|
case when l.product_id is not null then |
||||
|
sum(l.price_unit) |
||||
|
else 0 end as unit_price_purchase, |
||||
|
0 as price_total_sale, |
||||
|
sum(l.price_total / coalesce(po.currency_rate, 1.0))::decimal(16,2) * currency_table.rate as price_total_purchase, |
||||
|
0 as price_subtotal_sale, |
||||
|
sum(l.price_subtotal / coalesce(po.currency_rate, 1.0))::decimal(16, 2) * currency_table.rate as price_subtotal_purchase, |
||||
|
case when l.product_id is not null then |
||||
|
sum(l.product_qty/ u.factor * u2.factor) else 0 |
||||
|
end as qty_ordered_to, |
||||
|
case when l.product_id is not null then |
||||
|
sum(l.qty_received / u.factor * u2.factor) else 0 |
||||
|
end as qty_received, |
||||
|
case when l.product_id is not null then |
||||
|
sum(l.qty_invoiced / u.factor * u2.factor) |
||||
|
else 0 end as qty_billed, |
||||
|
case when l.product_id is not null then |
||||
|
sum((l.product_qty - l.qty_received) / u.factor * u2.factor) |
||||
|
else 0 end as qty_to_receive, |
||||
|
0 as qty_ordered_by, |
||||
|
0 as qty_delivered, |
||||
|
0 as qty_invoiced, |
||||
|
0 as qty_to_deliver |
||||
|
from |
||||
|
(purchase_order_line l |
||||
|
join purchase_order po on (l.order_id=po.id) |
||||
|
join res_partner partner on |
||||
|
(po.partner_id=partner.id) |
||||
|
left join product_product p on |
||||
|
(l.product_id=p.id) |
||||
|
left join product_template t on |
||||
|
(p.product_tmpl_id=t.id) |
||||
|
left join uom_uom u on (l.product_uom=u.id) |
||||
|
left join uom_uom u2 on (t.uom_id=u2.id)) |
||||
|
left join currency_rate cr on |
||||
|
(cr.currency_id = po.currency_id |
||||
|
and cr.company_id = po.company_id and cr.date_start <= coalesce(po.date_order, now()) and |
||||
|
(cr.date_end is null or cr.date_end > coalesce(po.date_order, now()))) |
||||
|
left join {currency_table} on |
||||
|
currency_table.company_id = po.company_id |
||||
|
""".format( |
||||
|
currency_table=self.env[ |
||||
|
'res.currency']._get_query_currency_table( |
||||
|
{'multi_company': True, |
||||
|
'date': { |
||||
|
'date_to': fields.Date.today()}}), ) + |
||||
|
""" |
||||
|
where %s |
||||
|
group by |
||||
|
po.partner_id, |
||||
|
po.date_order, |
||||
|
l.product_id, |
||||
|
t.uom_id, |
||||
|
t.detailed_type, |
||||
|
po.id, |
||||
|
currency_table.rate, |
||||
|
t.purchase_method |
||||
|
order by l.product_id) |
||||
|
UNION ALL |
||||
|
(select |
||||
|
so.id as id, |
||||
|
so.date_order as order_date, |
||||
|
so.partner_id as partner_id, |
||||
|
so.company_id as company_id, |
||||
|
so.currency_id, |
||||
|
t.uom_id as product_uom, |
||||
|
so.state as order_state, |
||||
|
case when so.is_sale_order=True then |
||||
|
'Sale' else '' end as order_type, |
||||
|
s.product_id as product_id, |
||||
|
t.detailed_type as product_type, |
||||
|
so.name as order_ref, |
||||
|
case when s.product_id is not null |
||||
|
then sum(s.price_unit) |
||||
|
else 0 end as unit_price_sale, |
||||
|
0 as unit_price_purchase, |
||||
|
case when s.product_id is not null |
||||
|
then sum(s.price_total / case coalesce(so.currency_rate, 0) |
||||
|
when 0 then 1.0 else |
||||
|
so.currency_rate end) else 0 end |
||||
|
as price_total_sale, |
||||
|
0 as price_total_purchase, |
||||
|
case when s.product_id is not null |
||||
|
then sum(s.price_subtotal / case coalesce(so.currency_rate, 0) |
||||
|
when 0 then 1.0 else |
||||
|
so.currency_rate end) else |
||||
|
0 end as price_subtotal_sale, |
||||
|
0 as price_subtotal_purchase, |
||||
|
0 as qty_ordered_to, |
||||
|
0 as qty_received, |
||||
|
0 as qty_billed, |
||||
|
0 as qty_to_receive, |
||||
|
case when s.product_id is not null |
||||
|
then sum(s.product_uom_qty / u.factor * u2.factor) else 0 end as |
||||
|
qty_ordered_by, |
||||
|
case when s.product_id is not null |
||||
|
then sum(s.qty_delivered / u.factor * u2.factor) else 0 end as |
||||
|
qty_delivered, |
||||
|
case when s.product_id is not null |
||||
|
then sum(s.qty_invoiced / u.factor * u2.factor) else 0 end as |
||||
|
qty_invoiced, |
||||
|
case when s.product_id is not null |
||||
|
then sum((s.product_uom_qty - s.qty_delivered) / u.factor * u2.factor) |
||||
|
else 0 end as qty_to_deliver |
||||
|
from |
||||
|
(sale_order_line s |
||||
|
join sale_order so on (s.order_id=so.id) |
||||
|
join res_partner partner on |
||||
|
(so.partner_id=partner.id) |
||||
|
left join product_product p on |
||||
|
(s.product_id=p.id) |
||||
|
left join product_template t on |
||||
|
(p.product_tmpl_id=t.id) |
||||
|
left join uom_uom u on |
||||
|
(s.product_uom=u.id) |
||||
|
left join uom_uom u2 on |
||||
|
(t.uom_id=u2.id)) |
||||
|
where %s |
||||
|
group by |
||||
|
so.partner_id, |
||||
|
so.date_order, |
||||
|
s.product_id, |
||||
|
t.uom_id, |
||||
|
t.detailed_type, |
||||
|
so.id |
||||
|
order by s.product_id)) |
||||
|
macro |
||||
|
group by |
||||
|
macro.partner_id, |
||||
|
macro.order_date, |
||||
|
macro.order_state, |
||||
|
macro.product_id, |
||||
|
macro.id, |
||||
|
macro.order_ref, |
||||
|
macro.order_type, |
||||
|
macro.unit_price_sale, |
||||
|
macro.unit_price_purchase, |
||||
|
macro.product_type, |
||||
|
macro.qty_invoiced, |
||||
|
macro.qty_billed, |
||||
|
macro.qty_delivered, |
||||
|
macro.qty_received, |
||||
|
macro.qty_ordered_to, |
||||
|
macro.qty_ordered_by, |
||||
|
macro.qty_to_deliver, |
||||
|
macro.qty_to_receive, |
||||
|
macro.price_total_sale, |
||||
|
macro.price_total_purchase, |
||||
|
macro.price_subtotal_sale, |
||||
|
macro.price_subtotal_purchase, |
||||
|
macro.company_id, |
||||
|
macro.currency_id, |
||||
|
macro.product_uom |
||||
|
order by macro.product_id |
||||
|
""" % (where_purchase, where_sale)) |
||||
|
rec = self.env.cr.fetchall() |
||||
|
j = 1 |
||||
|
k = 0 |
||||
|
for i in range(0, len(rec)): |
||||
|
product_id = self.env['product.product'].browse(rec[i][5]) |
||||
|
uom_id = self.env['uom.uom'].browse(rec[i][24]) |
||||
|
# currency_id = self.env['res.currency'].browse(rec[i][23]) |
||||
|
currency_id = company_id.currency_id |
||||
|
partner_id = self.env['res.partner'].browse(rec[i][4]) |
||||
|
sheet.set_column(j, k, 15) |
||||
|
sheet.write(j, 0, datetime.datetime.strftime(rec[i][3], '%m/%d/%Y'), |
||||
|
data_format) |
||||
|
sheet.write(j, 1, rec[i][1], data_format) |
||||
|
sheet.write(j, 2, rec[i][6], data_format) |
||||
|
sheet.write(j, 3, partner_id.name, data_format) |
||||
|
sheet.write(j, 4, product_id.display_name, data_format) |
||||
|
sheet.write(j, 5, rec[i][13], data_format) |
||||
|
sheet.write(j, 6, rec[i][17] if rec[i][1] == 'Sale' else rec[i][16], |
||||
|
data_format) |
||||
|
sheet.write(j, 7, rec[i][18] if rec[i][1] == 'Sale' else rec[i][19], |
||||
|
data_format) |
||||
|
sheet.write(j, 8, rec[i][20] if rec[i][1] == 'Sale' else rec[i][21], |
||||
|
data_format) |
||||
|
sheet.write(j, 9, rec[i][14] if rec[i][1] == 'Sale' else rec[i][15], |
||||
|
data_format) |
||||
|
sheet.write(j, 10, uom_id.name, data_format) |
||||
|
sheet.write(j, 11, rec[i][7] if rec[i][1] == 'Sale' else rec[i][8], |
||||
|
data_format) |
||||
|
sheet.write(j, 12, rec[i][9] if rec[i][1] == 'Sale' else rec[i][10], |
||||
|
data_format) |
||||
|
sheet.write(j, 13, currency_id.name, data_format) |
||||
|
sheet.write(j, 14, dict( |
||||
|
self.env['sale.order']._fields['state'].selection).get( |
||||
|
rec[i][2]) if rec[i][1] == 'Sale' else dict( |
||||
|
self.env['purchase.order']._fields['state'].selection).get( |
||||
|
rec[i][2]), data_format) |
||||
|
j += 1 |
||||
|
k += 1 |
||||
|
workbook.close() |
||||
|
output.seek(0) |
||||
|
response.stream.write(output.read()) |
||||
|
output.close() |
@ -0,0 +1,53 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<record id="wizard_sale_purchase_report_view_form" model="ir.ui.view"> |
||||
|
<field name="name">wizard.sale.purchase.report.view.form</field> |
||||
|
<field name="model">wizard.sale.purchase.report</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form> |
||||
|
<group> |
||||
|
<group> |
||||
|
<field name="partner_ids" widget="many2many_tags"/> |
||||
|
<field name="sale_order_ids" widget="many2many_tags"/> |
||||
|
<field name="purchase_order_ids" |
||||
|
widget="many2many_tags"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<field name="date_from"/> |
||||
|
<field name="date_to"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
<footer> |
||||
|
<button name="print_pdf_report" type="object" |
||||
|
string="Print PDF" class="oe_highlight"/> |
||||
|
<button name="print_xlsx_report" type="object" |
||||
|
string="Print Xlsx" class="oe_highlight"/> |
||||
|
</footer> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
<record id="action_wizard_sale_purchase_report_view_form" |
||||
|
model="ir.actions.act_window"> |
||||
|
<field name="name">Sale Purchase Report</field> |
||||
|
<field name="type">ir.actions.act_window</field> |
||||
|
<field name="res_model">wizard.sale.purchase.report</field> |
||||
|
<field name="view_mode">form</field> |
||||
|
<field name="view_id" ref="wizard_sale_purchase_report_view_form"/> |
||||
|
<field name="target">new</field> |
||||
|
</record> |
||||
|
<record id="action_report_sale_purchase" model="ir.actions.report"> |
||||
|
<field name="name">Sales Purchase Report</field> |
||||
|
<field name="model">wizard.sale.purchase.report</field> |
||||
|
<field name="report_type">qweb-pdf</field> |
||||
|
<field name="report_name">sale_purchase_mixed_report.report_sale_purchase</field> |
||||
|
<field name="report_file">sale_purchase_mixed_report.report_sale_purchase</field> |
||||
|
</record> |
||||
|
<menuitem name="Print Sale Purchase Report" |
||||
|
id="menu_sale_purchase_report_sale_print" |
||||
|
sequence="2" parent="menu_sale_purchase_report_root_sale" |
||||
|
action="action_wizard_sale_purchase_report_view_form"/> |
||||
|
<menuitem name="Print Sale Purchase Report" |
||||
|
id="menu_sale_purchase_report_purchase_print" |
||||
|
sequence="2" parent="menu_sale_purchase_report_root_purchase" |
||||
|
action="action_wizard_sale_purchase_report_view_form"/> |
||||
|
</odoo> |