From f300ceb3dc2d16c6546af4579e8f7c651a5cf683 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Wed, 27 Oct 2010 17:37:01 +0530 Subject: [PATCH] [IMP] point_of_sale: Code clean and rename some file name bzr revid: ara@tinyerp.com-20101027120701-7r63salifxf9hu91 --- addons/point_of_sale/__openerp__.py | 6 +- addons/point_of_sale/report/__init__.py | 10 +- .../point_of_sale/report/account_statement.py | 6 +- .../report/all_closed_cashbox_of_the_day.py | 14 +- .../report/point_of_sale_report.py | 238 ------------------ addons/point_of_sale/report/pos_details.py | 35 ++- .../report/pos_details_summary.py | 4 +- addons/point_of_sale/report/pos_invoice.py | 3 +- addons/point_of_sale/report/pos_lines.py | 7 +- .../report/pos_payment_report.py | 14 +- .../report/pos_payment_report_date.py | 18 +- .../report/pos_payment_report_user.py | 19 +- addons/point_of_sale/report/pos_receipt.py | 3 +- .../report/pos_receipt_with_remboursment.py | 5 +- .../pos_receipt_without_remboursment.py | 4 +- addons/point_of_sale/report/pos_sales_user.py | 12 +- .../report/pos_sales_user_today.py | 12 +- .../pos_sales_user_today_current_user.py | 14 +- .../point_of_sale/report/pos_users_product.py | 10 +- .../report/report_cash_register.py | 4 + .../point_of_sale/report/report_pos_order.py | 95 ------- .../report/report_pos_order_view.xml | 106 -------- 22 files changed, 77 insertions(+), 562 deletions(-) delete mode 100644 addons/point_of_sale/report/point_of_sale_report.py delete mode 100644 addons/point_of_sale/report/report_pos_order.py delete mode 100644 addons/point_of_sale/report/report_pos_order_view.xml diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py index 6e742830148..49d3c53ecb3 100644 --- a/addons/point_of_sale/__openerp__.py +++ b/addons/point_of_sale/__openerp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -64,7 +64,7 @@ Main features : 'wizard/pos_return_view.xml', 'point_of_sale_report.xml', 'point_of_sale_view.xml', - 'report/report_pos_order_view.xml', + 'report/pos_order_report_view.xml', 'report/report_cash_register_view.xml', 'point_of_sale_sequence.xml', 'point_of_sale_workflow.xml', diff --git a/addons/point_of_sale/report/__init__.py b/addons/point_of_sale/report/__init__.py index 804ea975c40..d7355af0357 100644 --- a/addons/point_of_sale/report/__init__.py +++ b/addons/point_of_sale/report/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -35,8 +35,8 @@ import pos_payment_report_user import pos_sales_user_today_current_user import pos_receipt_with_remboursment import pos_receipt_without_remboursment -import point_of_sale_report -import report_pos_order +import pos_report +import pos_order_report import report_cash_register -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/account_statement.py b/addons/point_of_sale/report/account_statement.py index 79f86151198..be5d4b3a330 100644 --- a/addons/point_of_sale/report/account_statement.py +++ b/addons/point_of_sale/report/account_statement.py @@ -22,7 +22,6 @@ import time from report import report_sxw - class account_statement(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): @@ -30,8 +29,8 @@ class account_statement(report_sxw.rml_parse): self.total = 0.0 self.localcontext.update({ 'time': time, - 'get_total':self._get_total, - 'get_data':self._get_data, + 'get_total': self._get_total, + 'get_data': self._get_data, }) def _get_data(self, statement): @@ -49,3 +48,4 @@ class account_statement(report_sxw.rml_parse): report_sxw.report_sxw('report.account.statement', 'account.bank.statement', 'addons/statement/report/account_statement.rml', parser=account_statement,header='internal') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py index 337a121bd41..4f342099a59 100644 --- a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py +++ b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py @@ -22,7 +22,6 @@ import time from report import report_sxw - class all_closed_cashbox_of_the_day(report_sxw.rml_parse): #TOFIX: sql injection problem: SQL Request must be pass from sql injection... def __init__(self, cr, uid, name, context): @@ -38,6 +37,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse): 'get_sub_total':self._get_sub_total, 'get_net_total_starting':self._get_net_total_starting, }) + def _get_user(self,line_ids): sql = "select name from res_users where id = %d"%(line_ids['create_uid']) self.cr.execute(sql) @@ -70,9 +70,9 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse): sql =""" select sum(pieces*number) as bal from account_cashbox_line where starting_id = %d """%(data['id']) self.cr.execute(sql) res = self.cr.dictfetchall() - if res : + if res: return res[0]['bal'] - else : + else: return False def _get_sub_total(self,user,data,date): @@ -89,6 +89,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse): return res[0][0] else: return False + def _get_partner(self,statement): res = {} if statement['pos_statement_id']: @@ -98,10 +99,9 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse): self.cr.execute(sql) res = self.cr.dictfetchall() or {} return res and res[0]['name'] - else : + else: return 0.00 - def _get_net_total_starting(self,user): lst = [] res={} @@ -113,7 +113,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse): and abs.user_id = %d"""%(user.id) self.cr.execute(sql) res = self.cr.dictfetchall() - for r in res : + for r in res: total_ending_bal += (r['net_total'] or 0.0) sql1 =""" select sum(pieces*number) as bal from account_cashbox_line where starting_id = %d"""%(r['id']) self.cr.execute(sql1) @@ -136,3 +136,5 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse): return res[0]['net_total'] or 0.0 report_sxw.report_sxw('report.all.closed.cashbox.of.the.day', 'account.bank.statement', 'addons/point_of_sale/report/all_closed_cashbox_of_the_day.rml', parser=all_closed_cashbox_of_the_day,header='internal') + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/point_of_sale_report.py b/addons/point_of_sale/report/point_of_sale_report.py deleted file mode 100644 index 45716f774fd..00000000000 --- a/addons/point_of_sale/report/point_of_sale_report.py +++ /dev/null @@ -1,238 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - -from osv import osv, fields -import time -import netsvc -import tools - -class report_transaction_pos(osv.osv): - _name = "report.transaction.pos" - _description = "transaction for the pos" - _auto = False - _columns = { - 'date_create': fields.char('Date', size=16, readonly=True), - 'journal_id': fields.many2one('account.journal', 'Sales Journal', readonly=True), - 'jl_id': fields.many2one('account.journal', 'Cash Journals', readonly=True), - 'user_id': fields.many2one('res.users', 'User', readonly=True), - 'no_trans': fields.float('Number of Transaction', readonly=True), - 'amount': fields.float('Amount', readonly=True), - 'invoice_id': fields.float('Nbr Invoice', readonly=True), - 'invoice_am': fields.float('Invoice Amount', readonly=True), - 'product_nb': fields.float('Product Nb.', readonly=True), - 'disc': fields.float('Disc.', readonly=True), - } - - def init(self, cr): - tools.drop_view_if_exists(cr, 'report_transaction_pos') - cr.execute(""" - create or replace view report_transaction_pos as ( - select - min(absl.id) as id, - count(absl.id) as no_trans, - sum(absl.amount) as amount, - sum(line.price_ded) as disc, - to_char(date_trunc('day',absl.create_date),'YYYY-MM-DD')::text as date_create, - po.user_id as user_id, - po.sale_journal as journal_id, - abs.journal_id as jl_id, - count(po.invoice_id) as invoice_id, - count(p.id) as product_nb - from - account_bank_statement_line as absl, - account_bank_statement as abs, - product_product as p, - pos_order_line as line, - pos_order as po - where - absl.pos_statement_id = po.id and - line.order_id=po.id and - line.product_id=p.id and - absl.statement_id=abs.id - - group by - po.user_id,po.sale_journal, abs.journal_id, - to_char(date_trunc('day',absl.create_date),'YYYY-MM-DD')::text - ) - """) - #to_char(date_trunc('day',absl.create_date),'YYYY-MM-DD') - #to_char(date_trunc('day',absl.create_date),'YYYY-MM-DD')::text as date_create, -report_transaction_pos() - -class report_sales_by_user_pos(osv.osv): - _name = "report.sales.by.user.pos" - _description = "Sales by user" - _auto = False - _columns = { - 'date_order': fields.date('Order Date',required=True, select=True), - 'amount': fields.float('Total', readonly=True, select=True), - 'qty': fields.float('Quantity', readonly=True, select=True), - 'user_id': fields.many2one('res.users', 'User', readonly=True, select=True), - } - - def init(self, cr): - tools.drop_view_if_exists(cr, 'report_sales_by_user_pos') - cr.execute(""" - create or replace view report_sales_by_user_pos as ( - select - min(po.id) as id, - to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::text as date_order, - po.user_id as user_id, - sum(pol.qty)as qty, - sum((pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0))) as amount - from - pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt - where - pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id - group by - to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::text, - po.user_id - - ) - """) -report_sales_by_user_pos() - -class report_sales_by_user_pos_month(osv.osv): - _name = "report.sales.by.user.pos.month" - _description = "Sales by user monthly" - _auto = False - _columns = { - 'date_order': fields.date('Order Date',required=True, select=True), - 'amount': fields.float('Total', readonly=True, select=True), - 'qty': fields.float('Quantity', readonly=True, select=True), - 'user_id': fields.many2one('res.users', 'User', readonly=True, select=True), - } - - def init(self, cr): - tools.drop_view_if_exists(cr, 'report_sales_by_user_pos_month') - cr.execute(""" - create or replace view report_sales_by_user_pos_month as ( - select - min(po.id) as id, - to_char(date_trunc('month',po.date_order),'YYYY-MM-DD')::text as date_order, - po.user_id as user_id, - sum(pol.qty)as qty, - sum((pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0))) as amount - from - pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt - where - pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id - group by - to_char(date_trunc('month',po.date_order),'YYYY-MM-DD')::text, - po.user_id - - ) - """) -report_sales_by_user_pos_month() - -class report_sales_by_margin_pos(osv.osv): - _name = "report.sales.by.margin.pos" - _description = "Sales by margin" - _auto = False - _columns = { - 'product_name':fields.char('Product Name', size=64, readonly=True), - 'date_order': fields.date('Order Date',required=True, select=True), - 'user_id': fields.many2one('res.users', 'User', readonly=True, select=True), - 'qty': fields.float('Qty', readonly=True, select=True), - 'net_margin_per_qty':fields.float('Net margin per Qty', readonly=True, select=True), - 'total':fields.float('Margin', readonly=True, select=True), - - } - - def init(self, cr): - tools.drop_view_if_exists(cr, 'report_sales_by_margin_pos') - cr.execute(""" - create or replace view report_sales_by_margin_pos as ( - select - min(pol.id) as id, - po.user_id as user_id, - pt.name as product_name, - to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::text as date_order, - sum(pol.qty) as qty, - pt.list_price-pt.standard_price as net_margin_per_qty, - (pt.list_price-pt.standard_price) *sum(pol.qty) as total - from - product_template as pt, - product_product as pp, - pos_order_line as pol, - pos_order as po - where - pol.product_id = pp.product_tmpl_id and - pp.product_tmpl_id = pt.id and - po.id = pol.order_id - - group by - pt.name, - pt.list_price, - pt.standard_price, - po.user_id, - to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::text - - ) - """) -report_sales_by_margin_pos() - -class report_sales_by_margin_pos_month(osv.osv): - _name = "report.sales.by.margin.pos.month" - _description = "Sales by margin monthly" - _auto = False - _columns = { - 'product_name':fields.char('Product Name', size=64, readonly=True), - 'date_order': fields.date('Order Date',required=True, select=True), - 'user_id': fields.many2one('res.users', 'User', readonly=True, select=True), - 'qty': fields.float('Qty', readonly=True, select=True), - 'net_margin_per_qty':fields.float('Net margin per Qty', readonly=True, select=True), - 'total':fields.float('Margin', readonly=True, select=True), - } - - def init(self, cr): - tools.drop_view_if_exists(cr, 'report_sales_by_margin_pos_month') - cr.execute(""" - create or replace view report_sales_by_margin_pos_month as ( - select - min(pol.id) as id, - po.user_id as user_id, - pt.name as product_name, - to_char(date_trunc('month',po.date_order),'YYYY-MM-DD')::text as date_order, - sum(pol.qty) as qty, - pt.list_price-pt.standard_price as net_margin_per_qty, - (pt.list_price-pt.standard_price) *sum(pol.qty) as total - from - product_template as pt, - product_product as pp, - pos_order_line as pol, - pos_order as po - where - pol.product_id = pp.product_tmpl_id and - pp.product_tmpl_id = pt.id and - po.id = pol.order_id - - group by - pt.name, - pt.list_price, - pt.standard_price, - po.user_id, - to_char(date_trunc('month',po.date_order),'YYYY-MM-DD')::text - - ) - """) -report_sales_by_margin_pos_month() - diff --git a/addons/point_of_sale/report/pos_details.py b/addons/point_of_sale/report/pos_details.py index 0e77dd39188..84f3de8258f 100644 --- a/addons/point_of_sale/report/pos_details.py +++ b/addons/point_of_sale/report/pos_details.py @@ -22,7 +22,6 @@ import time from report import report_sxw - class pos_details(report_sxw.rml_parse): def _get_invoice(self,inv_id,user): @@ -36,13 +35,13 @@ class pos_details(report_sxw.rml_parse): def _pos_sales_details(self,form,user): data={} - self.cr.execute ("select po.name as pos_name,po.date_order,pt.name ,pp.default_code as code,pol.qty,pu.name as uom,pol.price_unit,pol.discount,po.invoice_id,sum((pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0))) as Total " \ + self.cr.execute ("select po.name as pos_name,po.date_order,pt.name, pp.default_code as code,pol.qty,pu.name as uom,pol.price_unit,pol.discount,po.invoice_id,sum((pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0))) as Total " \ "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt,product_uom as pu,res_users as ru,res_company as rc " \ "where pt.id=pp.product_tmpl_id and pu.id=pt.uom_id and pp.id=pol.product_id and po.id = pol.order_id and po.state IN ('done','paid','invoiced') " \ "and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date >= %s and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date <= %s " \ "and po.user_id = ru.id and rc.id = %s and ru.id = %s " \ "group by po.name,pol.qty,po.date_order,pt.name,pp.default_code,pu.name,pol.price_unit,pol.discount,po.invoice_id " \ - ,(form['date_start'],form['date_end'],str(user.company_id.id),str(self.uid))) + ,(form['date_start'],form['date_end'],str(user.company_id.id),str(self.uid))) data=self.cr.dictfetchall() if data: for d in data: @@ -59,13 +58,13 @@ class pos_details(report_sxw.rml_parse): "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and po.state IN ('done','paid','invoiced') " \ " and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date >= %s and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date <= %s " \ "and po.user_id = ru.id and rc.id = %s and ru.id = %s " \ - ,(form['date_start'],form['date_end'],str(user.company_id.id),str(self.uid))) + ,(form['date_start'],form['date_end'],str(user.company_id.id),str(self.uid))) qty = self.cr.fetchone() return qty[0] or 0.00 def _get_sales_total_2(self, form,user): self.cr.execute("select sum((pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0))) as Total " \ - "from pos_order_line as pol , pos_order po, product_product as pp,product_template as pt " \ + "from pos_order_line as pol, pos_order po, product_product as pp,product_template as pt " \ " where po.company_id='%s' and po.id=pol.order_id and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date >= '%s' " \ " and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date <= '%s' and po.state IN ('paid','invoiced','done') " \ " and pt.id=pp.product_tmpl_id and pol.product_id=pp.id"% (str(user.company_id.id),form['date_start'],form['date_end'])) @@ -75,11 +74,11 @@ class pos_details(report_sxw.rml_parse): def _get_sum_invoice_2(self,form,user): res2=[] self.cr.execute ("select sum(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0))" \ - "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt ,res_users as ru,res_company as rc,account_invoice as ai " \ + "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt, res_users as ru,res_company as rc,account_invoice as ai " \ "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and ai.id=po.invoice_id " \ "and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date >= %s and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date <= %s " \ "and po.user_id = ru.id and rc.id = %s and ru.id = %s " \ - ,(form['date_start'],form['date_end'],str(user.company_id.id),str(self.uid))) + ,(form['date_start'],form['date_end'],str(user.company_id.id),str(self.uid))) res2=self.cr.fetchone() self.total_invoiced=res2[0] return res2[0] or False @@ -91,7 +90,7 @@ class pos_details(report_sxw.rml_parse): "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and po.state IN ('paid','invoiced','done') " \ "and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date >= %s and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date <= %s " \ "and po.user_id = ru.id and rc.id = %s and ru.id = %s " \ - ,(form['date_start'],form['date_end'],str(user.company_id.id),str(self.uid))) + ,(form['date_start'],form['date_end'],str(user.company_id.id),str(self.uid))) res3=self.cr.fetchone() self.total_paid=res3[0] return res3[0] or False @@ -99,16 +98,15 @@ class pos_details(report_sxw.rml_parse): def _get_sum_dis_2(self,form,user): res4=[] self.cr.execute ("select sum(pol.price_ded * pol.qty)" \ - "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt ,res_users as ru,res_company as rc " \ + "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt, res_users as ru,res_company as rc " \ "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and po.state IN ('paid') " \ "and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date >= %s and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date <= %s " \ "and po.user_id = ru.id and rc.id = %s and ru.id = %s " \ - ,(form['date_start'],form['date_end'],str(user.company_id.id),str(self.uid))) + ,(form['date_start'],form['date_end'],str(user.company_id.id),str(self.uid))) res4=self.cr.fetchone() self.total_invoiced=res4[0] return res4[0] or False - def _get_sum_discount(self, objects): #code for the sum of discount value return reduce(lambda acc, object: @@ -122,14 +120,15 @@ class pos_details(report_sxw.rml_parse): def _get_payments(self, form,user): statement_line_obj = self.pool.get("account.bank.statement.line") - pos_ids=self.pool.get("pos.order").search(self.cr, self.uid, [('date_order','>=',form['date_start'] + ' 00:00:00'),('date_order','<=',form['date_end'] + ' 23:59:59'),('state','in',['paid','invoiced','done']),('user_id','=',self.uid)]) + pos_order_obj = self.pool.get("pos.order") + pos_ids=pos_order_obj.search(self.cr, self.uid, [('date_order','>=',form['date_start'] + ' 00:00:00'),('date_order','<=',form['date_end'] + ' 23:59:59'),('state','in',['paid','invoiced','done']),('user_id','=',self.uid)]) data={} if pos_ids: st_line_ids = statement_line_obj.search(self.cr, self.uid, [('pos_statement_id', 'in', pos_ids)]) if st_line_ids: st_id = statement_line_obj.browse(self.cr, self.uid, st_line_ids) a_l=[] - for r in st_id : + for r in st_id: a_l.append(r['id']) self.cr.execute("select aj.name,sum(amount) from account_bank_statement_line as absl,account_bank_statement as abs,account_journal as aj " \ "where absl.statement_id = abs.id and abs.journal_id = aj.id and absl.id IN %s " \ @@ -142,7 +141,7 @@ class pos_details(report_sxw.rml_parse): def _total_of_the_day(self, objects): if self.total_paid: - if self.total_paid == self.total_invoiced : + if self.total_paid == self.total_invoiced: return self.total_paid else: return ((self.total_paid or 0.00) - (self.total_invoiced or 0.00)) @@ -170,9 +169,10 @@ class pos_details(report_sxw.rml_parse): temp={} list_ids = [] temp2 = 0.0 - pos_ids=self.pool.get("pos.order").search(self.cr, self.uid, [('date_order','>=',form['date_start'] + ' 00:00:00'),('date_order','<=',form['date_end'] + ' 23:59:59'),('state','in',['paid','invoiced','done']),('user_id','=',self.uid)]) + pos_order_obj = self.pool.get("pos.order") + pos_ids = pos_order_obj.search(self.cr, self.uid, [('date_order','>=',form['date_start'] + ' 00:00:00'),('date_order','<=',form['date_end'] + ' 23:59:59'),('state','in',['paid','invoiced','done']),('user_id','=',self.uid)]) temp.update({'name':''}) - for order in self.pool.get("pos.order").browse(self.cr, self.uid, pos_ids): + for order in pos_order_obj.browse(self.cr, self.uid, pos_ids): temp2 +=order.amount_tax for line in order.lines: if len(line.product_id.taxes_id): @@ -215,5 +215,4 @@ class pos_details(report_sxw.rml_parse): report_sxw.report_sxw('report.pos.details', 'pos.order', 'addons/point_of_sale_singer/report/pos_details.rml', parser=pos_details, header='internal') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/pos_details_summary.py b/addons/point_of_sale/report/pos_details_summary.py index 4c20649b5bf..2801dcf43f3 100644 --- a/addons/point_of_sale/report/pos_details_summary.py +++ b/addons/point_of_sale/report/pos_details_summary.py @@ -22,7 +22,6 @@ import time from report import report_sxw - class pos_details_summary(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(pos_details_summary, self).__init__(cr, uid, name, context=context) @@ -137,5 +136,4 @@ report_sxw.report_sxw('report.pos.details_summary', parser=pos_details_summary, header='internal') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/pos_invoice.py b/addons/point_of_sale/report/pos_invoice.py index 62054570dfe..c968c42e352 100644 --- a/addons/point_of_sale/report/pos_invoice.py +++ b/addons/point_of_sale/report/pos_invoice.py @@ -24,7 +24,6 @@ from report import report_sxw from osv import osv from tools.translate import _ - class pos_invoice(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): @@ -33,7 +32,6 @@ class pos_invoice(report_sxw.rml_parse): 'time': time, }) - def set_context(self, objects, data, ids, report_type=None): super(pos_invoice, self).set_context(objects, data, ids, report_type) iids = [] @@ -56,3 +54,4 @@ class pos_invoice(report_sxw.rml_parse): report_sxw.report_sxw('report.pos.invoice', 'pos.order', 'addons/account/report/account_print_invoice.rml', parser= pos_invoice) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/pos_lines.py b/addons/point_of_sale/report/pos_lines.py index cb45b107931..66b52d6ce01 100644 --- a/addons/point_of_sale/report/pos_lines.py +++ b/addons/point_of_sale/report/pos_lines.py @@ -22,7 +22,6 @@ import time from report import report_sxw - class pos_lines(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): @@ -47,12 +46,10 @@ class pos_lines(report_sxw.rml_parse): " LEFT JOIN pos_order_line as pol ON po.id = pol.order_id " \ " LEFT JOIN product_taxes_rel as ptr ON pol.product_id = ptr.prod_id " \ " LEFT JOIN account_tax as acct ON acct.id = ptr.tax_id " \ - " WHERE pol.id = %s" ,(obj.id,)) + " WHERE pol.id = %s", (obj.id,)) res=self.cr.fetchone()[0] return res - report_sxw.report_sxw('report.pos.lines', 'pos.order', 'addons/point_of_sale/report/pos_lines.rml', parser=pos_lines,header='internal') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/pos_payment_report.py b/addons/point_of_sale/report/pos_payment_report.py index f679e230107..beadd2d5cb6 100644 --- a/addons/point_of_sale/report/pos_payment_report.py +++ b/addons/point_of_sale/report/pos_payment_report.py @@ -18,10 +18,10 @@ # along with this program. If not, see . # ############################################################################## + import time from report import report_sxw - class pos_payment_report(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): @@ -44,7 +44,7 @@ class pos_payment_report(report_sxw.rml_parse): "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and pu.id=pt.uom_id " \ "and po.state IN ('paid','invoiced') and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date = current_date and po.id=%d"%(obj.id)) data=self.cr.dictfetchall() - else : + else: self.cr.execute ("select pt.name,pp.default_code as code,pol.qty,pu.name as uom,pol.discount,pol.price_unit, " \ "(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \ "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt, product_uom as pu " \ @@ -56,17 +56,9 @@ class pos_payment_report(report_sxw.rml_parse): self.total += d['price_unit'] * d['qty'] return data - def _pos_payment_total(self,o): return self.total - report_sxw.report_sxw('report.pos.payment.report', 'pos.order', 'addons/point_of_sale/report/pos_payment_report.rml', parser=pos_payment_report,header='internal') - - - - - - - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/pos_payment_report_date.py b/addons/point_of_sale/report/pos_payment_report_date.py index 823fb3ce95e..76cd9c12be7 100644 --- a/addons/point_of_sale/report/pos_payment_report_date.py +++ b/addons/point_of_sale/report/pos_payment_report_date.py @@ -18,10 +18,10 @@ # along with this program. If not, see . # ############################################################################## + import time from report import report_sxw - class pos_payment_report_date(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): @@ -43,14 +43,14 @@ class pos_payment_report_date(report_sxw.rml_parse): "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt,product_uom as pu " \ "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and pu.id=pt.uom_id " \ "and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s and po.user_id IN %s " \ - ,(dt1,dt2,tuple(form['user_id']))) + ,(dt1,dt2,tuple(form['user_id']))) else: self.cr.execute ("select pt.name,pp.default_code as code,pol.qty,pu.name as uom,pol.discount,pol.price_unit, " \ "(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \ "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt,product_uom as pu " \ "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and pu.id=pt.uom_id " \ "and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s" \ - ,(dt1,dt2)) + ,(dt1,dt2)) data=self.cr.dictfetchall() return data @@ -63,23 +63,17 @@ class pos_payment_report_date(report_sxw.rml_parse): "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \ "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \ "and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s and po.user_id IN %s " \ - ,(dt1,dt2,tuple(form['user_id']))) + ,(dt1,dt2,tuple(form['user_id']))) else: self.cr.execute ("select sum(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) " \ "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \ "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \ "and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s" \ - ,(dt1,dt2)) + ,(dt1,dt2)) res=self.cr.fetchone()[0] or 0.0 return res report_sxw.report_sxw('report.pos.payment.report.date', 'pos.order', 'addons/point_of_sale/report/pos_payment_report_date.rml', parser=pos_payment_report_date,header='internal') - - - - - - - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/pos_payment_report_user.py b/addons/point_of_sale/report/pos_payment_report_user.py index 37b129f68f2..c90387e4f7a 100644 --- a/addons/point_of_sale/report/pos_payment_report_user.py +++ b/addons/point_of_sale/report/pos_payment_report_user.py @@ -18,6 +18,7 @@ # along with this program. If not, see . # ############################################################################## + import time from report import report_sxw @@ -44,6 +45,7 @@ class pos_payment_report_user(report_sxw.rml_parse): self.cr.execute (sql, (tuple(ids), )) data=self.cr.dictfetchall() return data + def __pos_payment_user__total__(self, form): res=[] ids = form['user_id'] @@ -57,21 +59,6 @@ class pos_payment_report_user(report_sxw.rml_parse): return res - report_sxw.report_sxw('report.pos.payment.report.user', 'pos.order', 'addons/point_of_sale/report/pos_payment_report_user.rml', parser=pos_payment_report_user,header='internal') - - - - - - - - - - - - - - - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/pos_receipt.py b/addons/point_of_sale/report/pos_receipt.py index 40924003e1c..721f4bc86e2 100644 --- a/addons/point_of_sale/report/pos_receipt.py +++ b/addons/point_of_sale/report/pos_receipt.py @@ -74,5 +74,4 @@ class order(report_sxw.rml_parse): report_sxw.report_sxw('report.pos.receipt', 'pos.order', 'addons/point_of_sale/report/pos_receipt.rml', parser=order, header=False) -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/pos_receipt_with_remboursment.py b/addons/point_of_sale/report/pos_receipt_with_remboursment.py index 3286f40c5b7..9b3dc529646 100644 --- a/addons/point_of_sale/report/pos_receipt_with_remboursment.py +++ b/addons/point_of_sale/report/pos_receipt_with_remboursment.py @@ -23,7 +23,6 @@ import time from report import report_sxw import pooler - class order(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): @@ -55,6 +54,7 @@ class order(report_sxw.rml_parse): if line[0] != 0: dsum = dsum +(line[2] * (line[0]*line[1]/100)) return dsum + def _get_journal_amt(self, order_id): lst=[] sql = """ select aj.name from account_bank_statement as abs @@ -75,5 +75,4 @@ class order(report_sxw.rml_parse): report_sxw.report_sxw('report.pos.receipt.with.remboursment', 'pos.order', 'addons/point_of_sale/report/pos_receipt_with_remboursment.rml', parser=order, header=False) -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/pos_receipt_without_remboursment.py b/addons/point_of_sale/report/pos_receipt_without_remboursment.py index 58d7052b287..72d227fbd52 100644 --- a/addons/point_of_sale/report/pos_receipt_without_remboursment.py +++ b/addons/point_of_sale/report/pos_receipt_without_remboursment.py @@ -23,7 +23,6 @@ import time from report import report_sxw import pooler - class order(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): @@ -76,5 +75,4 @@ class order(report_sxw.rml_parse): report_sxw.report_sxw('report.pos.receipt.without.remboursment', 'pos.order', 'addons/point_of_sale/report/pos_receipt_without_remboursment.rml', parser=order, header=False) -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/pos_sales_user.py b/addons/point_of_sale/report/pos_sales_user.py index a764fa112b9..7bda5b04647 100644 --- a/addons/point_of_sale/report/pos_sales_user.py +++ b/addons/point_of_sale/report/pos_sales_user.py @@ -18,10 +18,10 @@ # along with this program. If not, see . # ############################################################################## + import time from report import report_sxw - class pos_sales_user(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): @@ -41,17 +41,11 @@ class pos_sales_user(report_sxw.rml_parse): "from pos_order as po,res_users as ru,res_company as rc " \ "where po.date_order >= %s and po.date_order <= %s " \ "and po.company_id=rc.id and po.user_id=ru.id and po.user_id IN %s " \ - ,(dt1,dt2,tuple(form['user_id']))) + ,(dt1,dt2,tuple(form['user_id']))) data = self.cr.dictfetchall() return data report_sxw.report_sxw('report.pos.sales.user', 'pos.order', 'addons/point_of_sale/report/pos_sales_user.rml', parser=pos_sales_user,header='internal') - - - - - - - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/pos_sales_user_today.py b/addons/point_of_sale/report/pos_sales_user_today.py index 3a8b8bb1bba..9696d036959 100644 --- a/addons/point_of_sale/report/pos_sales_user_today.py +++ b/addons/point_of_sale/report/pos_sales_user_today.py @@ -18,10 +18,10 @@ # along with this program. If not, see . # ############################################################################## + import time from report import report_sxw - class pos_sales_user_today(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): @@ -40,17 +40,11 @@ class pos_sales_user_today(report_sxw.rml_parse): self.cr.execute("select po.name as pos,po.date_order,ru.name as user,po.state,rc.name " \ "from pos_order as po,res_users as ru,res_company as rc " \ "where to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date = current_date " \ - "and po.company_id=rc.id and po.user_id=ru.id and po.user_id IN %s" ,(tuple(ids), )) + "and po.company_id=rc.id and po.user_id=ru.id and po.user_id IN %s", (tuple(ids), )) data = self.cr.dictfetchall() return data report_sxw.report_sxw('report.pos.sales.user.today', 'pos.order', 'addons/point_of_sale/report/pos_sales_user_today.rml', parser=pos_sales_user_today,header='internal') - - - - - - - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/pos_sales_user_today_current_user.py b/addons/point_of_sale/report/pos_sales_user_today_current_user.py index ed793b4277e..07cbdcbc488 100644 --- a/addons/point_of_sale/report/pos_sales_user_today_current_user.py +++ b/addons/point_of_sale/report/pos_sales_user_today_current_user.py @@ -18,10 +18,10 @@ # along with this program. If not, see . # ############################################################################## + import time from report import report_sxw - class pos_sales_user_today_current_user(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): @@ -45,11 +45,11 @@ class pos_sales_user_today_current_user(report_sxw.rml_parse): def _get_data_current_user(self, user): data={} self.cr.execute("select po.name,po. state,sum(pol.qty)as Qty,sum((pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0))) as Total " \ - "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt ,res_users as ru,res_company as rc " \ + "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt, res_users as ru,res_company as rc " \ "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \ "and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date = current_date and po.user_id = ru.id and rc.id = %s and ru.id = %s " \ "group by po.name, po.state " \ - ,(str(user.company_id.id),str(self.uid))) + ,(str(user.company_id.id),str(self.uid))) data = self.cr.dictfetchall() for d in data: @@ -65,10 +65,4 @@ class pos_sales_user_today_current_user(report_sxw.rml_parse): report_sxw.report_sxw('report.pos.sales.user.today.current.user', 'pos.order', 'addons/point_of_sale/report/pos_sales_user_today_current_user.rml', parser=pos_sales_user_today_current_user,header='internal') - - - - - - - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/pos_users_product.py b/addons/point_of_sale/report/pos_users_product.py index a147c03d113..04693064257 100644 --- a/addons/point_of_sale/report/pos_users_product.py +++ b/addons/point_of_sale/report/pos_users_product.py @@ -18,10 +18,10 @@ # along with this program. If not, see . # ############################################################################## + import time from report import report_sxw - class pos_user_product(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): @@ -33,8 +33,9 @@ class pos_user_product(report_sxw.rml_parse): 'get_total':self._get_total, }) + def _get_data(self,o): - self.total = 0.0 + self.total = 0.0 data={} sql1=""" SELECT distinct(o.id) from account_bank_statement s, account_bank_statement_line l,pos_order o,pos_order_line i where i.order_id=o.id and o.state='paid' and l.statement_id=s.id and l.pos_statement_id=o.id and s.id=%d"""%(o.id) self.cr.execute(sql1) @@ -51,14 +52,17 @@ class pos_user_product(report_sxw.rml_parse): return data def _get_user(self,object): - for o in object : + for o in object: sql = """select ru.name from account_bank_statement as abs,res_users ru where abs.user_id = ru.id and abs.id = %d"""%(o.id) self.cr.execute(sql) data = self.cr.fetchone() return data[0] + def _get_total(self,o): return self.total report_sxw.report_sxw('report.pos.user.product', 'account.bank.statement', 'addons/statement/report/pos_users_product.rml', parser=pos_user_product,header='internal') + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/report_cash_register.py b/addons/point_of_sale/report/report_cash_register.py index 0e09ddd9b62..679280d593f 100644 --- a/addons/point_of_sale/report/report_cash_register.py +++ b/addons/point_of_sale/report/report_cash_register.py @@ -18,6 +18,7 @@ # along with this program. If not, see . # ############################################################################## + import tools from osv import fields,osv @@ -39,6 +40,7 @@ class report_cash_register(osv.osv): 'balance_end_real': fields.float('Closing Balance'), } _order = 'date desc' + def init(self, cr): tools.drop_view_if_exists(cr, 'report_cash_register') cr.execute(""" @@ -62,3 +64,5 @@ class report_cash_register(osv.osv): to_char(s.create_date, 'YYYY-MM-DD'))""") report_cash_register() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/point_of_sale/report/report_pos_order.py b/addons/point_of_sale/report/report_pos_order.py deleted file mode 100644 index eb8bac2374e..00000000000 --- a/addons/point_of_sale/report/report_pos_order.py +++ /dev/null @@ -1,95 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - -import tools -from osv import fields,osv - -class report_pos_order(osv.osv): - _name = "report.pos.order" - _description = "Point of Sale Orders Statistics" - _auto = False - _columns = { - 'date': fields.date('Date Order', readonly=True), - 'year': fields.char('Year', size=4, readonly=True), - 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), - ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), - ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True), - 'day': fields.char('Day', size=128, readonly=True), - 'partner_id':fields.many2one('res.partner', 'Partner', readonly=True), - 'product_id':fields.many2one('product.product', 'Product', readonly=True), - 'state': fields.selection([('draft', 'Draft'), ('payment', 'Payment'), - ('advance','Advance'), - ('paid', 'Paid'), ('done', 'Done'), ('invoiced', 'Invoiced'), ('cancel', 'Cancel')], - 'State'), - 'user_id':fields.many2one('res.users', 'Salesman', readonly=True), - 'price_total':fields.float('Total Price', readonly=True), - 'total_discount':fields.float('Total Discount', readonly=True), - 'average_price': fields.float('Average Price', readonly=True,group_operator="avg"), - 'shop_id':fields.many2one('sale.shop', 'Shop', readonly=True), - 'company_id':fields.many2one('res.company', 'Company', readonly=True), - 'nbr':fields.integer('# of Lines', readonly=True), - 'product_qty':fields.integer('# of Qty', readonly=True), - 'journal_id': fields.many2one('account.journal', 'Journal'), - 'delay_validation': fields.integer('Delay Validation'), - 'delay_payment': fields.integer('Delay Payment'), - 'date_validation': fields.date('Validation Date', required=True), - 'date_payment': fields.date('Payment Date', required=True), - } - _order = 'date desc' - def init(self, cr): - tools.drop_view_if_exists(cr, 'report_pos_order') - cr.execute(""" - create or replace view report_pos_order as ( - select - min(l.id) as id, - count(*) as nbr, - to_date(to_char(s.date_order, 'dd-MM-YYYY'),'dd-MM-YYYY') as date, - sum(l.qty * u.factor) as product_qty, - sum(l.qty * l.price_unit) as price_total, - sum(l.qty * l.price_ded) as total_discount, - (sum(l.qty*l.price_unit)/sum(l.qty * u.factor))::decimal(16,2) as average_price, - sum(cast(to_char(date_trunc('day',s.date_validation) - date_trunc('day',s.date_order),'DD') as int)) as delay_validation, - sum(cast(to_char(date_trunc('day',s.date_payment) - date_trunc('day',s.date_order),'DD') as int)) as delay_payment, - to_char(s.date_order, 'YYYY') as year, - to_char(s.date_order, 'MM') as month, - to_char(s.date_order, 'YYYY-MM-DD') as day, - s.partner_id as partner_id, - s.state as state, - s.user_id as user_id, - s.shop_id as shop_id, - s.company_id as company_id, - s.sale_journal as journal_id, - l.product_id as product_id, - s.date_validation, - s.date_payment - from pos_order_line as l - left join pos_order s on (s.id=l.order_id) - left join product_template pt on (pt.id=l.product_id) - left join product_uom u on (u.id=pt.uom_id) - group by - to_char(s.date_order, 'dd-MM-YYYY'),to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'), - to_char(s.date_order, 'YYYY-MM-DD'), s.partner_id,s.state, - s.user_id,s.shop_id,s.company_id,s.sale_journal,l.product_id,s.date_validation, - s.date_payment - having - sum(l.qty * u.factor) != 0)""") - -report_pos_order() diff --git a/addons/point_of_sale/report/report_pos_order_view.xml b/addons/point_of_sale/report/report_pos_order_view.xml deleted file mode 100644 index c72a6b6d415..00000000000 --- a/addons/point_of_sale/report/report_pos_order_view.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - report.pos.order.tree - report.pos.order - tree - - - - - - - - - - - - - - - - - - - - - - - - - - - - report.pos.order.search - report.pos.order - search - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Point of Sale Analysis - report.pos.order - form - tree,graph - - {'search_default_today':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]} - - - - -