[IMP] sale: add 'confirmation_date' in reporting

What matters in sales reporting is the confirmation
date (signature, payment, etc), not the creation date.
All the sales reporting is based on order date
(= creation date). Most people need the confirmation
date (to grant commissions, etc.)
This commit is contained in:
Dhaval Panchal
2017-03-28 08:56:40 +02:00
committed by Jérome Maes
parent e2b9e3b6f7
commit 6e6350cfbc
2 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -69,7 +69,9 @@ class CrmTeam(models.Model):
self.browse(datum['team_id'][0]).invoiced = datum['amount_untaxed_signed']
def _graph_date_column(self):
if self.dashboard_graph_model in ['sales', 'invoices']:
if self.dashboard_graph_model == 'sales':
return 'confirmation_date'
elif self.dashboard_graph_model == 'invoices':
return 'date'
return super(CrmTeam, self)._graph_date_column()
+3
View File
@@ -14,6 +14,7 @@ class SaleReport(models.Model):
name = fields.Char('Order Reference', readonly=True)
date = fields.Datetime('Date Order', readonly=True)
confirmation_date = fields.Datetime('Confirmation Date', readonly=True)
product_id = fields.Many2one('product.product', 'Product', readonly=True)
product_uom = fields.Many2one('product.uom', 'Unit of Measure', readonly=True)
product_uom_qty = fields.Float('Qty Ordered', readonly=True)
@@ -58,6 +59,7 @@ class SaleReport(models.Model):
count(*) as nbr,
s.name as name,
s.date_order as date,
s.confirmation_date as confirmation_date,
s.state as state,
s.partner_id as partner_id,
s.user_id as user_id,
@@ -100,6 +102,7 @@ class SaleReport(models.Model):
t.categ_id,
s.name,
s.date_order,
s.confirmation_date,
s.partner_id,
s.user_id,
s.state,