From b91ea47bed9bdb095354ac8cd3de8c3514302f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 10 Mar 2015 23:57:35 +0100 Subject: [PATCH] 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 --- opportunity.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opportunity.py b/opportunity.py index 500f8ae400..1bb56f53c4 100644 --- a/opportunity.py +++ b/opportunity.py @@ -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)