[FIX]crm: crm lead merge, add create_date in argument for sorting
bzr revid: dle@openerp.com-20130329115908-gjia2se2kgnkaahh
This commit is contained in:
parent
3679b0c44c
commit
58a31f00d8
|
@ -632,8 +632,8 @@ class crm_lead(base_stage, format_address, osv.osv):
|
|||
sequence = -1
|
||||
if opportunity.stage_id and opportunity.stage_id.state != 'cancel':
|
||||
sequence = opportunity.stage_id.sequence
|
||||
|
||||
sequenced_opps.append(((int(opportunity.type == 'opportunity'), sequence), opportunity))
|
||||
create_time_reverse = - time.mktime(datetime.strptime(opportunity.create_date, tools.DEFAULT_SERVER_DATETIME_FORMAT).timetuple())
|
||||
sequenced_opps.append(((int(opportunity.type == 'opportunity'), sequence, create_time_reverse), opportunity))
|
||||
|
||||
sequenced_opps.sort(reverse=True)
|
||||
opportunities = map(itemgetter(1), sequenced_opps)
|
||||
|
|
Loading…
Reference in New Issue