From b5164698f255633e68e6c3b75f30eae8492326dc Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Fri, 5 Dec 2014 10:44:53 +0100 Subject: [PATCH] [IMP] Reportings Review MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This commit fixes lots of usability problems in the reporting views. eg: missing fields in the reports, labelling inconsistencies, broken/outdated/unused filters and group bys... Detailed changelist ------------------- account/Invoice Analysis: - "Product Category" vs "Category of Product": labelling consistency - group by Analytic Account account_voucher/Sales Receipt Analysis: - remove filter on Pro-forma crm/Lead & Opportunities Analysis: - "Exp." vs "Expected": labelluing consistency crm/Phone Calls Analysis: - remove Todo and My Phone Call filters - fix My Sales Team(s) filter crm_claim/Claims Analysis - remove My Case(s) filter - fix My Company(s) filter - remove group by Sales Team - fix label Creation Month crm_helpdesk/Helpdesk Analysis - remove My Case(s) filter event/Events Analysis - remove My Events & Show Confirmed Registrations filters - fix labelling of Attendee / Contact group by hr_holidays/Leaves Analysis - remove My Requests filter hr_recruitment/Recruitment Analysis - remove My filter marketing_campaign/Campaign Analysis - fix labelling mrp_operations/Work Order Analysis - add fields Product Template, Product Category, Responsible, Routing and BoM - fix labelling group by Planned Month point_of_sale/Orders Analysis - add fields Product Template, Invoiced, Point of Sale, Public Category, Warehouse and Pricelist - fix Year filter project/Tasks Analysis: - remove My Task filter project/Issues Analysis: - remove My Issues filter - remove Task group by purchase/Purchase Analysis: - fix quantity field into float - add fields Product Template, Product Category, Partner Country, Fiscal Position, Analytic Account and Commercial Entity - add group by Partner Country and Fiscal Position - fix labelling "Product Category" vs "Category of product" sale/Sales Analysis - fix labelling "Product Category" vs "Category of product" - add fields Product Template, Paid, # of Paid Lines, Partner Countru and Commercial Entity - remove filter My Sales - add group by Partner Country sale_stock/Sales Analysis - fix label name of shipped_qty_1 Credits ------- Analysis and code courtesy of Sébastien Versailles, Quentin De Coninck, Yannick Tivisse and Richard Mathot {sve,qdc,yti,rim}@odoo.com (congratulations if you've read this boring commit message) --- addons/account/report/account_invoice_report.py | 11 +++++----- .../account/report/account_invoice_report_view.xml | 2 +- .../report/account_voucher_sales_receipt_view.xml | 1 - addons/crm/report/crm_lead_report.py | 2 +- addons/crm/report/crm_opportunity_report.py | 2 +- addons/crm/report/crm_opportunity_report_view.xml | 2 +- addons/crm/report/crm_phonecall_report.py | 2 +- addons/crm/report/crm_phonecall_report_view.xml | 5 +---- addons/crm_claim/report/crm_claim_report_view.xml | 6 ++--- .../report/crm_helpdesk_report_view.xml | 2 -- .../report/report_event_registration_view.xml | 7 +----- addons/hr_holidays/hr_holidays_view.xml | 2 -- .../report/hr_recruitment_report_view.xml | 1 - .../marketing_campaign/report/campaign_analysis.py | 8 +++---- .../report/campaign_analysis_view.xml | 2 +- .../report/mrp_workorder_analysis.py | 18 ++++++++++++--- .../report/mrp_workorder_analysis_view.xml | 2 +- addons/point_of_sale/report/pos_order_report.py | 21 +++++++++++++----- .../point_of_sale/report/pos_order_report_view.xml | 2 +- addons/project/report/project_report_view.xml | 1 - .../report/project_issue_report_view.xml | 2 -- addons/purchase/report/purchase_report.py | 23 +++++++++++++++----- addons/purchase/report/purchase_report_view.xml | 4 +++- addons/sale/report/sale_report.py | 23 ++++++++++++++++---- addons/sale/report/sale_report_view.xml | 4 ++-- addons/sale_stock/report/sale_report.py | 2 +- 26 files changed, 96 insertions(+), 61 deletions(-) diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index 0639bfca..70367de 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -62,7 +62,7 @@ class account_invoice_report(osv.osv): 'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], readonly=True), 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True), 'currency_id': fields.many2one('res.currency', 'Currency', readonly=True), - 'categ_id': fields.many2one('product.category','Category of Product', readonly=True), + 'categ_id': fields.many2one('product.category','Product Category', readonly=True), 'journal_id': fields.many2one('account.journal', 'Journal', readonly=True), 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True), 'commercial_partner_id': fields.many2one('res.partner', 'Partner Company', help="Commercial Entity"), @@ -95,6 +95,7 @@ class account_invoice_report(osv.osv): 'residual': fields.float('Total Residual', readonly=True), 'user_currency_residual': fields.function(_compute_amounts_in_user_currency, string="Total Residual", type='float', digits_compute=dp.get_precision('Account'), multi="_compute_amounts"), 'country_id': fields.many2one('res.country', 'Country of the Partner Company'), + 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True), } _order = 'date desc' @@ -107,7 +108,7 @@ class account_invoice_report(osv.osv): ], 'account.invoice.line': [ 'account_id', 'invoice_id', 'price_subtotal', 'product_id', - 'quantity', 'uos_id', + 'quantity', 'uos_id', 'account_analytic_id', ], 'product.product': ['product_tmpl_id'], 'product.template': ['categ_id'], @@ -118,7 +119,7 @@ class account_invoice_report(osv.osv): def _select(self): select_str = """ - SELECT sub.id, sub.date, sub.product_id, sub.partner_id, sub.country_id, + SELECT sub.id, sub.date, sub.product_id, sub.partner_id, sub.country_id, sub.account_analytic_id, sub.payment_term, sub.period_id, sub.uom_name, sub.currency_id, sub.journal_id, sub.fiscal_position, sub.user_id, sub.company_id, sub.nbr, sub.type, sub.state, sub.categ_id, sub.date_due, sub.account_id, sub.account_line_id, sub.partner_bank_id, @@ -131,7 +132,7 @@ class account_invoice_report(osv.osv): select_str = """ SELECT min(ail.id) AS id, ai.date_invoice AS date, - ail.product_id, ai.partner_id, ai.payment_term, ai.period_id, + ail.product_id, ai.partner_id, ai.payment_term, ai.period_id, ail.account_analytic_id, CASE WHEN u.uom_type::text <> 'reference'::text THEN ( SELECT product_uom.name @@ -201,7 +202,7 @@ class account_invoice_report(osv.osv): def _group_by(self): group_by_str = """ - GROUP BY ail.product_id, ai.date_invoice, ai.id, + GROUP BY ail.product_id, ail.account_analytic_id, ai.date_invoice, ai.id, ai.partner_id, ai.payment_term, ai.period_id, u.name, ai.currency_id, ai.journal_id, ai.fiscal_position, ai.user_id, ai.company_id, ai.type, ai.state, pt.categ_id, ai.date_due, ai.account_id, ail.account_id, ai.partner_bank_id, ai.residual, diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index aec1aa1..06c9628 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -74,7 +74,7 @@ - + diff --git a/addons/account_voucher/report/account_voucher_sales_receipt_view.xml b/addons/account_voucher/report/account_voucher_sales_receipt_view.xml index 5621da6..69473dc 100644 --- a/addons/account_voucher/report/account_voucher_sales_receipt_view.xml +++ b/addons/account_voucher/report/account_voucher_sales_receipt_view.xml @@ -21,7 +21,6 @@ - diff --git a/addons/crm/report/crm_lead_report.py b/addons/crm/report/crm_lead_report.py index 73bd049..7a398d7 100644 --- a/addons/crm/report/crm_lead_report.py +++ b/addons/crm/report/crm_lead_report.py @@ -32,7 +32,7 @@ class crm_lead_report(osv.Model): _inherit = ["crm.tracking.mixin"] _columns = { - 'date_deadline': fields.date('Exp. Closing', readonly=True, help="Expected Closing"), + 'date_deadline': fields.date('Expected Closing', readonly=True), 'create_date': fields.datetime('Creation Date', readonly=True), 'opening_date': fields.datetime('Assignation Date', readonly=True), 'date_closed': fields.datetime('Close Date', readonly=True), diff --git a/addons/crm/report/crm_opportunity_report.py b/addons/crm/report/crm_opportunity_report.py index 318e2e5..3db5bd7 100644 --- a/addons/crm/report/crm_opportunity_report.py +++ b/addons/crm/report/crm_opportunity_report.py @@ -33,7 +33,7 @@ class crm_opportunity_report(osv.Model): _inherit = ["crm.tracking.mixin"] _columns = { - 'date_deadline': fields.date('Exp. Closing', readonly=True, help="Expected Closing"), + 'date_deadline': fields.date('Expected Closing', readonly=True), 'create_date': fields.datetime('Creation Date', readonly=True), 'opening_date': fields.datetime('Assignation Date', readonly=True), 'date_closed': fields.datetime('Close Date', readonly=True), diff --git a/addons/crm/report/crm_opportunity_report_view.xml b/addons/crm/report/crm_opportunity_report_view.xml index 2b4805c..936ac8c 100644 --- a/addons/crm/report/crm_opportunity_report_view.xml +++ b/addons/crm/report/crm_opportunity_report_view.xml @@ -94,7 +94,7 @@ - + diff --git a/addons/crm/report/crm_phonecall_report.py b/addons/crm/report/crm_phonecall_report.py index 58b34df..a1a048b 100644 --- a/addons/crm/report/crm_phonecall_report.py +++ b/addons/crm/report/crm_phonecall_report.py @@ -41,7 +41,7 @@ class crm_phonecall_report(osv.osv): _columns = { 'user_id':fields.many2one('res.users', 'User', readonly=True), - 'team_id':fields.many2one('crm.team', 'team', oldname='section_id', readonly=True), + 'team_id':fields.many2one('crm.team', 'Sales Team', oldname='section_id', readonly=True), 'priority': fields.selection([('0','Low'), ('1','Normal'), ('2','High')], 'Priority'), 'nbr': fields.integer('# of Cases', readonly=True), # TDE FIXME master: rename into nbr_cases 'state': fields.selection(AVAILABLE_STATES, 'Status', readonly=True), diff --git a/addons/crm/report/crm_phonecall_report_view.xml b/addons/crm/report/crm_phonecall_report_view.xml index 1401ec9..b646171 100644 --- a/addons/crm/report/crm_phonecall_report_view.xml +++ b/addons/crm/report/crm_phonecall_report_view.xml @@ -48,17 +48,14 @@ crm.phonecall.report - - - diff --git a/addons/crm_claim/report/crm_claim_report_view.xml b/addons/crm_claim/report/crm_claim_report_view.xml index accc981..6bb6db5 100644 --- a/addons/crm_claim/report/crm_claim_report_view.xml +++ b/addons/crm_claim/report/crm_claim_report_view.xml @@ -31,10 +31,9 @@ crm.claim.report - - + @@ -52,13 +51,12 @@ - - + diff --git a/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml b/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml index 6dd1f57..8fa29e5 100644 --- a/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml +++ b/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml @@ -28,8 +28,6 @@ - - diff --git a/addons/event/report/report_event_registration_view.xml b/addons/event/report/report_event_registration_view.xml index 5d5cd1d..6fff896 100644 --- a/addons/event/report/report_event_registration_view.xml +++ b/addons/event/report/report_event_registration_view.xml @@ -23,7 +23,6 @@ - @@ -32,7 +31,7 @@ - + @@ -40,10 +39,6 @@ - - - diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index e9820fa..c9626a8 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -33,8 +33,6 @@ - - diff --git a/addons/hr_recruitment/report/hr_recruitment_report_view.xml b/addons/hr_recruitment/report/hr_recruitment_report_view.xml index 9a39653..62d23da 100644 --- a/addons/hr_recruitment/report/hr_recruitment_report_view.xml +++ b/addons/hr_recruitment/report/hr_recruitment_report_view.xml @@ -43,7 +43,6 @@ - diff --git a/addons/marketing_campaign/report/campaign_analysis.py b/addons/marketing_campaign/report/campaign_analysis.py index f09ed96..d0db24b 100644 --- a/addons/marketing_campaign/report/campaign_analysis.py +++ b/addons/marketing_campaign/report/campaign_analysis.py @@ -45,14 +45,14 @@ class campaign_analysis(osv.osv): return result _columns = { 'res_id' : fields.integer('Resource', readonly=True), - 'year': fields.char('Year', size=4, readonly=True), + 'year': fields.char('Execution 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=10, readonly=True), - 'date': fields.date('Date', readonly=True, select=True), + 'Execution Month', readonly=True), + 'day': fields.char('Execution Day', size=10, readonly=True), + 'date': fields.date('Execution Date', readonly=True, select=True), 'campaign_id': fields.many2one('marketing.campaign', 'Campaign', readonly=True), 'activity_id': fields.many2one('marketing.campaign.activity', 'Activity', diff --git a/addons/marketing_campaign/report/campaign_analysis_view.xml b/addons/marketing_campaign/report/campaign_analysis_view.xml index 1ee0eac..43a43c7 100644 --- a/addons/marketing_campaign/report/campaign_analysis_view.xml +++ b/addons/marketing_campaign/report/campaign_analysis_view.xml @@ -56,7 +56,7 @@ - + diff --git a/addons/mrp_operations/report/mrp_workorder_analysis.py b/addons/mrp_operations/report/mrp_workorder_analysis.py index cc701e2..4b70785 100644 --- a/addons/mrp_operations/report/mrp_workorder_analysis.py +++ b/addons/mrp_operations/report/mrp_workorder_analysis.py @@ -31,13 +31,18 @@ class mrp_workorder(osv.osv): 'nbr': fields.integer('# of Lines', readonly=True), # TDE FIXME master: rename into nbr_lines 'date': fields.date('Date', readonly=True), 'product_id': fields.many2one('product.product', 'Product', readonly=True), + 'product_tmpl_id': fields.many2one('product.template', 'Product Template', readonly=True), + 'category_id': fields.many2one('product.category', 'Product Category', readonly=True), 'product_qty': fields.float('Product Qty', digits_compute=dp.get_precision('Product Unit of Measure'), readonly=True), 'state': fields.selection([('draft','Draft'),('startworking', 'In Progress'),('pause','Pause'),('cancel','Cancelled'),('done','Finished')], 'Status', readonly=True), 'total_hours': fields.float('Total Hours', readonly=True), 'total_cycles': fields.float('Total Cycles', readonly=True), 'delay': fields.float('Delay', readonly=True), 'production_id': fields.many2one('mrp.production', 'Production', readonly=True), - 'workcenter_id': fields.many2one('mrp.workcenter', 'Work Center', readonly=True) + 'workcenter_id': fields.many2one('mrp.workcenter', 'Work Center', readonly=True), + 'user_id': fields.many2one('res.users', 'Responsible'), + 'routing_id': fields.many2one('mrp.routing', string='Routing', readonly=True), + 'bom_id': fields.many2one('mrp.bom', 'Bill of Material', readonly=True), } def init(self, cr): @@ -48,6 +53,8 @@ class mrp_workorder(osv.osv): date(wl.date_planned) as date, min(wl.id) as id, mp.product_id as product_id, + p.product_tmpl_id, + t.categ_id as category_id, sum(wl.hour) as total_hours, avg(wl.delay) as delay, (w.costs_hour*sum(wl.hour)) as total_cost, @@ -56,12 +63,17 @@ class mrp_workorder(osv.osv): sum(wl.cycle) as total_cycles, count(*) as nbr, sum(mp.product_qty) as product_qty, - wl.state as state + wl.state as state, + mp.user_id, + mp.routing_id, + mp.bom_id from mrp_production_workcenter_line wl left join mrp_workcenter w on (w.id = wl.workcenter_id) left join mrp_production mp on (mp.id = wl.production_id) + left join product_product p on (mp.product_id=p.id) + left join product_template t on (p.product_tmpl_id=t.id) group by - w.costs_hour, mp.product_id, mp.name, wl.state, wl.date_planned, wl.production_id, wl.workcenter_id + w.costs_hour, mp.product_id, mp.name, mp.user_id, mp.routing_id, mp.bom_id, wl.state, wl.date_planned, wl.production_id, wl.workcenter_id, p.product_tmpl_id, t.categ_id )""") diff --git a/addons/mrp_operations/report/mrp_workorder_analysis_view.xml b/addons/mrp_operations/report/mrp_workorder_analysis_view.xml index 0d46952..da41d9e2 100644 --- a/addons/mrp_operations/report/mrp_workorder_analysis_view.xml +++ b/addons/mrp_operations/report/mrp_workorder_analysis_view.xml @@ -57,7 +57,7 @@ - + diff --git a/addons/point_of_sale/report/pos_order_report.py b/addons/point_of_sale/report/pos_order_report.py index aa25052..58e03da 100644 --- a/addons/point_of_sale/report/pos_order_report.py +++ b/addons/point_of_sale/report/pos_order_report.py @@ -31,6 +31,7 @@ class pos_order_report(osv.osv): 'date': fields.datetime('Date Order', readonly=True), 'partner_id':fields.many2one('res.partner', 'Partner', readonly=True), 'product_id':fields.many2one('product.product', 'Product', readonly=True), + 'product_tmpl_id': fields.many2one('product.template', 'Product Template', readonly=True), 'state': fields.selection([('draft', 'New'), ('paid', 'Closed'), ('done', 'Synchronized'), ('invoiced', 'Invoiced'), ('cancel', 'Cancelled')], 'Status'), 'user_id':fields.many2one('res.users', 'Salesperson', readonly=True), @@ -44,6 +45,11 @@ class pos_order_report(osv.osv): 'journal_id': fields.many2one('account.journal', 'Journal'), 'delay_validation': fields.integer('Delay Validation'), 'product_categ_id': fields.many2one('product.category', 'Product Category', readonly=True), + 'invoiced': fields.boolean('Invoiced', readonly=True), + 'config_id' : fields.many2one('pos.config', 'Point of Sale', readonly=True), + '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), } _order = 'date desc' @@ -67,17 +73,22 @@ class pos_order_report(osv.osv): s.company_id as company_id, s.sale_journal as journal_id, l.product_id as product_id, - pt.categ_id as product_categ_id + pt.categ_id as product_categ_id, + p.product_tmpl_id, + ps.config_id, + pt.pos_categ_id, + pc.stock_location_id, + s.pricelist_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) left join product_product p on (l.product_id=p.id) left join product_template pt on (p.product_tmpl_id=pt.id) left join product_uom u on (u.id=pt.uom_id) + left join pos_session ps on (s.session_id=ps.id) + 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,l.product_id,s.create_date + 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)""") - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/report/pos_order_report_view.xml b/addons/point_of_sale/report/pos_order_report_view.xml index d184971..d2b4774 100644 --- a/addons/point_of_sale/report/pos_order_report_view.xml +++ b/addons/point_of_sale/report/pos_order_report_view.xml @@ -23,7 +23,7 @@ - + diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml index d118ef2..80098bc 100644 --- a/addons/project/report/project_report_view.xml +++ b/addons/project/report/project_report_view.xml @@ -50,7 +50,6 @@ - diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml index fb42c50..d6be22bd 100644 --- a/addons/project_issue/report/project_issue_report_view.xml +++ b/addons/project_issue/report/project_issue_report_view.xml @@ -37,14 +37,12 @@ - - diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py index 263084f..338248d 100644 --- a/addons/purchase/report/purchase_report.py +++ b/addons/purchase/report/purchase_report.py @@ -52,14 +52,18 @@ class purchase_report(osv.osv): 'user_id':fields.many2one('res.users', 'Responsible', readonly=True), 'delay':fields.float('Days to Validate', digits=(16,2), readonly=True), 'delay_pass':fields.float('Days to Deliver', digits=(16,2), readonly=True), - 'quantity': fields.integer('Unit Quantity', readonly=True), # TDE FIXME master: rename into unit_quantity + 'quantity': fields.float('Product Quantity', readonly=True), # TDE FIXME master: rename into unit_quantity 'price_total': fields.float('Total Price', readonly=True), 'price_average': fields.float('Average Price', readonly=True, group_operator="avg"), 'negociation': fields.float('Purchase-Standard Price', readonly=True, group_operator="avg"), 'price_standard': fields.float('Products Value', readonly=True, group_operator="sum"), 'nbr': fields.integer('# of Lines', readonly=True), # TDE FIXME master: rename into nbr_lines - 'category_id': fields.many2one('product.category', 'Category', readonly=True) - + 'category_id': fields.many2one('product.category', 'Product Category', readonly=True), + 'product_tmpl_id': fields.many2one('product.template', 'Product Template', readonly=True), + 'country_id': fields.many2one('res.country', 'Partner Country', readonly=True), + 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True), + 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True), + 'commercial_partner_id': fields.many2one('res.partner', 'Commercial Entity', readonly=True), } _order = 'date desc, price_total desc' def init(self, cr): @@ -79,7 +83,9 @@ class purchase_report(osv.osv): s.partner_id as partner_id, s.create_uid as user_id, s.company_id as company_id, + s.fiscal_position as fiscal_position, l.product_id, + p.product_tmpl_id, t.categ_id as category_id, t.uom_id as product_uom, s.location_id as location_id, @@ -90,9 +96,12 @@ class purchase_report(osv.osv): sum(l.price_unit*l.product_qty)::decimal(16,2) as price_total, avg(100.0 * (l.price_unit*l.product_qty) / NULLIF(ip.value_float*l.product_qty/u.factor*u2.factor, 0.0))::decimal(16,2) as negociation, sum(ip.value_float*l.product_qty/u.factor*u2.factor)::decimal(16,2) as price_standard, - (sum(l.product_qty*l.price_unit)/NULLIF(sum(l.product_qty/u.factor*u2.factor),0.0))::decimal(16,2) as price_average + (sum(l.product_qty*l.price_unit)/NULLIF(sum(l.product_qty/u.factor*u2.factor),0.0))::decimal(16,2) as price_average, + partner.country_id as country_id, + partner.commercial_partner_id as commercial_partner_id from purchase_order_line l join purchase_order s on (l.order_id=s.id) + join res_partner partner on s.partner_id = partner.id left join product_product p on (l.product_id=p.id) left join product_template t on (p.product_tmpl_id=t.id) LEFT JOIN ir_property ip ON (ip.name='standard_price' AND ip.res_id=CONCAT('product.template,',t.id) AND ip.company_id=s.company_id) @@ -112,7 +121,9 @@ class purchase_report(osv.osv): s.pricelist_id, s.validator, s.dest_address_id, + s.fiscal_position, l.product_id, + p.product_tmpl_id, t.categ_id, s.date_order, s.state, @@ -121,7 +132,9 @@ class purchase_report(osv.osv): u.category_id, t.uom_id, u.id, - u2.factor + u2.factor, + partner.country_id, + partner.commercial_partner_id ) """) diff --git a/addons/purchase/report/purchase_report_view.xml b/addons/purchase/report/purchase_report_view.xml index 159268f..c60e3d6 100644 --- a/addons/purchase/report/purchase_report_view.xml +++ b/addons/purchase/report/purchase_report_view.xml @@ -60,12 +60,14 @@ + - + + diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py index bb32fd3..341a82d 100644 --- a/addons/sale/report/sale_report.py +++ b/addons/sale/report/sale_report.py @@ -40,7 +40,8 @@ class sale_report(osv.osv): 'user_id': fields.many2one('res.users', 'Salesperson', readonly=True), 'price_total': fields.float('Total Price', readonly=True), 'delay': fields.float('Commitment Delay', digits=(16,2), readonly=True), - 'categ_id': fields.many2one('product.category','Category of Product', readonly=True), + 'product_tmpl_id': fields.many2one('product.template', 'Product Template', readonly=True), + 'categ_id': fields.many2one('product.category','Product Category', readonly=True), 'nbr': fields.integer('# of Lines', readonly=True), # TDE FIXME master: rename into nbr_lines 'state': fields.selection([ ('draft', 'Quotation'), @@ -53,7 +54,11 @@ class sale_report(osv.osv): ], 'Order Status', readonly=True), 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', readonly=True), 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True), - 'team_id': fields.many2one('crm.team', 'Sales Team', oldname='section_id'), + 'invoiced': fields.boolean('Paid', readonly=True), + 'nbr_paid': fields.integer('# of Paid Lines', readonly=True), + 'team_id': fields.many2one('crm.team', 'Sales Team', readonly=True, oldname='section_id'), + 'country_id': fields.many2one('res.country', 'Partner Country', readonly=True), + 'commercial_partner_id': fields.many2one('res.partner', 'Commercial Entity', readonly=True), } _order = 'date desc' @@ -75,7 +80,12 @@ class sale_report(osv.osv): t.categ_id as categ_id, s.pricelist_id as pricelist_id, s.project_id as analytic_account_id, - s.team_id as team_id + s.team_id as team_id, + p.product_tmpl_id, + l.invoiced::integer as nbr_paid, + l.invoiced, + partner.country_id as country_id, + partner.commercial_partner_id as commercial_partner_id """ return select_str @@ -83,6 +93,7 @@ class sale_report(osv.osv): from_str = """ sale_order_line l join sale_order s on (l.order_id=s.id) + join res_partner partner on s.partner_id = partner.id left join product_product p on (l.product_id=p.id) left join product_template t on (p.product_tmpl_id=t.id) left join product_uom u on (u.id=l.product_uom) @@ -104,7 +115,11 @@ class sale_report(osv.osv): s.state, s.pricelist_id, s.project_id, - s.team_id + s.team_id, + p.product_tmpl_id, + l.invoiced, + partner.country_id, + partner.commercial_partner_id """ return group_by_str diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml index 7ddeaf0..92e8aaa 100644 --- a/addons/sale/report/sale_report_view.xml +++ b/addons/sale/report/sale_report_view.xml @@ -52,7 +52,6 @@ - @@ -63,8 +62,9 @@ + - + diff --git a/addons/sale_stock/report/sale_report.py b/addons/sale_stock/report/sale_report.py index 2d126fc..923d7c5 100644 --- a/addons/sale_stock/report/sale_report.py +++ b/addons/sale_stock/report/sale_report.py @@ -26,7 +26,7 @@ class sale_report(osv.osv): _inherit = "sale.report" _columns = { 'shipped': fields.boolean('Shipped', readonly=True), - 'shipped_qty_1': fields.integer('Shipped', readonly=True), + 'shipped_qty_1': fields.integer('# of Shipped Lines', readonly=True), 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse',readonly=True), 'state': fields.selection([ ('draft', 'Quotation'), -- 1.7.10.4