Allow to go from lead to converted

When a sale is linked to a lead and then quoted, the lead should be converted.

issue4611
review15081002
This commit is contained in:
Cédric Krier
2015-03-10 23:57:35 +01:00
parent db0c32de73
commit b91ea47bed
+2 -2
View File
@@ -69,7 +69,6 @@ class SaleOpportunity(Workflow, ModelSQL, ModelView):
help='Estimated revenue amount')
payment_term = fields.Many2One('account.invoice.payment_term',
'Payment Term', states={
'required': Eval('state') == 'converted',
'readonly': In(Eval('state'),
['converted', 'lost', 'cancelled']),
},
@@ -157,6 +156,7 @@ class SaleOpportunity(Workflow, ModelSQL, ModelView):
('lead', 'opportunity'),
('lead', 'lost'),
('lead', 'cancelled'),
('lead', 'converted'),
('opportunity', 'converted'),
('opportunity', 'lead'),
('opportunity', 'lost'),
@@ -407,7 +407,7 @@ class SaleOpportunity(Workflow, ModelSQL, ModelView):
won.append(opportunity)
elif opportunity.is_lost():
lost.append(opportunity)
elif (opportunity.state in ['won', 'lost']
elif (opportunity.state != 'converted'
and opportunity.sales):
converted.append(opportunity)
cls.save(opportunities)