diff --git a/pos_sale_report/__manifest__.py b/pos_sale_report/__manifest__.py index 35039ba..fea018e 100644 --- a/pos_sale_report/__manifest__.py +++ b/pos_sale_report/__manifest__.py @@ -1,35 +1,19 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# POS Sale Report module for Odoo -# Copyright (C) 2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed 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 for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2015-2016 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + { 'name': 'POS Sale Report', - 'version': '0.1', + 'version': '10.0.1.0.0', 'category': 'Point Of Sale', 'license': 'AGPL-3', 'summary': 'Add a graph via on that aggregate sale orders and pos orders', 'description': """ -In the *Reporting* menu, add a new entry *POS + Sale Orders Analysis* that show sale statistics per products that aggregate sale orders and pos orders. +In the *Point of sales > Reporting* menu, add a new entry *POS + Sale Orders Analysis* that show sale statistics per products that aggregate sale orders and pos orders. -Also add direct access to Sales statistics on the Product form view and Product Variants form view (Menu entry *Sales Statistics* in the *More* drop down list). +Also add direct access to Sales statistics on the Product form view and Product Variants form view (Menu entry *Sales Statistics* in the *Action* drop down list). This module has been written by Alexis de Lattre . @@ -42,5 +26,5 @@ This module has been written by Alexis de Lattre 'product_view.xml', 'security/ir.model.access.csv', ], - 'installable': False, + 'installable': True, } diff --git a/pos_sale_report/product_view.xml b/pos_sale_report/product_view.xml index e87727a..4afe86d 100644 --- a/pos_sale_report/product_view.xml +++ b/pos_sale_report/product_view.xml @@ -1,7 +1,6 @@ - - + @@ -19,11 +18,10 @@ name="Sales Statistics" res_model="pos.sale.report" src_model="product.template" - view_mode="graph" + view_mode="pivot" domain="[('product_tmpl_id', 'in', active_ids)]" context="{'search_default_product_tmpl_groupby': 1}" /> - - + diff --git a/pos_sale_report/report/pos_sale_report.py b/pos_sale_report/report/pos_sale_report.py index cbc7147..626aa21 100644 --- a/pos_sale_report/report/pos_sale_report.py +++ b/pos_sale_report/report/pos_sale_report.py @@ -1,30 +1,12 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# POS Sale Report module for Odoo -# Copyright (C) 2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed 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 for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2015-2016 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields -from openerp import tools +from odoo import models, fields, tools, api -class pos_sale_report(models.Model): +class PosSaleReport(models.Model): _name = 'pos.sale.report' _description = 'POS orders and Sale orders aggregated report' _auto = False @@ -76,7 +58,7 @@ class pos_sale_report(models.Model): """ return select - def init(self, cr): - tools.drop_view_if_exists(cr, self._table) - cr.execute("CREATE OR REPLACE VIEW %s AS (%s UNION %s)" % ( + def init(self): + tools.drop_view_if_exists(self._cr, self._table) + self._cr.execute("CREATE OR REPLACE VIEW %s AS (%s UNION %s)" % ( self._table, self._sale_order_select(), self._pos_order_select())) diff --git a/pos_sale_report/report/pos_sale_report_view.xml b/pos_sale_report/report/pos_sale_report_view.xml index eac51e4..e9d8a8b 100644 --- a/pos_sale_report/report/pos_sale_report_view.xml +++ b/pos_sale_report/report/pos_sale_report_view.xml @@ -1,7 +1,6 @@ - - + pos.sale.report.search @@ -25,29 +24,25 @@ - - pos.sale.report.graph + + pos.sale.report.pivot pos.sale.report - + - + POS + Sale Orders Analysis pos.sale.report - graph + pivot - - + parent="point_of_sale.menu_point_rep" sequence="100"/> - - + diff --git a/pos_sale_report/security/ir.model.access.csv b/pos_sale_report/security/ir.model.access.csv index c2f1543..e40be25 100644 --- a/pos_sale_report/security/ir.model.access.csv +++ b/pos_sale_report/security/ir.model.access.csv @@ -1,3 +1,3 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_pos_sale_report_pos_user,Full access on pos.sale.report to POS User,model_pos_sale_report,point_of_sale.group_pos_user,1,1,1,1 -access_pos_sale_report_sale_user,Full access on pos.sale.report to Sale User,model_pos_sale_report,base.group_sale_salesman,1,1,1,1 +access_pos_sale_report_sale_user,Full access on pos.sale.report to Sale User,model_pos_sale_report,sales_team.group_sale_salesman,1,1,1,1