Merge lp:~vauxoo/addons-vauxoo/jose-acceptability-criterial-buttons into lp:addons-vauxoo/7.0

Status: Merged
Merged at revision: 1152
Proposed branch: lp:~vauxoo/addons-vauxoo/jose-acceptability-criterial-buttons
Merge into: lp:addons-vauxoo/7.0
Diff against target: 1724 lines (+1350/-117)
8 files modified
user_story/__init__.py (+1/-0)
user_story/__openerp__.py (+32/-32)
user_story/data/user_story_template.xml (+976/-2)
user_story/model/user_story.py (+125/-15)
user_story/tests/test_user_story.py (+126/-51)
user_story/view/userstory_view.xml (+47/-17)
user_story/wizard/__init__.py (+1/-0)
user_story/wizard/message_compose.py (+42/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/jose-acceptability-criterial-buttons

This proposal supersedes a proposal from 2014-10-15.

To post a comment you must log in.
Revision history for this message
Nhomar - Vauxoo (nhomar) wrote : Posted in a previous version of this proposal

Dale play José mergea ésto.

Saludos.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'user_story/__init__.py'
--- user_story/__init__.py 2014-10-03 00:28:23 +0000
+++ user_story/__init__.py 2014-10-15 22:07:15 +0000
@@ -1,2 +1,3 @@
1from . import model1from . import model
2from . import report2from . import report
3from . import wizard
34
=== modified file 'user_story/__openerp__.py'
--- user_story/__openerp__.py 2014-10-03 08:22:36 +0000
+++ user_story/__openerp__.py 2014-10-15 22:07:15 +0000
@@ -24,10 +24,10 @@
24#24#
25##############################################################################25##############################################################################
26{26{
27 "name": "User Story", 27 "name": "User Story",
28 "version": "0.1", 28 "version": "0.1",
29 "author": "Vauxoo", 29 "author": "Vauxoo",
30 "category": "Generic Modules", 30 "category": "Generic Modules",
31 "description": """31 "description": """
32Este módulo registra requerimientos funcionales y técnicos de software a32Este módulo registra requerimientos funcionales y técnicos de software a
33través de Historias de Usuarios.33través de Historias de Usuarios.
@@ -40,40 +40,40 @@
40siguientes:40siguientes:
4141
42.. Story: http://dannorth.net/whats-in-a-story/42.. Story: http://dannorth.net/whats-in-a-story/
43.. fuentes: http://adrianmoya.com/2012/08/que-hay-en-una-historia/""", 43.. fuentes: http://adrianmoya.com/2012/08/que-hay-en-una-historia/""",
44 "website": "http://vauxoo.com", 44 "website": "http://vauxoo.com",
45 "license": "", 45 "license": "",
46 "depends": [46 "depends": [
47 "base", 47 "base",
48 "project", 48 "project",
49 "sprint_kanban", 49 "sprint_kanban",
50 "project_timesheet", 50 "project_timesheet",
51 "project_conf", 51 "project_conf",
52 "report_webkit"52 "report_webkit"
53 ], 53 ],
54 "demo": [54 "demo": [
55 "demo/demo.xml"55 "demo/demo.xml"
56 ], 56 ],
57 "data": [57 "data": [
58 "data/data_us_report.xml", 58 "data/data_us_report.xml",
59 "report/user_story_report_view.xml", 59 "report/user_story_report_view.xml",
60 "security/userstory_security.xml", 60 "security/userstory_security.xml",
61 "security/ir.model.access.csv", 61 "security/ir.model.access.csv",
62 "view/userstory_view.xml", 62 "view/userstory_view.xml",
63 "view/project_view.xml", 63 "view/project_view.xml",
64 "view/hr_timesheet_view.xml", 64 "view/hr_timesheet_view.xml",
65 "view/hr_timesheet_all_view.xml", 65 "view/hr_timesheet_all_view.xml",
66 "view/custom_project_task_view.xml", 66 "view/custom_project_task_view.xml",
67 "data/data.xml", 67 "data/data.xml",
68 "data/user_story_template.xml"68 "data/user_story_template.xml"
69 ], 69 ],
70 "test": [], 70 "test": [],
71 "js": [], 71 "js": [],
72 "css": [72 "css": [
73 "static/src/css/*.css"73 "static/src/css/*.css"
74 ], 74 ],
75 "qweb": [], 75 "qweb": [],
76 "installable": True, 76 "installable": True,
77 "auto_install": False, 77 "auto_install": False,
78 "active": False78 "active": False
79}
80\ No newline at end of file79\ No newline at end of file
80}
8181
=== modified file 'user_story/data/user_story_template.xml'
--- user_story/data/user_story_template.xml 2014-05-09 21:51:34 +0000
+++ user_story/data/user_story_template.xml 2014-10-15 22:07:15 +0000
@@ -1,11 +1,985 @@
1<?xml version="1.0"?>1<?xml version="1.0"?>
2<openerp>2<openerp>
3 <data noupdate="0">3 <data noupdate="0">
4 <!-- 4 <!--
5 =====================================================5 =====================================================
6 SEND EMAIL TEMPLATE6 SEND EMAIL TEMPLATE
7 =====================================================7 =====================================================
8 --> 8 -->
9 <record id="template_approve_aceptabilty_criterial" model="email.template" forcecreate="True">
10 <field name="name">Approve</field>
11 <field name="email_from"></field>
12 <field name="model_id" ref="user_story.model_acceptability_criteria" />
13 <field name="subject"></field>
14 <field name="auto_delete" eval="True"/>
15 <!--
16 <field name="mail_server_id" ref="template_outgoing_mail_server_test"/>
17 -->
18 <field name="mail_server_id">1</field>
19 <field name="email_to"></field>
20 <field name="body_html"><![CDATA[
21<html>
22 <head>
23 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
24 <title>*|MC:SUBJECT|*</title>
25 <style type="text/css">
26 /* Client-specific Styles */
27 #outlook a{padding:0;} /* Force Outlook to provide a "view in browser" button. */
28 body{width:100% !important;} .ReadMsgBody{width:100%;} .ExternalClass{width:100%;} /* Force Hotmail to display emails at full width */
29 body{-webkit-text-size-adjust:none;} /* Prevent Webkit platforms from changing default text sizes. */
30
31 /* Reset Styles */
32 body{margin:0; padding:0;}
33 img{border:0; height:auto; line-height:100%; outline:none; text-decoration:none;}
34 table td{border-collapse:collapse;}
35 #backgroundTable{height:100% !important; margin:0; padding:0; width:100% !important;}
36
37 /* Template Styles */
38
39 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: COMMON PAGE ELEMENTS /\/\/\/\/\/\/\/\/\/\ */
40
41 /**
42 * @tab Page
43 * @section background color
44 * @tip Set the background color for your email. You may want to choose one that matches your company's branding.
45 * @theme page
46 */
47 body, #backgroundTable{
48 /*@editable*/ background-color:#FAFAFA;
49 }
50
51 /**
52 * @tab Page
53 * @section email border
54 * @tip Set the border for your email.
55 */
56 #templateContainer{
57 /*@editable*/ border:0;
58 }
59
60 /**
61 * @tab Page
62 * @section heading 1
63 * @tip Set the styling for all first-level headings in your emails. These should be the largest of your headings.
64 * @style heading 1
65 */
66 h1, .h1{
67 /*@editable*/ color:#202020;
68 display:block;
69 /*@editable*/ font-family:Arial;
70 /*@editable*/ font-size:40px;
71 /*@editable*/ font-weight:bold;
72 /*@editable*/ line-height:100%;
73 margin-top:2%;
74 margin-right:0;
75 margin-bottom:1%;
76 margin-left:0;
77 /*@editable*/ text-align:left;
78 }
79
80 /**
81 * @tab Page
82 * @section heading 2
83 * @tip Set the styling for all second-level headings in your emails.
84 * @style heading 2
85 */
86 h2, .h2{
87 /*@editable*/ color:#404040;
88 display:block;
89 /*@editable*/ font-family:Arial;
90 /*@editable*/ font-size:18px;
91 /*@editable*/ font-weight:bold;
92 /*@editable*/ line-height:100%;
93 margin-top:2%;
94 margin-right:0;
95 margin-bottom:1%;
96 margin-left:0;
97 /*@editable*/ text-align:left;
98 }
99
100 /**
101 * @tab Page
102 * @section heading 3
103 * @tip Set the styling for all third-level headings in your emails.
104 * @style heading 3
105 */
106 h3, .h3{
107 /*@editable*/ color:#606060;
108 display:block;
109 /*@editable*/ font-family:Arial;
110 /*@editable*/ font-size:16px;
111 /*@editable*/ font-weight:bold;
112 /*@editable*/ line-height:100%;
113 margin-top:2%;
114 margin-right:0;
115 margin-bottom:1%;
116 margin-left:0;
117 /*@editable*/ text-align:left;
118 }
119
120 /**
121 * @tab Page
122 * @section heading 4
123 * @tip Set the styling for all fourth-level headings in your emails. These should be the smallest of your headings.
124 * @style heading 4
125 */
126 h4, .h4{
127 /*@editable*/ color:#808080;
128 display:block;
129 /*@editable*/ font-family:Arial;
130 /*@editable*/ font-size:14px;
131 /*@editable*/ font-weight:bold;
132 /*@editable*/ line-height:100%;
133 margin-top:2%;
134 margin-right:0;
135 margin-bottom:1%;
136 margin-left:0;
137 /*@editable*/ text-align:left;
138 }
139
140 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: PREHEADER /\/\/\/\/\/\/\/\/\/\ */
141
142 /**
143 * @tab Header
144 * @section preheader style
145 * @tip Set the background color for your email's preheader area.
146 * @theme page
147 */
148 #templatePreheader{
149 /*@editable*/ background-color:#FAFAFA;
150 }
151
152 /**
153 * @tab Header
154 * @section preheader text
155 * @tip Set the styling for your email's preheader text. Choose a size and color that is easy to read.
156 */
157 .preheaderContent div{
158 /*@editable*/ color:#707070;
159 /*@editable*/ font-family:Arial;
160 /*@editable*/ font-size:10px;
161 /*@editable*/ line-height:100%;
162 /*@editable*/ text-align:left;
163 }
164
165 /**
166 * @tab Header
167 * @section preheader link
168 * @tip Set the styling for your email's preheader links. Choose a color that helps them stand out from your text.
169 */
170 .preheaderContent div a:link, .preheaderContent div a:visited, /* Yahoo! Mail Override */ .preheaderContent div a .yshortcuts /* Yahoo! Mail Override */{
171 /*@editable*/ color:#336699;
172 /*@editable*/ font-weight:normal;
173 /*@editable*/ text-decoration:underline;
174 }
175
176 /**
177 * @tab Header
178 * @section social bar style
179 * @tip Set the background color and border for your email's footer social bar.
180 */
181 #social div{
182 /*@editable*/ text-align:right;
183 }
184
185 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: HEADER /\/\/\/\/\/\/\/\/\/\ */
186
187 /**
188 * @tab Header
189 * @section header style
190 * @tip Set the background color and border for your email's header area.
191 * @theme header
192 */
193 #templateHeader{
194 /*@editable*/ background-color:#FFFFFF;
195 /*@editable*/ border-bottom:5px solid #505050;
196 }
197
198 /**
199 * @tab Header
200 * @section header text
201 * @tip Set the styling for your email's header text. Choose a size and color that is easy to read.
202 */
203 .headerContent{
204 /*@editable*/ color:#202020;
205 /*@editable*/ font-family:Arial;
206 /*@editable*/ font-size:34px;
207 /*@editable*/ font-weight:bold;
208 /*@editable*/ line-height:100%;
209 /*@editable*/ padding:10px;
210 /*@editable*/ text-align:right;
211 /*@editable*/ vertical-align:middle;
212 }
213
214 /**
215 * @tab Header
216 * @section header link
217 * @tip Set the styling for your email's header links. Choose a color that helps them stand out from your text.
218 */
219 .headerContent a:link, .headerContent a:visited, /* Yahoo! Mail Override */ .headerContent a .yshortcuts /* Yahoo! Mail Override */{
220 /*@editable*/ color:#336699;
221 /*@editable*/ font-weight:normal;
222 /*@editable*/ text-decoration:underline;
223 }
224
225 #headerImage{
226 height:auto;
227 max-width:600px !important;
228 }
229
230 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: MAIN BODY /\/\/\/\/\/\/\/\/\/\ */
231
232 /**
233 * @tab Body
234 * @section body style
235 * @tip Set the background color for your email's body area.
236 */
237 #templateContainer, .bodyContent{
238 /*@editable*/ background-color:#FDFDFD;
239 }
240
241 /**
242 * @tab Body
243 * @section body text
244 * @tip Set the styling for your email's main content text. Choose a size and color that is easy to read.
245 * @theme main
246 */
247 .bodyContent div{
248 /*@editable*/ color:#505050;
249 /*@editable*/ font-family:Arial;
250 /*@editable*/ font-size:14px;
251 /*@editable*/ line-height:150%;
252 /*@editable*/ text-align:justify;
253 }
254
255 /**
256 * @tab Body
257 * @section body link
258 * @tip Set the styling for your email's main content links. Choose a color that helps them stand out from your text.
259 */
260 .bodyContent div a:link, .bodyContent div a:visited, /* Yahoo! Mail Override */ .bodyContent div a .yshortcuts /* Yahoo! Mail Override */{
261 /*@editable*/ color:#336699;
262 /*@editable*/ font-weight:normal;
263 /*@editable*/ text-decoration:underline;
264 }
265
266 .bodyContent img{
267 display:inline;
268 height:auto;
269 }
270
271 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: SIDEBAR /\/\/\/\/\/\/\/\/\/\ */
272
273 /**
274 * @tab Sidebar
275 * @section sidebar style
276 * @tip Set the background color and border for your email's sidebar area.
277 */
278 #templateSidebar{
279 /*@editable*/ background-color:#FDFDFD;
280 }
281
282 /**
283 * @tab Sidebar
284 * @section sidebar style
285 * @tip Set the background color and border for your email's sidebar area.
286 */
287 .sidebarContent{
288 /*@editable*/ border-right:1px solid #DDDDDD;
289 }
290
291 /**
292 * @tab Sidebar
293 * @section sidebar text
294 * @tip Set the styling for your email's sidebar text. Choose a size and color that is easy to read.
295 */
296 .sidebarContent div{
297 /*@editable*/ color:#505050;
298 /*@editable*/ font-family:Arial;
299 /*@editable*/ font-size:10px;
300 /*@editable*/ line-height:150%;
301 /*@editable*/ text-align:left;
302 }
303
304 /**
305 * @tab Sidebar
306 * @section sidebar link
307 * @tip Set the styling for your email's sidebar links. Choose a color that helps them stand out from your text.
308 */
309 .sidebarContent div a:link, .sidebarContent div a:visited, /* Yahoo! Mail Override */ .sidebarContent div a .yshortcuts /* Yahoo! Mail Override */{
310 /*@editable*/ color:#336699;
311 /*@editable*/ font-weight:normal;
312 /*@editable*/ text-decoration:underline;
313 }
314
315 .sidebarContent img{
316 display:inline;
317 height:auto;
318 }
319
320 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: FOOTER /\/\/\/\/\/\/\/\/\/\ */
321
322 /**
323 * @tab Footer
324 * @section footer style
325 * @tip Set the background color and top border for your email's footer area.
326 * @theme footer
327 */
328 #templateFooter{
329 /*@editable*/ background-color:#FAFAFA;
330 /*@editable*/ border-top:3px solid #909090;
331 }
332
333 /**
334 * @tab Footer
335 * @section footer text
336 * @tip Set the styling for your email's footer text. Choose a size and color that is easy to read.
337 * @theme footer
338 */
339 .footerContent div{
340 /*@editable*/ color:#707070;
341 /*@editable*/ font-family:Arial;
342 /*@editable*/ font-size:11px;
343 /*@editable*/ line-height:125%;
344 /*@editable*/ text-align:left;
345 }
346
347 /**
348 * @tab Footer
349 * @section footer link
350 * @tip Set the styling for your email's footer links. Choose a color that helps them stand out from your text.
351 */
352 .footerContent div a:link, .footerContent div a:visited, /* Yahoo! Mail Override */ .footerContent div a .yshortcuts /* Yahoo! Mail Override */{
353 /*@editable*/ color:#336699;
354 /*@editable*/ font-weight:normal;
355 /*@editable*/ text-decoration:underline;
356 }
357
358 .footerContent img{
359 display:inline;
360 }
361
362 /**
363 * @tab Footer
364 * @section social bar style
365 * @tip Set the background color and border for your email's footer social bar.
366 * @theme footer
367 */
368 #social{
369 /*@editable*/ background-color:#FFFFFF;
370 /*@editable*/ border:0;
371 }
372
373 /**
374 * @tab Footer
375 * @section social bar style
376 * @tip Set the background color and border for your email's footer social bar.
377 */
378 #social div{
379 /*@editable*/ text-align:left;
380 }
381
382 /**
383 * @tab Footer
384 * @section utility bar style
385 * @tip Set the background color and border for your email's footer utility bar.
386 * @theme footer
387 */
388 #utility{
389 /*@editable*/ background-color:#FAFAFA;
390 /*@editable*/ border-top:0;
391 }
392
393 /**
394 * @tab Footer
395 * @section utility bar style
396 * @tip Set the background color and border for your email's footer utility bar.
397 */
398 #utility div{
399 /*@editable*/ text-align:left;
400 }
401
402 #monkeyRewards img{
403 max-width:170px !important;
404 }
405 </style>
406 </head>
407 <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">
408 <center>
409 <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="backgroundTable">
410 <tr>
411 <td align="center" valign="top">
412 <table border="0" cellpadding="0" cellspacing="0" width="600" id="templateContainer">
413 <tr style="margin: 0px; padding: 0px; background-color: rgb(247, 247, 247);">
414 <td align="center" valign="top">
415 <!-- // Begin Template Header \\ -->
416 <table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin: 0px; padding: 0px; background-color: rgb(253, 253, 253);">
417 <tr>
418 <td class="headerContent">
419 <img src="https://pbs.twimg.com/profile_images/2137139487/logo-vauxoo-lp.jpg" style="max-width:60px; padding: 2px 2px 2px;" id="headerImage campaign-icon" mc:label="header_image" mc:edit="header_image" mc:allowtext />
420 </td>
421
422 <td class="headerContent" width="100%" style="padding-left:10px; padding-right:20px;">
423 <div mc:edit="Header_content">
424 <h2>
425 ${object.accep_crit_id.name}
426 </h2>
427 </div>
428 </td>
429 </tr>
430 </table>
431 <!-- // End Template Header \\ -->
432 </td>
433 </tr>
434 <tr>
435 <td align="center" style="margin: 0px; padding: 0px; width: 600px; background-color: #951510">
436 <div style="font-size:1.3em; font-family:Arial; color:#FFFFFF;"><b>
437 Criterio de Aceptación.
438 </b></div>
439 </td>
440 </tr>
441 <tr>
442 <td align="center" valign="top">
443 <!-- // Begin Template Body \\ -->
444 <table border="0" cellpadding="10" cellspacing="0" width="600" style="margin: 0px; padding: 0px; width: 600px; background-color: rgb(247, 247, 247);">
445 <tr>
446 <!-- // Begin Sidebar \\ -->
447 <td valign="top" width="180" id="templateSidebar">
448 <table border="0" cellpadding="0" cellspacing="0" width="100%">
449 <tr>
450 <td valign="top">
451 </td>
452 </tr>
453 </table>
454 </td>
455 <!-- // End Sidebar \\ -->
456 <td valign="top" class="bodyContent">
457
458 <!-- // Begin Module: Standard Content \\ -->
459 <table border="0" cellpadding="10" cellspacing="0" width="600">
460 <tr>
461 <td valign="top" style="padding-left:0;">
462 <div mc:edit="std_content00">
463 <h2 class="h2">Estimad@ ${object.accep_crit_id.owner_id.name}</h2>
464 <h3 class="h3">
465 El criterio de aceptación ${object.name} ha sido aceptado por ${user.name}.
466 </h3>
467 <pre style="font-size:1.1em; font-family:Arial">
468
469Agradeciendo su atención.
470
471Ante cualquier duda estamos a su disposición.
472<a href="${object.get_body_disapproval()}">Acceso directo al Documento</a>
473 </pre>
474 <br />
475 </div>
476 </td>
477 </tr>
478 </table>
479 <!-- // End Module: Standard Content \\ -->
480
481 </td>
482 </tr>
483 </table>
484 <!-- // End Template Body \\ -->
485 </td>
486 </table>
487 <br />
488 </td>
489 </tr>
490 </table>
491 </center>
492 </body>
493</html>
494 ]]></field>
495 </record>
496 <record id="template_ask_aceptabilty_criterial" model="email.template" forcecreate="True">
497 <field name="name">Ask For Review</field>
498 <field name="email_from"></field>
499 <field name="model_id" ref="user_story.model_acceptability_criteria" />
500 <field name="subject"></field>
501 <field name="auto_delete" eval="True"/>
502 <!--
503 <field name="mail_server_id" ref="template_outgoing_mail_server_test"/>
504 -->
505 <field name="mail_server_id">1</field>
506 <field name="email_to"></field>
507 <field name="body_html"><![CDATA[
508<html>
509 <head>
510 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
511 <title>*|MC:SUBJECT|*</title>
512 <style type="text/css">
513 /* Client-specific Styles */
514 #outlook a{padding:0;} /* Force Outlook to provide a "view in browser" button. */
515 body{width:100% !important;} .ReadMsgBody{width:100%;} .ExternalClass{width:100%;} /* Force Hotmail to display emails at full width */
516 body{-webkit-text-size-adjust:none;} /* Prevent Webkit platforms from changing default text sizes. */
517
518 /* Reset Styles */
519 body{margin:0; padding:0;}
520 img{border:0; height:auto; line-height:100%; outline:none; text-decoration:none;}
521 table td{border-collapse:collapse;}
522 #backgroundTable{height:100% !important; margin:0; padding:0; width:100% !important;}
523
524 /* Template Styles */
525
526 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: COMMON PAGE ELEMENTS /\/\/\/\/\/\/\/\/\/\ */
527
528 /**
529 * @tab Page
530 * @section background color
531 * @tip Set the background color for your email. You may want to choose one that matches your company's branding.
532 * @theme page
533 */
534 body, #backgroundTable{
535 /*@editable*/ background-color:#FAFAFA;
536 }
537
538 /**
539 * @tab Page
540 * @section email border
541 * @tip Set the border for your email.
542 */
543 #templateContainer{
544 /*@editable*/ border:0;
545 }
546
547 /**
548 * @tab Page
549 * @section heading 1
550 * @tip Set the styling for all first-level headings in your emails. These should be the largest of your headings.
551 * @style heading 1
552 */
553 h1, .h1{
554 /*@editable*/ color:#202020;
555 display:block;
556 /*@editable*/ font-family:Arial;
557 /*@editable*/ font-size:40px;
558 /*@editable*/ font-weight:bold;
559 /*@editable*/ line-height:100%;
560 margin-top:2%;
561 margin-right:0;
562 margin-bottom:1%;
563 margin-left:0;
564 /*@editable*/ text-align:left;
565 }
566
567 /**
568 * @tab Page
569 * @section heading 2
570 * @tip Set the styling for all second-level headings in your emails.
571 * @style heading 2
572 */
573 h2, .h2{
574 /*@editable*/ color:#404040;
575 display:block;
576 /*@editable*/ font-family:Arial;
577 /*@editable*/ font-size:18px;
578 /*@editable*/ font-weight:bold;
579 /*@editable*/ line-height:100%;
580 margin-top:2%;
581 margin-right:0;
582 margin-bottom:1%;
583 margin-left:0;
584 /*@editable*/ text-align:left;
585 }
586
587 /**
588 * @tab Page
589 * @section heading 3
590 * @tip Set the styling for all third-level headings in your emails.
591 * @style heading 3
592 */
593 h3, .h3{
594 /*@editable*/ color:#606060;
595 display:block;
596 /*@editable*/ font-family:Arial;
597 /*@editable*/ font-size:16px;
598 /*@editable*/ font-weight:bold;
599 /*@editable*/ line-height:100%;
600 margin-top:2%;
601 margin-right:0;
602 margin-bottom:1%;
603 margin-left:0;
604 /*@editable*/ text-align:left;
605 }
606
607 /**
608 * @tab Page
609 * @section heading 4
610 * @tip Set the styling for all fourth-level headings in your emails. These should be the smallest of your headings.
611 * @style heading 4
612 */
613 h4, .h4{
614 /*@editable*/ color:#808080;
615 display:block;
616 /*@editable*/ font-family:Arial;
617 /*@editable*/ font-size:14px;
618 /*@editable*/ font-weight:bold;
619 /*@editable*/ line-height:100%;
620 margin-top:2%;
621 margin-right:0;
622 margin-bottom:1%;
623 margin-left:0;
624 /*@editable*/ text-align:left;
625 }
626
627 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: PREHEADER /\/\/\/\/\/\/\/\/\/\ */
628
629 /**
630 * @tab Header
631 * @section preheader style
632 * @tip Set the background color for your email's preheader area.
633 * @theme page
634 */
635 #templatePreheader{
636 /*@editable*/ background-color:#FAFAFA;
637 }
638
639 /**
640 * @tab Header
641 * @section preheader text
642 * @tip Set the styling for your email's preheader text. Choose a size and color that is easy to read.
643 */
644 .preheaderContent div{
645 /*@editable*/ color:#707070;
646 /*@editable*/ font-family:Arial;
647 /*@editable*/ font-size:10px;
648 /*@editable*/ line-height:100%;
649 /*@editable*/ text-align:left;
650 }
651
652 /**
653 * @tab Header
654 * @section preheader link
655 * @tip Set the styling for your email's preheader links. Choose a color that helps them stand out from your text.
656 */
657 .preheaderContent div a:link, .preheaderContent div a:visited, /* Yahoo! Mail Override */ .preheaderContent div a .yshortcuts /* Yahoo! Mail Override */{
658 /*@editable*/ color:#336699;
659 /*@editable*/ font-weight:normal;
660 /*@editable*/ text-decoration:underline;
661 }
662
663 /**
664 * @tab Header
665 * @section social bar style
666 * @tip Set the background color and border for your email's footer social bar.
667 */
668 #social div{
669 /*@editable*/ text-align:right;
670 }
671
672 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: HEADER /\/\/\/\/\/\/\/\/\/\ */
673
674 /**
675 * @tab Header
676 * @section header style
677 * @tip Set the background color and border for your email's header area.
678 * @theme header
679 */
680 #templateHeader{
681 /*@editable*/ background-color:#FFFFFF;
682 /*@editable*/ border-bottom:5px solid #505050;
683 }
684
685 /**
686 * @tab Header
687 * @section header text
688 * @tip Set the styling for your email's header text. Choose a size and color that is easy to read.
689 */
690 .headerContent{
691 /*@editable*/ color:#202020;
692 /*@editable*/ font-family:Arial;
693 /*@editable*/ font-size:34px;
694 /*@editable*/ font-weight:bold;
695 /*@editable*/ line-height:100%;
696 /*@editable*/ padding:10px;
697 /*@editable*/ text-align:right;
698 /*@editable*/ vertical-align:middle;
699 }
700
701 /**
702 * @tab Header
703 * @section header link
704 * @tip Set the styling for your email's header links. Choose a color that helps them stand out from your text.
705 */
706 .headerContent a:link, .headerContent a:visited, /* Yahoo! Mail Override */ .headerContent a .yshortcuts /* Yahoo! Mail Override */{
707 /*@editable*/ color:#336699;
708 /*@editable*/ font-weight:normal;
709 /*@editable*/ text-decoration:underline;
710 }
711
712 #headerImage{
713 height:auto;
714 max-width:600px !important;
715 }
716
717 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: MAIN BODY /\/\/\/\/\/\/\/\/\/\ */
718
719 /**
720 * @tab Body
721 * @section body style
722 * @tip Set the background color for your email's body area.
723 */
724 #templateContainer, .bodyContent{
725 /*@editable*/ background-color:#FDFDFD;
726 }
727
728 /**
729 * @tab Body
730 * @section body text
731 * @tip Set the styling for your email's main content text. Choose a size and color that is easy to read.
732 * @theme main
733 */
734 .bodyContent div{
735 /*@editable*/ color:#505050;
736 /*@editable*/ font-family:Arial;
737 /*@editable*/ font-size:14px;
738 /*@editable*/ line-height:150%;
739 /*@editable*/ text-align:justify;
740 }
741
742 /**
743 * @tab Body
744 * @section body link
745 * @tip Set the styling for your email's main content links. Choose a color that helps them stand out from your text.
746 */
747 .bodyContent div a:link, .bodyContent div a:visited, /* Yahoo! Mail Override */ .bodyContent div a .yshortcuts /* Yahoo! Mail Override */{
748 /*@editable*/ color:#336699;
749 /*@editable*/ font-weight:normal;
750 /*@editable*/ text-decoration:underline;
751 }
752
753 .bodyContent img{
754 display:inline;
755 height:auto;
756 }
757
758 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: SIDEBAR /\/\/\/\/\/\/\/\/\/\ */
759
760 /**
761 * @tab Sidebar
762 * @section sidebar style
763 * @tip Set the background color and border for your email's sidebar area.
764 */
765 #templateSidebar{
766 /*@editable*/ background-color:#FDFDFD;
767 }
768
769 /**
770 * @tab Sidebar
771 * @section sidebar style
772 * @tip Set the background color and border for your email's sidebar area.
773 */
774 .sidebarContent{
775 /*@editable*/ border-right:1px solid #DDDDDD;
776 }
777
778 /**
779 * @tab Sidebar
780 * @section sidebar text
781 * @tip Set the styling for your email's sidebar text. Choose a size and color that is easy to read.
782 */
783 .sidebarContent div{
784 /*@editable*/ color:#505050;
785 /*@editable*/ font-family:Arial;
786 /*@editable*/ font-size:10px;
787 /*@editable*/ line-height:150%;
788 /*@editable*/ text-align:left;
789 }
790
791 /**
792 * @tab Sidebar
793 * @section sidebar link
794 * @tip Set the styling for your email's sidebar links. Choose a color that helps them stand out from your text.
795 */
796 .sidebarContent div a:link, .sidebarContent div a:visited, /* Yahoo! Mail Override */ .sidebarContent div a .yshortcuts /* Yahoo! Mail Override */{
797 /*@editable*/ color:#336699;
798 /*@editable*/ font-weight:normal;
799 /*@editable*/ text-decoration:underline;
800 }
801
802 .sidebarContent img{
803 display:inline;
804 height:auto;
805 }
806
807 /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: FOOTER /\/\/\/\/\/\/\/\/\/\ */
808
809 /**
810 * @tab Footer
811 * @section footer style
812 * @tip Set the background color and top border for your email's footer area.
813 * @theme footer
814 */
815 #templateFooter{
816 /*@editable*/ background-color:#FAFAFA;
817 /*@editable*/ border-top:3px solid #909090;
818 }
819
820 /**
821 * @tab Footer
822 * @section footer text
823 * @tip Set the styling for your email's footer text. Choose a size and color that is easy to read.
824 * @theme footer
825 */
826 .footerContent div{
827 /*@editable*/ color:#707070;
828 /*@editable*/ font-family:Arial;
829 /*@editable*/ font-size:11px;
830 /*@editable*/ line-height:125%;
831 /*@editable*/ text-align:left;
832 }
833
834 /**
835 * @tab Footer
836 * @section footer link
837 * @tip Set the styling for your email's footer links. Choose a color that helps them stand out from your text.
838 */
839 .footerContent div a:link, .footerContent div a:visited, /* Yahoo! Mail Override */ .footerContent div a .yshortcuts /* Yahoo! Mail Override */{
840 /*@editable*/ color:#336699;
841 /*@editable*/ font-weight:normal;
842 /*@editable*/ text-decoration:underline;
843 }
844
845 .footerContent img{
846 display:inline;
847 }
848
849 /**
850 * @tab Footer
851 * @section social bar style
852 * @tip Set the background color and border for your email's footer social bar.
853 * @theme footer
854 */
855 #social{
856 /*@editable*/ background-color:#FFFFFF;
857 /*@editable*/ border:0;
858 }
859
860 /**
861 * @tab Footer
862 * @section social bar style
863 * @tip Set the background color and border for your email's footer social bar.
864 */
865 #social div{
866 /*@editable*/ text-align:left;
867 }
868
869 /**
870 * @tab Footer
871 * @section utility bar style
872 * @tip Set the background color and border for your email's footer utility bar.
873 * @theme footer
874 */
875 #utility{
876 /*@editable*/ background-color:#FAFAFA;
877 /*@editable*/ border-top:0;
878 }
879
880 /**
881 * @tab Footer
882 * @section utility bar style
883 * @tip Set the background color and border for your email's footer utility bar.
884 */
885 #utility div{
886 /*@editable*/ text-align:left;
887 }
888
889 #monkeyRewards img{
890 max-width:170px !important;
891 }
892 </style>
893 </head>
894 <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">
895 <center>
896 <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="backgroundTable">
897 <tr>
898 <td align="center" valign="top">
899 <table border="0" cellpadding="0" cellspacing="0" width="600" id="templateContainer">
900 <tr style="margin: 0px; padding: 0px; background-color: rgb(247, 247, 247);">
901 <td align="center" valign="top">
902 <!-- // Begin Template Header \\ -->
903 <table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin: 0px; padding: 0px; background-color: rgb(253, 253, 253);">
904 <tr>
905 <td class="headerContent">
906 <img src="https://pbs.twimg.com/profile_images/2137139487/logo-vauxoo-lp.jpg" style="max-width:60px; padding: 2px 2px 2px;" id="headerImage campaign-icon" mc:label="header_image" mc:edit="header_image" mc:allowtext />
907 </td>
908
909 <td class="headerContent" width="100%" style="padding-left:10px; padding-right:20px;">
910 <div mc:edit="Header_content">
911 <h2>
912 ${object.accep_crit_id.name}
913 </h2>
914 </div>
915 </td>
916 </tr>
917 </table>
918 <!-- // End Template Header \\ -->
919 </td>
920 </tr>
921 <tr>
922 <td align="center" style="margin: 0px; padding: 0px; width: 600px; background-color: #951510">
923 <div style="font-size:1.3em; font-family:Arial; color:#FFFFFF;"><b>
924 Criterio de Aceptación.
925 </b></div>
926 </td>
927 </tr>
928 <tr>
929 <td align="center" valign="top">
930 <!-- // Begin Template Body \\ -->
931 <table border="0" cellpadding="10" cellspacing="0" width="600" style="margin: 0px; padding: 0px; width: 600px; background-color: rgb(247, 247, 247);">
932 <tr>
933 <!-- // Begin Sidebar \\ -->
934 <td valign="top" width="180" id="templateSidebar">
935 <table border="0" cellpadding="0" cellspacing="0" width="100%">
936 <tr>
937 <td valign="top">
938 </td>
939 </tr>
940 </table>
941 </td>
942 <!-- // End Sidebar \\ -->
943 <td valign="top" class="bodyContent">
944
945 <!-- // Begin Module: Standard Content \\ -->
946 <table border="0" cellpadding="10" cellspacing="0" width="600">
947 <tr>
948 <td valign="top" style="padding-left:0;">
949 <div mc:edit="std_content00">
950 <h2 class="h2">Estimad@ ${object.accep_crit_id.owner_id.name}</h2>
951 <h3 class="h3">
952 El criterio de aceptación ${object.name} ha sido terminado por ${object.accep_crit_id.user_execute_id and object.accep_crit_id.user_execute_id.name}.
953 </h3>
954 <pre style="font-size:1.1em; font-family:Arial">
955
956Agradeciendo su atención.
957
958Ante cualquier duda estamos a su disposición.
959<a href="${object.get_body_disapproval()}">Acceso directo al Documento</a>
960 </pre>
961 <br />
962 </div>
963 </td>
964 </tr>
965 </table>
966 <!-- // End Module: Standard Content \\ -->
967
968 </td>
969 </tr>
970 </table>
971 <!-- // End Template Body \\ -->
972 </td>
973 </table>
974 <br />
975 </td>
976 </tr>
977 </table>
978 </center>
979 </body>
980</html>
981 ]]></field>
982 </record>
9 <record id="template_send_email_hu" model="email.template" forcecreate="True">983 <record id="template_send_email_hu" model="email.template" forcecreate="True">
10 <field name="name">Accept Criteria</field>984 <field name="name">Accept Criteria</field>
11 <field name="email_from"></field>985 <field name="email_from"></field>
12986
=== modified file 'user_story/model/user_story.py'
--- user_story/model/user_story.py 2014-10-03 07:19:35 +0000
+++ user_story/model/user_story.py 2014-10-15 22:07:15 +0000
@@ -87,7 +87,7 @@
87 return super(user_story, self).write(cr, uid, ids,87 return super(user_story, self).write(cr, uid, ids,
88 vals, context=context)88 vals, context=context)
8989
90 def body_progress(self, cr, uid, ids, template, hu, context=None):90 def body_progress(self, cr, uid, ids, template, context=None):
91 imd_obj = self.pool.get('ir.model.data')91 imd_obj = self.pool.get('ir.model.data')
92 template_ids = imd_obj.search(92 template_ids = imd_obj.search(
93 cr, uid, [('model', '=', 'email.template'), ('name', '=', template)])93 cr, uid, [('model', '=', 'email.template'), ('name', '=', template)])
@@ -138,7 +138,8 @@
138 else:138 else:
139 return False139 return False
140140
141 def send_mail_hu(self, cr, uid, ids, subject, body, res_id, users=[], context=None):141 def send_mail_hu(self, cr, uid, ids, subject, body, res_id,
142 users=None, context=None):
142 if context is None:143 if context is None:
143 context = {}144 context = {}
144 if context.get('force_send', False):145 if context.get('force_send', False):
@@ -215,7 +216,9 @@
215 result[task.userstory_id.id] = True216 result[task.userstory_id.id] = True
216 return result.keys()217 return result.keys()
217218
218 def _message_get_auto_subscribe_fields(self, cr, uid, updated_fields, auto_follow_fields=['user_id'], context=None):219 def _message_get_auto_subscribe_fields(self, cr, uid, updated_fields,
220 auto_follow_fields=None,
221 context=None):
219 if auto_follow_fields is None:222 if auto_follow_fields is None:
220 auto_follow_fields = ['user_id']223 auto_follow_fields = ['user_id']
221224
@@ -300,13 +303,13 @@
300 '''303 '''
301 usname = self.browse(cr, uid, i).name304 usname = self.browse(cr, uid, i).name
302 username = self.pool.get('res.users').browse(cr, uid, uid).name305 username = self.pool.get('res.users').browse(cr, uid, uid).name
303 urlbase = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')306 link = '#id={i}&view_type=form&model=user.story'.format(i=i)
304 link = '#id={i}&view_type=form&model=user.story'.format(i=i, urlbase=urlbase)
305 return _(u'''<html><div>307 return _(u'''<html><div>
306 <h2>{usname}</h2>308 <h2>{usname}</h2>
307 <p>The user {user} has approved the user Story309 <p>The user {user} has approved the user Story
308 <a href="{link}">See what we are talking about here</a>310 <a href="{link}">See what we are talking about here</a>
309 </div></html>'''.format(usname=usname, user=username, link=link))311 </div></html>'''.format(usname=usname, user=username,
312 link=link))
310313
311 def do_disapproval(self, cr, uid, ids, context=None):314 def do_disapproval(self, cr, uid, ids, context=None):
312 '''315 '''
@@ -323,13 +326,13 @@
323 def get_body_approval(self, cr, uid, i, context=None):326 def get_body_approval(self, cr, uid, i, context=None):
324 usname = self.browse(cr, uid, i).name327 usname = self.browse(cr, uid, i).name
325 username = self.pool.get('res.users').browse(cr, uid, uid).name328 username = self.pool.get('res.users').browse(cr, uid, uid).name
326 urlbase = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')329 link = '#id={i}&view_type=form&model=user.story'.format(i=i)
327 link = '#id={i}&view_type=form&model=user.story'.format(i=i, urlbase=urlbase)
328 return _(u'''<html><div>330 return _(u'''<html><div>
329 <h2>{usname}</h2>331 <h2>{usname}</h2>
330 <p>The user {user} has approved the user Story332 <p>The user {user} has approved the user Story
331 <a href="{link}">See what we are talking about here</a>333 <a href="{link}">See what we are talking about here</a>
332 </div></html>'''.format(usname=usname, user=username, link=link))334 </div></html>'''.format(usname=usname, user=username,
335 link=link))
333336
334 def do_approval(self, cr, uid, ids, context=None):337 def do_approval(self, cr, uid, ids, context=None):
335 context = context or {}338 context = context or {}
@@ -418,6 +421,111 @@
418 cr, uid, [('accep_crit_id', 'in', us_ids)], context=context)421 cr, uid, [('accep_crit_id', 'in', us_ids)], context=context)
419 return ac_ids422 return ac_ids
420423
424 def get_body_disapproval(self, cr, uid, i, context=None):
425 '''
426 TODO: This body must be verified to give the information regarding the answers in
427 the do_disaproval method.
428 '''
429 model_brw = self.browse(cr, uid, i[0])
430 link = '#id={i}&view_type=form&model=user.story'.format(i=model_brw.accep_crit_id and model_brw.accep_crit_id.id)
431 return link
432
433 def approve(self, cr, uid, ids, context=None):
434 context = context or {}
435 criterial_brw2 = self.browse(cr, uid, ids[0])
436 criterial_brw = self.browse(cr, SUPERUSER_ID, ids[0])
437 if criterial_brw.accepted:
438 return True
439 data_obj = self.pool.get('ir.model.data')
440 compose_obj = self.pool.get('mail.compose.message')
441 user_story_brw = criterial_brw.accep_crit_id
442 partner_ids = [i.id for i in user_story_brw.message_follower_ids]
443 partner_ids.append(user_story_brw.owner_id.partner_id.id)
444 if user_story_brw.user_id:
445 partner_ids.append(user_story_brw.user_id.partner_id.id)
446 if user_story_brw.user_execute_id:
447 partner_ids.append(user_story_brw.user_execute_id.partner_id.id)
448 partner_ids = list(set(partner_ids))
449 template = data_obj.get_object(cr, uid, 'user_story', 'template_approve_aceptabilty_criterial')
450 mail = self.pool.get('email.template').generate_email(cr, SUPERUSER_ID, template.id, ids[0])
451 compose_id = compose_obj.create(cr, uid, {
452 'res_model': 'user.story',
453 'model': 'user.story',
454 'res_id': user_story_brw.id,
455 'partner_ids': [(6, 0, partner_ids)],
456 'partner_id':0,
457 'body': mail.get('body'),
458 })
459 criterial_brw2.write({'accepted': True})
460 compose_obj.send_mail(cr, uid, [compose_id])
461 return True
462
463 def disapprove(self, cr, uid, ids, context=None):
464 context = context or {}
465 criterial_brw = self.browse(cr, SUPERUSER_ID, ids[0])
466 if criterial_brw.accepted:
467 return True
468 data_obj = self.pool.get('ir.model.data')
469 user_story_brw = criterial_brw.accep_crit_id
470 partner_ids = [i.id for i in user_story_brw.message_follower_ids]
471 partner_ids.append(user_story_brw.owner_id.partner_id.id)
472 if user_story_brw.user_id:
473 partner_ids.append(user_story_brw.user_id.partner_id.id)
474 if user_story_brw.user_execute_idi:
475 partner_ids.append(user_story_brw.user_execute_id.partner_id.id)
476 partner_ids = list(set(partner_ids))
477 model_data_id = data_obj._get_id(cr, uid, 'user_story',
478 'email_compose_message_wizard_inherit_form_without_partner')
479 res_id = data_obj.browse(cr, uid, model_data_id, context=context).res_id
480 ction = {
481 'type': 'ir.actions.act_window',
482 'res_model': 'mail.compose.message',
483 'src_model': 'user.story',
484 'view_mode': 'form',
485 'view_mode':'form,tree',
486 'view_id': res_id,
487 'view_type': 'form',
488 'views': [[res_id, 'form']],
489 'target': 'new',
490 'context': {
491 'default_res_model': 'user.story',
492 'default_mail_compose_log': True,
493 'default_model': 'user.story',
494 'default_res_id': user_story_brw.id,
495 'default_partner_ids': [(6, 0, partner_ids)],
496 'default_body': _('<b>Description the cause of disapproval</b>'),
497 }
498 }
499 return ction
500
501 def ask_review(self, cr, uid, ids, context=None):
502 context = context or {}
503 criterial_brw = self.browse(cr, SUPERUSER_ID, ids[0])
504 if criterial_brw.accepted:
505 return True
506 data_obj = self.pool.get('ir.model.data')
507 compose_obj = self.pool.get('mail.compose.message')
508 user_story_brw = criterial_brw.accep_crit_id
509 partner_ids = [i.id for i in user_story_brw.message_follower_ids]
510 partner_ids.append(user_story_brw.owner_id.partner_id.id)
511 if user_story_brw.user_id:
512 partner_ids.append(user_story_brw.user_id.partner_id.id)
513 if user_story_brw.user_execute_id:
514 partner_ids.append(user_story_brw.user_execute_id.partner_id.id)
515 partner_ids = list(set(partner_ids))
516 template = data_obj.get_object(cr, uid, 'user_story', 'template_ask_aceptabilty_criterial')
517 mail = self.pool.get('email.template').generate_email(cr, SUPERUSER_ID, template.id, ids[0])
518 compose_id = compose_obj.create(cr, uid, {
519 'res_model': 'user.story',
520 'model': 'user.story',
521 'res_id': user_story_brw.id,
522 'partner_ids': [(6, 0, partner_ids)],
523 'partner_id':0,
524 'body': mail.get('body'),
525 })
526 compose_obj.send_mail(cr, uid, [compose_id])
527 return True
528
421 def _get_user_story_field(self, cr, uid, ids, fieldname, arg, context=None):529 def _get_user_story_field(self, cr, uid, ids, fieldname, arg, context=None):
422 """530 """
423 Method used as the function for extracting values for the user.story531 Method used as the function for extracting values for the user.story
@@ -441,7 +549,7 @@
441 'accep_crit_id': fields.many2one('user.story',549 'accep_crit_id': fields.many2one('user.story',
442 'User Story',550 'User Story',
443 ondelete='cascade',551 ondelete='cascade',
444 required=True),552 ),
445 'accepted': fields.boolean('Accepted',553 'accepted': fields.boolean('Accepted',
446 help='Check if this criterion apply'),554 help='Check if this criterion apply'),
447 'development': fields.boolean('Development'),555 'development': fields.boolean('Development'),
@@ -518,15 +626,17 @@
518class project_task(osv.Model):626class project_task(osv.Model):
519 _inherit = 'project.task'627 _inherit = 'project.task'
520628
521 def default_get(self, cr, uid, fields, context=None):629 def default_get(self, cr, uid, field, context=None):
522 '''Owerwrite default get to add project in new task automatically'''630 '''Owerwrite default get to add project in new task automatically'''
523 if context is None:631 if context is None:
524 context = {}632 context = {}
525 res = super(project_task, self).default_get(633 res = super(project_task, self).default_get(
526 cr, uid, fields, context=context)634 cr, uid, field, context=context)
527 context.get('project_task', False) and \635 if context.get('project_task', False):
528 res.update({'project_id': context.get('project_task'), 'categ_ids': context.get('categ_task'),636 res.update({'project_id': context.get('project_task'),
529 'sprint_id': context.get('sprint_task'), 'userstory_id': context.get('userstory_task')})637 'categ_ids': context.get('categ_task'),
638 'sprint_id': context.get('sprint_task'),
639 'userstory_id': context.get('userstory_task')})
530 return res640 return res
531641
532 def onchange_user_story_task(self, cr, uid, ids, us_id, context=None):642 def onchange_user_story_task(self, cr, uid, ids, us_id, context=None):
533643
=== modified file 'user_story/tests/test_user_story.py'
--- user_story/tests/test_user_story.py 2014-10-03 07:19:35 +0000
+++ user_story/tests/test_user_story.py 2014-10-15 22:07:15 +0000
@@ -2,6 +2,7 @@
2from openerp.osv.orm import except_orm2from openerp.osv.orm import except_orm
3from openerp import SUPERUSER_ID3from openerp import SUPERUSER_ID
4from openerp.tools import mute_logger4from openerp.tools import mute_logger
5import threading
56
67
7class TestUserStory(TransactionCase):8class TestUserStory(TransactionCase):
@@ -9,6 +10,7 @@
9 def setUp(self):10 def setUp(self):
10 super(TestUserStory, self).setUp()11 super(TestUserStory, self).setUp()
11 self.story = self.registry('user.story')12 self.story = self.registry('user.story')
13 self.criterial = self.registry('acceptability.criteria')
12 self.project = self.registry('project.project')14 self.project = self.registry('project.project')
13 self.user = self.registry('res.users')15 self.user = self.registry('res.users')
14 self.data = self.registry('ir.model.data')16 self.data = self.registry('ir.model.data')
@@ -35,33 +37,47 @@
35 'name': 'User Story Test',37 'name': 'User Story Test',
36 'owner_id': user_test_id,38 'owner_id': user_test_id,
37 'project_id': project_id,39 'project_id': project_id,
38 'accep_crit_ids': [(0, 0, {'name': 'Criterial Test 1', 'scenario': 'Test 1'}),
39 (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
40 (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
41 ]
42 })
43 # Adding user story group to the user created previously40 # Adding user story group to the user created previously
41 'accep_crit_ids': [(0, 0,
42 {'name': 'Criterial Test 1',
43 'scenario': 'Test 1'}),
44 (0, 0,
45 {'name': 'Criterial Test 2',
46 'scenario': 'Test 2'}),
47 (0, 0,
48 {'name': 'Criterial Test 3',
49 'scenario': 'Test 3'}),
50 ]
51 })
52 #Adding user story group to the user created previously
44 self.user.write(cr, SUPERUSER_ID, [user_test_id], {53 self.user.write(cr, SUPERUSER_ID, [user_test_id], {
45 'groups_id': [(4, us_manager_group.id)]54 'groups_id': [(4, us_manager_group.id)]
46 })55 })
47 # Try that a user with user story group can create a user story, this group must allow create user story without problems56 # Try that a user with user story group can create a user story, this group must allow create user story without problems
48 self.assertTrue(self.story.create(cr, user_test_id, {57 self.assertTrue(self.story.create(cr, user_test_id, {
49 'name': 'User Story Test',58 'name': 'User Story Test',
50 'owner_id': user_test_id,59 'owner_id': user_test_id,
51 'project_id': project_id,60 'project_id': project_id,
52 'accep_crit_ids': [(0, 0, {'name': 'Criterial Test 1', 'scenario': 'Test 1'}),61 'accep_crit_ids': [(0, 0,
53 (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),62 {'name': 'Criterial Test 1',
54 (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),63 'scenario': 'Test 1'}),
55 ]64 (0, 0,
65 {'name': 'Criterial Test 2',
66 'scenario': 'Test 2'}),
67 (0, 0,
68 {'name': 'Criterial Test 3',
69 'scenario': 'Test 3'}),
70 ]
5671
57 }), "An user with user story group manager cannot create an user story")72 }), "An user with user story group manager cannot create an user story")
5873
59 @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.osv.orm')74 @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.osv.orm')
60 def test_write_method(self):75 def test_write_method(self):
61 cr, uid = self.cr, self.uid76 cr, uid = self.cr, self.uid
62 # Search groups that allow manage user story77 #Search groups that allow manage user story
63 us_manager_group = self.data.get_object(cr, uid, 'user_story', 'group_user_story_manager')78 us_manager_group = self.data.get_object(cr, uid, 'user_story',
64 # Creating user to try the create method79 'group_user_story_manager')
80 #Creating user to try the create method
65 user_test_id = self.user.create(cr, SUPERUSER_ID, {81 user_test_id = self.user.create(cr, SUPERUSER_ID, {
66 'name': 'User Test',82 'name': 'User Test',
67 'login': 'test_create_user'83 'login': 'test_create_user'
@@ -77,13 +93,20 @@
77 'name': 'User Story Test',93 'name': 'User Story Test',
78 'owner_id': user_test_id,94 'owner_id': user_test_id,
79 'project_id': project_id,95 'project_id': project_id,
80 'accep_crit_ids': [(0, 0, {'name': 'Criterial Test 1', 'scenario': 'Test 1'}),96 'accep_crit_ids': [(0, 0,
81 (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),97 {'name': 'Criterial Test 1',
82 (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),98 'scenario': 'Test 1'}),
83 ]99 (0, 0,
84 })100 {'name': 'Criterial Test 2',
85 # Try that a user without user story group cannot write an user story101 'scenario': 'Test 2'}),
86 self.assertRaises(except_orm, self.story.write, cr, user_test_id, [story_id],102 (0, 0,
103 {'name': 'Criterial Test 3',
104 'scenario': 'Test 3'}),
105 ]
106 })
107 #Try that a user without user story group cannot write an user story
108 self.assertRaises(except_orm, self.story.write, cr,
109 user_test_id, [story_id],
87 {110 {
88 'name': 'User Story Test Changed',111 'name': 'User Story Test Changed',
89 })112 })
@@ -99,9 +122,10 @@
99 @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.osv.orm')122 @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.osv.orm')
100 def test_unlink_method(self):123 def test_unlink_method(self):
101 cr, uid = self.cr, self.uid124 cr, uid = self.cr, self.uid
102 # Search groups that allow manage user story125 #Search groups that allow manage user story
103 us_manager_group = self.data.get_object(cr, uid, 'user_story', 'group_user_story_manager')126 us_manager_group = self.data.get_object(cr, uid, 'user_story',
104 # Creating user to try the create method127 'group_user_story_manager')
128 #Creating user to try the create method
105 user_test_id = self.user.create(cr, SUPERUSER_ID, {129 user_test_id = self.user.create(cr, SUPERUSER_ID, {
106 'name': 'User Test',130 'name': 'User Test',
107 'login': 'test_create_user'131 'login': 'test_create_user'
@@ -117,27 +141,35 @@
117 'name': 'User Story Test',141 'name': 'User Story Test',
118 'owner_id': user_test_id,142 'owner_id': user_test_id,
119 'project_id': project_id,143 'project_id': project_id,
120 'accep_crit_ids': [(0, 0, {'name': 'Criterial Test 1', 'scenario': 'Test 1'}),144 'accep_crit_ids': [(0, 0,
121 (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),145 {'name': 'Criterial Test 1',
122 (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),146 'scenario': 'Test 1'}),
123 ]147 (0, 0,
124 })148 {'name': 'Criterial Test 2',
125 # Try that a user without user story group cannot remove an user story149 'scenario': 'Test 2'}),
126 self.assertRaises(except_orm, self.story.unlink, cr, user_test_id, [story_id])150 (0, 0,
127 # Adding user story group to the user created previously151 {'name': 'Criterial Test 3',
152 'scenario': 'Test 3'}),
153 ]
154 })
155 #Try that a user without user story group cannot remove an user story
156 self.assertRaises(except_orm, self.story.unlink,
157 cr, user_test_id, [story_id])
158 #Adding user story group to the user created previously
128 self.user.write(cr, SUPERUSER_ID, [user_test_id], {159 self.user.write(cr, SUPERUSER_ID, [user_test_id], {
129 'groups_id': [(4, us_manager_group.id)]160 'groups_id': [(4, us_manager_group.id)]
130 })161 })
131 # Try that a user with user story group can remove a user story, this group must allow create user story without problems162 #Try that a user with user story group can remove a user story, this group must allow create user story without problems
132 self.assertTrue(self.story.unlink(cr, user_test_id, [story_id]),163 self.assertTrue(self.story.unlink(cr, user_test_id, [story_id] ),
133 "An user with user story group manager cannot remove an user story")164 "An user with user story group manager cannot remove "
134165 "an user story")
135 @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.osv.orm')166 @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.osv.orm')
136 def test_copy_method(self):167 def test_copy_method(self):
137 cr, uid = self.cr, self.uid168 cr, uid = self.cr, self.uid
138 # Search groups that allow manage user story169 #Search groups that allow manage user story
139 us_manager_group = self.data.get_object(cr, uid, 'user_story', 'group_user_story_manager')170 us_manager_group = self.data.get_object(cr, uid, 'user_story',
140 # Creating user to try the create method171 'group_user_story_manager')
172 #Creating user to try the create method
141 user_test_id = self.user.create(cr, SUPERUSER_ID, {173 user_test_id = self.user.create(cr, SUPERUSER_ID, {
142 'name': 'User Test',174 'name': 'User Test',
143 'login': 'test_create_user'175 'login': 'test_create_user'
@@ -153,17 +185,60 @@
153 'name': 'User Story Test',185 'name': 'User Story Test',
154 'owner_id': user_test_id,186 'owner_id': user_test_id,
155 'project_id': project_id,187 'project_id': project_id,
156 'accep_crit_ids': [(0, 0, {'name': 'Criterial Test 1', 'scenario': 'Test 1'}),188 'accep_crit_ids': [(0, 0,
157 (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),189 {'name': 'Criterial Test 1',
158 (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),190 'scenario': 'Test 1'}),
159 ]191 (0, 0,
160 })192 {'name': 'Criterial Test 2',
161 # Try that a user without user story group cannot copy an user story193 'scenario': 'Test 2'}),
162 self.assertRaises(except_orm, self.story.copy, cr, user_test_id, story_id)194 (0, 0,
163 # Adding user story group to the user created previously195 {'name': 'Criterial Test 3',
196 'scenario': 'Test 3'}),
197 ]
198 })
199 #Try that a user without user story group cannot copy an user story
200 self.assertRaises(except_orm, self.story.copy, cr,
201 user_test_id, story_id)
202 #Adding user story group to the user created previously
164 self.user.write(cr, SUPERUSER_ID, [user_test_id], {203 self.user.write(cr, SUPERUSER_ID, [user_test_id], {
165 'groups_id': [(4, us_manager_group.id)]204 'groups_id': [(4, us_manager_group.id)]
166 })205 })
167 # Try that a user with user story group can copy a user story, this group must allow create user story without problems206 #Try that a user with user story group can copy a user story, this group must allow create user story without problems
168 self.assertTrue(self.story.copy(cr, user_test_id, story_id),207 self.assertTrue(self.story.copy(cr, user_test_id, story_id ),
169 "An user with user story group manager cannot remove an user story")208 "An user with user story group manager cannot "
209 "remove an user story")
210
211 @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.osv.orm')
212 def test_acceptability_criterial_buttons(self):
213 cr, uid = self.cr, self.uid
214 self.test_create_method()
215 threading.currentThread().testing = True
216 #Search the user and the user story to change the criterials
217 user_id = self.user.search(cr, uid, [('name', '=', 'User Test')])
218 story_id = self.story.search(cr, uid,
219 [('name', '=', 'User Story Test')])
220 user_brw = user_id and self.user.browse(cr, uid, user_id[0])
221 story_brw = story_id and self.story.browse(cr, uid, story_id[0])
222 i = 0
223 for criterial in user_brw and story_brw and story_brw.accep_crit_ids:
224 if i == 0:
225 mes = 'El criterio%{0}%ha sido aceptado por%'.\
226 format(criterial.name)
227 self.criterial.approve(cr, user_brw.id, [criterial.id])
228 m_id = self.message.search(cr, uid,
229 [('res_id', '=', story_brw.id),
230 ('body', 'ilike', mes)])
231 self.assertTrue(m_id, "The message was not created")
232 cri_brw = self.criterial.browse(cr, uid, criterial.id)
233 self.assertTrue(cri_brw.accepted,
234 "The criterial was not accepted")
235
236 elif i == 1:
237 mes = 'El criterio%{0}%ha sido terminado por%'.\
238 format(criterial.name)
239 self.criterial.ask_review(cr, user_brw.id, [criterial.id])
240 m_id = self.message.search(cr, uid,
241 [('res_id', '=', story_brw.id),
242 ('body', 'ilike', mes)])
243 self.assertTrue(m_id, "The message was not created")
244 i+=1
170245
=== modified file 'user_story/view/userstory_view.xml'
--- user_story/view/userstory_view.xml 2014-09-23 06:13:41 +0000
+++ user_story/view/userstory_view.xml 2014-10-15 22:07:15 +0000
@@ -8,16 +8,16 @@
8 <field name="arch" type="xml">8 <field name="arch" type="xml">
9 <form string="User Story" version="7.0">9 <form string="User Story" version="7.0">
10 <header>10 <header>
11 <button name="do_draft" string="Draft" type="object" states="open,pending,done,cancelled"/>11 <button name="do_draft" string="Draft" type="object" states="open,pending,done,cancelled"/>
12 <button name="do_progress" string="Progress" type="object" states="draft,pending,done,cancelled"/>12 <button name="do_progress" string="Progress" type="object" states="draft,pending,done,cancelled"/>
13 <button name="do_pending" string="Pending" type="object" states="draft,open,done,cancelled"/>13 <button name="do_pending" string="Pending" type="object" states="draft,open,done,cancelled"/>
14 <button name="do_done" string="Done" type="object" states="draft,open,pending,cancelled"/>14 <button name="do_done" string="Done" type="object" states="draft,open,pending,cancelled"/>
15 <button name="do_cancel" string="Cancel" type="object" states="draft,open,pending,done"/>15 <button name="do_cancel" string="Cancel" type="object" states="draft,open,pending,done"/>
16 <field name="state" widget="statusbar"/>16 <field name="state" widget="statusbar"/>
17 <label for='help'/>17 <label for='help'/>
18 <field name='help'/>18 <field name='help'/>
19 </header>19 </header>
20 <sheet string="User Story">20 <sheet string="User Story">
21 <div class="oe_right">21 <div class="oe_right">
22 <field name="date" select="1"22 <field name="date" select="1"
23 string="Created at"/>23 string="Created at"/>
@@ -28,10 +28,10 @@
28 -->28 -->
29 <h2 class="no_print"><label for="approved" string="0.- Is this User Story Approved to work with?"/><field name="approved"/></h2>29 <h2 class="no_print"><label for="approved" string="0.- Is this User Story Approved to work with?"/><field name="approved"/></h2>
30 <h1><label for="name" string="1.- Name of what will be done/configured/developed: Title of the Story" class="oe_horizontal_separator oe_clear"/></h1>30 <h1><label for="name" string="1.- Name of what will be done/configured/developed: Title of the Story" class="oe_horizontal_separator oe_clear"/></h1>
31 <h2><field name="name"/></h2>31 <h2><field name="name"/></h2>
32 <h3>32 <h3>
33 <label for="project_id" string="2.- Related Project" class="oe_horizontal_separator oe_clear"/>33 <label for="project_id" string="2.- Related Project" class="oe_horizontal_separator oe_clear"/>
34 </h3>34 </h3>
35 <div>35 <div>
36 <field name="project_id" domain="[('child_ids','=',False)]" context="{'current_model': 'project.project'}" />36 <field name="project_id" domain="[('child_ids','=',False)]" context="{'current_model': 'project.project'}" />
37 <div class="no_print" attrs="{'invisible':[('help','=',False)]}">37 <div class="no_print" attrs="{'invisible':[('help','=',False)]}">
@@ -75,11 +75,16 @@
75 </p>75 </p>
76 </div>76 </div>
77 <div class="no_print oe_right">77 <div class="no_print oe_right">
78 <button name="do_approval" type="object" states="draft" help="Please, Approve this User Story to start to work with it take care about if you are not the Owner of this User Story you will not be able to approve it." string="I approve start to work with this Story"/>78 <button name="do_approval"
79 type="object"
80 attrs="{'invisible':[('approved','=',True)]}"
81 states="draft"
82 help="Please, Approve this User Story to start to work with it take care about if you are not the Owner of this User Story you will not be able to approve it."
83 string="I approve start to work with this Story"/>
79 <h3>This User Story was approved by: <field name="approval_user_id" readonly="True"/></h3>84 <h3>This User Story was approved by: <field name="approval_user_id" readonly="True"/></h3>
80 </div>85 </div>
81 <field name="description" colspan="4" nolabel="1" attrs="{'readonly':[('approved','=',True)]}" placeholder="Add a description here ..." widget="html"/>86 <field name="description" colspan="4" nolabel="1" attrs="{'readonly':[('approved','=',True)]}" placeholder="Add a description here ..." widget="html"/>
82 <h1><label for="accep_crit_ids" string="4.- Aceptability Criteria" class="oe_horizontal_separator oe_clear"/></h1>87 <h1><label for="accep_crit_ids" string="4.- Aceptability Criteria" class="oe_horizontal_separator oe_clear"/></h1>
83 <field name="accep_crit_ids" colspan="4" nolabel="1">88 <field name="accep_crit_ids" colspan="4" nolabel="1">
84 <tree string="Acceptability Criteria" editable="bottom">89 <tree string="Acceptability Criteria" editable="bottom">
85 <field name="name"/>90 <field name="name"/>
@@ -111,7 +116,7 @@
111 <a href="/user_story/static/src/demo/TestUS.xmind" target="_NEW">here</a>116 <a href="/user_story/static/src/demo/TestUS.xmind" target="_NEW">here</a>
112 </p>117 </p>
113 </div>118 </div>
114 <separator colspan="4" string="5.- Technical Conclusions" class="oe_horizontal_separator oe_clear"/>119 <separator colspan="4" string="5.- Technical Conclusions" class="oe_horizontal_separator oe_clear"/>
115 <div class="no_print" attrs="{'invisible':[('help','=',False)]}">120 <div class="no_print" attrs="{'invisible':[('help','=',False)]}">
116 <p class="oe_grey">121 <p class="oe_grey">
117 Here you need to declare technically how will be122 Here you need to declare technically how will be
@@ -171,7 +176,7 @@
171 </field>176 </field>
172 </page>177 </page>
173 </notebook>178 </notebook>
174 </sheet>179 </sheet>
175 <div class="oe_chatter">180 <div class="oe_chatter">
176 <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>181 <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
177 <field name="message_ids" widget="mail_thread"/>182 <field name="message_ids" widget="mail_thread"/>
@@ -223,7 +228,6 @@
223 </h1>228 </h1>
224 <group>229 <group>
225 <field name="scenario"/>230 <field name="scenario"/>
226 <field name="accep_crit_id"/>
227 <field name="accepted"/>231 <field name="accepted"/>
228 <field name="development"/>232 <field name="development"/>
229 <field name="difficulty" invisible="1"/>233 <field name="difficulty" invisible="1"/>
@@ -289,6 +293,32 @@
289 </search>293 </search>
290 </field>294 </field>
291 </record>295 </record>
296 <record model="ir.ui.view" id="email_compose_message_wizard_inherit_form_without_partner">
297 <field name="name">mail.compose.message.form</field>
298 <field name="model">mail.compose.message</field>
299 <field name="priority">9999</field>
300 <field name="groups_id" eval="[(3,ref('base.group_user'))]"/>
301 <field name="arch" type="xml">
302 <form string="Compose Email" version="7.0">
303 <group>
304 <!-- truly invisible fields for control and options -->
305 <field name="composition_mode" invisible="1"/>
306 <field name="model" invisible="1"/>
307 <field name="res_id" invisible="1"/>
308 <field name="parent_id" invisible="1"/>
309 <!-- visible wizard -->
310 <field name="subject" placeholder="Subject..."/>
311 </group>
312 <field name="body"/>
313 <field name="attachment_ids" widget="many2many_binary"/>
314 <footer>
315 <button string="Send" name="send_mail" type="object" class="oe_highlight"/>
316 or
317 <button string="Cancel" class="oe_link" special="cancel" />
318 </footer>
319 </form>
320 </field>
321 </record>
292322
293 <record id="view_userstory_search" model="ir.ui.view">323 <record id="view_userstory_search" model="ir.ui.view">
294 <field name="name">user.story.search</field>324 <field name="name">user.story.search</field>
295325
=== added directory 'user_story/wizard'
=== added file 'user_story/wizard/__init__.py'
--- user_story/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ user_story/wizard/__init__.py 2014-10-15 22:07:15 +0000
@@ -0,0 +1,1 @@
1from . import message_compose
02
=== added file 'user_story/wizard/message_compose.py'
--- user_story/wizard/message_compose.py 1970-01-01 00:00:00 +0000
+++ user_story/wizard/message_compose.py 2014-10-15 22:07:15 +0000
@@ -0,0 +1,42 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>
19#
20##############################################################################
21
22from openerp.osv import osv, fields
23
24class mail_compose_message(osv.TransientModel):
25 _inherit = 'mail.compose.message'
26
27 def _get_templates(self, cr, uid, context=None):
28 if context is None:
29 context = {}
30 email_template_obj = self.pool.get('email.template')
31 if not email_template_obj.check_access_rights(cr, uid, 'read', raise_exception=False):
32 return []
33 else:
34 return super(mail_compose_message, self)._get_templates(cr, uid, context=context)
35 return []
36
37
38 _columns = {
39 # incredible hack of the day: size=-1 means we want an int db column instead of an str one
40 'template_id': fields.selection(_get_templates, 'Template', size=-1),
41 }
42# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: