LEFT | RIGHT |
1 #This file is part of Tryton. The COPYRIGHT file at the top level of | 1 #This file is part of Tryton. The COPYRIGHT file at the top level of |
2 #this repository contains the full copyright notices and license terms. | 2 #this repository contains the full copyright notices and license terms. |
3 "Sales extension for managing leads and opportunities" | 3 "Sales extension for managing leads and opportunities" |
4 from trytond.model import ModelView, ModelSQL, ModelWorkflow, fields | 4 from trytond.model import ModelView, ModelSQL, ModelWorkflow, fields |
5 from trytond.pyson import Equal, Eval, Not, In, If, Get | 5 from trytond.pyson import Equal, Eval, Not, In, If, Get |
6 import datetime | 6 import datetime |
7 | 7 |
8 STATES = [('lead', 'Open Lead'), | 8 STATES = [('lead', 'Lead'), |
9 ('opportunity', 'Opportunity'), | 9 ('opportunity', 'Opportunity'), |
10 ('converted', 'Converted'), | 10 ('converted', 'Converted'), |
11 ('cancel', 'Cancelled'), | 11 ('cancel', 'Cancelled'), |
12 ('lost', 'Lost'), | 12 ('lost', 'Lost'), |
13 ] | 13 ] |
14 _STATES_LEAD = {'readonly': Not(Equal(Eval('state'), 'lead')), } | 14 _STATES_LEAD = {'readonly': Not(Equal(Eval('state'), 'lead')), } |
15 _STATES_CONVERTED = {'readonly': Equal(Eval('state'), 'converted'), } | 15 _STATES_CONVERTED = {'readonly': Equal(Eval('state'), 'converted'), } |
16 | 16 |
17 class SaleOpportunity(ModelWorkflow, ModelSQL, ModelView): | 17 class SaleOpportunity(ModelWorkflow, ModelSQL, ModelView): |
18 'Sale Opportunity' | 18 'Sale Opportunity' |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 write_uid, | 158 write_uid, |
159 COALESCE(write_date, create_date) AS date, | 159 COALESCE(write_date, create_date) AS date, |
160 COALESCE(write_uid,create_uid) AS user, | 160 COALESCE(write_uid,create_uid) AS user, |
161 title,· | 161 title,· |
162 state,· | 162 state,· |
163 probability """ | 163 probability """ |
164 'FROM "%s__history"' % opportunity_object._table | 164 'FROM "%s__history"' % opportunity_object._table |
165 , []) | 165 , []) |
166 | 166 |
167 SaleOpportunityHistoryLines() | 167 SaleOpportunityHistoryLines() |
LEFT | RIGHT |