Merge lp:~credativ/openobject-addons/elico-6.1-fixes-gap-analysis-template-management into lp:~openerp-community/openobject-addons/elico-6.1
- elico-6.1-fixes-gap-analysis-template-management
- Merge into elico-6.1
Status: | Merged |
---|---|
Merged at revision: | 54 |
Proposed branch: | lp:~credativ/openobject-addons/elico-6.1-fixes-gap-analysis-template-management |
Merge into: | lp:~openerp-community/openobject-addons/elico-6.1 |
Diff against target: |
718 lines (+450/-87) 8 files modified
gap_analysis/__openerp__.py (+2/-1) gap_analysis/gap_analysis.py (+187/-52) gap_analysis/gap_analysis.xml (+99/-29) gap_analysis/wizard/__init__.py (+1/-0) gap_analysis/wizard/import_from_sheet.py (+1/-2) gap_analysis/wizard/import_from_tmpl.py (+12/-3) gap_analysis/wizard/line_create_wizard.py (+75/-0) gap_analysis/wizard/line_create_wizard_view.xml (+73/-0) |
To merge this branch: | bzr merge lp:~credativ/openobject-addons/elico-6.1-fixes-gap-analysis-template-management |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenERP Community (OBSOLETE) | Pending | ||
Review via email: mp+218422@code.launchpad.net |
Commit message
Description of the change
This branch adds several features to the Gap Analysis module which help to facilitate template-orientated workflows. These include:
- The ability to view associated Gap Analysis Lines and Gap Analysis Template Lines from a Functionality's form view.
- The ability to add Functionalities to Gap Analyses and Gap Analysis Templates from the 'All Functionalities' view.
- 'Group By...' options in the All 'Functionalities' view.
- Automatic updates to Gap Analysis Templates when a corresponding Functionality template is modified.
- Avoiding creation of duplicate Gap Analysis lines when importing from a Gap Analysis Template.
- 53. By Tom Pickering
-
[FIX] Fixed traceback when changing the functionality of a non-saved Gap Analysis Line.
- 54. By Tom Pickering
-
[IMP] Duplicate functionality warning can now trigger when creating a new line in an existing Gap Analysis, if any duplicates already exist.
Preview Diff
1 | === modified file 'gap_analysis/__openerp__.py' | |||
2 | --- gap_analysis/__openerp__.py 2013-06-22 02:18:01 +0000 | |||
3 | +++ gap_analysis/__openerp__.py 2014-05-09 11:32:13 +0000 | |||
4 | @@ -63,6 +63,7 @@ | |||
5 | 63 | 'gap_analysis_sequence.xml', | 63 | 'gap_analysis_sequence.xml', |
6 | 64 | 'gap_analysis.xml', | 64 | 'gap_analysis.xml', |
7 | 65 | 'wizard/import_from_tmpl.xml', | 65 | 'wizard/import_from_tmpl.xml', |
8 | 66 | 'wizard/line_create_wizard_view.xml' | ||
9 | 66 | ], | 67 | ], |
10 | 67 | #'demo_xml': ['gap_analysis_demo.xml'], | 68 | #'demo_xml': ['gap_analysis_demo.xml'], |
11 | 68 | 'test': [], | 69 | 'test': [], |
12 | @@ -73,4 +74,4 @@ | |||
13 | 73 | 'certificate': '', | 74 | 'certificate': '', |
14 | 74 | } | 75 | } |
15 | 75 | 76 | ||
16 | 76 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
17 | 77 | \ No newline at end of file | 77 | \ No newline at end of file |
18 | 78 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
19 | 78 | 79 | ||
20 | === modified file 'gap_analysis/gap_analysis.py' | |||
21 | --- gap_analysis/gap_analysis.py 2013-06-22 02:18:01 +0000 | |||
22 | +++ gap_analysis/gap_analysis.py 2014-05-09 11:32:13 +0000 | |||
23 | @@ -86,7 +86,8 @@ | |||
24 | 86 | my_type = self.pool.get('gap_analysis.workload.type').browse(cr, uid, type_id) | 86 | my_type = self.pool.get('gap_analysis.workload.type').browse(cr, uid, type_id) |
25 | 87 | val['duration'] = my_type.duration | 87 | val['duration'] = my_type.duration |
26 | 88 | return {'value': val} | 88 | return {'value': val} |
28 | 89 | 89 | ||
29 | 90 | |||
30 | 90 | gap_analysis_workload() | 91 | gap_analysis_workload() |
31 | 91 | 92 | ||
32 | 92 | 93 | ||
33 | @@ -150,33 +151,129 @@ | |||
34 | 150 | _name = "gap_analysis.functionality" | 151 | _name = "gap_analysis.functionality" |
35 | 151 | _description = "Gap Analysis Functionalities" | 152 | _description = "Gap Analysis Functionalities" |
36 | 152 | 153 | ||
37 | 154 | |||
38 | 155 | def _search_ga_lines(self, cr, uid, ids, field_names, arg=None, context=None, tmpl=False): | ||
39 | 156 | if context is None: | ||
40 | 157 | context = {} | ||
41 | 158 | |||
42 | 159 | ga_obj = self.pool.get('gap_analysis') | ||
43 | 160 | ga_line_obj = self.pool.get('gap_analysis.line') | ||
44 | 161 | func_obj = self.pool.get('gap_analysis.functionality') | ||
45 | 162 | |||
46 | 163 | line_ids = ga_line_obj.search(cr, uid, [('functionality','=', ids[0])], context=context) | ||
47 | 164 | |||
48 | 165 | lids_to_gids = {} | ||
49 | 166 | tmpl_lids = [] | ||
50 | 167 | ga_obj = self.pool.get('gap_analysis') | ||
51 | 168 | gap_ids = ga_line_obj.read(cr, uid, line_ids, ['gap_id'], context=context) | ||
52 | 169 | |||
53 | 170 | for gap_id in gap_ids: | ||
54 | 171 | lids_to_gids[gap_id['id']] = gap_id['gap_id'][0] | ||
55 | 172 | |||
56 | 173 | tmpl_checks = ga_obj.read(cr, uid, [gid['gap_id'][0] for gid in gap_ids], ['is_tmpl'], context=context) | ||
57 | 174 | gids_to_checks = dict(zip([c['id'] for c in tmpl_checks], [c['is_tmpl'] == tmpl for c in tmpl_checks])) | ||
58 | 175 | |||
59 | 176 | for lid in lids_to_gids.keys(): | ||
60 | 177 | if gids_to_checks[lids_to_gids[lid]]: | ||
61 | 178 | tmpl_lids.append(lid) | ||
62 | 179 | |||
63 | 180 | return {ids[0] : [l for l in line_ids if l in tmpl_lids]} | ||
64 | 181 | |||
65 | 182 | |||
66 | 183 | def _search_ga_tmpl_lines(self, cr, uid, ids, field_names, arg=None, context=None): | ||
67 | 184 | return self._search_ga_lines(cr, uid, ids, field_names, arg=arg, context=context, tmpl=True) | ||
68 | 185 | |||
69 | 186 | |||
70 | 187 | def _search_ga_non_tmpl_lines(self, cr, uid, ids, field_names, arg=None, context=None): | ||
71 | 188 | return self._search_ga_lines(cr, uid, ids, field_names, arg=arg, context=context, tmpl=False) | ||
72 | 189 | |||
73 | 190 | |||
74 | 153 | _columns = { | 191 | _columns = { |
80 | 154 | 'name': fields.char('Functionality', size=256, required=True, translate=True), | 192 | 'name': fields.char('Functionality', size=256, required=True, translate=True), |
81 | 155 | 'description': fields.text('Description'), | 193 | 'description': fields.text('Description'), |
82 | 156 | 'category': fields.many2one('gap_analysis.functionality.category', 'Category', required=True, select=True), | 194 | 'category': fields.many2one('gap_analysis.functionality.category', 'Category', required=True, select=True), |
83 | 157 | 'is_tmpl': fields.boolean('Template ?', help='This Functionality is a Template ?'), | 195 | 'is_tmpl': fields.boolean('Template ?', help='This Functionality is a Template ?'), |
84 | 158 | 'proposed': fields.boolean('Propose as template ?'), | 196 | 'proposed': fields.boolean('Propose as template ?'), |
85 | 159 | #### Default values (Templating) #### | 197 | #### Default values (Templating) #### |
93 | 160 | 'workloads': fields.one2many('gap_analysis.workload', 'fct_id', 'Default Workloads'), | 198 | 'workloads': fields.one2many('gap_analysis.workload', 'fct_id', 'Default Workloads'), |
94 | 161 | 'openerp_fct': fields.many2one('gap_analysis.openerp', 'Default OpenERP feature', select=True), | 199 | 'openerp_fct': fields.many2one('gap_analysis.openerp', 'Default OpenERP feature', select=True), |
95 | 162 | 'critical': fields.integer('Default Critical Level', help='Indicator to specify the importance of this functionality in the project.'), | 200 | 'critical': fields.integer('Default Critical Level', help='Indicator to specify the importance of this functionality in the project.'), |
96 | 163 | 'testing': fields.float('Test (hour)'), | 201 | 'testing': fields.float('Test (hour)'), |
97 | 164 | 'effort': fields.many2one('gap_analysis.effort', 'Default Effort', help="Development Effort for this functionality."), | 202 | 'effort': fields.many2one('gap_analysis.effort', 'Default Effort', help="Development Effort for this functionality."), |
98 | 165 | 'duration_wk': fields.float('Default Duration (hour)', help='Since this effort has no pre-defined duration, you must set one.'), | 203 | 'duration_wk': fields.float('Default Duration (hour)', help='Since this effort has no pre-defined duration, you must set one.'), |
99 | 166 | 'unknown_wk': fields.boolean('Must set the duration manually ? (Default)',), | 204 | 'unknown_wk': fields.boolean('Must set the duration manually ? (Default)',), |
100 | 205 | 'ga_lines': fields.function(_search_ga_non_tmpl_lines, type='one2many', relation='gap_analysis.line', method=True, string='Gap Analysis Lines'), | ||
101 | 206 | 'ga_tmpl_lines': fields.function(_search_ga_tmpl_lines, type='one2many', relation='gap_analysis.line', method=True, string='Gap Analysis Template Lines'), | ||
102 | 167 | } | 207 | } |
103 | 208 | |||
104 | 209 | |||
105 | 210 | def open_line_wizard(self, cr, uid, ids, context=None): | ||
106 | 211 | if context is None: | ||
107 | 212 | context={} | ||
108 | 213 | |||
109 | 214 | title = context.get('default_tmpl', False) and 'Create New Template Entry' or 'Create New Entry' | ||
110 | 215 | |||
111 | 216 | return { | ||
112 | 217 | 'type' : 'ir.actions.act_window', | ||
113 | 218 | 'name' : title, | ||
114 | 219 | 'res_model': 'gap_analysis.line_create_wizard', | ||
115 | 220 | 'view_type' : 'form', | ||
116 | 221 | 'view_mode' : 'form', | ||
117 | 222 | 'target' : 'new', | ||
118 | 223 | 'context' : context, | ||
119 | 224 | } | ||
120 | 168 | 225 | ||
121 | 226 | |||
122 | 227 | def onchange_is_tmpl(self, cr, uid, ids, is_tmpl, context=None): | ||
123 | 228 | if context is None: | ||
124 | 229 | context = {} | ||
125 | 230 | |||
126 | 231 | if not is_tmpl or not len(ids): | ||
127 | 232 | return {} | ||
128 | 233 | |||
129 | 234 | ga_line_pool = self.pool.get('gap_analysis.line') | ||
130 | 235 | related_lines = ga_line_pool.search(cr, uid, [('functionality','=',ids[0])], context=context) | ||
131 | 236 | |||
132 | 237 | if not related_lines: | ||
133 | 238 | return {} | ||
134 | 239 | |||
135 | 240 | source_line = max(related_lines) | ||
136 | 241 | fields_to_read = ['workloads', 'openerp_fct', 'critical', 'testing', 'effort', 'duration_wk', 'unknown_wk'] | ||
137 | 242 | val = ga_line_pool.read(cr, uid, source_line, fields_to_read, context=context) | ||
138 | 243 | |||
139 | 244 | if val.get('workloads', False): | ||
140 | 245 | wkld_pool = self.pool.get('gap_analysis.workload') | ||
141 | 246 | new_wklds = [] | ||
142 | 247 | for wkld in val['workloads']: | ||
143 | 248 | wkld_data = wkld_pool.read(cr, uid, wkld, ['type', 'duration']) | ||
144 | 249 | new_wklds.append({'fct_id' : ids[0], 'gap_line_id' : False, 'type' : wkld_data['type'][0], 'duration' : wkld_data['duration']}) | ||
145 | 250 | val['workloads'] = new_wklds | ||
146 | 251 | |||
147 | 252 | return {'value' : val} | ||
148 | 253 | |||
149 | 254 | |||
150 | 169 | def onchange_effort_id(self, cr, uid, ids, effort_id, unknown_wk): | 255 | def onchange_effort_id(self, cr, uid, ids, effort_id, unknown_wk): |
151 | 170 | val = {} | 256 | val = {} |
154 | 171 | my_effort = self.pool.get('gap_analysis.effort').browse(cr, uid, effort_id) | 257 | if effort_id: |
155 | 172 | val['unknown_wk'] = my_effort.unknown | 258 | my_effort = self.pool.get('gap_analysis.effort').browse(cr, uid, effort_id) |
156 | 259 | val['unknown_wk'] = my_effort.unknown | ||
157 | 260 | else: | ||
158 | 261 | val['unknown_wk'] = False | ||
159 | 173 | return {'value': val} | 262 | return {'value': val} |
160 | 174 | 263 | ||
161 | 175 | 264 | ||
162 | 176 | def write(self, cr, uid, ids, vals, context=None): | 265 | def write(self, cr, uid, ids, vals, context=None): |
163 | 177 | if 'is_tmpl' in vals and vals['is_tmpl'] == True: | 266 | if 'is_tmpl' in vals and vals['is_tmpl'] == True: |
164 | 178 | vals['proposed'] = False | 267 | vals['proposed'] = False |
166 | 179 | return super(gap_analysis_functionality, self).write(cr, uid, ids, vals, context=context) | 268 | res = super(gap_analysis_functionality, self).write(cr, uid, ids, vals, context=context) |
167 | 269 | if res: | ||
168 | 270 | id_list = isinstance(ids, list) and ids[:] or [ids] | ||
169 | 271 | line_pool = self.pool.get('gap_analysis.line') | ||
170 | 272 | for fid in id_list: | ||
171 | 273 | lids = line_pool.search(cr, uid, [('gap_id.is_tmpl','=',True),('functionality','=',fid)], context=context) | ||
172 | 274 | line_pool.set_values_by_fct(cr, uid, lids, fid, context=context) | ||
173 | 275 | |||
174 | 276 | return res | ||
175 | 180 | 277 | ||
176 | 181 | gap_analysis_functionality() | 278 | gap_analysis_functionality() |
177 | 182 | 279 | ||
178 | @@ -351,7 +448,7 @@ | |||
179 | 351 | class gap_analysis_line(osv.osv): | 448 | class gap_analysis_line(osv.osv): |
180 | 352 | _name = "gap_analysis.line" | 449 | _name = "gap_analysis.line" |
181 | 353 | _description = "Gap-analysis Lines" | 450 | _description = "Gap-analysis Lines" |
183 | 354 | 451 | ||
184 | 355 | def _estimated_line_time_cost(self, cursor, uid, ids, fields, arg, context=None): | 452 | def _estimated_line_time_cost(self, cursor, uid, ids, fields, arg, context=None): |
185 | 356 | result = {} | 453 | result = {} |
186 | 357 | gap = False | 454 | gap = False |
187 | @@ -404,39 +501,71 @@ | |||
188 | 404 | if w.type.id == arg: | 501 | if w.type.id == arg: |
189 | 405 | amount += w.duration | 502 | amount += w.duration |
190 | 406 | return amount | 503 | return amount |
221 | 407 | 504 | ||
222 | 408 | 505 | ||
223 | 409 | def onchange_functionality_id(self, cr, uid, ids, functionality_id, gap_line_id): | 506 | def set_values_by_fct(self, cr, uid, ids, fct_id, ret_fmt_onchange=False, context=None): |
224 | 410 | val = {} | 507 | vals = [] |
225 | 411 | functionality_tmpl = self.pool.get('gap_analysis.functionality').browse(cr, uid, functionality_id) | 508 | fct_tmpl = self.pool.get('gap_analysis.functionality').browse(cr, uid, fct_id) |
226 | 412 | if functionality_tmpl.effort: | 509 | id_list = isinstance(ids, list) and ids[:] or [ids] |
227 | 413 | val['effort'] = functionality_tmpl.effort.id | 510 | for lid in id_list: |
228 | 414 | if functionality_tmpl.category: | 511 | val = {} |
229 | 415 | val['category'] = functionality_tmpl.category.id | 512 | if fct_tmpl.effort: |
230 | 416 | if functionality_tmpl.testing: | 513 | val['effort'] = fct_tmpl.effort.id |
231 | 417 | val['testing'] = functionality_tmpl.testing | 514 | if fct_tmpl.category: |
232 | 418 | if functionality_tmpl.unknown_wk: | 515 | val['category'] = fct_tmpl.category.id |
233 | 419 | val['unknown_wk'] = functionality_tmpl.unknown_wk | 516 | if fct_tmpl.testing: |
234 | 420 | if functionality_tmpl.duration_wk: | 517 | val['testing'] = fct_tmpl.testing |
235 | 421 | val['duration_wk'] = functionality_tmpl.duration_wk | 518 | if fct_tmpl.unknown_wk: |
236 | 422 | if functionality_tmpl.critical: | 519 | val['unknown_wk'] = fct_tmpl.unknown_wk |
237 | 423 | val['critical'] = functionality_tmpl.critical | 520 | if fct_tmpl.duration_wk: |
238 | 424 | if functionality_tmpl.openerp_fct: | 521 | val['duration_wk'] = fct_tmpl.duration_wk |
239 | 425 | val['openerp_fct'] = functionality_tmpl.openerp_fct.id | 522 | if fct_tmpl.critical: |
240 | 426 | if functionality_tmpl.workloads: | 523 | val['critical'] = fct_tmpl.critical |
241 | 427 | workload_pool = self.pool.get('gap_analysis.workload') | 524 | if fct_tmpl.openerp_fct: |
242 | 428 | my_workloads = [] | 525 | val['openerp_fct'] = fct_tmpl.openerp_fct.id |
243 | 429 | for workload in functionality_tmpl.workloads: | 526 | if fct_tmpl.workloads: |
244 | 430 | workload_vals = {'type':workload.type.id,'duration':workload.duration,} | 527 | workload_pool = self.pool.get('gap_analysis.workload') |
245 | 431 | if gap_line_id: | 528 | my_workloads = [] |
246 | 432 | workload_vals['gap_line_id'] = gap_line_id | 529 | for workload in fct_tmpl.workloads: |
247 | 433 | workload_id = workload_pool.create(cr, uid, workload_vals) | 530 | workload_vals = {'type':workload.type.id,'duration':workload.duration,} |
248 | 434 | if workload_id: | 531 | if lid: |
249 | 435 | my_workloads.append(workload_id) | 532 | workload_vals['gap_line_id'] = lid |
250 | 436 | if my_workloads: | 533 | my_workloads.append(workload_vals) |
251 | 437 | val['workloads'] = my_workloads | 534 | val['workloads'] = my_workloads |
254 | 438 | 535 | if ret_fmt_onchange: | |
255 | 439 | return {'value': val} | 536 | vals.append(val) |
256 | 537 | else: | ||
257 | 538 | my_workloads = val.get('workloads', False) | ||
258 | 539 | old_wkld_data = self.read(cr, uid, lid, ['workloads'], context=context) | ||
259 | 540 | if old_wkld_data: | ||
260 | 541 | old_wklds = old_wkld_data['workloads'] | ||
261 | 542 | wkld_unlink_tuples = [(2, wid) for wid in old_wklds] | ||
262 | 543 | val['workloads'] = wkld_unlink_tuples | ||
263 | 544 | self.write(cr, uid, lid, val, context=context) | ||
264 | 545 | if my_workloads: | ||
265 | 546 | wkld_tuples = [] | ||
266 | 547 | for wkld in my_workloads: | ||
267 | 548 | wkld_tuples.append((0, 0, wkld)) | ||
268 | 549 | self.write(cr, uid, lid, {'workloads':wkld_tuples}, context=context) | ||
269 | 550 | return ret_fmt_onchange and vals or True | ||
270 | 551 | |||
271 | 552 | |||
272 | 553 | def onchange_functionality_id(self, cr, uid, ids, fct_id, gap_id, context=None): | ||
273 | 554 | ret = {} | ||
274 | 555 | ids = isinstance(ids, list) and ids or [ids] | ||
275 | 556 | val = self.set_values_by_fct(cr, uid, ids, fct_id, ret_fmt_onchange=True, context=context) | ||
276 | 557 | ret.update({'value' : val[0]}) | ||
277 | 558 | |||
278 | 559 | if gap_id: | ||
279 | 560 | ga_lines = self.search(cr, uid, [('gap_id','=',gap_id),('id','!=',ids[0])], context=context) | ||
280 | 561 | if ga_lines: | ||
281 | 562 | ga_fcts = self.read(cr, uid, ga_lines, ['functionality'], context=context) | ||
282 | 563 | if fct_id in [fct['functionality'][0] for fct in ga_fcts]: | ||
283 | 564 | ret.update({'warning' : { | ||
284 | 565 | 'title' : 'Warning: Functionality Duplication.', | ||
285 | 566 | 'message' : 'This functionality already exists within this Gap Analysis.', | ||
286 | 567 | }}) | ||
287 | 568 | return ret | ||
288 | 440 | 569 | ||
289 | 441 | 570 | ||
290 | 442 | def onchange_effort_id(self, cr, uid, ids, effort_id, unknown_wk): | 571 | def onchange_effort_id(self, cr, uid, ids, effort_id, unknown_wk): |
291 | @@ -444,8 +573,13 @@ | |||
292 | 444 | my_effort = self.pool.get('gap_analysis.effort').browse(cr, uid, effort_id) | 573 | my_effort = self.pool.get('gap_analysis.effort').browse(cr, uid, effort_id) |
293 | 445 | val['unknown_wk'] = my_effort.unknown | 574 | val['unknown_wk'] = my_effort.unknown |
294 | 446 | return {'value': val} | 575 | return {'value': val} |
297 | 447 | 576 | ||
298 | 448 | 577 | ||
299 | 578 | def _get_dummy_gap_is_tmpl(self, cr, uid, ids, fields, arg, context=None): | ||
300 | 579 | gid = self.read(cr, uid, ids[0], ['gap_id'], context=context)['gap_id'][0] | ||
301 | 580 | return {ids[0] : self.pool.get('gap_analysis').read(cr, uid, gid, ['is_tmpl'], context=context)['is_tmpl']} | ||
302 | 581 | |||
303 | 582 | |||
304 | 449 | _columns = { | 583 | _columns = { |
305 | 450 | 'gap_id': fields.many2one('gap_analysis', 'Gap-analysis', required=True, ondelete='cascade', select=True, readonly=True), | 584 | 'gap_id': fields.many2one('gap_analysis', 'Gap-analysis', required=True, ondelete='cascade', select=True, readonly=True), |
306 | 451 | 'seq': fields.char('Sequence', size=48), | 585 | 'seq': fields.char('Sequence', size=48), |
307 | @@ -463,6 +597,7 @@ | |||
308 | 463 | 'effort': fields.many2one('gap_analysis.effort', 'Effort', help="Development Effort for this functionality."), | 597 | 'effort': fields.many2one('gap_analysis.effort', 'Effort', help="Development Effort for this functionality."), |
309 | 464 | 'duration_wk': fields.float('Duration (hour)', help='Since this effort has no pre-defined duration, you must set one.'), | 598 | 'duration_wk': fields.float('Duration (hour)', help='Since this effort has no pre-defined duration, you must set one.'), |
310 | 465 | 'unknown_wk': fields.boolean('Must set the duration manually ?',), | 599 | 'unknown_wk': fields.boolean('Must set the duration manually ?',), |
311 | 600 | 'dummy_gap_is_tmpl': fields.function(_get_dummy_gap_is_tmpl, type='boolean', name='dummy_gap_is_tmpl', method=True), | ||
312 | 466 | } | 601 | } |
313 | 467 | _defaults = { | 602 | _defaults = { |
314 | 468 | 'unknown_wk': lambda *a: False, | 603 | 'unknown_wk': lambda *a: False, |
315 | @@ -475,4 +610,4 @@ | |||
316 | 475 | 610 | ||
317 | 476 | gap_analysis_line() | 611 | gap_analysis_line() |
318 | 477 | 612 | ||
319 | 478 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
320 | 479 | \ No newline at end of file | 613 | \ No newline at end of file |
321 | 614 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
322 | 480 | 615 | ||
323 | === modified file 'gap_analysis/gap_analysis.xml' | |||
324 | --- gap_analysis/gap_analysis.xml 2013-06-22 02:18:01 +0000 | |||
325 | +++ gap_analysis/gap_analysis.xml 2014-05-09 11:32:13 +0000 | |||
326 | @@ -24,36 +24,104 @@ | |||
327 | 24 | <form string="Gap Analysis Functionalities"> | 24 | <form string="Gap Analysis Functionalities"> |
328 | 25 | <field name="category"/> | 25 | <field name="category"/> |
329 | 26 | <field name="name"/> | 26 | <field name="name"/> |
331 | 27 | <field name="is_tmpl" groups="gap_analysis.res_group_gap1"/> | 27 | <field name="is_tmpl" groups="gap_analysis.res_group_gap1" on_change="onchange_is_tmpl(is_tmpl)"/> |
332 | 28 | <field name="proposed" attrs="{'invisible':[('is_tmpl','=',True)]}"/> | 28 | <field name="proposed" attrs="{'invisible':[('is_tmpl','=',True)]}"/> |
333 | 29 | <newline/> | 29 | <newline/> |
339 | 30 | <separator string="Description" colspan="4"/> | 30 | |
340 | 31 | <field name="description" colspan="4" nolabel="1"/> | 31 | <notebook colspan="4"> |
341 | 32 | <newline/> | 32 | <page string="Details"> |
342 | 33 | <group groups="gap_analysis.res_group_gap1" attrs="{'invisible':[('is_tmpl','=',False)]}" colspan="4" col="4"> | 33 | <separator string="Description" colspan="4"/> |
343 | 34 | <separator colspan="4" string="Template Default Values"/> | 34 | <field name="description" colspan="4" nolabel="1"/> |
344 | 35 | <newline/> | ||
345 | 36 | <group groups="gap_analysis.res_group_gap1" attrs="{'invisible':[('is_tmpl','=',False)]}" colspan="4" col="4"> | ||
346 | 37 | <separator colspan="4" string="Default Values"/> | ||
347 | 35 | <field name="critical"/> | 38 | <field name="critical"/> |
348 | 36 | <field name="openerp_fct"/> | 39 | <field name="openerp_fct"/> |
349 | 37 | <field name="effort" on_change="onchange_effort_id(effort,unknown_wk)"/> | 40 | <field name="effort" on_change="onchange_effort_id(effort,unknown_wk)"/> |
350 | 38 | <field name="unknown_wk" invisible="1"/> | 41 | <field name="unknown_wk" invisible="1"/> |
353 | 39 | <field name="duration_wk" attrs="{'invisible':[('unknown_wk','=',False)]}"/> | 42 | <field name="duration_wk" attrs="{'invisible':[('unknown_wk','=',False)]}"/> |
354 | 40 | <field name="testing"/> | 43 | <field name="testing"/> |
355 | 41 | <newline/> | 44 | <newline/> |
356 | 45 | |||
357 | 42 | <separator colspan="4" string="Workloads"/> | 46 | <separator colspan="4" string="Workloads"/> |
369 | 43 | <field colspan="4" name="workloads" nolabel="1" widget="one2many_list"> | 47 | <field colspan="4" name="workloads" nolabel="1" widget="one2many_list"> |
370 | 44 | <form string="Workloads"> | 48 | <form string="Workloads"> |
371 | 45 | <field name="type" on_change="onchange_type_id(type)" colspan="4"/> | 49 | <field name="type" on_change="onchange_type_id(type)" colspan="4"/> |
372 | 46 | <field name="duration"/> | 50 | <field name="duration"/> |
373 | 47 | </form> | 51 | </form> |
374 | 48 | <tree string="Workloads"> | 52 | <tree> |
375 | 49 | <field name="type"/> | 53 | <field name="type"/> |
376 | 50 | <field name="duration"/> | 54 | <field name="duration"/> |
377 | 51 | </tree> | 55 | </tree> |
378 | 52 | </field> | 56 | </field> |
379 | 53 | </group> | 57 | <newline/> |
380 | 58 | </group> | ||
381 | 59 | </page> | ||
382 | 60 | |||
383 | 61 | <page string="Analyses"> | ||
384 | 62 | <group colspan="4" col="4"> | ||
385 | 63 | <separator colspan="4" string="Instances"/> | ||
386 | 64 | <field colspan="4" name="ga_lines" nolabel="1"> | ||
387 | 65 | <tree colors="grey:keep==False;"> | ||
388 | 66 | <field name="gap_id" string="Gap Analysis"/> | ||
389 | 67 | <field name="code"/> | ||
390 | 68 | <field name="keep" invisible="1"/> | ||
391 | 69 | <field name="phase"/> | ||
392 | 70 | <field name="critical"/> | ||
393 | 71 | <field name="effort"/> | ||
394 | 72 | <field name="testing"/> | ||
395 | 73 | <field name="duration_wk"/> | ||
396 | 74 | <field name="total_time"/> | ||
397 | 75 | <field name="total_cost"/> | ||
398 | 76 | </tree> | ||
399 | 77 | </field> | ||
400 | 78 | <button name="open_line_wizard" string="Add to Analysis" type="object" icon="gtk-add" context="{'default_tmpl':False}"/> | ||
401 | 79 | </group> | ||
402 | 80 | <group attrs="{'invisible':[('is_tmpl','=',False)]}" colspan="4" col="4"> | ||
403 | 81 | <separator colspan="4" string="Gap Templates"/> | ||
404 | 82 | <field colspan="4" name="ga_tmpl_lines" nolabel="1" options="{'deletable': false}"> | ||
405 | 83 | <tree colors="grey:keep==False;"> | ||
406 | 84 | <field name="gap_id" string="Template"/> | ||
407 | 85 | <field name="code"/> | ||
408 | 86 | <field name="keep" invisible="1"/> | ||
409 | 87 | <field name="phase"/> | ||
410 | 88 | <field name="critical"/> | ||
411 | 89 | <field name="effort"/> | ||
412 | 90 | <field name="testing"/> | ||
413 | 91 | <field name="duration_wk"/> | ||
414 | 92 | </tree> | ||
415 | 93 | </field> | ||
416 | 94 | <button name="open_line_wizard" string="Add to Template" type="object" icon="gtk-add" context="{'default_tmpl':True}"/> | ||
417 | 95 | </group> | ||
418 | 96 | </page> | ||
419 | 97 | </notebook> | ||
420 | 54 | </form> | 98 | </form> |
421 | 55 | </field> | 99 | </field> |
422 | 56 | </record> | 100 | </record> |
423 | 101 | |||
424 | 102 | <record id="view_gap_analysis_functionality_filter" model="ir.ui.view"> | ||
425 | 103 | <field name="name">gap_analysis.functionality.search</field> | ||
426 | 104 | <field name="model">gap_analysis.functionality</field> | ||
427 | 105 | <field name="type">search</field> | ||
428 | 106 | <field name="arch" type="xml"> | ||
429 | 107 | <search string="Search Functionality"> | ||
430 | 108 | <filter string="Template" icon="star-on" domain="[('is_tmpl','=',True)]"/> | ||
431 | 109 | <filter string="Regular" icon="star-off" domain="[('is_tmpl','=',False)]"/> | ||
432 | 110 | <separator orientation="vertical"/> | ||
433 | 111 | <filter string="Proposed" icon="terp-idea" domain="[('proposed','=',True)]"/> | ||
434 | 112 | <field name="category"/> | ||
435 | 113 | <field name="name" string="Name"/> | ||
436 | 114 | <field name="description"/> | ||
437 | 115 | <field name="openerp_fct" string="OpenERP Feature"/> | ||
438 | 116 | <newline/> | ||
439 | 117 | <group expand="0" string="Group By..." colspan="4"> | ||
440 | 118 | <filter string="Category" icon="terp-stage" context="{'group_by':'category'}"/> | ||
441 | 119 | <filter string="Critical Level" icon="terp-gnome-cpu-frequency-applet+" context="{'group_by':'critical'}"/> | ||
442 | 120 | <filter string="Effort" icon="terp-project" context="{'group_by':'effort'}"/> | ||
443 | 121 | </group> | ||
444 | 122 | </search> | ||
445 | 123 | </field> | ||
446 | 124 | </record> | ||
447 | 57 | 125 | ||
448 | 58 | <!-- Functionality Categories --> | 126 | <!-- Functionality Categories --> |
449 | 59 | <record id="view_gap_analysis_functionality_category_tree" model="ir.ui.view"> | 127 | <record id="view_gap_analysis_functionality_category_tree" model="ir.ui.view"> |
450 | @@ -202,19 +270,20 @@ | |||
451 | 202 | <form string="Functionalities"> | 270 | <form string="Functionalities"> |
452 | 203 | <group colspan="4" col="4"> | 271 | <group colspan="4" col="4"> |
453 | 204 | <field name="id" invisible="1"/> | 272 | <field name="id" invisible="1"/> |
456 | 205 | <field name="functionality" on_change="onchange_functionality_id(functionality,id)" colspan="4" domain="[('is_tmpl','=',True)]"/> | 273 | <field name="dummy_gap_is_tmpl" invisible="1"/> |
457 | 206 | <field name="category"/> | 274 | <field name="functionality" on_change="onchange_functionality_id(functionality,parent.id)" colspan="4" domain="[('is_tmpl','=',True)]"/> |
458 | 275 | <field name="category" attrs="{'readonly':[('dummy_gap_is_tmpl','=',True)]}"/> | ||
459 | 207 | <field name="keep"/> | 276 | <field name="keep"/> |
462 | 208 | <field name="critical"/> | 277 | <field name="critical" attrs="{'readonly':[('dummy_gap_is_tmpl','=',True)]}"/> |
463 | 209 | <field name="openerp_fct"/> | 278 | <field name="openerp_fct" attrs="{'readonly':[('dummy_gap_is_tmpl','=',True)]}"/> |
464 | 210 | <field name="contributors"/> | 279 | <field name="contributors"/> |
469 | 211 | <field name="testing"/> | 280 | <field name="testing" attrs="{'readonly':[('dummy_gap_is_tmpl','=',True)]}"/> |
470 | 212 | <field name="effort" on_change="onchange_effort_id(effort,unknown_wk)"/> | 281 | <field name="effort" on_change="onchange_effort_id(effort,unknown_wk)" attrs="{'readonly':[('dummy_gap_is_tmpl','=',True)]}"/> |
471 | 213 | <field name="unknown_wk" invisible="1"/> | 282 | <field name="unknown_wk" invisible="1" attrs="{'readonly':[('dummy_gap_is_tmpl','=',True)]}"/> |
472 | 214 | <field name="duration_wk" attrs="{'invisible':[('unknown_wk','=',False)]}"/> | 283 | <field name="duration_wk" attrs="{'invisible':[('unknown_wk','=',False)],'readonly':[('dummy_gap_is_tmpl','=',True)]}"/> |
473 | 215 | <newline/> | 284 | <newline/> |
474 | 216 | <separator colspan="4" string="Workloads"/> | 285 | <separator colspan="4" string="Workloads"/> |
476 | 217 | <field colspan="4" name="workloads" nolabel="1" widget="one2many_list"> | 286 | <field colspan="4" name="workloads" nolabel="1" widget="one2many_list" attrs="{'readonly':[('dummy_gap_is_tmpl','=',True)]}"> |
477 | 218 | <form string="Workloads"> | 287 | <form string="Workloads"> |
478 | 219 | <field name="type" on_change="onchange_type_id(type)"/> | 288 | <field name="type" on_change="onchange_type_id(type)"/> |
479 | 220 | <field name="duration"/> | 289 | <field name="duration"/> |
480 | @@ -295,6 +364,7 @@ | |||
481 | 295 | <field name="res_model">gap_analysis.functionality</field> | 364 | <field name="res_model">gap_analysis.functionality</field> |
482 | 296 | <field name="view_type">form</field> | 365 | <field name="view_type">form</field> |
483 | 297 | <field name="view_mode">tree,form</field> | 366 | <field name="view_mode">tree,form</field> |
484 | 367 | <field name="search_view">gap_analysis.view_gap_analysis_functionality_filter</field> | ||
485 | 298 | </record> | 368 | </record> |
486 | 299 | <record id="act_gap_analysis_fct_tmpl" model="ir.actions.act_window"> | 369 | <record id="act_gap_analysis_fct_tmpl" model="ir.actions.act_window"> |
487 | 300 | <field name="name">Functionality Templates</field> | 370 | <field name="name">Functionality Templates</field> |
488 | @@ -376,4 +446,4 @@ | |||
489 | 376 | <menuitem id="menu_gap_022" name="Efforts" parent="menu_gap_02" sequence="6" action="act_gap_analysis_effort" /> | 446 | <menuitem id="menu_gap_022" name="Efforts" parent="menu_gap_02" sequence="6" action="act_gap_analysis_effort" /> |
490 | 377 | <menuitem id="menu_gap_023" name="OpenERP Features" parent="menu_gap_02" sequence="9" action="act_gap_analysis_openerp" /> | 447 | <menuitem id="menu_gap_023" name="OpenERP Features" parent="menu_gap_02" sequence="9" action="act_gap_analysis_openerp" /> |
491 | 378 | </data> | 448 | </data> |
492 | 379 | </openerp> | ||
493 | 380 | \ No newline at end of file | 449 | \ No newline at end of file |
494 | 450 | </openerp> | ||
495 | 381 | 451 | ||
496 | === modified file 'gap_analysis/wizard/__init__.py' | |||
497 | --- gap_analysis/wizard/__init__.py 2013-06-22 02:18:01 +0000 | |||
498 | +++ gap_analysis/wizard/__init__.py 2014-05-09 11:32:13 +0000 | |||
499 | @@ -22,5 +22,6 @@ | |||
500 | 22 | 22 | ||
501 | 23 | import import_from_tmpl | 23 | import import_from_tmpl |
502 | 24 | import import_from_sheet | 24 | import import_from_sheet |
503 | 25 | import line_create_wizard | ||
504 | 25 | 26 | ||
505 | 26 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 27 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
506 | 27 | 28 | ||
507 | === modified file 'gap_analysis/wizard/import_from_sheet.py' | |||
508 | --- gap_analysis/wizard/import_from_sheet.py 2013-06-22 02:18:01 +0000 | |||
509 | +++ gap_analysis/wizard/import_from_sheet.py 2014-05-09 11:32:13 +0000 | |||
510 | @@ -222,8 +222,7 @@ | |||
511 | 222 | 222 | ||
512 | 223 | # Check Functionality | 223 | # Check Functionality |
513 | 224 | fct_ids = g_fct_pool.search(cr, uid, [('name','ilike',gap_line.functionality)]) | 224 | fct_ids = g_fct_pool.search(cr, uid, [('name','ilike',gap_line.functionality)]) |
516 | 225 | if True: | 225 | if not fct_ids: |
515 | 226 | # if not fct_ids: | ||
517 | 227 | # Create Functionality | 226 | # Create Functionality |
518 | 228 | fct_id = g_fct_pool.create(cr, uid, {'name':gap_line.functionality,'description': gap_line.function_desc,'category':gap_line.category,}) | 227 | fct_id = g_fct_pool.create(cr, uid, {'name':gap_line.functionality,'description': gap_line.function_desc,'category':gap_line.category,}) |
519 | 229 | print('Gap Import: Fct %s created (%s)'%(gap_line.functionality,fct_id)) | 228 | print('Gap Import: Fct %s created (%s)'%(gap_line.functionality,fct_id)) |
520 | 230 | 229 | ||
521 | === modified file 'gap_analysis/wizard/import_from_tmpl.py' | |||
522 | --- gap_analysis/wizard/import_from_tmpl.py 2013-06-22 02:18:01 +0000 | |||
523 | +++ gap_analysis/wizard/import_from_tmpl.py 2014-05-09 11:32:13 +0000 | |||
524 | @@ -38,10 +38,19 @@ | |||
525 | 38 | this = self.browse(cr, uid, ids[0], context=context) | 38 | this = self.browse(cr, uid, ids[0], context=context) |
526 | 39 | gap_line_pool = self.pool.get('gap_analysis.line') | 39 | gap_line_pool = self.pool.get('gap_analysis.line') |
527 | 40 | workload_pool = self.pool.get('gap_analysis.workload') | 40 | workload_pool = self.pool.get('gap_analysis.workload') |
529 | 41 | 41 | ||
530 | 42 | for id in context.get('active_ids', []): #for each gap in which we want to import stuff | 42 | for id in context.get('active_ids', []): #for each gap in which we want to import stuff |
531 | 43 | current_line_ids = gap_line_pool.search(cr, uid, [('gap_id','=',id)], context=context) | ||
532 | 44 | current_fcts = gap_line_pool.read(cr, uid, current_line_ids, ['functionality']) | ||
533 | 45 | current_fct_ids = [f['functionality'][0] for f in current_fcts] | ||
534 | 46 | |||
535 | 43 | #copy gap_line with functionalities and workloads | 47 | #copy gap_line with functionalities and workloads |
536 | 44 | for gap_line in this.template.gap_lines: | 48 | for gap_line in this.template.gap_lines: |
537 | 49 | |||
538 | 50 | if gap_line.functionality.id in current_fct_ids: | ||
539 | 51 | # Functionality already exists in the Gap. | ||
540 | 52 | continue | ||
541 | 53 | |||
542 | 45 | line_vals = { | 54 | line_vals = { |
543 | 46 | 'gap_id': id, | 55 | 'gap_id': id, |
544 | 47 | 'functionality': gap_line.functionality.id, | 56 | 'functionality': gap_line.functionality.id, |
545 | @@ -54,7 +63,7 @@ | |||
546 | 54 | 'duration_wk': gap_line.duration_wk, | 63 | 'duration_wk': gap_line.duration_wk, |
547 | 55 | 'unknown_wk': gap_line.unknown_wk, | 64 | 'unknown_wk': gap_line.unknown_wk, |
548 | 56 | 'testing': gap_line.testing, | 65 | 'testing': gap_line.testing, |
550 | 57 | 'category': gap_line.category, | 66 | 'category': gap_line.category.id, |
551 | 58 | } | 67 | } |
552 | 59 | gap_line_id = gap_line_pool.create(cr, uid, line_vals, context=context) | 68 | gap_line_id = gap_line_pool.create(cr, uid, line_vals, context=context) |
553 | 60 | 69 | ||
554 | @@ -70,4 +79,4 @@ | |||
555 | 70 | 79 | ||
556 | 71 | gap_analysis_import_from_tmpl() | 80 | gap_analysis_import_from_tmpl() |
557 | 72 | 81 | ||
558 | 73 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
559 | 74 | \ No newline at end of file | 82 | \ No newline at end of file |
560 | 83 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
561 | 75 | 84 | ||
562 | === added file 'gap_analysis/wizard/line_create_wizard.py' | |||
563 | --- gap_analysis/wizard/line_create_wizard.py 1970-01-01 00:00:00 +0000 | |||
564 | +++ gap_analysis/wizard/line_create_wizard.py 2014-05-09 11:32:13 +0000 | |||
565 | @@ -0,0 +1,75 @@ | |||
566 | 1 | |||
567 | 2 | |||
568 | 3 | from osv import osv, fields | ||
569 | 4 | from osv.osv import except_osv | ||
570 | 5 | from tools.translate import _ | ||
571 | 6 | |||
572 | 7 | class line_create_wizard(osv.TransientModel): | ||
573 | 8 | _name = 'gap_analysis.line_create_wizard' | ||
574 | 9 | |||
575 | 10 | _columns = { | ||
576 | 11 | 'gap_id' : fields.many2one('gap_analysis', 'Gap Analysis', required=True), | ||
577 | 12 | 'tmpl' : fields.boolean('', help='This is used to control the gap_id domain presented in the wizard'), | ||
578 | 13 | } | ||
579 | 14 | |||
580 | 15 | |||
581 | 16 | def create_line(self, cr, uid, ids, context=None): | ||
582 | 17 | if context is None: | ||
583 | 18 | context = {} | ||
584 | 19 | |||
585 | 20 | fct_fields = [ | ||
586 | 21 | 'workloads', | ||
587 | 22 | 'critical', | ||
588 | 23 | 'testing', | ||
589 | 24 | 'duration_wk', | ||
590 | 25 | 'unknown_wk', | ||
591 | 26 | ] | ||
592 | 27 | |||
593 | 28 | fct_rel_fields = [ | ||
594 | 29 | 'category', | ||
595 | 30 | 'openerp_fct', | ||
596 | 31 | 'effort', | ||
597 | 32 | ] | ||
598 | 33 | |||
599 | 34 | line_pool = self.pool.get('gap_analysis.line') | ||
600 | 35 | fct_pool = self.pool.get('gap_analysis.functionality') | ||
601 | 36 | self_browse = self.browse(cr, uid, ids[0], context=context) | ||
602 | 37 | |||
603 | 38 | # If adding to a template, make sure all the functionalities are also templates. | ||
604 | 39 | if self_browse.gap_id.is_tmpl: | ||
605 | 40 | tmpl_stats = fct_pool.read(cr, uid, context['active_ids'], ['is_tmpl','name'], context=context) | ||
606 | 41 | if not all([tmpl_stat['is_tmpl'] for tmpl_stat in tmpl_stats]): | ||
607 | 42 | non_tmpls = [tmpl_stat['name'] for tmpl_stat in tmpl_stats if not tmpl_stat['is_tmpl']] | ||
608 | 43 | raise except_osv( | ||
609 | 44 | _('Error: Non-template functionalities may not be added to a Gap Analysis Template.'), | ||
610 | 45 | _('Please configure these functionalities accordingly and retry:\n\n%s') % ('\n\n'.join(non_tmpls)) | ||
611 | 46 | ) | ||
612 | 47 | |||
613 | 48 | fct_defs = fct_pool.read(cr, uid, context['active_ids'], fct_fields + fct_rel_fields, context=context) | ||
614 | 49 | gap_id = self_browse.gap_id.id | ||
615 | 50 | new_params = {'gap_id' : gap_id} | ||
616 | 51 | |||
617 | 52 | for fct_def in fct_defs: | ||
618 | 53 | for rel_field in fct_rel_fields: | ||
619 | 54 | fct_def[rel_field] = fct_def[rel_field] and fct_def[rel_field][0] | ||
620 | 55 | |||
621 | 56 | if fct_def['workloads']: | ||
622 | 57 | wkld_pool = self.pool.get('gap_analysis.workload') | ||
623 | 58 | wkld_cps = [] | ||
624 | 59 | for wkld in fct_def['workloads']: | ||
625 | 60 | wkld_cp = wkld_pool.copy(cr, uid, wkld, {'fct_id' : False}, context=context) | ||
626 | 61 | wkld_cps.append(wkld_cp) | ||
627 | 62 | fct_def['workloads'] = [(6, 0, wkld_cps)] | ||
628 | 63 | |||
629 | 64 | new_params.update(functionality=fct_def['id']) | ||
630 | 65 | |||
631 | 66 | fct_def.update(new_params) | ||
632 | 67 | del fct_def['id'] | ||
633 | 68 | line_pool.create(cr, uid, fct_def, context=context) | ||
634 | 69 | |||
635 | 70 | return {'type' : 'ir.actions.act_window_close'} | ||
636 | 71 | |||
637 | 72 | |||
638 | 73 | line_create_wizard() | ||
639 | 74 | |||
640 | 75 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
641 | 0 | 76 | ||
642 | === added file 'gap_analysis/wizard/line_create_wizard_view.xml' | |||
643 | --- gap_analysis/wizard/line_create_wizard_view.xml 1970-01-01 00:00:00 +0000 | |||
644 | +++ gap_analysis/wizard/line_create_wizard_view.xml 2014-05-09 11:32:13 +0000 | |||
645 | @@ -0,0 +1,73 @@ | |||
646 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
647 | 2 | |||
648 | 3 | <openerp> | ||
649 | 4 | <data> | ||
650 | 5 | <record id="line_create_wizard_view" model="ir.ui.view"> | ||
651 | 6 | <field name="name">gap.analysis.line.create.wizard</field> | ||
652 | 7 | <field name="model">gap_analysis.line_create_wizard</field> | ||
653 | 8 | <field name="type">form</field> | ||
654 | 9 | <field name="arch" type="xml"> | ||
655 | 10 | <form string="Create Gap Analysis Lines"> | ||
656 | 11 | <group col="2" colspan="2"> | ||
657 | 12 | <field name="tmpl" invisible="1"/> | ||
658 | 13 | <field name="gap_id" domain="[('is_tmpl','=',tmpl),'|',('is_tmpl','=',True),('state','=','draft')]"/> | ||
659 | 14 | </group> | ||
660 | 15 | <group colspan="2"/> | ||
661 | 16 | <separator colspan="4"/> | ||
662 | 17 | <group colspan="2"/> | ||
663 | 18 | <group col="2" colspan="2"> | ||
664 | 19 | <button icon="gtk-cancel" special="cancel" string="Cancel" colspan="1"/> | ||
665 | 20 | <button icon="gtk-apply" name="create_line" string="Create" type="object" colspan="1" default_focus="1"/> | ||
666 | 21 | </group> | ||
667 | 22 | </form> | ||
668 | 23 | </field> | ||
669 | 24 | </record> | ||
670 | 25 | |||
671 | 26 | <record model="ir.actions.act_window" id="action_gap_analysis_mass_add_to_analysis"> | ||
672 | 27 | <field name="name">Add to Analysis</field> | ||
673 | 28 | <field name="type">ir.actions.act_window</field> | ||
674 | 29 | <field name="view_id" ref="line_create_wizard_view"/> | ||
675 | 30 | <field name="domain">[]</field> | ||
676 | 31 | <field name="context">{'default_tmpl' : False}</field> | ||
677 | 32 | <field name="res_model">gap_analysis.line_create_wizard</field> | ||
678 | 33 | <field name="view_type">form</field> | ||
679 | 34 | <field name="view_mode">form</field> | ||
680 | 35 | <field name="usage">menu</field> | ||
681 | 36 | <field name="target">new</field> | ||
682 | 37 | </record> | ||
683 | 38 | |||
684 | 39 | <record model="ir.values" id="values_gap_analysis_mass_add_to_analysis"> | ||
685 | 40 | <field name="model_id" ref="gap_analysis.model_gap_analysis_functionality" /> | ||
686 | 41 | <field name="object" eval="1" /> | ||
687 | 42 | <field name="name">Add to Analysis</field> | ||
688 | 43 | <field name="key2">client_action_multi</field> | ||
689 | 44 | <field name="value" eval="'ir.actions.act_window,' + str(ref('action_gap_analysis_mass_add_to_analysis'))" /> | ||
690 | 45 | <field name="key">action</field> | ||
691 | 46 | <field name="model">gap_analysis.functionality</field> | ||
692 | 47 | </record> | ||
693 | 48 | |||
694 | 49 | <record model="ir.actions.act_window" id="action_gap_analysis_mass_add_to_template"> | ||
695 | 50 | <field name="name">Add to Template</field> | ||
696 | 51 | <field name="type">ir.actions.act_window</field> | ||
697 | 52 | <field name="view_id" ref="line_create_wizard_view"/> | ||
698 | 53 | <field name="domain">[]</field> | ||
699 | 54 | <field name="context">{'default_tmpl' : True}</field> | ||
700 | 55 | <field name="res_model">gap_analysis.line_create_wizard</field> | ||
701 | 56 | <field name="view_type">form</field> | ||
702 | 57 | <field name="view_mode">form</field> | ||
703 | 58 | <field name="usage">menu</field> | ||
704 | 59 | <field name="target">new</field> | ||
705 | 60 | </record> | ||
706 | 61 | |||
707 | 62 | <record model="ir.values" id="values_gap_analysis_mass_add_to_template"> | ||
708 | 63 | <field name="model_id" ref="gap_analysis.model_gap_analysis_functionality" /> | ||
709 | 64 | <field name="object" eval="1" /> | ||
710 | 65 | <field name="name">Add to Template</field> | ||
711 | 66 | <field name="key2">client_action_multi</field> | ||
712 | 67 | <field name="value" eval="'ir.actions.act_window,' + str(ref('action_gap_analysis_mass_add_to_template'))" /> | ||
713 | 68 | <field name="key">action</field> | ||
714 | 69 | <field name="model">gap_analysis.functionality</field> | ||
715 | 70 | </record> | ||
716 | 71 | |||
717 | 72 | </data> | ||
718 | 73 | </openerp> |