Merge lp:~vauxoo/addons-vauxoo/7.0-expired_task_change_days_gaby into lp:addons-vauxoo/7.0

Proposed by Gabriela Quilarque
Status: Merged
Merged at revision: 842
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0-expired_task_change_days_gaby
Merge into: lp:addons-vauxoo/7.0
Diff against target: 436 lines (+73/-67)
3 files modified
expired_task_information/data/config_task_expired_data.xml (+1/-1)
expired_task_information/model/task.py (+66/-66)
project_conf/view/project_view.xml (+6/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0-expired_task_change_days_gaby
Reviewer Review Type Date Requested Status
Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com Pending
Review via email: mp+187305@code.launchpad.net

Description of the change

-Agregada lógica de enviar tarea cuando tiene x tiempo sin cambios.
-Cambiado campo date_deadline de project.task a requerido.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'expired_task_information/data/config_task_expired_data.xml'
2--- expired_task_information/data/config_task_expired_data.xml 2013-09-12 21:50:48 +0000
3+++ expired_task_information/data/config_task_expired_data.xml 2013-09-24 17:52:34 +0000
4@@ -9,8 +9,8 @@
5 <field name="numbercall">-1</field>
6 <field eval="False" name="doall"/>
7 <field eval="'task.expired.config'" name="model"/>
8+ <field eval="False" name="active"/>
9 <field eval="'send_expiration_message'" name="function"/>
10 </record>
11-
12 </data>
13 </openerp>
14
15=== modified file 'expired_task_information/model/task.py'
16--- expired_task_information/model/task.py 2013-09-12 21:50:48 +0000
17+++ expired_task_information/model/task.py 2013-09-24 17:52:34 +0000
18@@ -68,8 +68,7 @@
19
20 def send_expiration_message(self, cr, uid, context=None):
21 context = context or {}
22- msg_expired=''
23- msg_expiredp=''
24+
25 mail_mail = self.pool.get('mail.mail')
26 message = self.pool.get('mail.message')
27 task_obj = self.pool.get('project.task')
28@@ -87,32 +86,33 @@
29 [('state', 'not in',
30 ('done', 'cancelled'))],
31 context=context)
32- msg_expiredp = 'ACTIVIDAD VENCIDA'
33 for task in task_ids and task_obj.browse(cr, uid, task_ids):
34- if task.date_deadline and task.date_deadline <= today:
35- msg_expired = ('<p>Esta tarea ha expirado el dia %s \
36- </p>', task.date_deadline)
37-
38+ msg_expired = ''
39+ msg_expiredp = ''
40+ last_message_ids = message.search(cr, uid,
41+ [('res_id', '=', task.id),
42+ ('model', '=', 'project.task')],
43+ context, order='date desc')
44+ last_fecha = last_message_ids and message.browse(cr, uid, last_message_ids[0]).date
45+ #~ Para cuando la tarea se vencio a la fecha de hoy.
46+ #~ if task.date_deadline and task.date_deadline <= today:
47+ #~ msg_expired = ('<p>Esta tarea ha expirado el dia %s \
48+ #~ </p>', task.date_deadline)
49+ #~ msg_expiredp = 'ACTIVIDAD VENCIDA'
50 if work_obj.search(cr, uid,
51 [('date', '<=', last_change),
52 ('task_id', '=', task.id)],
53 context) or \
54- message.search(cr, uid,
55- [('date', '<=', last_change),
56- ('res_id', '=', task.id)],
57- context):
58+ last_fecha and last_fecha <= last_change :
59 msg_expiredp = 'ACTIVIDAD SIN CAMBIOS'
60- if config_brw.without_change >1:
61- msg_expired = ('<p>La Tarea tiene mas de %s dias sin \
62- cambios</p>'
63- % config_brw.without_change)
64- elif config_brw.without_change==1:
65- msg_expired = ('<p>La Tarea tiene mas de %s dia \
66- sin cambios</p> '
67- % config_brw.without_change)
68- if task.date_deadline and task.date_deadline == before_expiry:
69- msg_expired = ('<p>La Tarea expirara en %s \
70- dias</p>' % config_brw.before_expiry)
71+ msg_expired = ('<p>La Tarea tiene mas de %s dia(s) sin \
72+ cambios</p>'
73+ % config_brw.without_change)
74+ #~ Para cuando la tarea tiene x cantidad de dias vencida.
75+ #~ if task.date_deadline and task.date_deadline == before_expiry:
76+ #~ msg_expired = ('<p>La Tarea expirara en %s \
77+ #~ dias</p>' % config_brw.before_expiry)
78+ #~ msg_expiredp = 'ACTIVIDAD VENCIDA'
79 if msg_expired:
80 html = """<html>
81 <head>
82@@ -123,15 +123,15 @@
83 #outlook a{padding:0;} /* Force Outlook to provide a "view in browser" button. */
84 body{width:100% !important;} .ReadMsgBody{width:100%;} .ExternalClass{width:100%;} /* Force Hotmail to display emails at full width */
85 body{-webkit-text-size-adjust:none;} /* Prevent Webkit platforms from changing default text sizes. */
86-
87+
88 /* Reset Styles */
89 body{margin:0; padding:0;}
90 img{border:0; height:auto; line-height:100%; outline:none; text-decoration:none;}
91 table td{border-collapse:collapse;}
92 #backgroundTable{height:100% !important; margin:0; padding:0; width:100% !important;}
93-
94+
95 /* Template Styles */
96-
97+
98 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: COMMON PAGE ELEMENTS /\/\/\/\/\/\/\/\/\/\ */
99
100 /**
101@@ -143,7 +143,7 @@
102 body, #backgroundTable{
103 /*@editable*/ background-color:#FAFAFA;
104 }
105-
106+
107 /**
108 * @tab Page
109 * @section email border
110@@ -152,7 +152,7 @@
111 #templateContainer{
112 /*@editable*/ border:0;
113 }
114-
115+
116 /**
117 * @tab Page
118 * @section heading 1
119@@ -232,9 +232,9 @@
120 margin-left:0;
121 /*@editable*/ text-align:left;
122 }
123-
124+
125 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: PREHEADER /\/\/\/\/\/\/\/\/\/\ */
126-
127+
128 /**
129 * @tab Header
130 * @section preheader style
131@@ -244,7 +244,7 @@
132 #templatePreheader{
133 /*@editable*/ background-color:#FAFAFA;
134 }
135-
136+
137 /**
138 * @tab Header
139 * @section preheader text
140@@ -257,7 +257,7 @@
141 /*@editable*/ line-height:100%;
142 /*@editable*/ text-align:left;
143 }
144-
145+
146 /**
147 * @tab Header
148 * @section preheader link
149@@ -268,7 +268,7 @@
150 /*@editable*/ font-weight:normal;
151 /*@editable*/ text-decoration:underline;
152 }
153-
154+
155 /**
156 * @tab Header
157 * @section social bar style
158@@ -277,9 +277,9 @@
159 #social div{
160 /*@editable*/ text-align:right;
161 }
162-
163+
164 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: HEADER /\/\/\/\/\/\/\/\/\/\ */
165-
166+
167 /**
168 * @tab Header
169 * @section header style
170@@ -290,7 +290,7 @@
171 /*@editable*/ background-color:#FFFFFF;
172 /*@editable*/ border-bottom:5px solid #505050;
173 }
174-
175+
176 /**
177 * @tab Header
178 * @section header text
179@@ -306,7 +306,7 @@
180 /*@editable*/ text-align:right;
181 /*@editable*/ vertical-align:middle;
182 }
183-
184+
185 /**
186 * @tab Header
187 * @section header link
188@@ -317,14 +317,14 @@
189 /*@editable*/ font-weight:normal;
190 /*@editable*/ text-decoration:underline;
191 }
192-
193+
194 #headerImage{
195 height:auto;
196 max-width:600px !important;
197 }
198-
199+
200 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: MAIN BODY /\/\/\/\/\/\/\/\/\/\ */
201-
202+
203 /**
204 * @tab Body
205 * @section body style
206@@ -333,7 +333,7 @@
207 #templateContainer, .bodyContent{
208 /*@editable*/ background-color:#FDFDFD;
209 }
210-
211+
212 /**
213 * @tab Body
214 * @section body text
215@@ -347,7 +347,7 @@
216 /*@editable*/ line-height:150%;
217 /*@editable*/ text-align:justify;
218 }
219-
220+
221 /**
222 * @tab Body
223 * @section body link
224@@ -358,14 +358,14 @@
225 /*@editable*/ font-weight:normal;
226 /*@editable*/ text-decoration:underline;
227 }
228-
229+
230 .bodyContent img{
231 display:inline;
232 height:auto;
233 }
234-
235+
236 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: SIDEBAR /\/\/\/\/\/\/\/\/\/\ */
237-
238+
239 /**
240 * @tab Sidebar
241 * @section sidebar style
242@@ -374,7 +374,7 @@
243 #templateSidebar{
244 /*@editable*/ background-color:#FDFDFD;
245 }
246-
247+
248 /**
249 * @tab Sidebar
250 * @section sidebar style
251@@ -383,7 +383,7 @@
252 .sidebarContent{
253 /*@editable*/ border-right:1px solid #DDDDDD;
254 }
255-
256+
257 /**
258 * @tab Sidebar
259 * @section sidebar text
260@@ -396,7 +396,7 @@
261 /*@editable*/ line-height:150%;
262 /*@editable*/ text-align:left;
263 }
264-
265+
266 /**
267 * @tab Sidebar
268 * @section sidebar link
269@@ -407,14 +407,14 @@
270 /*@editable*/ font-weight:normal;
271 /*@editable*/ text-decoration:underline;
272 }
273-
274+
275 .sidebarContent img{
276 display:inline;
277 height:auto;
278 }
279-
280+
281 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: FOOTER /\/\/\/\/\/\/\/\/\/\ */
282-
283+
284 /**
285 * @tab Footer
286 * @section footer style
287@@ -425,7 +425,7 @@
288 /*@editable*/ background-color:#FAFAFA;
289 /*@editable*/ border-top:3px solid #909090;
290 }
291-
292+
293 /**
294 * @tab Footer
295 * @section footer text
296@@ -439,7 +439,7 @@
297 /*@editable*/ line-height:125%;
298 /*@editable*/ text-align:left;
299 }
300-
301+
302 /**
303 * @tab Footer
304 * @section footer link
305@@ -450,11 +450,11 @@
306 /*@editable*/ font-weight:normal;
307 /*@editable*/ text-decoration:underline;
308 }
309-
310+
311 .footerContent img{
312 display:inline;
313 }
314-
315+
316 /**
317 * @tab Footer
318 * @section social bar style
319@@ -465,7 +465,7 @@
320 /*@editable*/ background-color:#FFFFFF;
321 /*@editable*/ border:0;
322 }
323-
324+
325 /**
326 * @tab Footer
327 * @section social bar style
328@@ -474,7 +474,7 @@
329 #social div{
330 /*@editable*/ text-align:left;
331 }
332-
333+
334 /**
335 * @tab Footer
336 * @section utility bar style
337@@ -494,7 +494,7 @@
338 #utility div{
339 /*@editable*/ text-align:left;
340 }
341-
342+
343 #monkeyRewards img{
344 max-width:170px !important;
345 }
346@@ -519,7 +519,7 @@
347 <div mc:edit="Header_content">
348 <h2>"""
349 html += task.name
350- html +="""</h2>
351+ html += """</h2>
352 </div>
353 </td>
354 </tr>
355@@ -531,7 +531,7 @@
356 <td align="center" style="margin: 0px; padding: 0px; width: 600px; background-color: #E8C808">
357 <div style="font-size:1.3em; font-family:Arial"><b>"""
358 html += msg_expiredp
359- html +="""</b></div>
360+ html += """</b></div>
361 </td>
362 </tr>
363 <tr>
364@@ -550,21 +550,21 @@
365 </td>
366 <!-- // End Sidebar \\ -->
367 <td valign="top" class="bodyContent">
368-
369+
370 <!-- // Begin Module: Standard Content \\ -->
371 <table border="0" cellpadding="10" cellspacing="0" width="600">
372 <tr>
373 <td valign="top" style="padding-left:0;">
374 <div mc:edit="std_content00">
375 <h2 class="h2">Hola @"""
376- html +=task.user_id.name
377- html +="""</h2>
378+ html += task.user_id.name
379+ html += """</h2>
380 <h3 class="h3">"""
381 html += msg_expired
382 html += """</h3>
383 <pre style="font-size:1.1em; font-family:Arial">Podrias ser tan amable de comentarnos el estatus de la misma por este medio.
384
385-Si es por alguna de las 3 siguientes razones, o alguna ajena a estos puntos justificalo por favor:
386+Si es por alguna de las 3 siguientes razones, o alguna ajena a estos puntos justificalo por favor:
387
388 <b>1.- Aun no cargas tus labores en la instancia. </b>
389 (Recuerda que gran parte del trabajo que realizas esta en cargar las horas, asi demuestras en que te ocupas realmente).
390@@ -580,7 +580,7 @@
391 </tr>
392 </table>
393 <!-- // End Module: Standard Content \\ -->
394-
395+
396 </td>
397 </tr>
398 </table>
399@@ -593,12 +593,12 @@
400 </table>
401 </center>
402 </body>
403-</html>"""
404+</html>"""
405 mail_id = mail_mail.create(cr, uid,
406 {
407 'model': 'project.task',
408 'res_id': task.id,
409- 'subject': ('#' + str(task.id) +' - ' + task.name),
410+ 'subject':('#'+str(task.id)+' - '+task.name),
411 'body_html': html,
412 'auto_delete': True,
413 }, context=context)
414
415=== modified file 'project_conf/view/project_view.xml'
416--- project_conf/view/project_view.xml 2013-09-06 19:29:11 +0000
417+++ project_conf/view/project_view.xml 2013-09-24 17:52:34 +0000
418@@ -2,6 +2,9 @@
419 <openerp>
420 <data>
421 <!-- Vista -->
422+
423+
424+
425 <record model="ir.ui.view" id="inherit_project_task_project_conf_view">
426 <field name="name">inherit.project.task.project.conf.view</field>
427 <field name="model">project.task</field>
428@@ -10,6 +13,9 @@
429 <xpath expr="//field[@name='planned_hours']" position="after">
430 <field name="project_leader_id"/>
431 </xpath>
432+ <xpath expr="//field[@name='date_deadline']" position="replace">
433+ <field name="date_deadline" required="1" attrs="{'readonly':[('state','in',['done', 'cancelled'])]}"/>
434+ </xpath>
435 </field>
436 </record>
437