From 9c8d2f1ea9d8fa6b03c028227b99636187604b6c Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Tue, 28 May 2013 11:58:22 +0200 Subject: [PATCH] [REM] point_of_sale: removed by margin analysis that doesn't sound interestigng at all for a point of sale and that is not compliant with the new type of standard price (fields.property) bzr revid: qdp-launchpad@openerp.com-20130528095822-xxnubsv1mkgg78vu --- addons/point_of_sale/point_of_sale_view.xml | 130 ------------------ addons/point_of_sale/report/pos_report.py | 94 ------------- .../security/ir.model.access.csv | 2 - 3 files changed, 226 deletions(-) diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index 8a53015b7d7..79fe2fd736b 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -479,137 +479,7 @@ [('date_order','like',time.strftime('%Y-%m'))] - - - report.sales.by.margin.pos.form - report.sales.by.margin.pos - -
- - - - - - - - -
-
-
- - - - report.sales.by.margin.pos.tree - report.sales.by.margin.pos - - - - - - - - - - - - - - report.sales.by.margin.pos.calendar - report.sales.by.margin.pos - - - - - - - - - - - report.sales.by.margin.pos.graph - report.sales.by.margin.pos - - - - - - - - - - - Sales by User Daily margin - report.sales.by.margin.pos - form - tree,calendar,form,graph - [('date_order','=',time.strftime('%Y-%m-%d'))] - - - - report.sales.by.margin.pos.month.form - report.sales.by.margin.pos.month - -
- - - - - - - - -
-
-
- - - - report.sales.by.margin.pos.month.tree - report.sales.by.margin.pos.month - - - - - - - - - - - - - - report.sales.by.margin.pos.month.calendar - report.sales.by.margin.pos.month - - - - - - - - - - - report.sales.by.margin.pos.month.graph - report.sales.by.margin.pos.month - - - - - - - - - - - Sales by User Monthly margin - report.sales.by.margin.pos.month - form - tree,calendar,form,graph - [('date_order','like',time.strftime('%Y-%m'))] - product.normal.form.inherit diff --git a/addons/point_of_sale/report/pos_report.py b/addons/point_of_sale/report/pos_report.py index 11c31ea2691..abaa25f2fcd 100644 --- a/addons/point_of_sale/report/pos_report.py +++ b/addons/point_of_sale/report/pos_report.py @@ -139,99 +139,5 @@ class report_sales_by_user_pos_month(osv.osv): ) """) -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), - - } - #TODO: i don't think your join condition is correct, in all your reports because the company_id field on ir.property may be emtpy (not required) - #so you should take that into account in your query :-s - - 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-ip.value_float as net_margin_per_qty, - (pt.list_price-ip.value_float) *sum(pol.qty) as total - from - product_template as pt, - product_product as pp, - ir_property as ip, - 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 and - ip.name='standard_price' AND ip.res_id=CONCAT('product.template,',pt.id) AND ip.company_id=po.company_id - group by - pt.name, - pt.list_price, - ip.value_float, - po.user_id, - to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::text - - ) - """) - -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-ip.value_float as net_margin_per_qty, - (pt.list_price-ip.value_float) *sum(pol.qty) as total - from - product_template as pt, - ir_property as ip, - 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 and - ip.name='standard_price' AND ip.res_id=CONCAT('product.template,',pt.id) AND ip.company_id=po.company_id - group by - pt.name, - pt.list_price, - ip.value_float, - po.user_id, - to_char(date_trunc('month',po.date_order),'YYYY-MM-DD')::text - - ) - """) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/security/ir.model.access.csv b/addons/point_of_sale/security/ir.model.access.csv index 1d2c22053fb..d1f0657f49f 100644 --- a/addons/point_of_sale/security/ir.model.access.csv +++ b/addons/point_of_sale/security/ir.model.access.csv @@ -13,8 +13,6 @@ access_pos_order_stock_worker,pos.order stock_worker,model_pos_order,stock.group 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_sales_by_margin_pos,report.sales.by.margin.pos,model_report_sales_by_margin_pos,group_pos_user,1,0,0,0 -access_report_sales_by_margin_pos_month,report.sales.by.margin.pos.month,model_report_sales_by_margin_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_bank_statement,account.bank.statement,account.model_account_bank_statement,group_pos_user,1,1,1,0 access_account_bank_statement_manager,account.bank.statement manager,account.model_account_bank_statement,group_pos_manager,1,1,1,1