Port to v10
This commit is contained in:
@@ -1,35 +1,19 @@
|
|||||||
# -*- encoding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
# © 2015-2016 Akretion (http://www.akretion.com)
|
||||||
#
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# POS Sale Report module for Odoo
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
|
||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
|
||||||
#
|
|
||||||
# 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 <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
{
|
{
|
||||||
'name': 'POS Sale Report',
|
'name': 'POS Sale Report',
|
||||||
'version': '0.1',
|
'version': '10.0.1.0.0',
|
||||||
'category': 'Point Of Sale',
|
'category': 'Point Of Sale',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'summary': 'Add a graph via on that aggregate sale orders and pos orders',
|
'summary': 'Add a graph via on that aggregate sale orders and pos orders',
|
||||||
'description': """
|
'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
|
This module has been written by Alexis de Lattre
|
||||||
<alexis.delattre@akretion.com>.
|
<alexis.delattre@akretion.com>.
|
||||||
@@ -42,5 +26,5 @@ This module has been written by Alexis de Lattre
|
|||||||
'product_view.xml',
|
'product_view.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
],
|
],
|
||||||
'installable': False,
|
'installable': True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<openerp>
|
<odoo>
|
||||||
<data>
|
|
||||||
|
|
||||||
<!-- Add entry in the "More" drop down list in form view -->
|
<!-- Add entry in the "More" drop down list in form view -->
|
||||||
<act_window id="product_product_pos_sale_report_action"
|
<act_window id="product_product_pos_sale_report_action"
|
||||||
@@ -9,7 +8,7 @@
|
|||||||
name="Sales Statistics"
|
name="Sales Statistics"
|
||||||
res_model="pos.sale.report"
|
res_model="pos.sale.report"
|
||||||
src_model="product.product"
|
src_model="product.product"
|
||||||
view_mode="graph"
|
view_mode="pivot"
|
||||||
domain="[('product_id', 'in', active_ids)]"
|
domain="[('product_id', 'in', active_ids)]"
|
||||||
context="{'search_default_product_groupby': 1}"
|
context="{'search_default_product_groupby': 1}"
|
||||||
/>
|
/>
|
||||||
@@ -19,11 +18,10 @@
|
|||||||
name="Sales Statistics"
|
name="Sales Statistics"
|
||||||
res_model="pos.sale.report"
|
res_model="pos.sale.report"
|
||||||
src_model="product.template"
|
src_model="product.template"
|
||||||
view_mode="graph"
|
view_mode="pivot"
|
||||||
domain="[('product_tmpl_id', 'in', active_ids)]"
|
domain="[('product_tmpl_id', 'in', active_ids)]"
|
||||||
context="{'search_default_product_tmpl_groupby': 1}"
|
context="{'search_default_product_tmpl_groupby': 1}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
@@ -1,30 +1,12 @@
|
|||||||
# -*- encoding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
# © 2015-2016 Akretion (http://www.akretion.com)
|
||||||
#
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# POS Sale Report module for Odoo
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
|
||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
|
||||||
#
|
|
||||||
# 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 <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
from openerp import models, fields
|
from odoo import models, fields, tools, api
|
||||||
from openerp import tools
|
|
||||||
|
|
||||||
|
|
||||||
class pos_sale_report(models.Model):
|
class PosSaleReport(models.Model):
|
||||||
_name = 'pos.sale.report'
|
_name = 'pos.sale.report'
|
||||||
_description = 'POS orders and Sale orders aggregated report'
|
_description = 'POS orders and Sale orders aggregated report'
|
||||||
_auto = False
|
_auto = False
|
||||||
@@ -76,7 +58,7 @@ class pos_sale_report(models.Model):
|
|||||||
"""
|
"""
|
||||||
return select
|
return select
|
||||||
|
|
||||||
def init(self, cr):
|
def init(self):
|
||||||
tools.drop_view_if_exists(cr, self._table)
|
tools.drop_view_if_exists(self._cr, self._table)
|
||||||
cr.execute("CREATE OR REPLACE VIEW %s AS (%s UNION %s)" % (
|
self._cr.execute("CREATE OR REPLACE VIEW %s AS (%s UNION %s)" % (
|
||||||
self._table, self._sale_order_select(), self._pos_order_select()))
|
self._table, self._sale_order_select(), self._pos_order_select()))
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<openerp>
|
<odoo>
|
||||||
<data>
|
|
||||||
|
|
||||||
<record id="pos_sale_report_search" model="ir.ui.view">
|
<record id="pos_sale_report_search" model="ir.ui.view">
|
||||||
<field name="name">pos.sale.report.search</field>
|
<field name="name">pos.sale.report.search</field>
|
||||||
@@ -25,29 +24,25 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="pos_sale_report_graph" model="ir.ui.view">
|
<record id="pos_sale_report_pivot" model="ir.ui.view">
|
||||||
<field name="name">pos.sale.report.graph</field>
|
<field name="name">pos.sale.report.pivot</field>
|
||||||
<field name="model">pos.sale.report</field>
|
<field name="model">pos.sale.report</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<graph string="POS orders and Sale Orders aggregated report" type="pivot">
|
<pivot string="POS orders and Sale Orders aggregated report" type="pivot">
|
||||||
<field name="origin" type="col"/>
|
<field name="origin" type="col"/>
|
||||||
<field name="date" type="row" interval="month"/>
|
<field name="date" type="row" interval="month"/>
|
||||||
<field name="qty" type="measure"/>
|
<field name="qty" type="measure"/>
|
||||||
</graph>
|
</pivot>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="pos_sale_report_action" model="ir.actions.act_window">
|
<record id="pos_sale_report_action" model="ir.actions.act_window">
|
||||||
<field name="name">POS + Sale Orders Analysis</field>
|
<field name="name">POS + Sale Orders Analysis</field>
|
||||||
<field name="res_model">pos.sale.report</field>
|
<field name="res_model">pos.sale.report</field>
|
||||||
<field name="view_mode">graph</field>
|
<field name="view_mode">pivot</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem id="pos_sale_report_title_menu" parent="base.menu_reporting"
|
|
||||||
name="POS + Sales" sequence="9"/>
|
|
||||||
|
|
||||||
<menuitem id="pos_sale_report_menu" action="pos_sale_report_action"
|
<menuitem id="pos_sale_report_menu" action="pos_sale_report_action"
|
||||||
parent="pos_sale_report_title_menu" sequence="10"/>
|
parent="point_of_sale.menu_point_rep" sequence="100"/>
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
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_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
|
||||||
|
|||||||
|
Reference in New Issue
Block a user