Port to v10
This commit is contained in:
@@ -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 <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/>.
|
||||
#
|
||||
##############################################################################
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2015-2016 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# 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()))
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
<odoo>
|
||||
|
||||
<record id="pos_sale_report_search" model="ir.ui.view">
|
||||
<field name="name">pos.sale.report.search</field>
|
||||
@@ -25,29 +24,25 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="pos_sale_report_graph" model="ir.ui.view">
|
||||
<field name="name">pos.sale.report.graph</field>
|
||||
<record id="pos_sale_report_pivot" model="ir.ui.view">
|
||||
<field name="name">pos.sale.report.pivot</field>
|
||||
<field name="model">pos.sale.report</field>
|
||||
<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="date" type="row" interval="month"/>
|
||||
<field name="qty" type="measure"/>
|
||||
</graph>
|
||||
</pivot>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="pos_sale_report_action" model="ir.actions.act_window">
|
||||
<field name="name">POS + Sale Orders Analysis</field>
|
||||
<field name="res_model">pos.sale.report</field>
|
||||
<field name="view_mode">graph</field>
|
||||
<field name="view_mode">pivot</field>
|
||||
</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"
|
||||
parent="pos_sale_report_title_menu" sequence="10"/>
|
||||
parent="point_of_sale.menu_point_rep" sequence="100"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user