Merge lp:~openerp-dev/openobject-addons/trunk-stage-vs-status-with-new-warning-tpa into lp:openobject-addons
- trunk-stage-vs-status-with-new-warning-tpa
- Merge into trunk
Proposed by
Anto
Status: | Needs review |
---|---|
Proposed branch: | lp:~openerp-dev/openobject-addons/trunk-stage-vs-status-with-new-warning-tpa |
Merge into: | lp:openobject-addons |
Diff against target: |
616 lines (+173/-30) 18 files modified
base_status/__openerp__.py (+1/-0) base_status/base_stage.py (+5/-3) base_status/static/src/css/base_status.css (+6/-0) crm/crm.py (+14/-0) crm/crm_lead.py (+2/-0) crm/crm_lead_data.xml (+4/-0) crm/crm_view.xml (+15/-6) crm_claim/crm_claim.py (+17/-0) crm_claim/crm_claim_data.xml (+3/-0) crm_claim/crm_claim_view.xml (+17/-9) hr_recruitment/hr_recruitment.py (+20/-0) hr_recruitment/hr_recruitment_data.xml (+9/-0) hr_recruitment/hr_recruitment_view.xml (+15/-4) project/project.py (+20/-1) project/project_data.xml (+4/-0) project/project_view.xml (+17/-5) project_issue/project_issue.py (+2/-0) project_issue/test/issue_demo.yml (+2/-2) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-addons/trunk-stage-vs-status-with-new-warning-tpa |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Anto | Pending | ||
Review via email: mp+150510@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Unmerged revisions
- 8570. By Turkesh Patel (openERP)
-
[IMP] improved code of warning
- 8569. By Turkesh Patel (openERP)
-
[MRG] merge with lp:openobject-addons
- 8568. By Turkesh Patel (openERP)
-
[IMP] improve warnings related to stages.
- 8567. By Turkesh Patel (openERP)
-
[IMP] improved code.
- 8566. By Turkesh Patel (openERP)
-
[IMP] hr_recruitment: improved code
- 8565. By Turkesh Patel (openERP)
-
[IMP] project_issue: improve yml.
- 8564. By Turkesh Patel (openERP)
-
[MRG] merge with lp:openobject-addons
- 8563. By Turkesh Patel (openERP)
-
[IMP] project_issue: add warning.
- 8562. By Turkesh Patel (openERP)
-
[IMP] project:improved code
- 8561. By Turkesh Patel (openERP)
-
[IMP] improved wrningstring and default values
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'base_status/__openerp__.py' | |||
2 | --- base_status/__openerp__.py 2012-11-29 22:26:45 +0000 | |||
3 | +++ base_status/__openerp__.py 2013-02-26 09:48:36 +0000 | |||
4 | @@ -35,6 +35,7 @@ | |||
5 | 35 | 'depends': ['base'], | 35 | 'depends': ['base'], |
6 | 36 | 'data': [], | 36 | 'data': [], |
7 | 37 | 'demo': [], | 37 | 'demo': [], |
8 | 38 | 'css': ['static/src/css/base_status.css'], | ||
9 | 38 | 'installable': True, | 39 | 'installable': True, |
10 | 39 | 'auto_install': False, | 40 | 'auto_install': False, |
11 | 40 | } | 41 | } |
12 | 41 | 42 | ||
13 | === modified file 'base_status/base_stage.py' | |||
14 | --- base_status/base_stage.py 2012-12-21 13:48:10 +0000 | |||
15 | +++ base_status/base_stage.py 2013-02-26 09:48:36 +0000 | |||
16 | @@ -108,6 +108,7 @@ | |||
17 | 108 | 108 | ||
18 | 109 | def _get_default_stage_id(self, cr, uid, context=None): | 109 | def _get_default_stage_id(self, cr, uid, context=None): |
19 | 110 | """ Gives default stage_id """ | 110 | """ Gives default stage_id """ |
20 | 111 | context.update({'state_name': 'draft',}) | ||
21 | 111 | return self.stage_find(cr, uid, [], None, [('state', '=', 'draft')], context=context) | 112 | return self.stage_find(cr, uid, [], None, [('state', '=', 'draft')], context=context) |
22 | 112 | 113 | ||
23 | 113 | def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None): | 114 | def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None): |
24 | @@ -135,6 +136,7 @@ | |||
25 | 135 | """ | 136 | """ |
26 | 136 | if isinstance(cases, (int, long)): | 137 | if isinstance(cases, (int, long)): |
27 | 137 | cases = self.browse(cr, uid, cases, context=context) | 138 | cases = self.browse(cr, uid, cases, context=context) |
28 | 139 | context.update({'state_name': state_name,}) | ||
29 | 138 | for case in cases: | 140 | for case in cases: |
30 | 139 | stage_id = self.stage_find(cr, uid, [case], None, [('state', '=', state_name)], context=context) | 141 | stage_id = self.stage_find(cr, uid, [case], None, [('state', '=', state_name)], context=context) |
31 | 140 | if stage_id: | 142 | if stage_id: |
32 | @@ -254,10 +256,10 @@ | |||
33 | 254 | """ | 256 | """ |
34 | 255 | cases = self.browse(cr, uid, ids, context=context) | 257 | cases = self.browse(cr, uid, ids, context=context) |
35 | 256 | # 1. update the stage | 258 | # 1. update the stage |
37 | 257 | if new_state_name: | 259 | if not (new_stage_id is None): |
38 | 260 | self.stage_set(cr, uid, ids, new_stage_id, context=context) | ||
39 | 261 | elif new_state_name: | ||
40 | 258 | self.stage_set_with_state_name(cr, uid, cases, new_state_name, context=context) | 262 | self.stage_set_with_state_name(cr, uid, cases, new_state_name, context=context) |
41 | 259 | elif not (new_stage_id is None): | ||
42 | 260 | self.stage_set(cr, uid, ids, new_stage_id, context=context) | ||
43 | 261 | # 2. update values | 263 | # 2. update values |
44 | 262 | if values_to_update: | 264 | if values_to_update: |
45 | 263 | self.write(cr, uid, ids, values_to_update, context=context) | 265 | self.write(cr, uid, ids, values_to_update, context=context) |
46 | 264 | 266 | ||
47 | === added directory 'base_status/static' | |||
48 | === added directory 'base_status/static/src' | |||
49 | === added directory 'base_status/static/src/css' | |||
50 | === added file 'base_status/static/src/css/base_status.css' | |||
51 | --- base_status/static/src/css/base_status.css 1970-01-01 00:00:00 +0000 | |||
52 | +++ base_status/static/src/css/base_status.css 2013-02-26 09:48:36 +0000 | |||
53 | @@ -0,0 +1,6 @@ | |||
54 | 1 | .openerp .oe_stage_status_alert textarea { | ||
55 | 2 | background-color: #ffc7c7; | ||
56 | 3 | padding: 10px; | ||
57 | 4 | height: 1em; | ||
58 | 5 | margin-bottom: 20px; | ||
59 | 6 | } | ||
60 | 0 | 7 | ||
61 | === modified file 'crm/crm.py' | |||
62 | --- crm/crm.py 2012-12-18 09:32:41 +0000 | |||
63 | +++ crm/crm.py 2013-02-26 09:48:36 +0000 | |||
64 | @@ -87,6 +87,10 @@ | |||
65 | 87 | ('both', 'Both')], | 87 | ('both', 'Both')], |
66 | 88 | string='Type', size=16, required=True, | 88 | string='Type', size=16, required=True, |
67 | 89 | help="This field is used to distinguish stages related to Leads from stages related to Opportunities, or to specify stages available for both types."), | 89 | help="This field is used to distinguish stages related to Leads from stages related to Opportunities, or to specify stages available for both types."), |
68 | 90 | 'draft_state': fields.boolean('This stage contains newly created documents', help="This stage contains newly created documents."), | ||
69 | 91 | 'done_state': fields.boolean('This stage contains closed documents', help="This stage contains closed documents."), | ||
70 | 92 | 'cancel_state': fields.boolean('This stage contains cancelled documents', help="This stage contains cancelled documents."), | ||
71 | 93 | 'alert': fields.text('Alert Message',readonly=True), | ||
72 | 90 | } | 94 | } |
73 | 91 | 95 | ||
74 | 92 | _defaults = { | 96 | _defaults = { |
75 | @@ -96,8 +100,18 @@ | |||
76 | 96 | 'fold': False, | 100 | 'fold': False, |
77 | 97 | 'type': 'both', | 101 | 'type': 'both', |
78 | 98 | 'case_default': True, | 102 | 'case_default': True, |
79 | 103 | 'alert': "If you do not select any of the boolean field then this stage will be considered as 'In Progress.'", | ||
80 | 99 | } | 104 | } |
81 | 100 | 105 | ||
82 | 106 | def onchange_stage_state(self, cr, uid, ids, draft_state, done_state, cancel_state, context=None): | ||
83 | 107 | if draft_state: | ||
84 | 108 | return {'value':{'state':'draft', 'done_state': False, 'cancel_state': False}} | ||
85 | 109 | if done_state: | ||
86 | 110 | return {'value':{'state':'done', 'draft_state': False, 'cancel_state': False}} | ||
87 | 111 | if cancel_state: | ||
88 | 112 | return {'value':{'state':'cancel', 'done_state': False, 'draft_state': False}} | ||
89 | 113 | return {'value':{'state':'open', 'draft_state': False, 'cancel_state': False, 'done_state': False}} | ||
90 | 114 | |||
91 | 101 | class crm_case_section(osv.osv): | 115 | class crm_case_section(osv.osv): |
92 | 102 | """ Model for sales teams. """ | 116 | """ Model for sales teams. """ |
93 | 103 | _name = "crm.case.section" | 117 | _name = "crm.case.section" |
94 | 104 | 118 | ||
95 | === modified file 'crm/crm_lead.py' | |||
96 | --- crm/crm_lead.py 2013-02-21 10:52:47 +0000 | |||
97 | +++ crm/crm_lead.py 2013-02-26 09:48:36 +0000 | |||
98 | @@ -102,6 +102,7 @@ | |||
99 | 102 | 102 | ||
100 | 103 | def _get_default_stage_id(self, cr, uid, context=None): | 103 | def _get_default_stage_id(self, cr, uid, context=None): |
101 | 104 | """ Gives default stage_id """ | 104 | """ Gives default stage_id """ |
102 | 105 | context.update({'state_name': 'draft',}) | ||
103 | 105 | section_id = self._get_default_section_id(cr, uid, context=context) | 106 | section_id = self._get_default_section_id(cr, uid, context=context) |
104 | 106 | return self.stage_find(cr, uid, [], section_id, [('state', '=', 'draft')], context=context) | 107 | return self.stage_find(cr, uid, [], section_id, [('state', '=', 'draft')], context=context) |
105 | 107 | 108 | ||
106 | @@ -408,6 +409,7 @@ | |||
107 | 408 | stage_ids = self.pool.get('crm.case.stage').search(cr, uid, search_domain, order=order, context=context) | 409 | stage_ids = self.pool.get('crm.case.stage').search(cr, uid, search_domain, order=order, context=context) |
108 | 409 | if stage_ids: | 410 | if stage_ids: |
109 | 410 | return stage_ids[0] | 411 | return stage_ids[0] |
110 | 412 | raise self.pool.get('res.config.settings').get_config_warning(cr, _("Any stage related to '%s' state not found.\nPlease configure any one stage which will contain documents of this state in %%(menu:crm.menu_crm_lead_stage_act)s.")%context.get('state_name'), context) | ||
111 | 411 | return False | 413 | return False |
112 | 412 | 414 | ||
113 | 413 | def case_cancel(self, cr, uid, ids, context=None): | 415 | def case_cancel(self, cr, uid, ids, context=None): |
114 | 414 | 416 | ||
115 | === modified file 'crm/crm_lead_data.xml' | |||
116 | --- crm/crm_lead_data.xml 2013-01-30 09:09:42 +0000 | |||
117 | +++ crm/crm_lead_data.xml 2013-02-26 09:48:36 +0000 | |||
118 | @@ -7,6 +7,7 @@ | |||
119 | 7 | <field name="name">New</field> | 7 | <field name="name">New</field> |
120 | 8 | <field eval="1" name="case_default"/> | 8 | <field eval="1" name="case_default"/> |
121 | 9 | <field name="state">draft</field> | 9 | <field name="state">draft</field> |
122 | 10 | <field eval="True" name="draft_state"/> | ||
123 | 10 | <field eval="'10'" name="probability"/> | 11 | <field eval="'10'" name="probability"/> |
124 | 11 | <field eval="'10'" name="sequence"/> | 12 | <field eval="'10'" name="sequence"/> |
125 | 12 | <field name="type">both</field> | 13 | <field name="type">both</field> |
126 | @@ -47,6 +48,7 @@ | |||
127 | 47 | <field name="name">Won</field> | 48 | <field name="name">Won</field> |
128 | 48 | <field eval="1" name="case_default"/> | 49 | <field eval="1" name="case_default"/> |
129 | 49 | <field name="state">done</field> | 50 | <field name="state">done</field> |
130 | 51 | <field eval="True" name="done_state"/> | ||
131 | 50 | <field eval="'100'" name="probability"/> | 52 | <field eval="'100'" name="probability"/> |
132 | 51 | <field eval="'15'" name="sequence"/> | 53 | <field eval="'15'" name="sequence"/> |
133 | 52 | <field eval="1" name="on_change"/> | 54 | <field eval="1" name="on_change"/> |
134 | @@ -57,6 +59,7 @@ | |||
135 | 57 | <field eval="1" name="case_default"/> | 59 | <field eval="1" name="case_default"/> |
136 | 58 | <field eval="False" name="fold"/> | 60 | <field eval="False" name="fold"/> |
137 | 59 | <field name="state">cancel</field> | 61 | <field name="state">cancel</field> |
138 | 62 | <field eval="True" name="cancel_state"/> | ||
139 | 60 | <field eval="'0'" name="probability"/> | 63 | <field eval="'0'" name="probability"/> |
140 | 61 | <field eval="'16'" name="sequence"/> | 64 | <field eval="'16'" name="sequence"/> |
141 | 62 | <field name="type">lead</field> | 65 | <field name="type">lead</field> |
142 | @@ -67,6 +70,7 @@ | |||
143 | 67 | <field eval="True" name="fold"/> | 70 | <field eval="True" name="fold"/> |
144 | 68 | <field eval="1" name="on_change"/> | 71 | <field eval="1" name="on_change"/> |
145 | 69 | <field name="state">cancel</field> | 72 | <field name="state">cancel</field> |
146 | 73 | <field eval="True" name="cancel_state"/> | ||
147 | 70 | <field eval="'0'" name="probability"/> | 74 | <field eval="'0'" name="probability"/> |
148 | 71 | <field eval="'17'" name="sequence"/> | 75 | <field eval="'17'" name="sequence"/> |
149 | 72 | <field name="type">opportunity</field> | 76 | <field name="type">opportunity</field> |
150 | 73 | 77 | ||
151 | === modified file 'crm/crm_view.xml' | |||
152 | --- crm/crm_view.xml 2012-12-18 14:08:42 +0000 | |||
153 | +++ crm/crm_view.xml 2013-02-26 09:48:36 +0000 | |||
154 | @@ -183,7 +183,6 @@ | |||
155 | 183 | <field name="sequence" widget="handle"/> | 183 | <field name="sequence" widget="handle"/> |
156 | 184 | <field name="name"/> | 184 | <field name="name"/> |
157 | 185 | <field name="probability"/> | 185 | <field name="probability"/> |
158 | 186 | <field name="state"/> | ||
159 | 187 | <field name="type"/> | 186 | <field name="type"/> |
160 | 188 | </tree> | 187 | </tree> |
161 | 189 | </field> | 188 | </field> |
162 | @@ -199,17 +198,27 @@ | |||
163 | 199 | <form string="Stage" version="7.0"> | 198 | <form string="Stage" version="7.0"> |
164 | 200 | <group col="4"> | 199 | <group col="4"> |
165 | 201 | <field name="name"/> | 200 | <field name="name"/> |
166 | 202 | <field name="state"/> | ||
167 | 203 | <field name="probability"/> | 201 | <field name="probability"/> |
168 | 204 | <field name="type"/> | 202 | <field name="type"/> |
169 | 205 | <field name="on_change"/> | 203 | <field name="on_change"/> |
170 | 206 | <field name="sequence"/> | 204 | <field name="sequence"/> |
171 | 207 | <field name="case_default"/> | 205 | <field name="case_default"/> |
172 | 208 | <field name="fold"/> | 206 | <field name="fold"/> |
177 | 209 | </group> | 207 | <field name="state" invisible="1"/> |
178 | 210 | <separator string="Requirements"/> | 208 | </group> |
179 | 211 | <field name="requirements" nolabel="1"/> | 209 | <group> |
180 | 212 | <field name="section_ids" invisible="1"/> | 210 | <group string="Column Status"> |
181 | 211 | <field name='alert' attrs="{'invisible': [('state','in',('draft','cancel','done'))]}" class="oe_inline oe_stage_status_alert" nolabel="1"/> | ||
182 | 212 | <newline/> | ||
183 | 213 | <field name="draft_state" on_change="onchange_stage_state(draft_state,False,False)" attrs="{'invisible': ['|', ('done_state', '=', True), ('cancel_state', '=', True)]}"/> | ||
184 | 214 | <field name="done_state" on_change="onchange_stage_state(False,done_state,False)" attrs="{'invisible': ['|', ('draft_state', '=', True), ('cancel_state', '=', True)]}"/> | ||
185 | 215 | <field name="cancel_state" on_change="onchange_stage_state(False,False,cancel_state)" attrs="{'invisible': ['|', ('done_state', '=', True), ('draft_state', '=', True)]}"/> | ||
186 | 216 | </group> | ||
187 | 217 | <group string="Requirements"> | ||
188 | 218 | <field name="requirements" nolabel="1"/> | ||
189 | 219 | <field name="section_ids" invisible="1"/> | ||
190 | 220 | </group> | ||
191 | 221 | </group> | ||
192 | 213 | </form> | 222 | </form> |
193 | 214 | </field> | 223 | </field> |
194 | 215 | </record> | 224 | </record> |
195 | 216 | 225 | ||
196 | === modified file 'crm_claim/crm_claim.py' | |||
197 | --- crm_claim/crm_claim.py 2013-01-15 13:43:59 +0000 | |||
198 | +++ crm_claim/crm_claim.py 2013-02-26 09:48:36 +0000 | |||
199 | @@ -57,15 +57,31 @@ | |||
200 | 57 | help="If you check this field, this stage will be proposed by default on each sales team. It will not assign this stage to existing teams."), | 57 | help="If you check this field, this stage will be proposed by default on each sales team. It will not assign this stage to existing teams."), |
201 | 58 | 'fold': fields.boolean('Hide in Views when Empty', | 58 | 'fold': fields.boolean('Hide in Views when Empty', |
202 | 59 | help="This stage is not visible, for example in status bar or kanban view, when there are no records in that stage to display."), | 59 | help="This stage is not visible, for example in status bar or kanban view, when there are no records in that stage to display."), |
203 | 60 | 'draft_state': fields.boolean('This stage contains newly created documents', help="This stage contains newly created documents."), | ||
204 | 61 | 'done_state': fields.boolean('This stage contains closed documents', help="This stage contains closed documents."), | ||
205 | 62 | 'cancel_state': fields.boolean('This stage contains cancelled documents', help="This stage contains cancelled documents."), | ||
206 | 63 | 'alert': fields.text('Alert Message',readonly=True), | ||
207 | 60 | } | 64 | } |
208 | 61 | 65 | ||
209 | 62 | _defaults = { | 66 | _defaults = { |
210 | 63 | 'sequence': lambda *args: 1, | 67 | 'sequence': lambda *args: 1, |
211 | 64 | 'state': 'draft', | 68 | 'state': 'draft', |
212 | 69 | 'draft_state': True, | ||
213 | 65 | 'fold': False, | 70 | 'fold': False, |
214 | 66 | 'case_refused': False, | 71 | 'case_refused': False, |
215 | 72 | 'alert': "If you do not select any of the boolean field then this stage will be considered as 'In Progress.'", | ||
216 | 67 | } | 73 | } |
217 | 68 | 74 | ||
218 | 75 | def onchange_stage_state(self, cr, uid, ids, draft_state, done_state, cancel_state, context=None): | ||
219 | 76 | if draft_state: | ||
220 | 77 | return {'value':{'state':'draft', 'done_state': False, 'cancel_state': False}} | ||
221 | 78 | if done_state: | ||
222 | 79 | return {'value':{'state':'done', 'draft_state': False, 'cancel_state': False}} | ||
223 | 80 | if cancel_state: | ||
224 | 81 | return {'value':{'state':'cancel', 'done_state': False, 'draft_state': False}} | ||
225 | 82 | return {'value':{'state':'open', 'draft_state': False, 'cancel_state': False, 'done_state': False}} | ||
226 | 83 | |||
227 | 84 | |||
228 | 69 | class crm_claim(base_stage, osv.osv): | 85 | class crm_claim(base_stage, osv.osv): |
229 | 70 | """ Crm claim | 86 | """ Crm claim |
230 | 71 | """ | 87 | """ |
231 | @@ -156,6 +172,7 @@ | |||
232 | 156 | stage_ids = self.pool.get('crm.claim.stage').search(cr, uid, search_domain, order=order, context=context) | 172 | stage_ids = self.pool.get('crm.claim.stage').search(cr, uid, search_domain, order=order, context=context) |
233 | 157 | if stage_ids: | 173 | if stage_ids: |
234 | 158 | return stage_ids[0] | 174 | return stage_ids[0] |
235 | 175 | raise self.pool.get('res.config.settings').get_config_warning(cr, _("Any stage related to '%s' state not found.\nPlease configure any one stage which will contain documents of this state in %%(menu:crm_claim.menu_claim_stage_view)s.")%context.get('state_name'), context) | ||
236 | 159 | return False | 176 | return False |
237 | 160 | 177 | ||
238 | 161 | def case_refuse(self, cr, uid, ids, context=None): | 178 | def case_refuse(self, cr, uid, ids, context=None): |
239 | 162 | 179 | ||
240 | === modified file 'crm_claim/crm_claim_data.xml' | |||
241 | --- crm_claim/crm_claim_data.xml 2012-11-29 22:26:45 +0000 | |||
242 | +++ crm_claim/crm_claim_data.xml 2013-02-26 09:48:36 +0000 | |||
243 | @@ -45,6 +45,7 @@ | |||
244 | 45 | <record model="crm.claim.stage" id="stage_claim1"> | 45 | <record model="crm.claim.stage" id="stage_claim1"> |
245 | 46 | <field name="name">New</field> | 46 | <field name="name">New</field> |
246 | 47 | <field name="state">draft</field> | 47 | <field name="state">draft</field> |
247 | 48 | <field eval="True" name="draft_state"/> | ||
248 | 48 | <field name="sequence">26</field> | 49 | <field name="sequence">26</field> |
249 | 49 | <field name="case_default" eval="True"/> | 50 | <field name="case_default" eval="True"/> |
250 | 50 | </record> | 51 | </record> |
251 | @@ -57,12 +58,14 @@ | |||
252 | 57 | <record model="crm.claim.stage" id="stage_claim2"> | 58 | <record model="crm.claim.stage" id="stage_claim2"> |
253 | 58 | <field name="name">Settled</field> | 59 | <field name="name">Settled</field> |
254 | 59 | <field name="state">done</field> | 60 | <field name="state">done</field> |
255 | 61 | <field eval="True" name="done_state"/> | ||
256 | 60 | <field name="sequence">28</field> | 62 | <field name="sequence">28</field> |
257 | 61 | <field name="case_default" eval="True"/> | 63 | <field name="case_default" eval="True"/> |
258 | 62 | </record> | 64 | </record> |
259 | 63 | <record model="crm.claim.stage" id="stage_claim3"> | 65 | <record model="crm.claim.stage" id="stage_claim3"> |
260 | 64 | <field name="name">Rejected</field> | 66 | <field name="name">Rejected</field> |
261 | 65 | <field name="state">cancel</field> | 67 | <field name="state">cancel</field> |
262 | 68 | <field eval="True" name="cancel_state"/> | ||
263 | 66 | <field name="sequence">29</field> | 69 | <field name="sequence">29</field> |
264 | 67 | <field name="case_default" eval="True"/> | 70 | <field name="case_default" eval="True"/> |
265 | 68 | <field name="case_refused" eval="True"/> | 71 | <field name="case_refused" eval="True"/> |
266 | 69 | 72 | ||
267 | === modified file 'crm_claim/crm_claim_view.xml' | |||
268 | --- crm_claim/crm_claim_view.xml 2012-11-29 22:26:45 +0000 | |||
269 | +++ crm_claim/crm_claim_view.xml 2013-02-26 09:48:36 +0000 | |||
270 | @@ -36,9 +36,8 @@ | |||
271 | 36 | <field name="model">crm.claim.stage</field> | 36 | <field name="model">crm.claim.stage</field> |
272 | 37 | <field name="arch" type="xml"> | 37 | <field name="arch" type="xml"> |
273 | 38 | <tree string="Claim Stages"> | 38 | <tree string="Claim Stages"> |
274 | 39 | <field name="name"/> | ||
275 | 39 | <field name="sequence"/> | 40 | <field name="sequence"/> |
276 | 40 | <field name="name"/> | ||
277 | 41 | <field name="state"/> | ||
278 | 42 | </tree> | 41 | </tree> |
279 | 43 | </field> | 42 | </field> |
280 | 44 | </record> | 43 | </record> |
281 | @@ -47,13 +46,22 @@ | |||
282 | 47 | <field name="name">crm.claim.stage.form</field> | 46 | <field name="name">crm.claim.stage.form</field> |
283 | 48 | <field name="model">crm.claim.stage</field> | 47 | <field name="model">crm.claim.stage</field> |
284 | 49 | <field name="arch" type="xml"> | 48 | <field name="arch" type="xml"> |
292 | 50 | <form string="Claim Stage"> | 49 | <form string="Claim Stage" version="7.0"> |
293 | 51 | <field name="name"/> | 50 | <group col="4"> |
294 | 52 | <field name="case_default"/> | 51 | <field name="name"/> |
295 | 53 | <field name="sequence"/> | 52 | <field name="case_default"/> |
296 | 54 | <field name="state"/> | 53 | <field name="sequence"/> |
297 | 55 | <field name="case_refused"/> | 54 | <field name="case_refused"/> |
298 | 56 | <field name="fold"/> | 55 | <field name="fold"/> |
299 | 56 | <field name="state" invisible="1"/> | ||
300 | 57 | </group> | ||
301 | 58 | <group string="Column Status"> | ||
302 | 59 | <field name='alert' attrs="{'invisible': [('state','in',('draft','cancel','done'))]}" class="oe_inline oe_stage_status_alert" nolabel="1"/> | ||
303 | 60 | <newline/> | ||
304 | 61 | <field name="draft_state" on_change="onchange_stage_state(draft_state,False,False)" attrs="{'invisible': ['|', ('done_state', '=', True), ('cancel_state', '=', True)]}"/> | ||
305 | 62 | <field name="done_state" on_change="onchange_stage_state(False,done_state,False)" attrs="{'invisible': ['|', ('draft_state', '=', True), ('cancel_state', '=', True)]}"/> | ||
306 | 63 | <field name="cancel_state" on_change="onchange_stage_state(False,False,cancel_state)" attrs="{'invisible': ['|', ('done_state', '=', True), ('draft_state', '=', True)]}"/> | ||
307 | 64 | </group> | ||
308 | 57 | </form> | 65 | </form> |
309 | 58 | </field> | 66 | </field> |
310 | 59 | </record> | 67 | </record> |
311 | 60 | 68 | ||
312 | === modified file 'hr_recruitment/hr_recruitment.py' | |||
313 | --- hr_recruitment/hr_recruitment.py 2013-02-24 11:52:27 +0000 | |||
314 | +++ hr_recruitment/hr_recruitment.py 2013-02-26 09:48:36 +0000 | |||
315 | @@ -65,13 +65,31 @@ | |||
316 | 65 | 'state': fields.selection(AVAILABLE_STATES, 'Status', required=True, help="The related status for the stage. The status of your document will automatically change according to the selected stage. Example, a stage is related to the status 'Close', when your document reach this stage, it will be automatically closed."), | 65 | 'state': fields.selection(AVAILABLE_STATES, 'Status', required=True, help="The related status for the stage. The status of your document will automatically change according to the selected stage. Example, a stage is related to the status 'Close', when your document reach this stage, it will be automatically closed."), |
317 | 66 | 'fold': fields.boolean('Hide in views if empty', help="This stage is not visible, for example in status bar or kanban view, when there are no records in that stage to display."), | 66 | 'fold': fields.boolean('Hide in views if empty', help="This stage is not visible, for example in status bar or kanban view, when there are no records in that stage to display."), |
318 | 67 | 'requirements': fields.text('Requirements'), | 67 | 'requirements': fields.text('Requirements'), |
319 | 68 | 'draft_state': fields.boolean('This stage contains newly created applications', help="This stage contains newly created applications."), | ||
320 | 69 | 'pending_state': fields.boolean('This stage contains pending applications', help="This stage contains pending applications."), | ||
321 | 70 | 'done_state': fields.boolean('This stage contains hired applications', help="This stage contains hired applications."), | ||
322 | 71 | 'cancel_state': fields.boolean('This stage contains refused applications', help="This stage contains refused applications."), | ||
323 | 72 | 'alert': fields.text('Alert Message',readonly=True), | ||
324 | 68 | } | 73 | } |
325 | 69 | _defaults = { | 74 | _defaults = { |
326 | 70 | 'sequence': 1, | 75 | 'sequence': 1, |
327 | 71 | 'state': 'draft', | 76 | 'state': 'draft', |
328 | 77 | 'draft_state': True, | ||
329 | 72 | 'fold': False, | 78 | 'fold': False, |
330 | 79 | 'alert': "If you do not select any of the boolean field then this stage will be considered as 'In Progress.'", | ||
331 | 73 | } | 80 | } |
332 | 74 | 81 | ||
333 | 82 | def onchange_stage_state(self, cr, uid, ids, draft_state, pending_state, done_state, cancel_state, context=None): | ||
334 | 83 | if draft_state: | ||
335 | 84 | return {'value':{'state':'draft', 'done_state': False, 'cancel_state': False, 'pending_state': False}} | ||
336 | 85 | if pending_state: | ||
337 | 86 | return {'value':{'state':'pending', 'done_state': False, 'draft_state': False, 'cancel_state': False}} | ||
338 | 87 | if done_state: | ||
339 | 88 | return {'value':{'state':'done', 'draft_state': False, 'cancel_state': False, 'pending_state': False}} | ||
340 | 89 | if cancel_state: | ||
341 | 90 | return {'value':{'state':'cancel', 'done_state': False, 'draft_state': False, 'pending_state': False}} | ||
342 | 91 | return {'value':{'state':'open', 'draft_state': False, 'cancel_state': False, 'done_state': False, 'pending_state': False}} | ||
343 | 92 | |||
344 | 75 | class hr_recruitment_degree(osv.osv): | 93 | class hr_recruitment_degree(osv.osv): |
345 | 76 | """ Degree of HR Recruitment """ | 94 | """ Degree of HR Recruitment """ |
346 | 77 | _name = "hr.recruitment.degree" | 95 | _name = "hr.recruitment.degree" |
347 | @@ -108,6 +126,7 @@ | |||
348 | 108 | 126 | ||
349 | 109 | def _get_default_stage_id(self, cr, uid, context=None): | 127 | def _get_default_stage_id(self, cr, uid, context=None): |
350 | 110 | """ Gives default stage_id """ | 128 | """ Gives default stage_id """ |
351 | 129 | context.update({'state_name': 'draft',}) | ||
352 | 111 | department_id = self._get_default_department_id(cr, uid, context=context) | 130 | department_id = self._get_default_department_id(cr, uid, context=context) |
353 | 112 | return self.stage_find(cr, uid, [], department_id, [('state', '=', 'draft')], context=context) | 131 | return self.stage_find(cr, uid, [], department_id, [('state', '=', 'draft')], context=context) |
354 | 113 | 132 | ||
355 | @@ -304,6 +323,7 @@ | |||
356 | 304 | stage_ids = self.pool.get('hr.recruitment.stage').search(cr, uid, search_domain, order=order, context=context) | 323 | stage_ids = self.pool.get('hr.recruitment.stage').search(cr, uid, search_domain, order=order, context=context) |
357 | 305 | if stage_ids: | 324 | if stage_ids: |
358 | 306 | return stage_ids[0] | 325 | return stage_ids[0] |
359 | 326 | raise self.pool.get('res.config.settings').get_config_warning(cr, _("Any stage related to '%s' state not found.\nPlease configure any one stage which will contain documents of this state in %%(menu:hr_recruitment.menu_hr_recruitment_stage)s.")%context.get('state_name'), context) | ||
360 | 307 | return False | 327 | return False |
361 | 308 | 328 | ||
362 | 309 | def action_makeMeeting(self, cr, uid, ids, context=None): | 329 | def action_makeMeeting(self, cr, uid, ids, context=None): |
363 | 310 | 330 | ||
364 | === modified file 'hr_recruitment/hr_recruitment_data.xml' | |||
365 | --- hr_recruitment/hr_recruitment_data.xml 2013-01-30 13:58:25 +0000 | |||
366 | +++ hr_recruitment/hr_recruitment_data.xml 2013-02-26 09:48:36 +0000 | |||
367 | @@ -54,31 +54,40 @@ | |||
368 | 54 | <record model="hr.recruitment.stage" id="stage_job1"> | 54 | <record model="hr.recruitment.stage" id="stage_job1"> |
369 | 55 | <field name="name">Initial Qualification</field> | 55 | <field name="name">Initial Qualification</field> |
370 | 56 | <field name="state">draft</field> | 56 | <field name="state">draft</field> |
371 | 57 | <field eval="True" name="draft_state"/> | ||
372 | 57 | <field name="sequence">1</field> | 58 | <field name="sequence">1</field> |
373 | 58 | </record> | 59 | </record> |
374 | 59 | <record model="hr.recruitment.stage" id="stage_job2"> | 60 | <record model="hr.recruitment.stage" id="stage_job2"> |
375 | 60 | <field name="name">First Interview</field> | 61 | <field name="name">First Interview</field> |
376 | 61 | <field name="state">open</field> | 62 | <field name="state">open</field> |
377 | 63 | <field eval="False" name="draft_state"/> | ||
378 | 62 | <field name="sequence">2</field> | 64 | <field name="sequence">2</field> |
379 | 63 | </record> | 65 | </record> |
380 | 64 | <record model="hr.recruitment.stage" id="stage_job3"> | 66 | <record model="hr.recruitment.stage" id="stage_job3"> |
381 | 65 | <field name="name">Second Interview</field> | 67 | <field name="name">Second Interview</field> |
382 | 66 | <field name="state">open</field> | 68 | <field name="state">open</field> |
383 | 69 | <field eval="False" name="draft_state"/> | ||
384 | 67 | <field name="sequence">3</field> | 70 | <field name="sequence">3</field> |
385 | 68 | </record> | 71 | </record> |
386 | 69 | <record model="hr.recruitment.stage" id="stage_job4"> | 72 | <record model="hr.recruitment.stage" id="stage_job4"> |
387 | 70 | <field name="name">Contract Proposed</field> | 73 | <field name="name">Contract Proposed</field> |
388 | 71 | <field name="state">pending</field> | 74 | <field name="state">pending</field> |
389 | 75 | <field eval="True" name="pending_state"/> | ||
390 | 76 | <field eval="False" name="draft_state"/> | ||
391 | 72 | <field name="sequence">4</field> | 77 | <field name="sequence">4</field> |
392 | 73 | </record> | 78 | </record> |
393 | 74 | <record model="hr.recruitment.stage" id="stage_job5"> | 79 | <record model="hr.recruitment.stage" id="stage_job5"> |
394 | 75 | <field name="name">Contract Signed</field> | 80 | <field name="name">Contract Signed</field> |
395 | 76 | <field name="state">done</field> | 81 | <field name="state">done</field> |
396 | 82 | <field eval="True" name="done_state"/> | ||
397 | 83 | <field eval="False" name="draft_state"/> | ||
398 | 77 | <field name="sequence">5</field> | 84 | <field name="sequence">5</field> |
399 | 78 | </record> | 85 | </record> |
400 | 79 | <record model="hr.recruitment.stage" id="stage_job6"> | 86 | <record model="hr.recruitment.stage" id="stage_job6"> |
401 | 80 | <field name="name">Refused</field> | 87 | <field name="name">Refused</field> |
402 | 81 | <field name="state">cancel</field> | 88 | <field name="state">cancel</field> |
403 | 89 | <field eval="True" name="cancel_state"/> | ||
404 | 90 | <field eval="False" name="draft_state"/> | ||
405 | 82 | <field name="sequence">6</field> | 91 | <field name="sequence">6</field> |
406 | 83 | <field name="fold" eval="True"/> | 92 | <field name="fold" eval="True"/> |
407 | 84 | </record> | 93 | </record> |
408 | 85 | 94 | ||
409 | === modified file 'hr_recruitment/hr_recruitment_view.xml' | |||
410 | --- hr_recruitment/hr_recruitment_view.xml 2013-02-11 12:57:51 +0000 | |||
411 | +++ hr_recruitment/hr_recruitment_view.xml 2013-02-26 09:48:36 +0000 | |||
412 | @@ -328,7 +328,6 @@ | |||
413 | 328 | <field name="sequence" invisible="1"/> | 328 | <field name="sequence" invisible="1"/> |
414 | 329 | <field name="name"/> | 329 | <field name="name"/> |
415 | 330 | <field name="department_id"/> | 330 | <field name="department_id"/> |
416 | 331 | <field name="state"/> | ||
417 | 332 | </tree> | 331 | </tree> |
418 | 333 | </field> | 332 | </field> |
419 | 334 | </record> | 333 | </record> |
420 | @@ -345,13 +344,25 @@ | |||
421 | 345 | <field name="department_id"/> | 344 | <field name="department_id"/> |
422 | 346 | </group> | 345 | </group> |
423 | 347 | <group> | 346 | <group> |
425 | 348 | <field name="state"/> | 347 | <field name="state" invisible="1"/> |
426 | 349 | <field name="sequence"/> | 348 | <field name="sequence"/> |
427 | 350 | <field name="fold"/> | 349 | <field name="fold"/> |
428 | 351 | </group> | 350 | </group> |
429 | 352 | </group> | 351 | </group> |
432 | 353 | <separator string="Requirements"/> | 352 | <group> |
433 | 354 | <field name="requirements"/> | 353 | <group string="Column status"> |
434 | 354 | <field name='alert' attrs="{'invisible': [('state','in',('draft','cancel','done','pending'))]}" class="oe_inline oe_stage_status_alert" nolabel="1"/> | ||
435 | 355 | <newline/> | ||
436 | 356 | <field name="draft_state" on_change="onchange_stage_state(draft_state,False,False,False)" attrs="{'invisible': ['|','|', ('done_state', '=', True), ('cancel_state', '=', True), ('pending_state', '=', True)]}"/> | ||
437 | 357 | <field name="pending_state" on_change="onchange_stage_state(False,pending_state,False,False)" attrs="{'invisible': ['|','|', ('done_state', '=', True), ('cancel_state', '=', True), ('draft_state', '=', True)]}"/> | ||
438 | 358 | <field name="done_state" on_change="onchange_stage_state(False,False,done_state,False)" attrs="{'invisible': ['|','|', ('draft_state', '=', True), ('cancel_state', '=', True), ('pending_state', '=', True)]}"/> | ||
439 | 359 | <field name="cancel_state" on_change="onchange_stage_state(False,False,False,cancel_state)" attrs="{'invisible': ['|','|', ('done_state', '=', True), ('draft_state', '=', True), ('pending_state', '=', True)]}"/> | ||
440 | 360 | </group> | ||
441 | 361 | <group string="Requirements"> | ||
442 | 362 | <field name="requirements" nolabel="1"/> | ||
443 | 363 | </group> | ||
444 | 364 | </group> | ||
445 | 365 | |||
446 | 355 | </form> | 366 | </form> |
447 | 356 | </field> | 367 | </field> |
448 | 357 | </record> | 368 | </record> |
449 | 358 | 369 | ||
450 | === modified file 'project/project.py' | |||
451 | --- project/project.py 2013-01-15 10:03:53 +0000 | |||
452 | +++ project/project.py 2013-02-26 09:48:36 +0000 | |||
453 | @@ -49,6 +49,11 @@ | |||
454 | 49 | "For example, if a stage is related to the status 'Close', when your document reaches this stage, it is automatically closed."), | 49 | "For example, if a stage is related to the status 'Close', when your document reaches this stage, it is automatically closed."), |
455 | 50 | 'fold': fields.boolean('Folded by Default', | 50 | 'fold': fields.boolean('Folded by Default', |
456 | 51 | help="This stage is not visible, for example in status bar or kanban view, when there are no records in that stage to display."), | 51 | help="This stage is not visible, for example in status bar or kanban view, when there are no records in that stage to display."), |
457 | 52 | 'draft_state': fields.boolean('This stage contains newly created documents', help="This stage contains newly created documents."), | ||
458 | 53 | 'done_state': fields.boolean('This stage contains closed documents', help="This stage contains closed documents."), | ||
459 | 54 | 'pending_state': fields.boolean('This stage contains pending documents', help="This stage contains pending documents."), | ||
460 | 55 | 'cancelled_state': fields.boolean('This stage contains cancelled documents', help="This stage contains cancelled documents."), | ||
461 | 56 | 'alert': fields.text('Alert Message',readonly=True), | ||
462 | 52 | } | 57 | } |
463 | 53 | def _get_default_project_id(self, cr, uid, ctx={}): | 58 | def _get_default_project_id(self, cr, uid, ctx={}): |
464 | 54 | proj = ctx.get('default_project_id', False) | 59 | proj = ctx.get('default_project_id', False) |
465 | @@ -60,10 +65,22 @@ | |||
466 | 60 | 'state': 'open', | 65 | 'state': 'open', |
467 | 61 | 'fold': False, | 66 | 'fold': False, |
468 | 62 | 'case_default': False, | 67 | 'case_default': False, |
470 | 63 | 'project_ids': _get_default_project_id | 68 | 'project_ids': _get_default_project_id, |
471 | 69 | 'alert': "If you do not select any of the boolean field then this stage will be considered as 'In Progress.'", | ||
472 | 64 | } | 70 | } |
473 | 65 | _order = 'sequence' | 71 | _order = 'sequence' |
474 | 66 | 72 | ||
475 | 73 | def onchange_stage_state(self, cr, uid, ids, draft_state, pending_state, done_state, cancelled_state, context=None): | ||
476 | 74 | if draft_state: | ||
477 | 75 | return {'value':{'state':'draft', 'done_state': False, 'cancelled_state': False, 'pending_state': False}} | ||
478 | 76 | if pending_state: | ||
479 | 77 | return {'value':{'state':'pending', 'done_state': False, 'draft_state': False, 'cancelled_state': False}} | ||
480 | 78 | if done_state: | ||
481 | 79 | return {'value':{'state':'done', 'draft_state': False, 'cancelled_state': False, 'pending_state': False}} | ||
482 | 80 | if cancelled_state: | ||
483 | 81 | return {'value':{'state':'cancelled', 'done_state': False, 'draft_state': False, 'pending_state': False}} | ||
484 | 82 | return {'value':{'state':'open', 'draft_state': False, 'cancelled_state': False, 'done_state': False, 'pending_state': False}} | ||
485 | 83 | |||
486 | 67 | def short_name(name): | 84 | def short_name(name): |
487 | 68 | """Keep first word(s) of name to make it small enough | 85 | """Keep first word(s) of name to make it small enough |
488 | 69 | but distinctive""" | 86 | but distinctive""" |
489 | @@ -578,6 +595,7 @@ | |||
490 | 578 | 595 | ||
491 | 579 | def _get_default_stage_id(self, cr, uid, context=None): | 596 | def _get_default_stage_id(self, cr, uid, context=None): |
492 | 580 | """ Gives default stage_id """ | 597 | """ Gives default stage_id """ |
493 | 598 | context.update({'state_name': 'draft',}) | ||
494 | 581 | project_id = self._get_default_project_id(cr, uid, context=context) | 599 | project_id = self._get_default_project_id(cr, uid, context=context) |
495 | 582 | return self.stage_find(cr, uid, [], project_id, [('state', '=', 'draft')], context=context) | 600 | return self.stage_find(cr, uid, [], project_id, [('state', '=', 'draft')], context=context) |
496 | 583 | 601 | ||
497 | @@ -919,6 +937,7 @@ | |||
498 | 919 | stage_ids = self.pool.get('project.task.type').search(cr, uid, search_domain, order=order, context=context) | 937 | stage_ids = self.pool.get('project.task.type').search(cr, uid, search_domain, order=order, context=context) |
499 | 920 | if stage_ids: | 938 | if stage_ids: |
500 | 921 | return stage_ids[0] | 939 | return stage_ids[0] |
501 | 940 | raise self.pool.get('res.config.settings').get_config_warning(cr, _("Any stage related to '%s' state not found.\nPlease configure any one stage which will contain documents of this state in %%(menu:project.menu_task_types_view)s.")%context.get('state_name'), context) | ||
502 | 922 | return False | 941 | return False |
503 | 923 | 942 | ||
504 | 924 | def _check_child_task(self, cr, uid, ids, context=None): | 943 | def _check_child_task(self, cr, uid, ids, context=None): |
505 | 925 | 944 | ||
506 | === modified file 'project/project_data.xml' | |||
507 | --- project/project_data.xml 2013-01-30 09:09:42 +0000 | |||
508 | +++ project/project_data.xml 2013-02-26 09:48:36 +0000 | |||
509 | @@ -30,12 +30,14 @@ | |||
510 | 30 | <field name="sequence">1</field> | 30 | <field name="sequence">1</field> |
511 | 31 | <field name="name">Analysis</field> | 31 | <field name="name">Analysis</field> |
512 | 32 | <field name="state">draft</field> | 32 | <field name="state">draft</field> |
513 | 33 | <field eval="True" name="draft_state"/> | ||
514 | 33 | <field name="case_default" eval="False"/> | 34 | <field name="case_default" eval="False"/> |
515 | 34 | </record> | 35 | </record> |
516 | 35 | <record id="project_tt_specification" model="project.task.type"> | 36 | <record id="project_tt_specification" model="project.task.type"> |
517 | 36 | <field name="sequence">2</field> | 37 | <field name="sequence">2</field> |
518 | 37 | <field name="name">Specification</field> | 38 | <field name="name">Specification</field> |
519 | 38 | <field name="state">pending</field> | 39 | <field name="state">pending</field> |
520 | 40 | <field eval="True" name="pending_state"/> | ||
521 | 39 | <field name="case_default" eval="True"/> | 41 | <field name="case_default" eval="True"/> |
522 | 40 | </record> | 42 | </record> |
523 | 41 | <record id="project_tt_design" model="project.task.type"> | 43 | <record id="project_tt_design" model="project.task.type"> |
524 | @@ -67,6 +69,7 @@ | |||
525 | 67 | <field name="sequence">100</field> | 69 | <field name="sequence">100</field> |
526 | 68 | <field name="name">Done</field> | 70 | <field name="name">Done</field> |
527 | 69 | <field name="state">done</field> | 71 | <field name="state">done</field> |
528 | 72 | <field eval="True" name="done_state"/> | ||
529 | 70 | <field name="case_default" eval="True"/> | 73 | <field name="case_default" eval="True"/> |
530 | 71 | <field name="fold" eval="True"/> | 74 | <field name="fold" eval="True"/> |
531 | 72 | </record> | 75 | </record> |
532 | @@ -74,6 +77,7 @@ | |||
533 | 74 | <field name="sequence">200</field> | 77 | <field name="sequence">200</field> |
534 | 75 | <field name="name">Cancelled</field> | 78 | <field name="name">Cancelled</field> |
535 | 76 | <field name="state">cancelled</field> | 79 | <field name="state">cancelled</field> |
536 | 80 | <field eval="True" name="cancelled_state"/> | ||
537 | 77 | <field name="case_default" eval="True"/> | 81 | <field name="case_default" eval="True"/> |
538 | 78 | <field name="fold" eval="True"/> | 82 | <field name="fold" eval="True"/> |
539 | 79 | </record> | 83 | </record> |
540 | 80 | 84 | ||
541 | === modified file 'project/project_view.xml' | |||
542 | --- project/project_view.xml 2013-02-25 12:03:31 +0000 | |||
543 | +++ project/project_view.xml 2013-02-26 09:48:36 +0000 | |||
544 | @@ -689,12 +689,24 @@ | |||
545 | 689 | <field name="case_default"/> | 689 | <field name="case_default"/> |
546 | 690 | </group> | 690 | </group> |
547 | 691 | <group> | 691 | <group> |
548 | 692 | <field name="state"/> | ||
549 | 693 | <field name="sequence"/> | 692 | <field name="sequence"/> |
550 | 694 | <field name="fold"/> | 693 | <field name="fold"/> |
554 | 695 | </group> | 694 | <field name="state" invisible="1"/> |
555 | 696 | </group> | 695 | </group> |
556 | 697 | <field name="description" placeholder="Add a description..."/> | 696 | </group> |
557 | 697 | <group> | ||
558 | 698 | <group string="Column Status"> | ||
559 | 699 | <field name='alert' attrs="{'invisible': [('state','in',('draft','cancelled','done','pending'))]}" class="oe_inline oe_stage_status_alert" nolabel="1"/> | ||
560 | 700 | <newline/> | ||
561 | 701 | <field name="draft_state" on_change="onchange_stage_state(draft_state,False,False,False)" attrs="{'invisible': ['|','|', ('done_state', '=', True), ('cancelled_state', '=', True), ('pending_state', '=', True)]}"/> | ||
562 | 702 | <field name="pending_state" on_change="onchange_stage_state(False,pending_state,False,False)" attrs="{'invisible': ['|','|', ('done_state', '=', True), ('cancelled_state', '=', True), ('draft_state', '=', True)]}"/> | ||
563 | 703 | <field name="done_state" on_change="onchange_stage_state(False,False,done_state,False)" attrs="{'invisible': ['|','|', ('draft_state', '=', True), ('cancelled_state', '=', True), ('pending_state', '=', True)]}"/> | ||
564 | 704 | <field name="cancelled_state" on_change="onchange_stage_state(False,False,False,cancelled_state)" attrs="{'invisible': ['|','|', ('done_state', '=', True), ('draft_state', '=', True), ('pending_state', '=', True)]}"/> | ||
565 | 705 | </group> | ||
566 | 706 | <group string="Description"> | ||
567 | 707 | <field name="description" placeholder="Add a description..." nolabel="1"/> | ||
568 | 708 | </group> | ||
569 | 709 | </group> | ||
570 | 698 | </form> | 710 | </form> |
571 | 699 | </field> | 711 | </field> |
572 | 700 | </record> | 712 | </record> |
573 | @@ -706,7 +718,7 @@ | |||
574 | 706 | <tree string="Task Stage"> | 718 | <tree string="Task Stage"> |
575 | 707 | <field name="sequence" widget="handle"/> | 719 | <field name="sequence" widget="handle"/> |
576 | 708 | <field name="name"/> | 720 | <field name="name"/> |
578 | 709 | <field name="state"/> | 721 | <field name="case_default"/> |
579 | 710 | </tree> | 722 | </tree> |
580 | 711 | </field> | 723 | </field> |
581 | 712 | </record> | 724 | </record> |
582 | 713 | 725 | ||
583 | === modified file 'project_issue/project_issue.py' | |||
584 | --- project_issue/project_issue.py 2013-01-15 13:43:59 +0000 | |||
585 | +++ project_issue/project_issue.py 2013-02-26 09:48:36 +0000 | |||
586 | @@ -80,6 +80,7 @@ | |||
587 | 80 | 80 | ||
588 | 81 | def _get_default_stage_id(self, cr, uid, context=None): | 81 | def _get_default_stage_id(self, cr, uid, context=None): |
589 | 82 | """ Gives default stage_id """ | 82 | """ Gives default stage_id """ |
590 | 83 | context.update({'state_name': 'draft',}) | ||
591 | 83 | project_id = self._get_default_project_id(cr, uid, context=context) | 84 | project_id = self._get_default_project_id(cr, uid, context=context) |
592 | 84 | return self.stage_find(cr, uid, [], project_id, [('state', '=', 'draft')], context=context) | 85 | return self.stage_find(cr, uid, [], project_id, [('state', '=', 'draft')], context=context) |
593 | 85 | 86 | ||
594 | @@ -454,6 +455,7 @@ | |||
595 | 454 | stage_ids = self.pool.get('project.task.type').search(cr, uid, search_domain, order=order, context=context) | 455 | stage_ids = self.pool.get('project.task.type').search(cr, uid, search_domain, order=order, context=context) |
596 | 455 | if stage_ids: | 456 | if stage_ids: |
597 | 456 | return stage_ids[0] | 457 | return stage_ids[0] |
598 | 458 | raise self.pool.get('res.config.settings').get_config_warning(cr, _("Any stage related to '%s' state not found.\nPlease configure any one stage which will contain documents of this state in %%(menu:project.menu_task_types_view)s.")%context.get('state_name'), context) | ||
599 | 457 | return False | 459 | return False |
600 | 458 | 460 | ||
601 | 459 | def case_cancel(self, cr, uid, ids, context=None): | 461 | def case_cancel(self, cr, uid, ids, context=None): |
602 | 460 | 462 | ||
603 | === modified file 'project_issue/test/issue_demo.yml' | |||
604 | --- project_issue/test/issue_demo.yml 2012-11-29 22:26:45 +0000 | |||
605 | +++ project_issue/test/issue_demo.yml 2013-02-26 09:48:36 +0000 | |||
606 | @@ -1,8 +1,8 @@ | |||
607 | 1 | - | 1 | - |
608 | 2 | !record {model: project.issue, id: project_task_1, view: False}: | 2 | !record {model: project.issue, id: project_task_1, view: False}: |
610 | 3 | task_id: 'project.project_task_17' | 3 | task_id: 'project.project_task_1' |
611 | 4 | name: 'Error in account module' | 4 | name: 'Error in account module' |
612 | 5 | - | 5 | - |
613 | 6 | !record {model: project.issue, id: project01, view: False}: | 6 | !record {model: project.issue, id: project01, view: False}: |
615 | 7 | project_id: 'project.project_project_2' | 7 | project_id: 'project.project_project_1' |
616 | 8 | name: 'OpenERP Integration' | 8 | name: 'OpenERP Integration' |