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
1=== modified file 'user_story/__init__.py'
2--- user_story/__init__.py 2014-10-03 00:28:23 +0000
3+++ user_story/__init__.py 2014-10-15 22:07:15 +0000
4@@ -1,2 +1,3 @@
5 from . import model
6 from . import report
7+from . import wizard
8
9=== modified file 'user_story/__openerp__.py'
10--- user_story/__openerp__.py 2014-10-03 08:22:36 +0000
11+++ user_story/__openerp__.py 2014-10-15 22:07:15 +0000
12@@ -24,10 +24,10 @@
13 #
14 ##############################################################################
15 {
16- "name": "User Story",
17- "version": "0.1",
18- "author": "Vauxoo",
19- "category": "Generic Modules",
20+ "name": "User Story",
21+ "version": "0.1",
22+ "author": "Vauxoo",
23+ "category": "Generic Modules",
24 "description": """
25 Este módulo registra requerimientos funcionales y técnicos de software a
26 través de Historias de Usuarios.
27@@ -40,40 +40,40 @@
28 siguientes:
29
30 .. Story: http://dannorth.net/whats-in-a-story/
31-.. fuentes: http://adrianmoya.com/2012/08/que-hay-en-una-historia/""",
32- "website": "http://vauxoo.com",
33- "license": "",
34+.. fuentes: http://adrianmoya.com/2012/08/que-hay-en-una-historia/""",
35+ "website": "http://vauxoo.com",
36+ "license": "",
37 "depends": [
38- "base",
39- "project",
40- "sprint_kanban",
41- "project_timesheet",
42- "project_conf",
43+ "base",
44+ "project",
45+ "sprint_kanban",
46+ "project_timesheet",
47+ "project_conf",
48 "report_webkit"
49- ],
50+ ],
51 "demo": [
52 "demo/demo.xml"
53- ],
54+ ],
55 "data": [
56- "data/data_us_report.xml",
57- "report/user_story_report_view.xml",
58- "security/userstory_security.xml",
59- "security/ir.model.access.csv",
60- "view/userstory_view.xml",
61- "view/project_view.xml",
62- "view/hr_timesheet_view.xml",
63- "view/hr_timesheet_all_view.xml",
64- "view/custom_project_task_view.xml",
65- "data/data.xml",
66+ "data/data_us_report.xml",
67+ "report/user_story_report_view.xml",
68+ "security/userstory_security.xml",
69+ "security/ir.model.access.csv",
70+ "view/userstory_view.xml",
71+ "view/project_view.xml",
72+ "view/hr_timesheet_view.xml",
73+ "view/hr_timesheet_all_view.xml",
74+ "view/custom_project_task_view.xml",
75+ "data/data.xml",
76 "data/user_story_template.xml"
77- ],
78- "test": [],
79- "js": [],
80+ ],
81+ "test": [],
82+ "js": [],
83 "css": [
84 "static/src/css/*.css"
85- ],
86- "qweb": [],
87- "installable": True,
88- "auto_install": False,
89+ ],
90+ "qweb": [],
91+ "installable": True,
92+ "auto_install": False,
93 "active": False
94-}
95\ No newline at end of file
96+}
97
98=== modified file 'user_story/data/user_story_template.xml'
99--- user_story/data/user_story_template.xml 2014-05-09 21:51:34 +0000
100+++ user_story/data/user_story_template.xml 2014-10-15 22:07:15 +0000
101@@ -1,11 +1,985 @@
102 <?xml version="1.0"?>
103 <openerp>
104 <data noupdate="0">
105- <!--
106+ <!--
107 =====================================================
108 SEND EMAIL TEMPLATE
109 =====================================================
110- -->
111+ -->
112+ <record id="template_approve_aceptabilty_criterial" model="email.template" forcecreate="True">
113+ <field name="name">Approve</field>
114+ <field name="email_from"></field>
115+ <field name="model_id" ref="user_story.model_acceptability_criteria" />
116+ <field name="subject"></field>
117+ <field name="auto_delete" eval="True"/>
118+ <!--
119+ <field name="mail_server_id" ref="template_outgoing_mail_server_test"/>
120+ -->
121+ <field name="mail_server_id">1</field>
122+ <field name="email_to"></field>
123+ <field name="body_html"><![CDATA[
124+<html>
125+ <head>
126+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
127+ <title>*|MC:SUBJECT|*</title>
128+ <style type="text/css">
129+ /* Client-specific Styles */
130+ #outlook a{padding:0;} /* Force Outlook to provide a "view in browser" button. */
131+ body{width:100% !important;} .ReadMsgBody{width:100%;} .ExternalClass{width:100%;} /* Force Hotmail to display emails at full width */
132+ body{-webkit-text-size-adjust:none;} /* Prevent Webkit platforms from changing default text sizes. */
133+
134+ /* Reset Styles */
135+ body{margin:0; padding:0;}
136+ img{border:0; height:auto; line-height:100%; outline:none; text-decoration:none;}
137+ table td{border-collapse:collapse;}
138+ #backgroundTable{height:100% !important; margin:0; padding:0; width:100% !important;}
139+
140+ /* Template Styles */
141+
142+ /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: COMMON PAGE ELEMENTS /\/\/\/\/\/\/\/\/\/\ */
143+
144+ /**
145+ * @tab Page
146+ * @section background color
147+ * @tip Set the background color for your email. You may want to choose one that matches your company's branding.
148+ * @theme page
149+ */
150+ body, #backgroundTable{
151+ /*@editable*/ background-color:#FAFAFA;
152+ }
153+
154+ /**
155+ * @tab Page
156+ * @section email border
157+ * @tip Set the border for your email.
158+ */
159+ #templateContainer{
160+ /*@editable*/ border:0;
161+ }
162+
163+ /**
164+ * @tab Page
165+ * @section heading 1
166+ * @tip Set the styling for all first-level headings in your emails. These should be the largest of your headings.
167+ * @style heading 1
168+ */
169+ h1, .h1{
170+ /*@editable*/ color:#202020;
171+ display:block;
172+ /*@editable*/ font-family:Arial;
173+ /*@editable*/ font-size:40px;
174+ /*@editable*/ font-weight:bold;
175+ /*@editable*/ line-height:100%;
176+ margin-top:2%;
177+ margin-right:0;
178+ margin-bottom:1%;
179+ margin-left:0;
180+ /*@editable*/ text-align:left;
181+ }
182+
183+ /**
184+ * @tab Page
185+ * @section heading 2
186+ * @tip Set the styling for all second-level headings in your emails.
187+ * @style heading 2
188+ */
189+ h2, .h2{
190+ /*@editable*/ color:#404040;
191+ display:block;
192+ /*@editable*/ font-family:Arial;
193+ /*@editable*/ font-size:18px;
194+ /*@editable*/ font-weight:bold;
195+ /*@editable*/ line-height:100%;
196+ margin-top:2%;
197+ margin-right:0;
198+ margin-bottom:1%;
199+ margin-left:0;
200+ /*@editable*/ text-align:left;
201+ }
202+
203+ /**
204+ * @tab Page
205+ * @section heading 3
206+ * @tip Set the styling for all third-level headings in your emails.
207+ * @style heading 3
208+ */
209+ h3, .h3{
210+ /*@editable*/ color:#606060;
211+ display:block;
212+ /*@editable*/ font-family:Arial;
213+ /*@editable*/ font-size:16px;
214+ /*@editable*/ font-weight:bold;
215+ /*@editable*/ line-height:100%;
216+ margin-top:2%;
217+ margin-right:0;
218+ margin-bottom:1%;
219+ margin-left:0;
220+ /*@editable*/ text-align:left;
221+ }
222+
223+ /**
224+ * @tab Page
225+ * @section heading 4
226+ * @tip Set the styling for all fourth-level headings in your emails. These should be the smallest of your headings.
227+ * @style heading 4
228+ */
229+ h4, .h4{
230+ /*@editable*/ color:#808080;
231+ display:block;
232+ /*@editable*/ font-family:Arial;
233+ /*@editable*/ font-size:14px;
234+ /*@editable*/ font-weight:bold;
235+ /*@editable*/ line-height:100%;
236+ margin-top:2%;
237+ margin-right:0;
238+ margin-bottom:1%;
239+ margin-left:0;
240+ /*@editable*/ text-align:left;
241+ }
242+
243+ /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: PREHEADER /\/\/\/\/\/\/\/\/\/\ */
244+
245+ /**
246+ * @tab Header
247+ * @section preheader style
248+ * @tip Set the background color for your email's preheader area.
249+ * @theme page
250+ */
251+ #templatePreheader{
252+ /*@editable*/ background-color:#FAFAFA;
253+ }
254+
255+ /**
256+ * @tab Header
257+ * @section preheader text
258+ * @tip Set the styling for your email's preheader text. Choose a size and color that is easy to read.
259+ */
260+ .preheaderContent div{
261+ /*@editable*/ color:#707070;
262+ /*@editable*/ font-family:Arial;
263+ /*@editable*/ font-size:10px;
264+ /*@editable*/ line-height:100%;
265+ /*@editable*/ text-align:left;
266+ }
267+
268+ /**
269+ * @tab Header
270+ * @section preheader link
271+ * @tip Set the styling for your email's preheader links. Choose a color that helps them stand out from your text.
272+ */
273+ .preheaderContent div a:link, .preheaderContent div a:visited, /* Yahoo! Mail Override */ .preheaderContent div a .yshortcuts /* Yahoo! Mail Override */{
274+ /*@editable*/ color:#336699;
275+ /*@editable*/ font-weight:normal;
276+ /*@editable*/ text-decoration:underline;
277+ }
278+
279+ /**
280+ * @tab Header
281+ * @section social bar style
282+ * @tip Set the background color and border for your email's footer social bar.
283+ */
284+ #social div{
285+ /*@editable*/ text-align:right;
286+ }
287+
288+ /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: HEADER /\/\/\/\/\/\/\/\/\/\ */
289+
290+ /**
291+ * @tab Header
292+ * @section header style
293+ * @tip Set the background color and border for your email's header area.
294+ * @theme header
295+ */
296+ #templateHeader{
297+ /*@editable*/ background-color:#FFFFFF;
298+ /*@editable*/ border-bottom:5px solid #505050;
299+ }
300+
301+ /**
302+ * @tab Header
303+ * @section header text
304+ * @tip Set the styling for your email's header text. Choose a size and color that is easy to read.
305+ */
306+ .headerContent{
307+ /*@editable*/ color:#202020;
308+ /*@editable*/ font-family:Arial;
309+ /*@editable*/ font-size:34px;
310+ /*@editable*/ font-weight:bold;
311+ /*@editable*/ line-height:100%;
312+ /*@editable*/ padding:10px;
313+ /*@editable*/ text-align:right;
314+ /*@editable*/ vertical-align:middle;
315+ }
316+
317+ /**
318+ * @tab Header
319+ * @section header link
320+ * @tip Set the styling for your email's header links. Choose a color that helps them stand out from your text.
321+ */
322+ .headerContent a:link, .headerContent a:visited, /* Yahoo! Mail Override */ .headerContent a .yshortcuts /* Yahoo! Mail Override */{
323+ /*@editable*/ color:#336699;
324+ /*@editable*/ font-weight:normal;
325+ /*@editable*/ text-decoration:underline;
326+ }
327+
328+ #headerImage{
329+ height:auto;
330+ max-width:600px !important;
331+ }
332+
333+ /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: MAIN BODY /\/\/\/\/\/\/\/\/\/\ */
334+
335+ /**
336+ * @tab Body
337+ * @section body style
338+ * @tip Set the background color for your email's body area.
339+ */
340+ #templateContainer, .bodyContent{
341+ /*@editable*/ background-color:#FDFDFD;
342+ }
343+
344+ /**
345+ * @tab Body
346+ * @section body text
347+ * @tip Set the styling for your email's main content text. Choose a size and color that is easy to read.
348+ * @theme main
349+ */
350+ .bodyContent div{
351+ /*@editable*/ color:#505050;
352+ /*@editable*/ font-family:Arial;
353+ /*@editable*/ font-size:14px;
354+ /*@editable*/ line-height:150%;
355+ /*@editable*/ text-align:justify;
356+ }
357+
358+ /**
359+ * @tab Body
360+ * @section body link
361+ * @tip Set the styling for your email's main content links. Choose a color that helps them stand out from your text.
362+ */
363+ .bodyContent div a:link, .bodyContent div a:visited, /* Yahoo! Mail Override */ .bodyContent div a .yshortcuts /* Yahoo! Mail Override */{
364+ /*@editable*/ color:#336699;
365+ /*@editable*/ font-weight:normal;
366+ /*@editable*/ text-decoration:underline;
367+ }
368+
369+ .bodyContent img{
370+ display:inline;
371+ height:auto;
372+ }
373+
374+ /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: SIDEBAR /\/\/\/\/\/\/\/\/\/\ */
375+
376+ /**
377+ * @tab Sidebar
378+ * @section sidebar style
379+ * @tip Set the background color and border for your email's sidebar area.
380+ */
381+ #templateSidebar{
382+ /*@editable*/ background-color:#FDFDFD;
383+ }
384+
385+ /**
386+ * @tab Sidebar
387+ * @section sidebar style
388+ * @tip Set the background color and border for your email's sidebar area.
389+ */
390+ .sidebarContent{
391+ /*@editable*/ border-right:1px solid #DDDDDD;
392+ }
393+
394+ /**
395+ * @tab Sidebar
396+ * @section sidebar text
397+ * @tip Set the styling for your email's sidebar text. Choose a size and color that is easy to read.
398+ */
399+ .sidebarContent div{
400+ /*@editable*/ color:#505050;
401+ /*@editable*/ font-family:Arial;
402+ /*@editable*/ font-size:10px;
403+ /*@editable*/ line-height:150%;
404+ /*@editable*/ text-align:left;
405+ }
406+
407+ /**
408+ * @tab Sidebar
409+ * @section sidebar link
410+ * @tip Set the styling for your email's sidebar links. Choose a color that helps them stand out from your text.
411+ */
412+ .sidebarContent div a:link, .sidebarContent div a:visited, /* Yahoo! Mail Override */ .sidebarContent div a .yshortcuts /* Yahoo! Mail Override */{
413+ /*@editable*/ color:#336699;
414+ /*@editable*/ font-weight:normal;
415+ /*@editable*/ text-decoration:underline;
416+ }
417+
418+ .sidebarContent img{
419+ display:inline;
420+ height:auto;
421+ }
422+
423+ /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: FOOTER /\/\/\/\/\/\/\/\/\/\ */
424+
425+ /**
426+ * @tab Footer
427+ * @section footer style
428+ * @tip Set the background color and top border for your email's footer area.
429+ * @theme footer
430+ */
431+ #templateFooter{
432+ /*@editable*/ background-color:#FAFAFA;
433+ /*@editable*/ border-top:3px solid #909090;
434+ }
435+
436+ /**
437+ * @tab Footer
438+ * @section footer text
439+ * @tip Set the styling for your email's footer text. Choose a size and color that is easy to read.
440+ * @theme footer
441+ */
442+ .footerContent div{
443+ /*@editable*/ color:#707070;
444+ /*@editable*/ font-family:Arial;
445+ /*@editable*/ font-size:11px;
446+ /*@editable*/ line-height:125%;
447+ /*@editable*/ text-align:left;
448+ }
449+
450+ /**
451+ * @tab Footer
452+ * @section footer link
453+ * @tip Set the styling for your email's footer links. Choose a color that helps them stand out from your text.
454+ */
455+ .footerContent div a:link, .footerContent div a:visited, /* Yahoo! Mail Override */ .footerContent div a .yshortcuts /* Yahoo! Mail Override */{
456+ /*@editable*/ color:#336699;
457+ /*@editable*/ font-weight:normal;
458+ /*@editable*/ text-decoration:underline;
459+ }
460+
461+ .footerContent img{
462+ display:inline;
463+ }
464+
465+ /**
466+ * @tab Footer
467+ * @section social bar style
468+ * @tip Set the background color and border for your email's footer social bar.
469+ * @theme footer
470+ */
471+ #social{
472+ /*@editable*/ background-color:#FFFFFF;
473+ /*@editable*/ border:0;
474+ }
475+
476+ /**
477+ * @tab Footer
478+ * @section social bar style
479+ * @tip Set the background color and border for your email's footer social bar.
480+ */
481+ #social div{
482+ /*@editable*/ text-align:left;
483+ }
484+
485+ /**
486+ * @tab Footer
487+ * @section utility bar style
488+ * @tip Set the background color and border for your email's footer utility bar.
489+ * @theme footer
490+ */
491+ #utility{
492+ /*@editable*/ background-color:#FAFAFA;
493+ /*@editable*/ border-top:0;
494+ }
495+
496+ /**
497+ * @tab Footer
498+ * @section utility bar style
499+ * @tip Set the background color and border for your email's footer utility bar.
500+ */
501+ #utility div{
502+ /*@editable*/ text-align:left;
503+ }
504+
505+ #monkeyRewards img{
506+ max-width:170px !important;
507+ }
508+ </style>
509+ </head>
510+ <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">
511+ <center>
512+ <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="backgroundTable">
513+ <tr>
514+ <td align="center" valign="top">
515+ <table border="0" cellpadding="0" cellspacing="0" width="600" id="templateContainer">
516+ <tr style="margin: 0px; padding: 0px; background-color: rgb(247, 247, 247);">
517+ <td align="center" valign="top">
518+ <!-- // Begin Template Header \\ -->
519+ <table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin: 0px; padding: 0px; background-color: rgb(253, 253, 253);">
520+ <tr>
521+ <td class="headerContent">
522+ <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 />
523+ </td>
524+
525+ <td class="headerContent" width="100%" style="padding-left:10px; padding-right:20px;">
526+ <div mc:edit="Header_content">
527+ <h2>
528+ ${object.accep_crit_id.name}
529+ </h2>
530+ </div>
531+ </td>
532+ </tr>
533+ </table>
534+ <!-- // End Template Header \\ -->
535+ </td>
536+ </tr>
537+ <tr>
538+ <td align="center" style="margin: 0px; padding: 0px; width: 600px; background-color: #951510">
539+ <div style="font-size:1.3em; font-family:Arial; color:#FFFFFF;"><b>
540+ Criterio de Aceptación.
541+ </b></div>
542+ </td>
543+ </tr>
544+ <tr>
545+ <td align="center" valign="top">
546+ <!-- // Begin Template Body \\ -->
547+ <table border="0" cellpadding="10" cellspacing="0" width="600" style="margin: 0px; padding: 0px; width: 600px; background-color: rgb(247, 247, 247);">
548+ <tr>
549+ <!-- // Begin Sidebar \\ -->
550+ <td valign="top" width="180" id="templateSidebar">
551+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
552+ <tr>
553+ <td valign="top">
554+ </td>
555+ </tr>
556+ </table>
557+ </td>
558+ <!-- // End Sidebar \\ -->
559+ <td valign="top" class="bodyContent">
560+
561+ <!-- // Begin Module: Standard Content \\ -->
562+ <table border="0" cellpadding="10" cellspacing="0" width="600">
563+ <tr>
564+ <td valign="top" style="padding-left:0;">
565+ <div mc:edit="std_content00">
566+ <h2 class="h2">Estimad@ ${object.accep_crit_id.owner_id.name}</h2>
567+ <h3 class="h3">
568+ El criterio de aceptación ${object.name} ha sido aceptado por ${user.name}.
569+ </h3>
570+ <pre style="font-size:1.1em; font-family:Arial">
571+
572+Agradeciendo su atención.
573+
574+Ante cualquier duda estamos a su disposición.
575+<a href="${object.get_body_disapproval()}">Acceso directo al Documento</a>
576+ </pre>
577+ <br />
578+ </div>
579+ </td>
580+ </tr>
581+ </table>
582+ <!-- // End Module: Standard Content \\ -->
583+
584+ </td>
585+ </tr>
586+ </table>
587+ <!-- // End Template Body \\ -->
588+ </td>
589+ </table>
590+ <br />
591+ </td>
592+ </tr>
593+ </table>
594+ </center>
595+ </body>
596+</html>
597+ ]]></field>
598+ </record>
599+ <record id="template_ask_aceptabilty_criterial" model="email.template" forcecreate="True">
600+ <field name="name">Ask For Review</field>
601+ <field name="email_from"></field>
602+ <field name="model_id" ref="user_story.model_acceptability_criteria" />
603+ <field name="subject"></field>
604+ <field name="auto_delete" eval="True"/>
605+ <!--
606+ <field name="mail_server_id" ref="template_outgoing_mail_server_test"/>
607+ -->
608+ <field name="mail_server_id">1</field>
609+ <field name="email_to"></field>
610+ <field name="body_html"><![CDATA[
611+<html>
612+ <head>
613+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
614+ <title>*|MC:SUBJECT|*</title>
615+ <style type="text/css">
616+ /* Client-specific Styles */
617+ #outlook a{padding:0;} /* Force Outlook to provide a "view in browser" button. */
618+ body{width:100% !important;} .ReadMsgBody{width:100%;} .ExternalClass{width:100%;} /* Force Hotmail to display emails at full width */
619+ body{-webkit-text-size-adjust:none;} /* Prevent Webkit platforms from changing default text sizes. */
620+
621+ /* Reset Styles */
622+ body{margin:0; padding:0;}
623+ img{border:0; height:auto; line-height:100%; outline:none; text-decoration:none;}
624+ table td{border-collapse:collapse;}
625+ #backgroundTable{height:100% !important; margin:0; padding:0; width:100% !important;}
626+
627+ /* Template Styles */
628+
629+ /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: COMMON PAGE ELEMENTS /\/\/\/\/\/\/\/\/\/\ */
630+
631+ /**
632+ * @tab Page
633+ * @section background color
634+ * @tip Set the background color for your email. You may want to choose one that matches your company's branding.
635+ * @theme page
636+ */
637+ body, #backgroundTable{
638+ /*@editable*/ background-color:#FAFAFA;
639+ }
640+
641+ /**
642+ * @tab Page
643+ * @section email border
644+ * @tip Set the border for your email.
645+ */
646+ #templateContainer{
647+ /*@editable*/ border:0;
648+ }
649+
650+ /**
651+ * @tab Page
652+ * @section heading 1
653+ * @tip Set the styling for all first-level headings in your emails. These should be the largest of your headings.
654+ * @style heading 1
655+ */
656+ h1, .h1{
657+ /*@editable*/ color:#202020;
658+ display:block;
659+ /*@editable*/ font-family:Arial;
660+ /*@editable*/ font-size:40px;
661+ /*@editable*/ font-weight:bold;
662+ /*@editable*/ line-height:100%;
663+ margin-top:2%;
664+ margin-right:0;
665+ margin-bottom:1%;
666+ margin-left:0;
667+ /*@editable*/ text-align:left;
668+ }
669+
670+ /**
671+ * @tab Page
672+ * @section heading 2
673+ * @tip Set the styling for all second-level headings in your emails.
674+ * @style heading 2
675+ */
676+ h2, .h2{
677+ /*@editable*/ color:#404040;
678+ display:block;
679+ /*@editable*/ font-family:Arial;
680+ /*@editable*/ font-size:18px;
681+ /*@editable*/ font-weight:bold;
682+ /*@editable*/ line-height:100%;
683+ margin-top:2%;
684+ margin-right:0;
685+ margin-bottom:1%;
686+ margin-left:0;
687+ /*@editable*/ text-align:left;
688+ }
689+
690+ /**
691+ * @tab Page
692+ * @section heading 3
693+ * @tip Set the styling for all third-level headings in your emails.
694+ * @style heading 3
695+ */
696+ h3, .h3{
697+ /*@editable*/ color:#606060;
698+ display:block;
699+ /*@editable*/ font-family:Arial;
700+ /*@editable*/ font-size:16px;
701+ /*@editable*/ font-weight:bold;
702+ /*@editable*/ line-height:100%;
703+ margin-top:2%;
704+ margin-right:0;
705+ margin-bottom:1%;
706+ margin-left:0;
707+ /*@editable*/ text-align:left;
708+ }
709+
710+ /**
711+ * @tab Page
712+ * @section heading 4
713+ * @tip Set the styling for all fourth-level headings in your emails. These should be the smallest of your headings.
714+ * @style heading 4
715+ */
716+ h4, .h4{
717+ /*@editable*/ color:#808080;
718+ display:block;
719+ /*@editable*/ font-family:Arial;
720+ /*@editable*/ font-size:14px;
721+ /*@editable*/ font-weight:bold;
722+ /*@editable*/ line-height:100%;
723+ margin-top:2%;
724+ margin-right:0;
725+ margin-bottom:1%;
726+ margin-left:0;
727+ /*@editable*/ text-align:left;
728+ }
729+
730+ /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: PREHEADER /\/\/\/\/\/\/\/\/\/\ */
731+
732+ /**
733+ * @tab Header
734+ * @section preheader style
735+ * @tip Set the background color for your email's preheader area.
736+ * @theme page
737+ */
738+ #templatePreheader{
739+ /*@editable*/ background-color:#FAFAFA;
740+ }
741+
742+ /**
743+ * @tab Header
744+ * @section preheader text
745+ * @tip Set the styling for your email's preheader text. Choose a size and color that is easy to read.
746+ */
747+ .preheaderContent div{
748+ /*@editable*/ color:#707070;
749+ /*@editable*/ font-family:Arial;
750+ /*@editable*/ font-size:10px;
751+ /*@editable*/ line-height:100%;
752+ /*@editable*/ text-align:left;
753+ }
754+
755+ /**
756+ * @tab Header
757+ * @section preheader link
758+ * @tip Set the styling for your email's preheader links. Choose a color that helps them stand out from your text.
759+ */
760+ .preheaderContent div a:link, .preheaderContent div a:visited, /* Yahoo! Mail Override */ .preheaderContent div a .yshortcuts /* Yahoo! Mail Override */{
761+ /*@editable*/ color:#336699;
762+ /*@editable*/ font-weight:normal;
763+ /*@editable*/ text-decoration:underline;
764+ }
765+
766+ /**
767+ * @tab Header
768+ * @section social bar style
769+ * @tip Set the background color and border for your email's footer social bar.
770+ */
771+ #social div{
772+ /*@editable*/ text-align:right;
773+ }
774+
775+ /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: HEADER /\/\/\/\/\/\/\/\/\/\ */
776+
777+ /**
778+ * @tab Header
779+ * @section header style
780+ * @tip Set the background color and border for your email's header area.
781+ * @theme header
782+ */
783+ #templateHeader{
784+ /*@editable*/ background-color:#FFFFFF;
785+ /*@editable*/ border-bottom:5px solid #505050;
786+ }
787+
788+ /**
789+ * @tab Header
790+ * @section header text
791+ * @tip Set the styling for your email's header text. Choose a size and color that is easy to read.
792+ */
793+ .headerContent{
794+ /*@editable*/ color:#202020;
795+ /*@editable*/ font-family:Arial;
796+ /*@editable*/ font-size:34px;
797+ /*@editable*/ font-weight:bold;
798+ /*@editable*/ line-height:100%;
799+ /*@editable*/ padding:10px;
800+ /*@editable*/ text-align:right;
801+ /*@editable*/ vertical-align:middle;
802+ }
803+
804+ /**
805+ * @tab Header
806+ * @section header link
807+ * @tip Set the styling for your email's header links. Choose a color that helps them stand out from your text.
808+ */
809+ .headerContent a:link, .headerContent a:visited, /* Yahoo! Mail Override */ .headerContent a .yshortcuts /* Yahoo! Mail Override */{
810+ /*@editable*/ color:#336699;
811+ /*@editable*/ font-weight:normal;
812+ /*@editable*/ text-decoration:underline;
813+ }
814+
815+ #headerImage{
816+ height:auto;
817+ max-width:600px !important;
818+ }
819+
820+ /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: MAIN BODY /\/\/\/\/\/\/\/\/\/\ */
821+
822+ /**
823+ * @tab Body
824+ * @section body style
825+ * @tip Set the background color for your email's body area.
826+ */
827+ #templateContainer, .bodyContent{
828+ /*@editable*/ background-color:#FDFDFD;
829+ }
830+
831+ /**
832+ * @tab Body
833+ * @section body text
834+ * @tip Set the styling for your email's main content text. Choose a size and color that is easy to read.
835+ * @theme main
836+ */
837+ .bodyContent div{
838+ /*@editable*/ color:#505050;
839+ /*@editable*/ font-family:Arial;
840+ /*@editable*/ font-size:14px;
841+ /*@editable*/ line-height:150%;
842+ /*@editable*/ text-align:justify;
843+ }
844+
845+ /**
846+ * @tab Body
847+ * @section body link
848+ * @tip Set the styling for your email's main content links. Choose a color that helps them stand out from your text.
849+ */
850+ .bodyContent div a:link, .bodyContent div a:visited, /* Yahoo! Mail Override */ .bodyContent div a .yshortcuts /* Yahoo! Mail Override */{
851+ /*@editable*/ color:#336699;
852+ /*@editable*/ font-weight:normal;
853+ /*@editable*/ text-decoration:underline;
854+ }
855+
856+ .bodyContent img{
857+ display:inline;
858+ height:auto;
859+ }
860+
861+ /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: SIDEBAR /\/\/\/\/\/\/\/\/\/\ */
862+
863+ /**
864+ * @tab Sidebar
865+ * @section sidebar style
866+ * @tip Set the background color and border for your email's sidebar area.
867+ */
868+ #templateSidebar{
869+ /*@editable*/ background-color:#FDFDFD;
870+ }
871+
872+ /**
873+ * @tab Sidebar
874+ * @section sidebar style
875+ * @tip Set the background color and border for your email's sidebar area.
876+ */
877+ .sidebarContent{
878+ /*@editable*/ border-right:1px solid #DDDDDD;
879+ }
880+
881+ /**
882+ * @tab Sidebar
883+ * @section sidebar text
884+ * @tip Set the styling for your email's sidebar text. Choose a size and color that is easy to read.
885+ */
886+ .sidebarContent div{
887+ /*@editable*/ color:#505050;
888+ /*@editable*/ font-family:Arial;
889+ /*@editable*/ font-size:10px;
890+ /*@editable*/ line-height:150%;
891+ /*@editable*/ text-align:left;
892+ }
893+
894+ /**
895+ * @tab Sidebar
896+ * @section sidebar link
897+ * @tip Set the styling for your email's sidebar links. Choose a color that helps them stand out from your text.
898+ */
899+ .sidebarContent div a:link, .sidebarContent div a:visited, /* Yahoo! Mail Override */ .sidebarContent div a .yshortcuts /* Yahoo! Mail Override */{
900+ /*@editable*/ color:#336699;
901+ /*@editable*/ font-weight:normal;
902+ /*@editable*/ text-decoration:underline;
903+ }
904+
905+ .sidebarContent img{
906+ display:inline;
907+ height:auto;
908+ }
909+
910+ /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: FOOTER /\/\/\/\/\/\/\/\/\/\ */
911+
912+ /**
913+ * @tab Footer
914+ * @section footer style
915+ * @tip Set the background color and top border for your email's footer area.
916+ * @theme footer
917+ */
918+ #templateFooter{
919+ /*@editable*/ background-color:#FAFAFA;
920+ /*@editable*/ border-top:3px solid #909090;
921+ }
922+
923+ /**
924+ * @tab Footer
925+ * @section footer text
926+ * @tip Set the styling for your email's footer text. Choose a size and color that is easy to read.
927+ * @theme footer
928+ */
929+ .footerContent div{
930+ /*@editable*/ color:#707070;
931+ /*@editable*/ font-family:Arial;
932+ /*@editable*/ font-size:11px;
933+ /*@editable*/ line-height:125%;
934+ /*@editable*/ text-align:left;
935+ }
936+
937+ /**
938+ * @tab Footer
939+ * @section footer link
940+ * @tip Set the styling for your email's footer links. Choose a color that helps them stand out from your text.
941+ */
942+ .footerContent div a:link, .footerContent div a:visited, /* Yahoo! Mail Override */ .footerContent div a .yshortcuts /* Yahoo! Mail Override */{
943+ /*@editable*/ color:#336699;
944+ /*@editable*/ font-weight:normal;
945+ /*@editable*/ text-decoration:underline;
946+ }
947+
948+ .footerContent img{
949+ display:inline;
950+ }
951+
952+ /**
953+ * @tab Footer
954+ * @section social bar style
955+ * @tip Set the background color and border for your email's footer social bar.
956+ * @theme footer
957+ */
958+ #social{
959+ /*@editable*/ background-color:#FFFFFF;
960+ /*@editable*/ border:0;
961+ }
962+
963+ /**
964+ * @tab Footer
965+ * @section social bar style
966+ * @tip Set the background color and border for your email's footer social bar.
967+ */
968+ #social div{
969+ /*@editable*/ text-align:left;
970+ }
971+
972+ /**
973+ * @tab Footer
974+ * @section utility bar style
975+ * @tip Set the background color and border for your email's footer utility bar.
976+ * @theme footer
977+ */
978+ #utility{
979+ /*@editable*/ background-color:#FAFAFA;
980+ /*@editable*/ border-top:0;
981+ }
982+
983+ /**
984+ * @tab Footer
985+ * @section utility bar style
986+ * @tip Set the background color and border for your email's footer utility bar.
987+ */
988+ #utility div{
989+ /*@editable*/ text-align:left;
990+ }
991+
992+ #monkeyRewards img{
993+ max-width:170px !important;
994+ }
995+ </style>
996+ </head>
997+ <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">
998+ <center>
999+ <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="backgroundTable">
1000+ <tr>
1001+ <td align="center" valign="top">
1002+ <table border="0" cellpadding="0" cellspacing="0" width="600" id="templateContainer">
1003+ <tr style="margin: 0px; padding: 0px; background-color: rgb(247, 247, 247);">
1004+ <td align="center" valign="top">
1005+ <!-- // Begin Template Header \\ -->
1006+ <table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin: 0px; padding: 0px; background-color: rgb(253, 253, 253);">
1007+ <tr>
1008+ <td class="headerContent">
1009+ <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 />
1010+ </td>
1011+
1012+ <td class="headerContent" width="100%" style="padding-left:10px; padding-right:20px;">
1013+ <div mc:edit="Header_content">
1014+ <h2>
1015+ ${object.accep_crit_id.name}
1016+ </h2>
1017+ </div>
1018+ </td>
1019+ </tr>
1020+ </table>
1021+ <!-- // End Template Header \\ -->
1022+ </td>
1023+ </tr>
1024+ <tr>
1025+ <td align="center" style="margin: 0px; padding: 0px; width: 600px; background-color: #951510">
1026+ <div style="font-size:1.3em; font-family:Arial; color:#FFFFFF;"><b>
1027+ Criterio de Aceptación.
1028+ </b></div>
1029+ </td>
1030+ </tr>
1031+ <tr>
1032+ <td align="center" valign="top">
1033+ <!-- // Begin Template Body \\ -->
1034+ <table border="0" cellpadding="10" cellspacing="0" width="600" style="margin: 0px; padding: 0px; width: 600px; background-color: rgb(247, 247, 247);">
1035+ <tr>
1036+ <!-- // Begin Sidebar \\ -->
1037+ <td valign="top" width="180" id="templateSidebar">
1038+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
1039+ <tr>
1040+ <td valign="top">
1041+ </td>
1042+ </tr>
1043+ </table>
1044+ </td>
1045+ <!-- // End Sidebar \\ -->
1046+ <td valign="top" class="bodyContent">
1047+
1048+ <!-- // Begin Module: Standard Content \\ -->
1049+ <table border="0" cellpadding="10" cellspacing="0" width="600">
1050+ <tr>
1051+ <td valign="top" style="padding-left:0;">
1052+ <div mc:edit="std_content00">
1053+ <h2 class="h2">Estimad@ ${object.accep_crit_id.owner_id.name}</h2>
1054+ <h3 class="h3">
1055+ 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}.
1056+ </h3>
1057+ <pre style="font-size:1.1em; font-family:Arial">
1058+
1059+Agradeciendo su atención.
1060+
1061+Ante cualquier duda estamos a su disposición.
1062+<a href="${object.get_body_disapproval()}">Acceso directo al Documento</a>
1063+ </pre>
1064+ <br />
1065+ </div>
1066+ </td>
1067+ </tr>
1068+ </table>
1069+ <!-- // End Module: Standard Content \\ -->
1070+
1071+ </td>
1072+ </tr>
1073+ </table>
1074+ <!-- // End Template Body \\ -->
1075+ </td>
1076+ </table>
1077+ <br />
1078+ </td>
1079+ </tr>
1080+ </table>
1081+ </center>
1082+ </body>
1083+</html>
1084+ ]]></field>
1085+ </record>
1086 <record id="template_send_email_hu" model="email.template" forcecreate="True">
1087 <field name="name">Accept Criteria</field>
1088 <field name="email_from"></field>
1089
1090=== modified file 'user_story/model/user_story.py'
1091--- user_story/model/user_story.py 2014-10-03 07:19:35 +0000
1092+++ user_story/model/user_story.py 2014-10-15 22:07:15 +0000
1093@@ -87,7 +87,7 @@
1094 return super(user_story, self).write(cr, uid, ids,
1095 vals, context=context)
1096
1097- def body_progress(self, cr, uid, ids, template, hu, context=None):
1098+ def body_progress(self, cr, uid, ids, template, context=None):
1099 imd_obj = self.pool.get('ir.model.data')
1100 template_ids = imd_obj.search(
1101 cr, uid, [('model', '=', 'email.template'), ('name', '=', template)])
1102@@ -138,7 +138,8 @@
1103 else:
1104 return False
1105
1106- def send_mail_hu(self, cr, uid, ids, subject, body, res_id, users=[], context=None):
1107+ def send_mail_hu(self, cr, uid, ids, subject, body, res_id,
1108+ users=None, context=None):
1109 if context is None:
1110 context = {}
1111 if context.get('force_send', False):
1112@@ -215,7 +216,9 @@
1113 result[task.userstory_id.id] = True
1114 return result.keys()
1115
1116- def _message_get_auto_subscribe_fields(self, cr, uid, updated_fields, auto_follow_fields=['user_id'], context=None):
1117+ def _message_get_auto_subscribe_fields(self, cr, uid, updated_fields,
1118+ auto_follow_fields=None,
1119+ context=None):
1120 if auto_follow_fields is None:
1121 auto_follow_fields = ['user_id']
1122
1123@@ -300,13 +303,13 @@
1124 '''
1125 usname = self.browse(cr, uid, i).name
1126 username = self.pool.get('res.users').browse(cr, uid, uid).name
1127- urlbase = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')
1128- link = '#id={i}&view_type=form&model=user.story'.format(i=i, urlbase=urlbase)
1129+ link = '#id={i}&view_type=form&model=user.story'.format(i=i)
1130 return _(u'''<html><div>
1131 <h2>{usname}</h2>
1132 <p>The user {user} has approved the user Story
1133 <a href="{link}">See what we are talking about here</a>
1134- </div></html>'''.format(usname=usname, user=username, link=link))
1135+ </div></html>'''.format(usname=usname, user=username,
1136+ link=link))
1137
1138 def do_disapproval(self, cr, uid, ids, context=None):
1139 '''
1140@@ -323,13 +326,13 @@
1141 def get_body_approval(self, cr, uid, i, context=None):
1142 usname = self.browse(cr, uid, i).name
1143 username = self.pool.get('res.users').browse(cr, uid, uid).name
1144- urlbase = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')
1145- link = '#id={i}&view_type=form&model=user.story'.format(i=i, urlbase=urlbase)
1146+ link = '#id={i}&view_type=form&model=user.story'.format(i=i)
1147 return _(u'''<html><div>
1148 <h2>{usname}</h2>
1149 <p>The user {user} has approved the user Story
1150 <a href="{link}">See what we are talking about here</a>
1151- </div></html>'''.format(usname=usname, user=username, link=link))
1152+ </div></html>'''.format(usname=usname, user=username,
1153+ link=link))
1154
1155 def do_approval(self, cr, uid, ids, context=None):
1156 context = context or {}
1157@@ -418,6 +421,111 @@
1158 cr, uid, [('accep_crit_id', 'in', us_ids)], context=context)
1159 return ac_ids
1160
1161+ def get_body_disapproval(self, cr, uid, i, context=None):
1162+ '''
1163+ TODO: This body must be verified to give the information regarding the answers in
1164+ the do_disaproval method.
1165+ '''
1166+ model_brw = self.browse(cr, uid, i[0])
1167+ link = '#id={i}&view_type=form&model=user.story'.format(i=model_brw.accep_crit_id and model_brw.accep_crit_id.id)
1168+ return link
1169+
1170+ def approve(self, cr, uid, ids, context=None):
1171+ context = context or {}
1172+ criterial_brw2 = self.browse(cr, uid, ids[0])
1173+ criterial_brw = self.browse(cr, SUPERUSER_ID, ids[0])
1174+ if criterial_brw.accepted:
1175+ return True
1176+ data_obj = self.pool.get('ir.model.data')
1177+ compose_obj = self.pool.get('mail.compose.message')
1178+ user_story_brw = criterial_brw.accep_crit_id
1179+ partner_ids = [i.id for i in user_story_brw.message_follower_ids]
1180+ partner_ids.append(user_story_brw.owner_id.partner_id.id)
1181+ if user_story_brw.user_id:
1182+ partner_ids.append(user_story_brw.user_id.partner_id.id)
1183+ if user_story_brw.user_execute_id:
1184+ partner_ids.append(user_story_brw.user_execute_id.partner_id.id)
1185+ partner_ids = list(set(partner_ids))
1186+ template = data_obj.get_object(cr, uid, 'user_story', 'template_approve_aceptabilty_criterial')
1187+ mail = self.pool.get('email.template').generate_email(cr, SUPERUSER_ID, template.id, ids[0])
1188+ compose_id = compose_obj.create(cr, uid, {
1189+ 'res_model': 'user.story',
1190+ 'model': 'user.story',
1191+ 'res_id': user_story_brw.id,
1192+ 'partner_ids': [(6, 0, partner_ids)],
1193+ 'partner_id':0,
1194+ 'body': mail.get('body'),
1195+ })
1196+ criterial_brw2.write({'accepted': True})
1197+ compose_obj.send_mail(cr, uid, [compose_id])
1198+ return True
1199+
1200+ def disapprove(self, cr, uid, ids, context=None):
1201+ context = context or {}
1202+ criterial_brw = self.browse(cr, SUPERUSER_ID, ids[0])
1203+ if criterial_brw.accepted:
1204+ return True
1205+ data_obj = self.pool.get('ir.model.data')
1206+ user_story_brw = criterial_brw.accep_crit_id
1207+ partner_ids = [i.id for i in user_story_brw.message_follower_ids]
1208+ partner_ids.append(user_story_brw.owner_id.partner_id.id)
1209+ if user_story_brw.user_id:
1210+ partner_ids.append(user_story_brw.user_id.partner_id.id)
1211+ if user_story_brw.user_execute_idi:
1212+ partner_ids.append(user_story_brw.user_execute_id.partner_id.id)
1213+ partner_ids = list(set(partner_ids))
1214+ model_data_id = data_obj._get_id(cr, uid, 'user_story',
1215+ 'email_compose_message_wizard_inherit_form_without_partner')
1216+ res_id = data_obj.browse(cr, uid, model_data_id, context=context).res_id
1217+ ction = {
1218+ 'type': 'ir.actions.act_window',
1219+ 'res_model': 'mail.compose.message',
1220+ 'src_model': 'user.story',
1221+ 'view_mode': 'form',
1222+ 'view_mode':'form,tree',
1223+ 'view_id': res_id,
1224+ 'view_type': 'form',
1225+ 'views': [[res_id, 'form']],
1226+ 'target': 'new',
1227+ 'context': {
1228+ 'default_res_model': 'user.story',
1229+ 'default_mail_compose_log': True,
1230+ 'default_model': 'user.story',
1231+ 'default_res_id': user_story_brw.id,
1232+ 'default_partner_ids': [(6, 0, partner_ids)],
1233+ 'default_body': _('<b>Description the cause of disapproval</b>'),
1234+ }
1235+ }
1236+ return ction
1237+
1238+ def ask_review(self, cr, uid, ids, context=None):
1239+ context = context or {}
1240+ criterial_brw = self.browse(cr, SUPERUSER_ID, ids[0])
1241+ if criterial_brw.accepted:
1242+ return True
1243+ data_obj = self.pool.get('ir.model.data')
1244+ compose_obj = self.pool.get('mail.compose.message')
1245+ user_story_brw = criterial_brw.accep_crit_id
1246+ partner_ids = [i.id for i in user_story_brw.message_follower_ids]
1247+ partner_ids.append(user_story_brw.owner_id.partner_id.id)
1248+ if user_story_brw.user_id:
1249+ partner_ids.append(user_story_brw.user_id.partner_id.id)
1250+ if user_story_brw.user_execute_id:
1251+ partner_ids.append(user_story_brw.user_execute_id.partner_id.id)
1252+ partner_ids = list(set(partner_ids))
1253+ template = data_obj.get_object(cr, uid, 'user_story', 'template_ask_aceptabilty_criterial')
1254+ mail = self.pool.get('email.template').generate_email(cr, SUPERUSER_ID, template.id, ids[0])
1255+ compose_id = compose_obj.create(cr, uid, {
1256+ 'res_model': 'user.story',
1257+ 'model': 'user.story',
1258+ 'res_id': user_story_brw.id,
1259+ 'partner_ids': [(6, 0, partner_ids)],
1260+ 'partner_id':0,
1261+ 'body': mail.get('body'),
1262+ })
1263+ compose_obj.send_mail(cr, uid, [compose_id])
1264+ return True
1265+
1266 def _get_user_story_field(self, cr, uid, ids, fieldname, arg, context=None):
1267 """
1268 Method used as the function for extracting values for the user.story
1269@@ -441,7 +549,7 @@
1270 'accep_crit_id': fields.many2one('user.story',
1271 'User Story',
1272 ondelete='cascade',
1273- required=True),
1274+ ),
1275 'accepted': fields.boolean('Accepted',
1276 help='Check if this criterion apply'),
1277 'development': fields.boolean('Development'),
1278@@ -518,15 +626,17 @@
1279 class project_task(osv.Model):
1280 _inherit = 'project.task'
1281
1282- def default_get(self, cr, uid, fields, context=None):
1283+ def default_get(self, cr, uid, field, context=None):
1284 '''Owerwrite default get to add project in new task automatically'''
1285 if context is None:
1286 context = {}
1287 res = super(project_task, self).default_get(
1288- cr, uid, fields, context=context)
1289- context.get('project_task', False) and \
1290- res.update({'project_id': context.get('project_task'), 'categ_ids': context.get('categ_task'),
1291- 'sprint_id': context.get('sprint_task'), 'userstory_id': context.get('userstory_task')})
1292+ cr, uid, field, context=context)
1293+ if context.get('project_task', False):
1294+ res.update({'project_id': context.get('project_task'),
1295+ 'categ_ids': context.get('categ_task'),
1296+ 'sprint_id': context.get('sprint_task'),
1297+ 'userstory_id': context.get('userstory_task')})
1298 return res
1299
1300 def onchange_user_story_task(self, cr, uid, ids, us_id, context=None):
1301
1302=== modified file 'user_story/tests/test_user_story.py'
1303--- user_story/tests/test_user_story.py 2014-10-03 07:19:35 +0000
1304+++ user_story/tests/test_user_story.py 2014-10-15 22:07:15 +0000
1305@@ -2,6 +2,7 @@
1306 from openerp.osv.orm import except_orm
1307 from openerp import SUPERUSER_ID
1308 from openerp.tools import mute_logger
1309+import threading
1310
1311
1312 class TestUserStory(TransactionCase):
1313@@ -9,6 +10,7 @@
1314 def setUp(self):
1315 super(TestUserStory, self).setUp()
1316 self.story = self.registry('user.story')
1317+ self.criterial = self.registry('acceptability.criteria')
1318 self.project = self.registry('project.project')
1319 self.user = self.registry('res.users')
1320 self.data = self.registry('ir.model.data')
1321@@ -35,33 +37,47 @@
1322 'name': 'User Story Test',
1323 'owner_id': user_test_id,
1324 'project_id': project_id,
1325- 'accep_crit_ids': [(0, 0, {'name': 'Criterial Test 1', 'scenario': 'Test 1'}),
1326- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1327- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1328- ]
1329- })
1330 # Adding user story group to the user created previously
1331+ 'accep_crit_ids': [(0, 0,
1332+ {'name': 'Criterial Test 1',
1333+ 'scenario': 'Test 1'}),
1334+ (0, 0,
1335+ {'name': 'Criterial Test 2',
1336+ 'scenario': 'Test 2'}),
1337+ (0, 0,
1338+ {'name': 'Criterial Test 3',
1339+ 'scenario': 'Test 3'}),
1340+ ]
1341+ })
1342+ #Adding user story group to the user created previously
1343 self.user.write(cr, SUPERUSER_ID, [user_test_id], {
1344 'groups_id': [(4, us_manager_group.id)]
1345 })
1346 # Try that a user with user story group can create a user story, this group must allow create user story without problems
1347 self.assertTrue(self.story.create(cr, user_test_id, {
1348- 'name': 'User Story Test',
1349- 'owner_id': user_test_id,
1350- 'project_id': project_id,
1351- 'accep_crit_ids': [(0, 0, {'name': 'Criterial Test 1', 'scenario': 'Test 1'}),
1352- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1353- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1354- ]
1355+ 'name': 'User Story Test',
1356+ 'owner_id': user_test_id,
1357+ 'project_id': project_id,
1358+ 'accep_crit_ids': [(0, 0,
1359+ {'name': 'Criterial Test 1',
1360+ 'scenario': 'Test 1'}),
1361+ (0, 0,
1362+ {'name': 'Criterial Test 2',
1363+ 'scenario': 'Test 2'}),
1364+ (0, 0,
1365+ {'name': 'Criterial Test 3',
1366+ 'scenario': 'Test 3'}),
1367+ ]
1368
1369 }), "An user with user story group manager cannot create an user story")
1370
1371 @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.osv.orm')
1372 def test_write_method(self):
1373 cr, uid = self.cr, self.uid
1374- # Search groups that allow manage user story
1375- us_manager_group = self.data.get_object(cr, uid, 'user_story', 'group_user_story_manager')
1376- # Creating user to try the create method
1377+ #Search groups that allow manage user story
1378+ us_manager_group = self.data.get_object(cr, uid, 'user_story',
1379+ 'group_user_story_manager')
1380+ #Creating user to try the create method
1381 user_test_id = self.user.create(cr, SUPERUSER_ID, {
1382 'name': 'User Test',
1383 'login': 'test_create_user'
1384@@ -77,13 +93,20 @@
1385 'name': 'User Story Test',
1386 'owner_id': user_test_id,
1387 'project_id': project_id,
1388- 'accep_crit_ids': [(0, 0, {'name': 'Criterial Test 1', 'scenario': 'Test 1'}),
1389- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1390- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1391- ]
1392- })
1393- # Try that a user without user story group cannot write an user story
1394- self.assertRaises(except_orm, self.story.write, cr, user_test_id, [story_id],
1395+ 'accep_crit_ids': [(0, 0,
1396+ {'name': 'Criterial Test 1',
1397+ 'scenario': 'Test 1'}),
1398+ (0, 0,
1399+ {'name': 'Criterial Test 2',
1400+ 'scenario': 'Test 2'}),
1401+ (0, 0,
1402+ {'name': 'Criterial Test 3',
1403+ 'scenario': 'Test 3'}),
1404+ ]
1405+ })
1406+ #Try that a user without user story group cannot write an user story
1407+ self.assertRaises(except_orm, self.story.write, cr,
1408+ user_test_id, [story_id],
1409 {
1410 'name': 'User Story Test Changed',
1411 })
1412@@ -99,9 +122,10 @@
1413 @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.osv.orm')
1414 def test_unlink_method(self):
1415 cr, uid = self.cr, self.uid
1416- # Search groups that allow manage user story
1417- us_manager_group = self.data.get_object(cr, uid, 'user_story', 'group_user_story_manager')
1418- # Creating user to try the create method
1419+ #Search groups that allow manage user story
1420+ us_manager_group = self.data.get_object(cr, uid, 'user_story',
1421+ 'group_user_story_manager')
1422+ #Creating user to try the create method
1423 user_test_id = self.user.create(cr, SUPERUSER_ID, {
1424 'name': 'User Test',
1425 'login': 'test_create_user'
1426@@ -117,27 +141,35 @@
1427 'name': 'User Story Test',
1428 'owner_id': user_test_id,
1429 'project_id': project_id,
1430- 'accep_crit_ids': [(0, 0, {'name': 'Criterial Test 1', 'scenario': 'Test 1'}),
1431- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1432- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1433- ]
1434- })
1435- # Try that a user without user story group cannot remove an user story
1436- self.assertRaises(except_orm, self.story.unlink, cr, user_test_id, [story_id])
1437- # Adding user story group to the user created previously
1438+ 'accep_crit_ids': [(0, 0,
1439+ {'name': 'Criterial Test 1',
1440+ 'scenario': 'Test 1'}),
1441+ (0, 0,
1442+ {'name': 'Criterial Test 2',
1443+ 'scenario': 'Test 2'}),
1444+ (0, 0,
1445+ {'name': 'Criterial Test 3',
1446+ 'scenario': 'Test 3'}),
1447+ ]
1448+ })
1449+ #Try that a user without user story group cannot remove an user story
1450+ self.assertRaises(except_orm, self.story.unlink,
1451+ cr, user_test_id, [story_id])
1452+ #Adding user story group to the user created previously
1453 self.user.write(cr, SUPERUSER_ID, [user_test_id], {
1454 'groups_id': [(4, us_manager_group.id)]
1455 })
1456- # Try that a user with user story group can remove a user story, this group must allow create user story without problems
1457- self.assertTrue(self.story.unlink(cr, user_test_id, [story_id]),
1458- "An user with user story group manager cannot remove an user story")
1459-
1460+ #Try that a user with user story group can remove a user story, this group must allow create user story without problems
1461+ self.assertTrue(self.story.unlink(cr, user_test_id, [story_id] ),
1462+ "An user with user story group manager cannot remove "
1463+ "an user story")
1464 @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.osv.orm')
1465 def test_copy_method(self):
1466 cr, uid = self.cr, self.uid
1467- # Search groups that allow manage user story
1468- us_manager_group = self.data.get_object(cr, uid, 'user_story', 'group_user_story_manager')
1469- # Creating user to try the create method
1470+ #Search groups that allow manage user story
1471+ us_manager_group = self.data.get_object(cr, uid, 'user_story',
1472+ 'group_user_story_manager')
1473+ #Creating user to try the create method
1474 user_test_id = self.user.create(cr, SUPERUSER_ID, {
1475 'name': 'User Test',
1476 'login': 'test_create_user'
1477@@ -153,17 +185,60 @@
1478 'name': 'User Story Test',
1479 'owner_id': user_test_id,
1480 'project_id': project_id,
1481- 'accep_crit_ids': [(0, 0, {'name': 'Criterial Test 1', 'scenario': 'Test 1'}),
1482- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1483- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1484- ]
1485- })
1486- # Try that a user without user story group cannot copy an user story
1487- self.assertRaises(except_orm, self.story.copy, cr, user_test_id, story_id)
1488- # Adding user story group to the user created previously
1489+ 'accep_crit_ids': [(0, 0,
1490+ {'name': 'Criterial Test 1',
1491+ 'scenario': 'Test 1'}),
1492+ (0, 0,
1493+ {'name': 'Criterial Test 2',
1494+ 'scenario': 'Test 2'}),
1495+ (0, 0,
1496+ {'name': 'Criterial Test 3',
1497+ 'scenario': 'Test 3'}),
1498+ ]
1499+ })
1500+ #Try that a user without user story group cannot copy an user story
1501+ self.assertRaises(except_orm, self.story.copy, cr,
1502+ user_test_id, story_id)
1503+ #Adding user story group to the user created previously
1504 self.user.write(cr, SUPERUSER_ID, [user_test_id], {
1505 'groups_id': [(4, us_manager_group.id)]
1506 })
1507- # Try that a user with user story group can copy a user story, this group must allow create user story without problems
1508- self.assertTrue(self.story.copy(cr, user_test_id, story_id),
1509- "An user with user story group manager cannot remove an user story")
1510+ #Try that a user with user story group can copy a user story, this group must allow create user story without problems
1511+ self.assertTrue(self.story.copy(cr, user_test_id, story_id ),
1512+ "An user with user story group manager cannot "
1513+ "remove an user story")
1514+
1515+ @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.osv.orm')
1516+ def test_acceptability_criterial_buttons(self):
1517+ cr, uid = self.cr, self.uid
1518+ self.test_create_method()
1519+ threading.currentThread().testing = True
1520+ #Search the user and the user story to change the criterials
1521+ user_id = self.user.search(cr, uid, [('name', '=', 'User Test')])
1522+ story_id = self.story.search(cr, uid,
1523+ [('name', '=', 'User Story Test')])
1524+ user_brw = user_id and self.user.browse(cr, uid, user_id[0])
1525+ story_brw = story_id and self.story.browse(cr, uid, story_id[0])
1526+ i = 0
1527+ for criterial in user_brw and story_brw and story_brw.accep_crit_ids:
1528+ if i == 0:
1529+ mes = 'El criterio%{0}%ha sido aceptado por%'.\
1530+ format(criterial.name)
1531+ self.criterial.approve(cr, user_brw.id, [criterial.id])
1532+ m_id = self.message.search(cr, uid,
1533+ [('res_id', '=', story_brw.id),
1534+ ('body', 'ilike', mes)])
1535+ self.assertTrue(m_id, "The message was not created")
1536+ cri_brw = self.criterial.browse(cr, uid, criterial.id)
1537+ self.assertTrue(cri_brw.accepted,
1538+ "The criterial was not accepted")
1539+
1540+ elif i == 1:
1541+ mes = 'El criterio%{0}%ha sido terminado por%'.\
1542+ format(criterial.name)
1543+ self.criterial.ask_review(cr, user_brw.id, [criterial.id])
1544+ m_id = self.message.search(cr, uid,
1545+ [('res_id', '=', story_brw.id),
1546+ ('body', 'ilike', mes)])
1547+ self.assertTrue(m_id, "The message was not created")
1548+ i+=1
1549
1550=== modified file 'user_story/view/userstory_view.xml'
1551--- user_story/view/userstory_view.xml 2014-09-23 06:13:41 +0000
1552+++ user_story/view/userstory_view.xml 2014-10-15 22:07:15 +0000
1553@@ -8,16 +8,16 @@
1554 <field name="arch" type="xml">
1555 <form string="User Story" version="7.0">
1556 <header>
1557- <button name="do_draft" string="Draft" type="object" states="open,pending,done,cancelled"/>
1558- <button name="do_progress" string="Progress" type="object" states="draft,pending,done,cancelled"/>
1559- <button name="do_pending" string="Pending" type="object" states="draft,open,done,cancelled"/>
1560- <button name="do_done" string="Done" type="object" states="draft,open,pending,cancelled"/>
1561- <button name="do_cancel" string="Cancel" type="object" states="draft,open,pending,done"/>
1562- <field name="state" widget="statusbar"/>
1563+ <button name="do_draft" string="Draft" type="object" states="open,pending,done,cancelled"/>
1564+ <button name="do_progress" string="Progress" type="object" states="draft,pending,done,cancelled"/>
1565+ <button name="do_pending" string="Pending" type="object" states="draft,open,done,cancelled"/>
1566+ <button name="do_done" string="Done" type="object" states="draft,open,pending,cancelled"/>
1567+ <button name="do_cancel" string="Cancel" type="object" states="draft,open,pending,done"/>
1568+ <field name="state" widget="statusbar"/>
1569 <label for='help'/>
1570 <field name='help'/>
1571- </header>
1572- <sheet string="User Story">
1573+ </header>
1574+ <sheet string="User Story">
1575 <div class="oe_right">
1576 <field name="date" select="1"
1577 string="Created at"/>
1578@@ -28,10 +28,10 @@
1579 -->
1580 <h2 class="no_print"><label for="approved" string="0.- Is this User Story Approved to work with?"/><field name="approved"/></h2>
1581 <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>
1582- <h2><field name="name"/></h2>
1583- <h3>
1584- <label for="project_id" string="2.- Related Project" class="oe_horizontal_separator oe_clear"/>
1585- </h3>
1586+ <h2><field name="name"/></h2>
1587+ <h3>
1588+ <label for="project_id" string="2.- Related Project" class="oe_horizontal_separator oe_clear"/>
1589+ </h3>
1590 <div>
1591 <field name="project_id" domain="[('child_ids','=',False)]" context="{'current_model': 'project.project'}" />
1592 <div class="no_print" attrs="{'invisible':[('help','=',False)]}">
1593@@ -75,11 +75,16 @@
1594 </p>
1595 </div>
1596 <div class="no_print oe_right">
1597- <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"/>
1598+ <button name="do_approval"
1599+ type="object"
1600+ attrs="{'invisible':[('approved','=',True)]}"
1601+ states="draft"
1602+ 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."
1603+ string="I approve start to work with this Story"/>
1604 <h3>This User Story was approved by: <field name="approval_user_id" readonly="True"/></h3>
1605 </div>
1606 <field name="description" colspan="4" nolabel="1" attrs="{'readonly':[('approved','=',True)]}" placeholder="Add a description here ..." widget="html"/>
1607- <h1><label for="accep_crit_ids" string="4.- Aceptability Criteria" class="oe_horizontal_separator oe_clear"/></h1>
1608+ <h1><label for="accep_crit_ids" string="4.- Aceptability Criteria" class="oe_horizontal_separator oe_clear"/></h1>
1609 <field name="accep_crit_ids" colspan="4" nolabel="1">
1610 <tree string="Acceptability Criteria" editable="bottom">
1611 <field name="name"/>
1612@@ -111,7 +116,7 @@
1613 <a href="/user_story/static/src/demo/TestUS.xmind" target="_NEW">here</a>
1614 </p>
1615 </div>
1616- <separator colspan="4" string="5.- Technical Conclusions" class="oe_horizontal_separator oe_clear"/>
1617+ <separator colspan="4" string="5.- Technical Conclusions" class="oe_horizontal_separator oe_clear"/>
1618 <div class="no_print" attrs="{'invisible':[('help','=',False)]}">
1619 <p class="oe_grey">
1620 Here you need to declare technically how will be
1621@@ -171,7 +176,7 @@
1622 </field>
1623 </page>
1624 </notebook>
1625- </sheet>
1626+ </sheet>
1627 <div class="oe_chatter">
1628 <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
1629 <field name="message_ids" widget="mail_thread"/>
1630@@ -223,7 +228,6 @@
1631 </h1>
1632 <group>
1633 <field name="scenario"/>
1634- <field name="accep_crit_id"/>
1635 <field name="accepted"/>
1636 <field name="development"/>
1637 <field name="difficulty" invisible="1"/>
1638@@ -289,6 +293,32 @@
1639 </search>
1640 </field>
1641 </record>
1642+ <record model="ir.ui.view" id="email_compose_message_wizard_inherit_form_without_partner">
1643+ <field name="name">mail.compose.message.form</field>
1644+ <field name="model">mail.compose.message</field>
1645+ <field name="priority">9999</field>
1646+ <field name="groups_id" eval="[(3,ref('base.group_user'))]"/>
1647+ <field name="arch" type="xml">
1648+ <form string="Compose Email" version="7.0">
1649+ <group>
1650+ <!-- truly invisible fields for control and options -->
1651+ <field name="composition_mode" invisible="1"/>
1652+ <field name="model" invisible="1"/>
1653+ <field name="res_id" invisible="1"/>
1654+ <field name="parent_id" invisible="1"/>
1655+ <!-- visible wizard -->
1656+ <field name="subject" placeholder="Subject..."/>
1657+ </group>
1658+ <field name="body"/>
1659+ <field name="attachment_ids" widget="many2many_binary"/>
1660+ <footer>
1661+ <button string="Send" name="send_mail" type="object" class="oe_highlight"/>
1662+ or
1663+ <button string="Cancel" class="oe_link" special="cancel" />
1664+ </footer>
1665+ </form>
1666+ </field>
1667+ </record>
1668
1669 <record id="view_userstory_search" model="ir.ui.view">
1670 <field name="name">user.story.search</field>
1671
1672=== added directory 'user_story/wizard'
1673=== added file 'user_story/wizard/__init__.py'
1674--- user_story/wizard/__init__.py 1970-01-01 00:00:00 +0000
1675+++ user_story/wizard/__init__.py 2014-10-15 22:07:15 +0000
1676@@ -0,0 +1,1 @@
1677+from . import message_compose
1678
1679=== added file 'user_story/wizard/message_compose.py'
1680--- user_story/wizard/message_compose.py 1970-01-01 00:00:00 +0000
1681+++ user_story/wizard/message_compose.py 2014-10-15 22:07:15 +0000
1682@@ -0,0 +1,42 @@
1683+# -*- coding: utf-8 -*-
1684+##############################################################################
1685+#
1686+# OpenERP, Open Source Management Solution
1687+# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
1688+#
1689+# This program is free software: you can redistribute it and/or modify
1690+# it under the terms of the GNU General Public License as published by
1691+# the Free Software Foundation, either version 3 of the License, or
1692+# (at your option) any later version.
1693+#
1694+# This program is distributed in the hope that it will be useful,
1695+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1696+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1697+# GNU General Public License for more details.
1698+#
1699+# You should have received a copy of the GNU General Public License
1700+# along with this program. If not, see <http://www.gnu.org/licenses/>
1701+#
1702+##############################################################################
1703+
1704+from openerp.osv import osv, fields
1705+
1706+class mail_compose_message(osv.TransientModel):
1707+ _inherit = 'mail.compose.message'
1708+
1709+ def _get_templates(self, cr, uid, context=None):
1710+ if context is None:
1711+ context = {}
1712+ email_template_obj = self.pool.get('email.template')
1713+ if not email_template_obj.check_access_rights(cr, uid, 'read', raise_exception=False):
1714+ return []
1715+ else:
1716+ return super(mail_compose_message, self)._get_templates(cr, uid, context=context)
1717+ return []
1718+
1719+
1720+ _columns = {
1721+ # incredible hack of the day: size=-1 means we want an int db column instead of an str one
1722+ 'template_id': fields.selection(_get_templates, 'Template', size=-1),
1723+ }
1724+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: