diff --git a/pos_sale_report/__init__.py b/pos_sale_report/__init__.py index a0eb602..006edd3 100644 --- a/pos_sale_report/__init__.py +++ b/pos_sale_report/__init__.py @@ -1,23 +1,3 @@ -# -*- 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 -*- from . import report diff --git a/pos_sale_report/product_view.xml b/pos_sale_report/product_view.xml index a91f1df..e87727a 100644 --- a/pos_sale_report/product_view.xml +++ b/pos_sale_report/product_view.xml @@ -10,7 +10,8 @@ res_model="pos.sale.report" src_model="product.product" view_mode="graph" - context="{'search_default_product_id': active_id}" + domain="[('product_id', 'in', active_ids)]" + context="{'search_default_product_groupby': 1}" /> diff --git a/pos_sale_report/report/pos_sale_report.py b/pos_sale_report/report/pos_sale_report.py index 6eb7f8e..cbc7147 100644 --- a/pos_sale_report/report/pos_sale_report.py +++ b/pos_sale_report/report/pos_sale_report.py @@ -31,7 +31,7 @@ class pos_sale_report(models.Model): _rec_name = 'date' _order = 'date desc' - date = fields.Datetime(string='Order Date', readonly=True) + date = fields.Date(string='Order Date', readonly=True) product_id = fields.Many2one( 'product.product', string='Product Variant', readonly=True) product_tmpl_id = fields.Many2one( @@ -44,7 +44,7 @@ class pos_sale_report(models.Model): # WARNING : this code doesn't handle uom conversion for the moment def _sale_order_select(self): select = """SELECT min(sol.id)*-1 AS id, - so.date_order AS date, + so.date_order::date AS date, sol.product_id AS product_id, pp.product_tmpl_id AS product_tmpl_id, so.company_id AS company_id, @@ -61,7 +61,7 @@ class pos_sale_report(models.Model): def _pos_order_select(self): select = """SELECT min(pol.id) AS id, - po.date_order AS date, + po.date_order::date AS date, pol.product_id AS product_id, pp.product_tmpl_id AS product_tmpl_id, po.company_id AS company_id, diff --git a/pos_sale_report/report/pos_sale_report_view.xml b/pos_sale_report/report/pos_sale_report_view.xml index 1d265e0..eac51e4 100644 --- a/pos_sale_report/report/pos_sale_report_view.xml +++ b/pos_sale_report/report/pos_sale_report_view.xml @@ -10,6 +10,10 @@ + +