[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:
committed by
Jérome Maes
parent
e2b9e3b6f7
commit
6e6350cfbc
@@ -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()
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user