Merge lp:~openerp-commiter/openobject-addons/trunk-rpa-new into lp:~openerp/openobject-addons/old_trunk
- trunk-rpa-new
- Merge into old_trunk
Proposed by
Rucha (Open ERP)
Status: | Merged |
---|---|
Merge reported by: | Husen Daudi |
Merged at revision: | not available |
Proposed branch: | lp:~openerp-commiter/openobject-addons/trunk-rpa-new |
Merge into: | lp:~openerp/openobject-addons/old_trunk |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~openerp-commiter/openobject-addons/trunk-rpa-new |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenERP Core Team | Pending | ||
Review via email: mp+6415@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'report_analytic_planning/__terp__.py' |
2 | --- report_analytic_planning/__terp__.py 2009-02-03 17:02:20 +0000 |
3 | +++ report_analytic_planning/__terp__.py 2009-05-05 09:52:10 +0000 |
4 | @@ -28,7 +28,9 @@ |
5 | 'description': """Planning on analytic accounts.""", |
6 | 'author': 'Tiny', |
7 | 'website': 'http://www.openerp.com', |
8 | - 'depends': ['account', 'hr_timesheet_invoice', 'project', 'report_analytic_line'], |
9 | + 'depends': ['account', 'hr_timesheet_invoice', 'project', 'report_analytic_line', 'hr_holidays', |
10 | + 'hr_timesheet_sheet' |
11 | + ], |
12 | 'init_xml': [], |
13 | 'update_xml': [ |
14 | 'security/ir.model.access.csv', |
15 | |
16 | === modified file 'report_analytic_planning/report_account_analytic.planning.csv' |
17 | --- report_analytic_planning/report_account_analytic.planning.csv 2007-08-09 11:20:41 +0000 |
18 | +++ report_analytic_planning/report_account_analytic.planning.csv 2009-05-07 12:36:03 +0000 |
19 | @@ -1,10 +1,10 @@ |
20 | -name,line_ids/amount,line_ids/amount_unit,line_ids/user_id,line_ids/account_id,user_id |
21 | -Planning 2007,5.0,Day,admin,Seagate P1,admin |
22 | -,7.0,Day,admin,Seagate P2, |
23 | -,2.0,Day,admin,Sednacom, |
24 | -,3.0,Day,admin,Administratif, |
25 | -,4.0,Day,admin,Commercial & Marketing, |
26 | -,6.0,Day,demo,Seagate P1, |
27 | -,7.0,Day,demo,Seagate P2, |
28 | -,1.0,Day,demo,CampToCamp, |
29 | -,7.0,Day,demo,Agrolait, |
30 | +name,line_ids/amount,line_ids/amount_unit,line_ids/user_id,line_ids/task,line_ids/account_id,user_id |
31 | +Planning 2007,5.0,Day,admin,1,Seagate P1,admin |
32 | +,7.0,Day,admin,0,Seagate P2, |
33 | +,2.0,Day,admin,1,Sednacom, |
34 | +,3.0,Day,admin,0,Administratif, |
35 | +,4.0,Day,admin,0,Commercial & Marketing, |
36 | +,6.0,Day,demo,1,Seagate P1, |
37 | +,7.0,Day,demo,1,Seagate P2, |
38 | +,1.0,Day,demo,0,CampToCamp, |
39 | +,7.0,Day,demo,0,Agrolait, |
40 | |
41 | === modified file 'report_analytic_planning/report_analytic_planning.py' |
42 | --- report_analytic_planning/report_analytic_planning.py 2009-04-29 05:03:05 +0000 |
43 | +++ report_analytic_planning/report_analytic_planning.py 2009-05-11 09:20:03 +0000 |
44 | @@ -20,7 +20,7 @@ |
45 | # |
46 | ############################################################################## |
47 | |
48 | -from osv import fields,osv |
49 | +from osv import fields, osv |
50 | |
51 | import time |
52 | import mx.DateTime |
53 | @@ -28,31 +28,68 @@ |
54 | class report_account_analytic_planning(osv.osv): |
55 | _name = "report_account_analytic.planning" |
56 | _description = "Planning" |
57 | + |
58 | + def _get_total_planned(self, cr, uid, ids, name, args, context): |
59 | + result = {} |
60 | + for plan in self.browse(cr, uid, ids, context): |
61 | + plan_hrs=0.0 |
62 | + for p in plan.planning_user: |
63 | + if not p.plan_open : p.plan_open = 0.0 |
64 | + if not p.plan_tasks : p.plan_tasks = 0.0 |
65 | + plan_hrs=plan_hrs +p.plan_open+p.plan_tasks |
66 | + result[plan.id] = plan_hrs |
67 | + return result |
68 | + |
69 | + def _get_total_free(self, cr, uid, ids, name, args, context): |
70 | + result = {} |
71 | + for plan in self.browse(cr, uid, ids, context): |
72 | + total_free=0.0 |
73 | + for p in plan.planning_user: |
74 | + if p.free: |
75 | + total_free=total_free+p.free |
76 | + result[plan.id] = total_free |
77 | + return result |
78 | + |
79 | + |
80 | _columns = { |
81 | - 'name': fields.char('Planning Name', size=32, required=True, readonly=True, states={'open':[('readonly',False)]}), |
82 | - 'user_id': fields.many2one('res.users', 'Responsible', required=True, readonly=True, states={'open':[('readonly',False)]}), |
83 | - 'date_from':fields.date('Start Date', required=True, readonly=True, states={'open':[('readonly',False)]}), |
84 | - 'date_to':fields.date('End Date', required=True, readonly=True, states={'open':[('readonly',False)]}), |
85 | - 'line_ids': fields.one2many('report_account_analytic.planning.line', 'planning_id', 'Planning lines', readonly=True, states={'open':[('readonly',False)]}), |
86 | - 'stat_ids': fields.one2many('report_account_analytic.planning.stat', 'planning_id', 'Planning analysis', readonly=True), |
87 | - 'stat_user_ids': fields.one2many('report_account_analytic.planning.stat.user', 'planning_id', 'Planning by user', readonly=True), |
88 | - 'stat_account_ids': fields.one2many('report_account_analytic.planning.stat.account', 'planning_id', 'Planning by account', readonly=True), |
89 | - 'state': fields.selection([('open','Open'),('done','Done')], 'Status', required=True), |
90 | - 'business_days' : fields.integer('Business Days') |
91 | + 'name': fields.char('Planning Name', size=32, required=True, readonly=True, states={'open':[('readonly', False)]}), |
92 | + 'user_id': fields.many2one('res.users', 'Responsible', required=True, readonly=True, states={'open':[('readonly', False)]}), |
93 | + 'date_from':fields.date('Start Date', required=True, readonly=True, states={'open':[('readonly', False)]}), |
94 | + 'date_to':fields.date('End Date', required=True, readonly=True, states={'open':[('readonly', False)]}), |
95 | + 'line_ids': fields.one2many('report_account_analytic.planning.line', 'planning_id', 'Planning lines', readonly=True, states={'open':[('readonly', False)]}), |
96 | + 'stat_ids': fields.one2many('report_account_analytic.planning.stat', 'planning_id', 'Planning analysis', readonly=True), |
97 | + 'stat_user_ids': fields.one2many('report_account_analytic.planning.stat.user', 'planning_id', 'Planning by user', readonly=True), |
98 | + 'stat_account_ids': fields.one2many('report_account_analytic.planning.stat.account', 'planning_id', 'Planning by account', readonly=True), |
99 | + 'state': fields.selection([('draft','Draft'),('open', 'Open'), ('done', 'Done'),('cancel','Cancelled')], 'Status', required=True), |
100 | + 'business_days' : fields.integer('Business Days', required=True), |
101 | + 'task_ids': fields.one2many('project.task', 'planning_id', 'Planning Tasks'), |
102 | + 'planning_user': fields.one2many('report_account_analytic.planning.user', 'planning_id', 'Planning By User'), |
103 | + 'planning_account': fields.one2many('report_account_analytic.planning.account', 'planning_id', 'Planning By Account'), |
104 | + 'total_planned' : fields.function(_get_total_planned, method=True, string='Total Planned'), |
105 | + 'total_free' : fields.function(_get_total_free, method=True, string='Total Free'), |
106 | } |
107 | _defaults = { |
108 | - 'name': lambda *a: time.strftime('%Y-%m-%d'), |
109 | - 'date_from': lambda *a: time.strftime('%Y-%m-01'), |
110 | - 'date_to': lambda *a: (mx.DateTime.now()+mx.DateTime.RelativeDateTime(months=1,day=1,days=-1)).strftime('%Y-%m-%d'), |
111 | - 'user_id': lambda self,cr,uid,c: uid, |
112 | - 'state': lambda *args: 'open' |
113 | + 'name': lambda *a: time.strftime('%B-%y'), |
114 | + 'date_from': lambda *a: time.strftime('%Y-%m-01'), |
115 | + 'date_to': lambda *a: (mx.DateTime.now()+mx.DateTime.RelativeDateTime(months=1, day=1, days=-1)).strftime('%Y-%m-%d'), |
116 | + 'user_id': lambda self, cr, uid, c: uid, |
117 | + 'state': lambda *args: 'draft', |
118 | + 'business_days' : lambda *a: 20, |
119 | } |
120 | _order = 'date_from desc' |
121 | |
122 | def action_open(self, cr, uid, id, context={}): |
123 | self.write(cr, uid, id, {'state' : 'open'}) |
124 | return True |
125 | - |
126 | + |
127 | + def action_cancel(self, cr, uid, id, context={}): |
128 | + self.write(cr, uid, id, {'state' : 'cancel'}) |
129 | + return True |
130 | + |
131 | + def action_draft(self, cr, uid, id, context={}): |
132 | + self.write(cr, uid, id, {'state' : 'draft'}) |
133 | + return True |
134 | + |
135 | def action_done(self, cr, uid, id, context={}): |
136 | self.write(cr, uid, id, {'state' : 'done'}) |
137 | return True |
138 | @@ -64,16 +101,187 @@ |
139 | _description = "Planning Line" |
140 | _rec_name = 'user_id' |
141 | _columns = { |
142 | - 'account_id':fields.many2one('account.analytic.account', 'Analytic account', required=True), |
143 | - 'planning_id': fields.many2one('report_account_analytic.planning', 'Planning', required=True, ondelete='cascade'), |
144 | - 'user_id': fields.many2one('res.users', 'User'), |
145 | - 'amount': fields.float('Quantity', required=True), |
146 | - 'amount_unit':fields.many2one('product.uom', 'Qty UoM', required=True), |
147 | - 'note':fields.text('Note', size=64), |
148 | + 'account_id':fields.many2one('account.analytic.account', 'Analytic account', required=True), |
149 | + 'planning_id': fields.many2one('report_account_analytic.planning', 'Planning', required=True, ondelete='cascade'), |
150 | + 'user_id': fields.many2one('res.users', 'User'), |
151 | + 'amount': fields.float('Quantity', required=True), |
152 | + 'amount_unit': fields.many2one('product.uom', 'Qty UoM', required=True), |
153 | + 'note': fields.text('Note', size=64), |
154 | + 'task' : fields.boolean('Assigned to task(s)'), |
155 | + |
156 | } |
157 | _order = 'user_id,account_id' |
158 | report_account_analytic_planning_line() |
159 | |
160 | +class project_task(osv.osv): |
161 | + _name = "project.task" |
162 | + _inherit = "project.task" |
163 | + _columns = { |
164 | + 'planning_id': fields.many2one('report_account_analytic.planning', 'Planning', ondelete='cascade'), |
165 | + } |
166 | +project_task() |
167 | + |
168 | + |
169 | +class report_account_analytic_planning_user(osv.osv): |
170 | + _name = "report_account_analytic.planning.user" |
171 | + _description = "Planning by User" |
172 | + _rec_name = 'user_id' |
173 | + _auto = False |
174 | + |
175 | + |
176 | + def _get_tasks(self, cr, uid, ids, name, args, context): |
177 | + result = {} |
178 | + for line in self.browse(cr, uid, ids, context): |
179 | + if line.user_id.id: |
180 | + cr.execute("""select COALESCE(sum(tasks.remaining_hours),0) from project_task tasks \ |
181 | + where tasks.user_id=%s and tasks.planning_id=%s""", (line.user_id.id, line.planning_id.id,)) |
182 | + result[line.id] = cr.fetchall()[0][0] |
183 | + else: |
184 | + result[line.id] = 0 |
185 | + return result |
186 | + |
187 | + |
188 | + def _get_free(self, cr, uid, ids, name, args, context): |
189 | + result = {} |
190 | + for line in self.browse(cr, uid, ids, context): |
191 | + |
192 | + result[line.id] = line.planning_id.business_days - line.plan_tasks - line.plan_open - line.holiday |
193 | + return result |
194 | + |
195 | + def _get_plan_open(self, cr, uid, ids, name, args, context): |
196 | + result = {} |
197 | + for line in self.browse(cr, uid, ids, context): |
198 | + if line.user_id.id: |
199 | + cr.execute('select sum(amount) as plan_tasks\ |
200 | + from report_account_analytic_planning_line where task=False and user_id= %s ', (line.user_id.id or None,)) |
201 | + result[line.id] = cr.fetchall()[0][0] |
202 | + else: |
203 | + cr.execute('select sum(amount) as plan_tasks\ |
204 | + from report_account_analytic_planning_line where task=False and user_id is null') |
205 | + result[line.id] = cr.fetchall()[0][0] |
206 | + return result |
207 | + |
208 | + |
209 | + _columns = { |
210 | + 'planning_id': fields.many2one('report_account_analytic.planning', 'Planning'), |
211 | + 'user_id': fields.many2one('res.users', 'User', readonly=True), |
212 | + 'tasks' : fields.function(_get_tasks, method=True, string='Tasks'), |
213 | + 'plan_tasks': fields.float('Planned to tasks', readonly=True), |
214 | + 'free' : fields.function(_get_free, method=True, string='Free', readonly=True), |
215 | + 'plan_open': fields.float('Planned-Open', readonly=True), |
216 | + 'holiday': fields.float('Holidays'), |
217 | + 'timesheet': fields.float('Timesheet'), |
218 | + } |
219 | + |
220 | + def init(self, cr): |
221 | + cr.execute(""" create or replace view report_account_analytic_planning_user as ( |
222 | + select |
223 | + planning.id as planning_id, |
224 | + sum(line.id) as id, |
225 | + planning.business_days, |
226 | + line.user_id, |
227 | + (Select sum(line1.amount) from report_account_analytic_planning_line line1 |
228 | + where line1.task = True and line1.user_id = line.user_id |
229 | + and line1.planning_id = line.planning_id |
230 | + ) |
231 | + as plan_tasks, |
232 | + (Select sum(line1.amount) from report_account_analytic_planning_line line1 |
233 | + where line1.task = False and line1.user_id = line.user_id |
234 | + and line1.planning_id = line.planning_id |
235 | + ) |
236 | + as plan_open, |
237 | + ( select sum(holidays.number_of_days) from hr_holidays holidays where line.user_id=holidays.user_id and holidays.state in ('validate','confirm') |
238 | + and holidays.date_from>=planning.date_from and holidays.date_to <= planning.date_to) |
239 | + as holiday, |
240 | + (select sum(sheet_day.total_timesheet) as timesheet |
241 | + from hr_timesheet_sheet_sheet_day sheet_day |
242 | + left join hr_timesheet_sheet_sheet sheet on sheet_day.sheet_id = sheet.id |
243 | + where sheet_day.name BETWEEN planning.date_from and planning.date_to |
244 | + and sheet.user_id =line.user_id |
245 | + ) as timesheet |
246 | + from report_account_analytic_planning planning |
247 | + inner join report_account_analytic_planning_line line on line.planning_id = planning.id and line.user_id is not null |
248 | + group by planning.id,planning.business_days, line.planning_id, line.user_id, planning.date_from, planning.date_to |
249 | + UNION |
250 | + |
251 | + select |
252 | + planning.id as planning_id, |
253 | + max(planning.id) as id, |
254 | + planning.business_days, |
255 | + line.user_id, |
256 | + (Select sum(line1.amount) from report_account_analytic_planning_line line1 |
257 | + where line1.task = True and line1.user_id is null) |
258 | + as plan_tasks, |
259 | + (Select sum(line1.amount) from report_account_analytic_planning_line line1 |
260 | + where line1.task = False and line1.user_id is null) |
261 | + as plan_open, |
262 | + '0' as holiday, |
263 | + '0' as timesheet |
264 | + from report_account_analytic_planning planning |
265 | + inner join report_account_analytic_planning_line line on line.planning_id = planning.id and line.user_id is null |
266 | + group by planning.id,planning.business_days, line.user_id, planning.date_from, planning.date_to |
267 | + ) |
268 | + """) |
269 | + |
270 | + |
271 | +report_account_analytic_planning_user() |
272 | + |
273 | +class report_account_analytic_planning_account(osv.osv): |
274 | + _name = "report_account_analytic.planning.account" |
275 | + _description = "Planning by Account" |
276 | + _rec_name = 'account_id' |
277 | + _auto = False |
278 | + |
279 | + def _get_free(self, cr, uid, ids, name, args, context): |
280 | + result = {} |
281 | + for line in self.browse(cr, uid, ids, context): |
282 | + result[line.id] = line.planning_id.business_days - line.plan_tasks - line.plan_open |
283 | + return result |
284 | + |
285 | + _columns = { |
286 | + 'planning_id': fields.many2one('report_account_analytic.planning', 'Planning'), |
287 | + 'account_id': fields.many2one('account.analytic.account', 'Analytic account', readonly=True), |
288 | + 'tasks' : fields.float('Tasks'), |
289 | + 'plan_tasks': fields.float('Planned to tasks', readonly=True), |
290 | + 'free' : fields.function(_get_free, method=True, string='Free', readonly=True), |
291 | + 'plan_open': fields.float('Planned-Open', readonly=True), |
292 | + } |
293 | + |
294 | + def init(self, cr): |
295 | + cr.execute(""" create or replace view report_account_analytic_planning_account as ( |
296 | + select |
297 | + min(l.id) as id, |
298 | + l.account_id as account_id, |
299 | + sum(l.amount) as quantity, |
300 | + l.planning_id as planning_id, |
301 | + (Select sum(line1.amount) from report_account_analytic_planning_line line1 |
302 | + where line1.task = True and l.account_id = line1.account_id |
303 | + and l.planning_id = line1.planning_id |
304 | + ) |
305 | + as plan_tasks, |
306 | + (Select sum(line1.amount) from report_account_analytic_planning_line line1 |
307 | + where line1.task = False and l.account_id = line1.account_id |
308 | + and l.planning_id = line1.planning_id |
309 | + ) |
310 | + as plan_open, |
311 | + |
312 | + ( |
313 | + select sum(tasks.remaining_hours) |
314 | + from report_account_analytic_planning plan |
315 | + left join project_task tasks on tasks.planning_id = plan.id |
316 | + inner join project_project proj on tasks.project_id = proj.id |
317 | + where plan.id = l.planning_id and proj.category_id = l.account_id |
318 | + group by proj.category_id |
319 | + ) as tasks |
320 | + from report_account_analytic_planning_line l |
321 | + group by l.account_id, l.planning_id |
322 | + ) |
323 | + """) |
324 | + |
325 | + |
326 | +report_account_analytic_planning_account() |
327 | + |
328 | + |
329 | class report_account_analytic_planning_stat_account(osv.osv): |
330 | _name = "report_account_analytic.planning.stat.account" |
331 | _description = "Planning account stat" |
332 | @@ -83,14 +291,14 @@ |
333 | def _sum_amount_real(self, cr, uid, ids, name, args, context): |
334 | result = {} |
335 | for line in self.browse(cr, uid, ids, context): |
336 | - cr.execute('select sum(unit_amount) from account_analytic_line where account_id=%s and date>=%s and date<=%s', (line.account_id.id,line.planning_id.date_from,line.planning_id.date_to)) |
337 | + cr.execute('select sum(unit_amount) from account_analytic_line where account_id=%s and date>=%s and date<=%s', (line.account_id.id, line.planning_id.date_from, line.planning_id.date_to)) |
338 | result[line.id] = cr.fetchone()[0] |
339 | return result |
340 | _columns = { |
341 | - 'planning_id': fields.many2one('report_account_analytic.planning', 'Planning'), |
342 | - 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True), |
343 | - 'quantity': fields.float('Planned', required=True), |
344 | - 'sum_amount_real': fields.function(_sum_amount_real, method=True, string='Timesheet'), |
345 | + 'planning_id': fields.many2one('report_account_analytic.planning', 'Planning'), |
346 | + 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True), |
347 | + 'quantity': fields.float('Planned', required=True), |
348 | + 'sum_amount_real': fields.function(_sum_amount_real, method=True, string='Timesheet'), |
349 | } |
350 | def init(self, cr): |
351 | cr.execute(""" |
352 | @@ -120,9 +328,9 @@ |
353 | result = {} |
354 | for line in self.browse(cr, uid, ids, context): |
355 | if line.user_id: |
356 | - cr.execute('select sum(unit_amount) from account_analytic_line where user_id=%s and account_id=%s and date>=%s and date<=%s', (line.user_id.id,line.account_id.id,line.planning_id.date_from,line.planning_id.date_to)) |
357 | + cr.execute('select sum(unit_amount) from account_analytic_line where user_id=%s and account_id=%s and date>=%s and date<=%s', (line.user_id.id, line.account_id.id, line.planning_id.date_from, line.planning_id.date_to)) |
358 | else: |
359 | - cr.execute('select sum(unit_amount) from account_analytic_line where account_id=%s and date>=%s and date<=%s', (line.account_id.id,line.planning_id.date_from,line.planning_id.date_to)) |
360 | + cr.execute('select sum(unit_amount) from account_analytic_line where account_id=%s and date>=%s and date<=%s', (line.account_id.id, line.planning_id.date_from, line.planning_id.date_to)) |
361 | result[line.id] = cr.fetchone()[0] |
362 | return result |
363 | def _sum_amount_tasks(self, cr, uid, ids, name, args, context): |
364 | @@ -140,20 +348,20 @@ |
365 | project_id in (select id from project_project where category_id=%s) and |
366 | date_close>=%s and |
367 | date_close<=%s''', ( |
368 | - line.account_id.id, |
369 | - line.planning_id.date_from, |
370 | + line.account_id.id, |
371 | + line.planning_id.date_from, |
372 | line.planning_id.date_to) |
373 | ) |
374 | result[line.id] = cr.fetchone()[0] |
375 | return result |
376 | _columns = { |
377 | - 'planning_id': fields.many2one('report_account_analytic.planning', 'Planning'), |
378 | - 'user_id': fields.many2one('res.users', 'User'), |
379 | - 'manager_id': fields.many2one('res.users', 'Manager'), |
380 | - 'account_id': fields.many2one('account.analytic.account', 'Account', required=True), |
381 | - 'sum_amount': fields.float('Planned hours', required=True), |
382 | - 'sum_amount_real': fields.function(_sum_amount_real, method=True, string='Timesheet'), |
383 | - 'sum_amount_tasks': fields.function(_sum_amount_tasks, method=True, string='Tasks'), |
384 | + 'planning_id': fields.many2one('report_account_analytic.planning', 'Planning'), |
385 | + 'user_id': fields.many2one('res.users', 'User'), |
386 | + 'manager_id': fields.many2one('res.users', 'Manager'), |
387 | + 'account_id': fields.many2one('account.analytic.account', 'Account', required=True), |
388 | + 'sum_amount': fields.float('Planned hours', required=True), |
389 | + 'sum_amount_real': fields.function(_sum_amount_real, method=True, string='Timesheet'), |
390 | + 'sum_amount_tasks': fields.function(_sum_amount_tasks, method=True, string='Tasks'), |
391 | } |
392 | _order = 'planning_id,user_id' |
393 | def init(self, cr): |
394 | @@ -189,14 +397,14 @@ |
395 | for line in self.browse(cr, uid, ids, context): |
396 | result[line.id] = 0.0 |
397 | if line.user_id: |
398 | - cr.execute('select sum(unit_amount) from account_analytic_line where user_id=%s and date>=%s and date<=%s', (line.user_id.id,line.planning_id.date_from,line.planning_id.date_to)) |
399 | + cr.execute('select sum(unit_amount) from account_analytic_line where user_id=%s and date>=%s and date<=%s', (line.user_id.id, line.planning_id.date_from, line.planning_id.date_to)) |
400 | result[line.id] = cr.fetchone()[0] |
401 | return result |
402 | _columns = { |
403 | - 'planning_id': fields.many2one('report_account_analytic.planning', 'Planning', required=True), |
404 | - 'user_id': fields.many2one('res.users', 'User'), |
405 | - 'quantity': fields.float('Planned', required=True), |
406 | - 'sum_amount_real': fields.function(_sum_amount_real, method=True, string='Timesheet'), |
407 | + 'planning_id': fields.many2one('report_account_analytic.planning', 'Planning', required=True), |
408 | + 'user_id': fields.many2one('res.users', 'User'), |
409 | + 'quantity': fields.float('Planned', required=True), |
410 | + 'sum_amount_real': fields.function(_sum_amount_real, method=True, string='Timesheet'), |
411 | } |
412 | def init(self, cr): |
413 | cr.execute(""" |
414 | @@ -218,3 +426,4 @@ |
415 | |
416 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
417 | |
418 | + |
419 | |
420 | === modified file 'report_analytic_planning/report_analytic_planning_view.xml' |
421 | --- report_analytic_planning/report_analytic_planning_view.xml 2009-04-29 05:03:05 +0000 |
422 | +++ report_analytic_planning/report_analytic_planning_view.xml 2009-05-11 09:20:03 +0000 |
423 | @@ -1,219 +1,277 @@ |
424 | <?xml version="1.0" encoding="utf-8"?> |
425 | <openerp> |
426 | - <data> |
427 | - <record id="account_analytic_planning_view_tree" model="ir.ui.view"> |
428 | - <field name="name">report.account.analytic.planning.tree</field> |
429 | - <field name="model">report_account_analytic.planning</field> |
430 | - <field name="type">tree</field> |
431 | - <field name="arch" type="xml"> |
432 | - <tree string="Planning by Account"> |
433 | - <field name="name"/> |
434 | - <field name="user_id"/> |
435 | - <field name="date_from"/> |
436 | - <field name="date_to"/> |
437 | - <field name="state"/> |
438 | - </tree> |
439 | - </field> |
440 | - </record> |
441 | - |
442 | - <record id="account_analytic_planning_view_form" model="ir.ui.view"> |
443 | - <field name="name">report.account.analytic.planning.form</field> |
444 | - <field name="model">report_account_analytic.planning</field> |
445 | - <field name="type">form</field> |
446 | - <field name="arch" type="xml"> |
447 | - <form string="Planning by Account"> |
448 | - <field name="name" select="1"/> |
449 | - <field name="user_id" select="1"/> |
450 | - <field name="date_from"/> |
451 | - <field name="date_to"/> |
452 | - <notebook> |
453 | - <page string="Planning"> |
454 | - <field colspan="4" name="line_ids" nolabel="1"> |
455 | - <tree editable="bottom" string="Planning Line"> |
456 | - <field name="user_id"/> |
457 | - <field name="account_id"/> |
458 | - <field name="amount"/> |
459 | - <field name="amount_unit"/> |
460 | - <field name="note"/> |
461 | - </tree> |
462 | - <form string="Planning Line"> |
463 | - <field name="user_id"/> |
464 | - <field name="account_id"/> |
465 | - <field name="amount"/> |
466 | - <field name="amount_unit"/> |
467 | - <separator string="Notes" colspan="4" /> |
468 | - <field name="note" colspan="4" nolabel="1"/> |
469 | - </form> |
470 | - </field> |
471 | - <group col="4" colspan="4"> |
472 | - <field name="state" select="1" readonly="1"/> |
473 | - <button name="action_open" states="done" string="Re-Open" type="object" icon="gtk-convert"/> |
474 | - <button name="action_done" states="open" string="Done" type="object" icon="gtk-jump-to"/> |
475 | - </group> |
476 | - </page> |
477 | - <page string="Analysis"> |
478 | - <field colspan="4" name="stat_ids" nolabel="1" readonly="1"> |
479 | - <tree editable="bottom" string="Planning Line"> |
480 | - <field name="user_id"/> |
481 | - <field name="account_id"/> |
482 | - <field name="sum_amount"/> |
483 | - <field name="sum_amount_real"/> |
484 | - </tree> |
485 | - </field> |
486 | - </page> |
487 | - <page string="Time by User"> |
488 | - <field colspan="4" name="stat_user_ids" nolabel="1"> |
489 | - <tree string="Quantities by User"> |
490 | - <field name="user_id"/> |
491 | - <field name="quantity" sum="Total Planned"/> |
492 | - <field name="sum_amount_real" sum="Total Timesheet"/> |
493 | - </tree> |
494 | - </field> |
495 | - </page> |
496 | - <page string="Time by Account"> |
497 | - <field colspan="4" name="stat_account_ids" nolabel="1"> |
498 | - <tree string="Quantities by Account"> |
499 | - <field name="account_id"/> |
500 | - <field name="quantity" sum="Total Planned"/> |
501 | - <field name="sum_amount_real" sum="Total Timesheet"/> |
502 | - </tree> |
503 | - </field> |
504 | - </page> |
505 | - </notebook> |
506 | - </form> |
507 | - </field> |
508 | - </record> |
509 | - |
510 | - <record id="action_account_analytic_planning_form" model="ir.actions.act_window"> |
511 | - <field name="name">Planning</field> |
512 | - <field name="res_model">report_account_analytic.planning</field> |
513 | - <field name="view_type">form</field> |
514 | - <field name="view_mode">tree,form</field> |
515 | - </record> |
516 | - <menuitem id="planning_main" name="Planning" parent="hr.menu_hr_root"/> |
517 | - <menuitem |
518 | - action="action_account_analytic_planning_form" |
519 | - id="menu_report_account_analytic_planning" |
520 | - parent="planning_main"/> |
521 | - |
522 | - <record id="action_account_analytic_planning_form_my" model="ir.actions.act_window"> |
523 | - <field name="name">My Planning</field> |
524 | - <field name="res_model">report_account_analytic.planning</field> |
525 | - <field name="view_type">form</field> |
526 | - <field name="view_mode">tree,form</field> |
527 | - <field name="domain">[('user_id','=',uid)]</field> |
528 | - </record> |
529 | - <menuitem |
530 | - action="action_account_analytic_planning_form_my" |
531 | - id="menu_report_account_analytic_planning_my2" |
532 | - parent="planning_main"/> |
533 | - |
534 | - <record id="action_account_analytic_planning_form_current_my" model="ir.actions.act_window"> |
535 | - <field name="name">My Current Planning</field> |
536 | - <field name="res_model">report_account_analytic.planning</field> |
537 | - <field name="view_type">form</field> |
538 | - <field name="view_mode">tree,form</field> |
539 | + <data> |
540 | + |
541 | + <record id="account_analytic_planning_view_tree" model="ir.ui.view"> |
542 | + <field name="name">report.account.analytic.planning.tree</field> |
543 | + <field name="model">report_account_analytic.planning</field> |
544 | + <field name="type">tree</field> |
545 | + <field name="arch" type="xml"> |
546 | + <tree string="Planning by Account"> |
547 | + <field name="name" /> |
548 | + <field name="user_id" /> |
549 | + <field name="date_from" /> |
550 | + <field name="date_to" /> |
551 | + <field name="business_days" /> |
552 | + <field name="total_planned" /> |
553 | + <field name="total_free" /> |
554 | + <field name="state" /> |
555 | + </tree> |
556 | + </field> |
557 | + </record> |
558 | + |
559 | + <record id="account_analytic_planning_view_form" model="ir.ui.view"> |
560 | + <field name="name">report.account.analytic.planning.form</field> |
561 | + <field name="model">report_account_analytic.planning</field> |
562 | + <field name="type">form</field> |
563 | + <field name="arch" type="xml"> |
564 | + <form string="Planning by Account"> |
565 | + <group col="6" colspan="4"> |
566 | + <field name="name" select="1" /> |
567 | + <field name="user_id" select="1" /> |
568 | + <field name="business_days" /> |
569 | + <field name="date_from" /> |
570 | + <field name="date_to" /> |
571 | + </group> |
572 | + <notebook colspan="4"> |
573 | + <page string="Planning by User"> |
574 | + <field colspan="4" name="planning_user" |
575 | + nolabel="1" widget="one2many_list" readonly="1"> |
576 | + <tree string="Planning By User"> |
577 | + <field name="user_id"/> |
578 | + <field name="tasks" /> |
579 | + <field name="plan_tasks" /> |
580 | + <field name="plan_open" /> |
581 | + <field name="holiday" /> |
582 | + <field name="free" /> |
583 | + <field name="timesheet" /> |
584 | + </tree> |
585 | + </field> |
586 | + </page> |
587 | + <page string="Planning by Account"> |
588 | + <field colspan="4" name="planning_account" |
589 | + nolabel="1" widget="one2many_list" readonly="1"> |
590 | + <tree string="Planning By Account"> |
591 | + <field name="account_id" /> |
592 | + <field name="tasks" /> |
593 | + <field name="plan_tasks" /> |
594 | + <field name="plan_open" /> |
595 | + <field name="free" /> |
596 | + </tree> |
597 | + </field> |
598 | + </page> |
599 | + <page string="Time Allocation"> |
600 | + <field colspan="4" name="line_ids" |
601 | + nolabel="1"> |
602 | + <tree editable="bottom" |
603 | + string="Planning Lines"> |
604 | + <field name="user_id" domain="[('id','child_of',[parent.user_id])]"/> |
605 | + <field name="account_id" /> |
606 | + <field name="amount" /> |
607 | + <field name="amount_unit" /> |
608 | + <field name="task" /> |
609 | + <field name="note" /> |
610 | + </tree> |
611 | + <form string="Planning Lines"> |
612 | + <field name="user_id" domain="[('id','child_of',[parent.user_id])]"/> |
613 | + <field name="account_id" /> |
614 | + <field name="amount" /> |
615 | + <field name="amount_unit" /> |
616 | + <field name="task" /> |
617 | + <separator string="Notes" colspan="4" /> |
618 | + <field name="note" colspan="4" |
619 | + nolabel="1" /> |
620 | + </form> |
621 | + </field> |
622 | + </page> |
623 | + <page string="Tasks Allocation"> |
624 | + <separator string="Tasks" colspan="4"/> |
625 | + <field name="task_ids" nolabel="1" colspan="4" widget="many2many"/> |
626 | + </page> |
627 | + </notebook> |
628 | + <group col="6" colspan="4"> |
629 | + <field name="state" select="1" |
630 | + readonly="1" /> |
631 | + <button name="action_open" states="draft" |
632 | + string="Open" type="object" icon="gtk-yes" /> |
633 | + <button name="action_done" states="open" |
634 | + string="Done" type="object" icon="gtk-jump-to" /> |
635 | + <button name="action_cancel" states="draft,open" |
636 | + string="Cancel" type="object" icon="gtk-cancel" /> |
637 | + <button name="action_draft" states="done,cancel" |
638 | + string="Reset to Draft" type="object" icon="gtk-convert" /> |
639 | + </group> |
640 | + </form> |
641 | + </field> |
642 | + </record> |
643 | + |
644 | + <record id="action_account_analytic_planning_form" model="ir.actions.act_window"> |
645 | + <field name="name">Planning</field> |
646 | + <field name="res_model">report_account_analytic.planning</field> |
647 | + <field name="view_type">form</field> |
648 | + <field name="view_mode">tree,form</field> |
649 | + </record> |
650 | + |
651 | + <menuitem id="planning_main" name="Planning" |
652 | + parent="hr.menu_hr_root" /> |
653 | + |
654 | + <menuitem action="action_account_analytic_planning_form" |
655 | + id="menu_report_account_analytic_planning" parent="planning_main" /> |
656 | + |
657 | + <record id="action_account_analytic_planning_form_my" model="ir.actions.act_window"> |
658 | + <field name="name">My Planning</field> |
659 | + <field name="res_model">report_account_analytic.planning</field> |
660 | + <field name="view_type">form</field> |
661 | + <field name="view_mode">tree,form</field> |
662 | + <field name="domain">[('user_id','=',uid)]</field> |
663 | + </record> |
664 | + |
665 | + <menuitem action="action_account_analytic_planning_form_my" |
666 | + id="menu_report_account_analytic_planning_my2" |
667 | + parent="planning_main" /> |
668 | + |
669 | + <record id="action_account_analytic_planning_form_current_my" |
670 | + model="ir.actions.act_window"> |
671 | + <field name="name">My Current Planning</field> |
672 | + <field name="res_model">report_account_analytic.planning</field> |
673 | + <field name="view_type">form</field> |
674 | + <field name="view_mode">tree,form</field> |
675 | <field name="domain">[('user_id','=',uid),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))]</field> |
676 | - </record> |
677 | - <menuitem action="action_account_analytic_planning_form_current_my" id="menu_report_account_analytic_planning_current_my" parent="menu_report_account_analytic_planning_my2"/> |
678 | - |
679 | - <record id="action_account_analytic_planning_form_current" model="ir.actions.act_window"> |
680 | - <field name="name">Current Planning</field> |
681 | - <field name="res_model">report_account_analytic.planning</field> |
682 | - <field name="view_type">form</field> |
683 | - <field name="view_mode">tree,form</field> |
684 | - <field name="domain">[('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))]</field> |
685 | - </record> |
686 | - <menuitem action="action_account_analytic_planning_form_current" id="menu_report_account_analytic_planning_current" parent="report_analytic_planning.menu_report_account_analytic_planning"/> |
687 | - |
688 | - <record id="action_account_analytic_planning_form_new" model="ir.actions.act_window"> |
689 | - <field name="name">New Planning</field> |
690 | - <field name="res_model">report_account_analytic.planning</field> |
691 | - <field name="view_type">form</field> |
692 | - <field name="view_mode">form,tree</field> |
693 | - </record> |
694 | - <menuitem action="action_account_analytic_planning_form_new" id="menu_report_account_analytic_planning_new" parent="planning_main"/> |
695 | - |
696 | - |
697 | - |
698 | - <!-- |
699 | - Planning statistics |
700 | ---> |
701 | - <record id="account_analytic_planning_stat_view_form" model="ir.ui.view"> |
702 | - <field name="name">report.account.analytic.planning.stat.form</field> |
703 | - <field name="model">report_account_analytic.planning.stat</field> |
704 | + </record> |
705 | + <menuitem |
706 | + action="action_account_analytic_planning_form_current_my" |
707 | + id="menu_report_account_analytic_planning_current_my" |
708 | + parent="menu_report_account_analytic_planning_my2" /> |
709 | + |
710 | + <record id="action_account_analytic_planning_form_current" |
711 | + model="ir.actions.act_window"> |
712 | + <field name="name">Current Planning</field> |
713 | + <field name="res_model"> |
714 | + report_account_analytic.planning |
715 | + </field> |
716 | + <field name="view_type">form</field> |
717 | + <field name="view_mode">tree,form</field> |
718 | + <field name="domain">[('date_from','<=',time.strftime('%Y-%m-%d')),('date_to','>=',time.strftime('%Y-%m-%d'))]</field> |
719 | + </record> |
720 | + <menuitem action="action_account_analytic_planning_form_current" |
721 | + id="menu_report_account_analytic_planning_current" |
722 | + parent="report_analytic_planning.menu_report_account_analytic_planning" /> |
723 | + |
724 | + <record id="action_account_analytic_planning_form_new" |
725 | + model="ir.actions.act_window"> |
726 | + <field name="name">New Planning</field> |
727 | + <field name="res_model">report_account_analytic.planning</field> |
728 | + <field name="view_type">form</field> |
729 | + <field name="view_mode">form,tree</field> |
730 | + </record> |
731 | + |
732 | + <menuitem action="action_account_analytic_planning_form_new" |
733 | + id="menu_report_account_analytic_planning_new" |
734 | + parent="planning_main" /> |
735 | + |
736 | + |
737 | + |
738 | + <!-- |
739 | + Planning statistics |
740 | + --> |
741 | + <record id="account_analytic_planning_stat_view_form" model="ir.ui.view"> |
742 | + <field name="name">report.account.analytic.planning.stat.form</field> |
743 | + <field name="model">report_account_analytic.planning.stat</field> |
744 | + <field name="type">form</field> |
745 | + <field name="arch" type="xml"> |
746 | + <form string="Planning statistics"> |
747 | + <field name="planning_id" select="1" /> |
748 | + <field name="user_id" select="1" /> |
749 | + <field name="account_id" select="1" /> |
750 | + </form> |
751 | + </field> |
752 | + </record> |
753 | + |
754 | + |
755 | + <record id="account_analytic_planning_stat_view_tree" model="ir.ui.view"> |
756 | + <field name="name">report.account.analytic.planning.stat.tree</field> |
757 | + <field name="model">report_account_analytic.planning.stat</field> |
758 | + <field name="type">tree</field> |
759 | + <field name="arch" type="xml"> |
760 | + <tree string="Planning statistics"> |
761 | + <field name="planning_id" /> |
762 | + <field name="user_id" /> |
763 | + <field name="manager_id" /> |
764 | + <field name="account_id" /> |
765 | + <field name="sum_amount" /> |
766 | + <field name="sum_amount_real" /> |
767 | + <field name="sum_amount_tasks" /> |
768 | + </tree> |
769 | + </field> |
770 | + </record> |
771 | + |
772 | + <record id="account_analytic_planning_stat_view_graph" model="ir.ui.view"> |
773 | + <field name="name">report.account.analytic.planning.stat.graph</field> |
774 | + <field name="model">report_account_analytic.planning.stat</field> |
775 | + <field name="type">graph</field> |
776 | + <field name="arch" type="xml"> |
777 | + <graph string="Planning statistics" type="bar"> |
778 | + <field name="account_id" /> |
779 | + <field name="sum_amount" operator="+" /> |
780 | + <field name="sum_amount_real" operator="+" /> |
781 | + <field name="sum_amount_tasks" operator="+" /> |
782 | + </graph> |
783 | + </field> |
784 | + </record> |
785 | + |
786 | + |
787 | + |
788 | + <record id="action_account_analytic_planning_stat_form" model="ir.actions.act_window"> |
789 | + <field name="name">Planning Statistics</field> |
790 | + <field name="res_model">report_account_analytic.planning.stat</field> |
791 | + <field name="view_type">form</field> |
792 | + <field name="view_mode">graph,tree</field> |
793 | + </record> |
794 | + <menuitem id="next_id_85" name="Planning" |
795 | + parent="hr.menu_hr_reporting" /> |
796 | + <menuitem action="action_account_analytic_planning_stat_form" |
797 | + id="menu_report_account_analytic_planning_stat" parent="next_id_85" /> |
798 | + |
799 | + <record id="action_account_analytic_planning_stat_my_form" |
800 | + model="ir.actions.act_window"> |
801 | + <field name="name">My Planning Statistics</field> |
802 | + <field name="res_model">report_account_analytic.planning.stat</field> |
803 | + <field name="view_type">form</field> |
804 | + <field name="domain">[('user_id','=',uid),('planning_id.state','=','open')]</field> |
805 | + <field name="view_mode">graph,tree</field> |
806 | + </record> |
807 | + |
808 | + <menuitem action="action_account_analytic_planning_stat_my_form" |
809 | + id="menu_report_account_analytic_planning_stat_my" |
810 | + parent="report_analytic_planning.next_id_85" /> |
811 | + |
812 | + <record |
813 | + id="action_account_analytic_planning_stat_my_manager_form" model="ir.actions.act_window"> |
814 | + <field name="name">Planning Statistics of My Projects</field> |
815 | + <field name="res_model">report_account_analytic.planning.stat</field> |
816 | + <field name="view_type">form</field> |
817 | + <field name="domain">[('manager_id','=',uid),('planning_id.state','=','open')]</field> |
818 | + <field name="view_mode">graph,tree</field> |
819 | + </record> |
820 | + |
821 | + <menuitem |
822 | + action="action_account_analytic_planning_stat_my_manager_form" |
823 | + id="menu_report_account_analytic_planning_stat_my_manager" |
824 | + parent="report_analytic_planning.next_id_85" /> |
825 | + |
826 | +<!-- Task Form --> |
827 | + |
828 | + <record id="view_task_planning_form" model="ir.ui.view"> |
829 | + <field name="name">planning.task.form</field> |
830 | + <field name="model">project.task</field> |
831 | <field name="type">form</field> |
832 | - <field name="arch" type="xml"> |
833 | - <form string="Planning statistics"> |
834 | - <field name="planning_id" select="1"/> |
835 | - <field name="user_id" select="1"/> |
836 | - <field name="account_id" select="1"/> |
837 | - </form> |
838 | - </field> |
839 | - </record> |
840 | - |
841 | - |
842 | - <record id="account_analytic_planning_stat_view_tree" model="ir.ui.view"> |
843 | - <field name="name">report.account.analytic.planning.stat.tree</field> |
844 | - <field name="model">report_account_analytic.planning.stat</field> |
845 | - <field name="type">tree</field> |
846 | - <field name="arch" type="xml"> |
847 | - <tree string="Planning statistics"> |
848 | - <field name="planning_id"/> |
849 | - <field name="user_id"/> |
850 | - <field name="manager_id"/> |
851 | - <field name="account_id"/> |
852 | - <field name="sum_amount"/> |
853 | - <field name="sum_amount_real"/> |
854 | - <field name="sum_amount_tasks"/> |
855 | - </tree> |
856 | - </field> |
857 | - </record> |
858 | - |
859 | - <record id="account_analytic_planning_stat_view_graph" model="ir.ui.view"> |
860 | - <field name="name">report.account.analytic.planning.stat.graph</field> |
861 | - <field name="model">report_account_analytic.planning.stat</field> |
862 | - <field name="type">graph</field> |
863 | - <field name="arch" type="xml"> |
864 | - <graph string="Planning statistics" type="bar"> |
865 | - <field name="account_id"/> |
866 | - <field name="sum_amount" operator="+"/> |
867 | - <field name="sum_amount_real" operator="+"/> |
868 | - <field name="sum_amount_tasks" operator="+"/> |
869 | - </graph> |
870 | - </field> |
871 | - </record> |
872 | - |
873 | - |
874 | - |
875 | - <record id="action_account_analytic_planning_stat_form" model="ir.actions.act_window"> |
876 | - <field name="name">Planning Statistics</field> |
877 | - <field name="res_model">report_account_analytic.planning.stat</field> |
878 | - <field name="view_type">form</field> |
879 | - <field name="view_mode">graph,tree</field> |
880 | - </record> |
881 | - <menuitem id="next_id_85" name="Planning" parent="hr.menu_hr_reporting"/><menuitem action="action_account_analytic_planning_stat_form" id="menu_report_account_analytic_planning_stat" parent="next_id_85"/> |
882 | - |
883 | - <record id="action_account_analytic_planning_stat_my_form" model="ir.actions.act_window"> |
884 | - <field name="name">My Planning Statistics</field> |
885 | - <field name="res_model">report_account_analytic.planning.stat</field> |
886 | - <field name="view_type">form</field> |
887 | - <field name="domain">[('user_id','=',uid),('planning_id.state','=','open')]</field> |
888 | - <field name="view_mode">graph,tree</field> |
889 | - </record> |
890 | - <menuitem action="action_account_analytic_planning_stat_my_form" id="menu_report_account_analytic_planning_stat_my" parent="report_analytic_planning.next_id_85"/> |
891 | - |
892 | - <record id="action_account_analytic_planning_stat_my_manager_form" model="ir.actions.act_window"> |
893 | - <field name="name">Planning Statistics of My Projects</field> |
894 | - <field name="res_model">report_account_analytic.planning.stat</field> |
895 | - <field name="view_type">form</field> |
896 | - <field name="domain">[('manager_id','=',uid),('planning_id.state','=','open')]</field> |
897 | - <field name="view_mode">graph,tree</field> |
898 | - </record> |
899 | - <menuitem action="action_account_analytic_planning_stat_my_manager_form" id="menu_report_account_analytic_planning_stat_my_manager" parent="report_analytic_planning.next_id_85"/> |
900 | - |
901 | - |
902 | - |
903 | - |
904 | - </data> |
905 | + <field name="inherit_id" ref="project.view_task_form2"/> |
906 | + <field name="arch" type="xml"> |
907 | + <field name="progress" position="after"> |
908 | + <field name="planning_id" select="1"/> |
909 | + </field> |
910 | + </field> |
911 | + </record> |
912 | + |
913 | + </data> |
914 | </openerp> |
Tasks for Planning Improvement
1.add integer 'Business Days' in planning
2.improve view and do a fixed area in top (as for new design since 5.0)
3. Change the default name to be the current month instead of the current day
4. add a many2one(planning) on project.task
5. add a boolean on planning line: "Assigned to task(s)"
6. 1st tab: Planning By User
everything read-only, psql view:
user: should list all the employee that are in the department of the user responsible (search users where (id, child_of, [uid])). There is one more line added, for everything planned with no user given.
tasks: total of remaining hours of uncanceled tasks linked to this planning
plan(tasks): total of planning line that have the Boolean "assigned to task(s)" = TRUE
plan(open): total of planning line that have the boolean "assigned to task(s)" = FALSE
holidays: total of holiday requests (all except the refused ones) between the 2 dates of the planning
free: depicts the number of unplanned days for someone: computed as business days on planning - plan(tasks) - plan(open) - holidays
timesheet: total of the timesheet lines between the dates of the planning
7. 2nd tab: Planning By Account
everything read-only, psql view:
same than 1st tab except that it's group by account, not by user
8. 3th tab: time allocation
that's where we can write the planning lines.
9. 4th tab: tasks allocation
that's the one2many where we can see the tasks linked to this planning. use a widget many2many
10. in list view, we should ba able to see
name: name of the planning
responsible: the planning responsible
total days: business days of the planning
total planned: sum of total plan(tasks) and total plan(open) for all lines of 1st tab
total free: sum of free field for all lines of 1st tab
state: the planning state