diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py
index 13800334325..9a84760bb68 100644
--- a/addons/point_of_sale/__openerp__.py
+++ b/addons/point_of_sale/__openerp__.py
@@ -34,7 +34,6 @@ Main Features
'security/ir.model.access.csv',
'data/default_barcode_patterns.xml',
'wizard/pos_box.xml',
- 'wizard/pos_details.xml',
'wizard/pos_discount.xml',
'wizard/pos_open_statement.xml',
'wizard/pos_payment.xml',
@@ -59,10 +58,6 @@ Main Features
'views/res_config_view.xml',
'views/report_statement.xml',
'views/report_usersproduct.xml',
- 'views/report_saleslines.xml',
- 'views/report_detailsofsales.xml',
- 'views/report_payment.xml',
- 'views/report_sessionsummary.xml',
'views/report_userlabel.xml',
'views/point_of_sale.xml',
'views/point_of_sale_dashboard.xml',
@@ -76,7 +71,6 @@ Main Features
'test/00_register_open.yml',
'test/01_order_to_payment.yml',
'test/02_order_to_invoice.yml',
- 'test/point_of_sale_report.yml',
'test/account_statement_reports.yml',
],
'installable': True,
diff --git a/addons/point_of_sale/report/__init__.py b/addons/point_of_sale/report/__init__.py
index 093cf63f789..3de0210b9f0 100644
--- a/addons/point_of_sale/report/__init__.py
+++ b/addons/point_of_sale/report/__init__.py
@@ -1,12 +1,8 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-import pos_users_product
import account_statement
-import pos_receipt
import pos_invoice
-import pos_lines
-import pos_details
-import pos_payment_report
-import pos_report
import pos_order_report
+import pos_receipt
+import pos_users_product
diff --git a/addons/point_of_sale/report/pos_details.py b/addons/point_of_sale/report/pos_details.py
deleted file mode 100644
index 4625ddbd766..00000000000
--- a/addons/point_of_sale/report/pos_details.py
+++ /dev/null
@@ -1,181 +0,0 @@
-# -*- coding: utf-8 -*-
-# Part of Odoo. See LICENSE file for full copyright and licensing details.
-
-import time
-from openerp.osv import osv
-from openerp.report import report_sxw
-
-
-class pos_details(report_sxw.rml_parse):
-
- def _get_invoice(self, inv_id):
- res={}
- if inv_id:
- self.cr.execute("select number from account_invoice as ac where id = %s", (inv_id,))
- res = self.cr.fetchone()
- return res[0] or 'Draft'
- else:
- return ''
-
- def _get_all_users(self):
- user_obj = self.pool.get('res.users')
- return user_obj.search(self.cr, self.uid, [])
-
- def _pos_sales_details(self, form):
- pos_obj = self.pool.get('pos.order')
- user_obj = self.pool.get('res.users')
- data = []
- result = {}
- user_ids = form['user_ids'] or self._get_all_users()
- company_id = user_obj.browse(self.cr, self.uid, self.uid).company_id.id
- pos_ids = pos_obj.search(self.cr, self.uid, [('date_order','>=',form['date_start'] + ' 00:00:00'),('date_order','<=',form['date_end'] + ' 23:59:59'),('user_id','in',user_ids),('state','in',['done','paid','invoiced']),('company_id','=',company_id)])
- for pos in pos_obj.browse(self.cr, self.uid, pos_ids, context=self.localcontext):
- for pol in pos.lines:
- result = {
- 'code': pol.product_id.default_code,
- 'name': pol.product_id.name,
- 'invoice_id': pos.invoice_id.id,
- 'price_unit': pol.price_unit,
- 'qty': pol.qty,
- 'discount': pol.discount,
- 'total': (pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)),
- 'date_order': pos.date_order,
- 'pos_name': pos.name,
- 'uom': pol.product_id.uom_id.name
- }
- data.append(result)
- self.total += result['total']
- self.qty += result['qty']
- self.discount += result['discount']
- if data:
- return data
- else:
- return {}
-
- def _get_qty_total_2(self):
- return self.qty
-
- def _get_sales_total_2(self):
- return self.total
-
- def _get_sum_invoice_2(self, form):
- pos_obj = self.pool.get('pos.order')
- user_obj = self.pool.get('res.users')
- user_ids = form['user_ids'] or self._get_all_users()
- company_id = user_obj.browse(self.cr, self.uid, self.uid).company_id.id
- pos_ids = pos_obj.search(self.cr, self.uid, [('date_order','>=',form['date_start'] + ' 00:00:00'),('date_order','<=',form['date_end'] + ' 23:59:59'),('user_id','in',user_ids),('company_id','=',company_id),('invoice_id','<>',False)])
- for pos in pos_obj.browse(self.cr, self.uid, pos_ids):
- for pol in pos.lines:
- self.total_invoiced += (pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0))
- return self.total_invoiced or False
-
- def _paid_total_2(self):
- return self.total or 0.0
-
- def _get_sum_dis_2(self):
- return self.discount or 0.0
-
- def _get_sum_discount(self, form):
- #code for the sum of discount value
- pos_obj = self.pool.get('pos.order')
- user_obj = self.pool.get('res.users')
- user_ids = form['user_ids'] or self._get_all_users()
- company_id = user_obj.browse(self.cr, self.uid, self.uid).company_id.id
- pos_ids = pos_obj.search(self.cr, self.uid, [('date_order','>=',form['date_start'] + ' 00:00:00'),('date_order','<=',form['date_end'] + ' 23:59:59'),('user_id','in',user_ids),('company_id','=',company_id)])
- for pos in pos_obj.browse(self.cr, self.uid, pos_ids):
- for pol in pos.lines:
- self.total_discount += ((pol.price_unit * pol.qty) * (pol.discount / 100))
- return self.total_discount or False
-
- def _get_payments(self, form):
- statement_line_obj = self.pool.get("account.bank.statement.line")
- pos_order_obj = self.pool.get("pos.order")
- user_ids = form['user_ids'] or self._get_all_users()
- company_id = self.pool['res.users'].browse(self.cr, self.uid, self.uid).company_id.id
- 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','in',user_ids), ('company_id', '=', company_id)])
- 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:
- 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 " \
- "group by aj.name ",(tuple(a_l),))
-
- data = self.cr.dictfetchall()
- return data
- else:
- return {}
-
- def _total_of_the_day(self, objects):
- return self.total or 0.00
-
- def _sum_invoice(self, objects):
- return reduce(lambda acc, obj:
- acc + obj.invoice_id.amount_total,
- [o for o in objects if o.invoice_id and o.invoice_id.number],
- 0.0)
-
- def _ellipsis(self, orig_str, maxlen=100, ellipsis='...'):
- maxlen = maxlen - len(ellipsis)
- if maxlen <= 0:
- maxlen = 1
- new_str = orig_str[:maxlen]
- return new_str
-
- def _strip_name(self, name, maxlen=50):
- return self._ellipsis(name, maxlen, ' ...')
-
- def _get_tax_amount(self, form):
- taxes = {}
- account_tax_obj = self.pool.get('account.tax')
- user_ids = form['user_ids'] or self._get_all_users()
- pos_order_obj = self.pool.get('pos.order')
- company_id = self.pool['res.users'].browse(self.cr, self.uid, self.uid).company_id.id
- 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','in',user_ids), ('company_id', '=', company_id)])
- for order in pos_order_obj.browse(self.cr, self.uid, pos_ids):
- currency = order.session_id.currency_id
- for line in order.lines:
- if line.product_id.taxes_id:
- line_taxes = line.product_id.taxes_id.compute_all(line.price_unit * (1-(line.discount or 0.0)/100.0), currency, line.qty, product=line.product_id, partner=line.order_id.partner_id or False)
- for tax in line_taxes['taxes']:
- taxes.setdefault(tax['id'], {'name': tax['name'], 'amount':0.0})
- taxes[tax['id']]['amount'] += tax['amount']
- return taxes.values()
-
- def _get_user_names(self, user_ids):
- user_obj = self.pool.get('res.users')
- return ', '.join(map(lambda x: x.name, user_obj.browse(self.cr, self.uid, user_ids)))
-
- def __init__(self, cr, uid, name, context):
- super(pos_details, self).__init__(cr, uid, name, context=context)
- self.total = 0.0
- self.qty = 0.0
- self.total_invoiced = 0.0
- self.discount = 0.0
- self.total_discount = 0.0
- self.localcontext.update({
- 'time': time,
- 'strip_name': self._strip_name,
- 'getpayments': self._get_payments,
- 'getsumdisc': self._get_sum_discount,
- 'gettotaloftheday': self._total_of_the_day,
- 'gettaxamount': self._get_tax_amount,
- 'pos_sales_details':self._pos_sales_details,
- 'getqtytotal2': self._get_qty_total_2,
- 'getsalestotal2': self._get_sales_total_2,
- 'getsuminvoice2':self._get_sum_invoice_2,
- 'getpaidtotal2': self._paid_total_2,
- 'getinvoice':self._get_invoice,
- 'get_user_names': self._get_user_names,
- })
-
-
-class report_pos_details(osv.AbstractModel):
- _name = 'report.point_of_sale.report_detailsofsales'
- _inherit = 'report.abstract_report'
- _template = 'point_of_sale.report_detailsofsales'
- _wrapped_report_class = pos_details
diff --git a/addons/point_of_sale/report/pos_lines.py b/addons/point_of_sale/report/pos_lines.py
deleted file mode 100644
index 6f74cf40ab6..00000000000
--- a/addons/point_of_sale/report/pos_lines.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# -*- coding: utf-8 -*-
-# Part of Odoo. See LICENSE file for full copyright and licensing details.
-
-import time
-from openerp.osv import osv
-from openerp.report import report_sxw
-
-
-class pos_lines(report_sxw.rml_parse):
-
- def __init__(self, cr, uid, name, context):
- super(pos_lines, self).__init__(cr, uid, name, context=context)
- self.total = 0.0
- self.localcontext.update({
- 'time': time,
- 'total_quantity': self.__total_quantity__,
- 'taxes':self.__taxes__,
-
- })
-
- def __total_quantity__(self, obj):
- tot = 0
- for line in obj.lines:
- tot += line.qty
- self.total = tot
- return self.total
-
- def __taxes__(self, obj):
- self.cr.execute ( " Select acct.name from pos_order as po " \
- " LEFT JOIN pos_order_line as pol ON po.id = pol.order_id " \
- " LEFT JOIN product_product as pp ON pol.product_id = pp.id"
- " LEFT JOIN product_taxes_rel as ptr ON pp.product_tmpl_id = ptr.prod_id " \
- " LEFT JOIN account_tax as acct ON acct.id = ptr.tax_id " \
- " WHERE pol.id = %s", (obj.id,))
- res=self.cr.fetchone()[0]
- return res
-
-
-class report_pos_lines(osv.AbstractModel):
- _name = 'report.point_of_sale.report_saleslines'
- _inherit = 'report.abstract_report'
- _template = 'point_of_sale.report_saleslines'
- _wrapped_report_class = pos_lines
diff --git a/addons/point_of_sale/report/pos_order_report.py b/addons/point_of_sale/report/pos_order_report.py
index 7adc4f8528b..7d528f8649d 100644
--- a/addons/point_of_sale/report/pos_order_report.py
+++ b/addons/point_of_sale/report/pos_order_report.py
@@ -33,6 +33,7 @@ class pos_order_report(osv.osv):
'pos_categ_id': fields.many2one('pos.category','Public Category', readonly=True),
'stock_location_id': fields.many2one('stock.location', 'Warehouse', readonly=True),
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', readonly=True),
+ 'session_id;: fields.many2one('pos.session', string='Session', readonly=True),
}
_order = 'date desc'
@@ -63,6 +64,7 @@ class pos_order_report(osv.osv):
pt.pos_categ_id,
pc.stock_location_id,
s.pricelist_id,
+ s.session_id,
s.invoice_id IS NOT NULL AS invoiced
from pos_order_line as l
left join pos_order s on (s.id=l.order_id)
@@ -73,6 +75,14 @@ class pos_order_report(osv.osv):
left join pos_config pc on (ps.config_id=pc.id)
group by
s.date_order, s.partner_id,s.state, pt.categ_id,
- s.user_id,s.location_id,s.company_id,s.sale_journal,s.pricelist_id,s.invoice_id,l.product_id,s.create_date,pt.categ_id,pt.pos_categ_id,p.product_tmpl_id,ps.config_id,pc.stock_location_id
- having
- sum(l.qty * u.factor) != 0)""")
+ s.user_id, s.location_id, s.company_id, s.sale_journal,
+ s.pricelist_id, s.invoice_id, s.create_date, s.session_id,
+ l.product_id,
+ pt.categ_id, pt.pos_categ_id,
+ p.product_tmpl_id,
+ ps.config_id,
+ pc.stock_location_id
+ HAVING
+ SUM(l.qty * u.factor) != 0
+ )
+ """)
diff --git a/addons/point_of_sale/report/pos_payment_report.py b/addons/point_of_sale/report/pos_payment_report.py
deleted file mode 100644
index e34e50e69bd..00000000000
--- a/addons/point_of_sale/report/pos_payment_report.py
+++ /dev/null
@@ -1,52 +0,0 @@
-# -*- coding: utf-8 -*-
-# Part of Odoo. See LICENSE file for full copyright and licensing details.
-
-import time
-from openerp.osv import osv
-from openerp.report import report_sxw
-
-
-class pos_payment_report(report_sxw.rml_parse):
-
- def __init__(self, cr, uid, name, context):
- super(pos_payment_report, self).__init__(cr, uid, name, context=context)
- self.total = 0.0
- self.localcontext.update({
- 'time': time,
- 'pos_payment': self._pos_payment,
- 'pos_payment_total':self._pos_payment_total,
- })
-
- def _pos_payment(self, obj):
- self.total = 0
- data={}
- sql = """ select id from pos_order where id = %d"""%(obj.id)
- self.cr.execute(sql)
- if self.cr.fetchone():
- 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 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:
- 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 to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date = current_date")
- data=self.cr.dictfetchall()
-
- for d in data:
- self.total += d['price_unit'] * d['qty']
- return data
-
- def _pos_payment_total(self, o):
- return self.total
-
-
-class report_pos_payment(osv.AbstractModel):
- _name = 'report.point_of_sale.report_payment'
- _inherit = 'report.abstract_report'
- _template = 'point_of_sale.report_payment'
- _wrapped_report_class = pos_payment_report
diff --git a/addons/point_of_sale/report/pos_report.py b/addons/point_of_sale/report/pos_report.py
deleted file mode 100644
index 826e6134429..00000000000
--- a/addons/point_of_sale/report/pos_report.py
+++ /dev/null
@@ -1,121 +0,0 @@
-# -*- coding: utf-8 -*-
-# Part of Odoo. See LICENSE file for full copyright and licensing details.
-
-from openerp.osv import fields, osv
-from openerp 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((100.0-line.discount) * line.price_unit * line.qty / 100.0) 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,
-
-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
-
- )
- """)
-
-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
-
- )
- """)
diff --git a/addons/point_of_sale/security/ir.model.access.csv b/addons/point_of_sale/security/ir.model.access.csv
index 2e167277dbc..17b4f584f45 100644
--- a/addons/point_of_sale/security/ir.model.access.csv
+++ b/addons/point_of_sale/security/ir.model.access.csv
@@ -1,13 +1,10 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_pos_order,pos.order,model_pos_order,group_pos_user,1,1,1,1
access_pos_order_line,pos.order.line,model_pos_order_line,group_pos_user,1,1,1,1
-access_report_transaction_pos,report.transaction.pos,model_report_transaction_pos,group_pos_manager,1,1,1,1
access_stock_picking_pos_user,stock.picking pos_user,stock.model_stock_picking,group_pos_user,1,1,1,1
access_stock_warehouse_pos_user,stock.warehouse pos_user,stock.model_stock_warehouse,group_pos_user,1,0,0,0
access_pos_order_stock_worker,pos.order stock_worker,model_pos_order,stock.group_stock_user,1,0,0,0
access_stock_move_pos_user,stock.move pos_user,stock.model_stock_move,group_pos_user,1,1,1,1
-access_report_sales_by_user_pos,report.sales.by.user.pos,model_report_sales_by_user_pos,group_pos_user,1,0,0,0
-access_report_sales_by_user_pos_month,report.sales.by.user.pos.month,model_report_sales_by_user_pos_month,group_pos_user,1,0,0,0
access_report_pos_order,report.pos.order,model_report_pos_order,group_pos_user,1,1,1,1
access_account_journal_pos_user,account.journal pos_user,account.model_account_journal,group_pos_user,1,0,0,0
access_account_payment_method_pos_user,account.payment.method pos_user,account.model_account_payment_method,group_pos_manager,1,0,0,0
diff --git a/addons/point_of_sale/test/point_of_sale_report.yml b/addons/point_of_sale/test/point_of_sale_report.yml
deleted file mode 100644
index c039eab4c3d..00000000000
--- a/addons/point_of_sale/test/point_of_sale_report.yml
+++ /dev/null
@@ -1,43 +0,0 @@
--
- In order to test the PDF reports defined on a Point Of Sale, we will print a POS Invoice Report
--
- !python {model: pos.order}: |
- import os
- import openerp.report
- from openerp import tools
- data, format = openerp.report.render_report(cr, uid, [ref('pos_order_pos1')], 'point_of_sale.report_invoice', {}, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-invoice_report.'+format), 'wb+').write(data)
-
--
- In order to test the PDF reports defined on a Point Of Sale, we will print a POS Lines Report
--
- !python {model: pos.order}: |
- import os
- import openerp.report
- from openerp import tools
- data, format = openerp.report.render_report(cr, uid, [ref('pos_order_pos1')], 'point_of_sale.report_saleslines', {}, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-lines_report.'+format), 'wb+').write(data)
-
--
- Print the POS Details Report through the wizard
--
- !python {model: ir.ui.menu}: |
- import time
- ctx={}
- ctx.update({'model': 'ir.ui.menu','active_ids': []})
- data_dict = {'date_start': time.strftime('%Y-%m-%d'), 'date_end': time.strftime('%Y-%m-%d'), 'user_ids': [(6,0,[ref('base.user_root')])]}
- from openerp.tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_report_pos_details',wiz_data=data_dict, context=ctx, our_module='point_of_sale')
-
--
- In order to test the PDF reports defined on a Point of Sale, we will print a POS Payment Report
--
- !python {model: pos.order}: |
- import os, time
- import openerp.report
- from openerp import tools
- data, format = openerp.report.render_report(cr, uid, [ref('pos_order_pos0')], 'point_of_sale.report_payment', {}, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-payment_report.'+format), 'wb+').write(data)
diff --git a/addons/point_of_sale/views/point_of_sale_report.xml b/addons/point_of_sale/views/point_of_sale_report.xml
index 9eee8f2c065..7d68e896f41 100644
--- a/addons/point_of_sale/views/point_of_sale_report.xml
+++ b/addons/point_of_sale/views/point_of_sale_report.xml
@@ -10,269 +10,15 @@
file="point_of_sale.report_userlabel"
/>
-
-
-
-
-
-
-
-
-
-
-
-
-
- report.trans.pos.user.form
- report.transaction.pos
-
-
-
+
+
+ Invoice
+ pos.order
+ qweb-pdf
+ point_of_sale.report_invoice
-
- Sales by user
- report.transaction.pos
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- report.transaction.pos.calendar
- report.transaction.pos
-
-
-
-
-
-
-
-
-
-
- report.transaction.pos.graph
- report.transaction.pos
-
-
-
-
-
-
-
-
-
-
-
- Sales by day
- report.transaction.pos
- form
- tree,calendar,form,graph
- [('date_create','=',time.strftime('%Y-%m-%d'))]
-
-
-
-
- Sales by month
- report.transaction.pos
- form
- tree,calendar,form,graph
- [('date_create','like',time.strftime('%Y-%m'))]
-
-
-
-
- Sales by user
- report.transaction.pos
- form
- tree,calendar,form,graph
-
-
-
-
-
- report.sales.by.user.pos.form
- report.sales.by.user.pos
-
-
-
-
-
-
-
- report.sales.by.user.pos.tree
- report.sales.by.user.pos
-
-
-
-
-
-
-
-
-
-
-
- report.sales.by.user.pos.calendar
- report.sales.by.user.pos
-
-
-
-
-
-
-
-
-
-
- report.sales.by.user.pos.graph
- report.sales.by.user.pos
-
-
-
-
-
-
-
-
-
-
- Sales by User
- report.sales.by.user.pos
- form
- tree,calendar,form,graph
- [('date_order','=',time.strftime('%Y-%m-%d'))]
-
-
-
-
-
-
- report.sales.by.user.pos.month.form
- report.sales.by.user.pos.month
-
-
-
-
-
-
-
- report.sales.by.user.pos.month.tree
- report.sales.by.user.pos.month
-
-
-
-
-
-
-
-
-
-
-
- report.sales.by.user.pos.month.calendar
- report.sales.by.user.pos.month
-
-
-
-
-
-
-
-
-
-
- report.sales.by.user.pos.month.graph
- report.sales.by.user.pos.month
-
-
-
-
-
-
-
-
-
-
-
- Sales by User Monthly
- report.sales.by.user.pos.month
- form
- tree,calendar,form,graph
- [('date_order','like',time.strftime('%Y-%m'))]
-
diff --git a/addons/point_of_sale/views/pos_order_report_view.xml b/addons/point_of_sale/views/pos_order_report_view.xml
index 56eb552b557..7351a30926b 100644
--- a/addons/point_of_sale/views/pos_order_report_view.xml
+++ b/addons/point_of_sale/views/pos_order_report_view.xml
@@ -53,6 +53,13 @@
+
+ Per session
+ report.pos.order
+
+ {'group_by': ['date', 'session_id'], 'measures': ['price_total']}
+
+
Orders Analysis
report.pos.order
diff --git a/addons/point_of_sale/views/pos_order_view.xml b/addons/point_of_sale/views/pos_order_view.xml
index b3fe63c1185..79c31b00706 100644
--- a/addons/point_of_sale/views/pos_order_view.xml
+++ b/addons/point_of_sale/views/pos_order_view.xml
@@ -242,9 +242,6 @@
-
-
pos.order.list.select
pos.order
diff --git a/addons/point_of_sale/views/report_detailsofsales.xml b/addons/point_of_sale/views/report_detailsofsales.xml
deleted file mode 100644
index 648d40969f9..00000000000
--- a/addons/point_of_sale/views/report_detailsofsales.xml
+++ /dev/null
@@ -1,140 +0,0 @@
-
-
-
-
-
-
-
-
Details of Sales
-
-
-
- Company:
-
-
-
- Users:
-
-
-
- Print Date:
-
-
-
-
-
- Start Period:
-
-
-
- End Period:
-
-
-
-
-
-
- | Date |
- Order |
- Product |
- Price |
- Qty |
- Disc(%) |
- Invoiced |
-
-
-
- |
-
- |
-
-
- |
-
- [
-
- ]
-
- |
-
-
- |
-
-
-
- |
-
-
- |
-
-
-
-
- |
-
-
-
-
-
- | Taxes |
-
- |
-
-
- |
-
-
- | Payment |
-
-
- |
-
-
- |
-
-
- | Summary |
-
-
- | Sales total(Revenue) |
-
-
- |
-
-
- | Qty of product |
-
-
- |
-
-
- | Total invoiced |
-
-
- |
-
-
- | Total discount |
-
-
- |
-
-
- | Total paid |
-
-
- |
-
-
- | Total of the day |
-
-
- |
-
-
-
-
-
-
-
-
diff --git a/addons/point_of_sale/views/report_payment.xml b/addons/point_of_sale/views/report_payment.xml
deleted file mode 100644
index 939391ca532..00000000000
--- a/addons/point_of_sale/views/report_payment.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
-
-
-
-
Today's Payments
-
-
- Company:
-
-
-
-
- Print date:
-
-
-
-
-
-
-
-
- |
- Product
- |
-
- Qty
- |
-
- Disc.(%)
- |
-
- Unit Price
- |
-
- Total
- |
-
-
-
-
- |
-
-
-
-
-
-
- |
-
-
-
-
-
- |
-
-
- |
-
-
- |
-
-
- |
-
-
-
-
-
-
-
- |
- Net Total
- |
-
-
- |
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/point_of_sale/views/report_saleslines.xml b/addons/point_of_sale/views/report_saleslines.xml
deleted file mode 100644
index 3a1dc1fc1c1..00000000000
--- a/addons/point_of_sale/views/report_saleslines.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
-
-
-
-
POS Lines
-
-
-
- Company:
-
-
-
- Print date:
-
-
-
- No. Of Articles:
-
-
-
-
-
-
-
- | Description |
- Tax |
- Quantity |
- Unit Price |
- Disc. (%) |
- Price |
-
-
-
-
- |
-
- []
-
-
- |
-
-
- |
-
-
-
- |
-
-
- |
-
-
- |
-
-
- |
-
-
-
-
-
-
-
-
- | Total Without Taxes |
-
-
- |
-
-
- | Taxes |
-
-
- |
-
-
- | Total |
-
-
- |
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/point_of_sale/views/report_sessionsummary.xml b/addons/point_of_sale/views/report_sessionsummary.xml
deleted file mode 100644
index 43c5f02b6bd..00000000000
--- a/addons/point_of_sale/views/report_sessionsummary.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
-
-
-
-
-
Session Summary:
-
-
-
- Responsible:
-
-
-
- Point of Sale:
-
-
-
- Opening Date:
-
-
-
- Closing Date:
-
-
-
-
-
Statement Summary
-
-
-
-
- |
- Reference
- |
-
- Journal
- |
-
- Starting Balance
- |
-
- Total Transactions
- |
-
- Ending Balance
- |
-
- Difference
- |
-
- Currency
- |
-
- Status
- |
-
-
-
-
- |
- |
-
-
- |
-
-
- |
-
-
- |
-
-
- |
-
-
- |
- |
-
-
-
-
-
- Statement Details:
-
-
-
-
- | Date |
- Description |
- Reference |
- Partner |
- Account |
- Amount |
-
-
-
-
- |
- |
- |
- |
- |
-
-
- |
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/point_of_sale/wizard/__init__.py b/addons/point_of_sale/wizard/__init__.py
index 442fc2a4133..c708aa57677 100644
--- a/addons/point_of_sale/wizard/__init__.py
+++ b/addons/point_of_sale/wizard/__init__.py
@@ -2,7 +2,6 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import pos_box
-import pos_details
import pos_discount
import pos_open_statement
import pos_payment
diff --git a/addons/point_of_sale/wizard/pos_details.py b/addons/point_of_sale/wizard/pos_details.py
deleted file mode 100644
index afca493acca..00000000000
--- a/addons/point_of_sale/wizard/pos_details.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- coding: utf-8 -*-
-# Part of Odoo. See LICENSE file for full copyright and licensing details.
-
-import time
-from openerp.osv import osv, fields
-
-
-class pos_details(osv.osv_memory):
- _name = 'pos.details'
- _description = 'Sales Details'
-
- _columns = {
- 'date_start': fields.date('Date Start', required=True),
- 'date_end': fields.date('Date End', required=True),
- 'user_ids': fields.many2many('res.users', 'pos_details_report_user_rel', 'user_id', 'wizard_id', 'Salespeople'),
- }
- _defaults = {
- 'date_start': fields.date.context_today,
- 'date_end': fields.date.context_today,
- }
-
- def print_report(self, cr, uid, ids, context=None):
- """
- To get the date and print the report
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return : retrun report
- """
- if context is None:
- context = {}
- datas = {'ids': context.get('active_ids', [])}
- res = self.read(cr, uid, ids, ['date_start', 'date_end', 'user_ids'], context=context)
- res = res and res[0] or {}
- datas['form'] = res
- if res.get('id',False):
- datas['ids']=[res['id']]
- return self.pool['report'].get_action(cr, uid, [], 'point_of_sale.report_detailsofsales', data=datas, context=context)
diff --git a/addons/point_of_sale/wizard/pos_details.xml b/addons/point_of_sale/wizard/pos_details.xml
deleted file mode 100644
index 87950677e5e..00000000000
--- a/addons/point_of_sale/wizard/pos_details.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
- POS Details
- pos.details
-
-
-
-
-
-
-
- Sale Details
- ir.actions.act_window
- pos.details
- form
- form
- new
-
-
-
-
-