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

Status: Superseded
Proposed branch: lp:~vauxoo/addons-vauxoo/jose-acceptability-criterial-buttons
Merge into: lp:addons-vauxoo/7.0
Diff against target: 1702 lines (+1344/-112)
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 (+119/-10)
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-09-18.

This proposal has been superseded by a proposal from 2014-10-15.

To post a comment you must log in.
1132. By Nhomar - Vauxoo

[FIX] Aceptability criteria editable in form view

1133. By Launchpad Translations on behalf of vauxoo

Launchpad automatic translations update.

1134. By Sabrina Romero - http://www.vauxoo.com

[FIX][invoice_datetime] Warnings of pylint test and variables names fixed.

1135. By hbto [Vauxoo] http://www.vauxoo.com

[merge] From Addons-Vauxoo-Cicsa
[FIX] Redefined general_journal_id fields in account.analytic.line
[merge] [MERGE] add new search by and group by fields in the hr.expense.expense model.
[ADD] add new search by and group by fields in the hr.expense.expense model.
[merge] [MERGE] the partner field is now inline searcheable on the
[ADD] add inline search by partner in the account.analytic.line view.
[merge] [MERGE] add translation template and es_VE.po of the field names of the hr.job
[ADD] add the translate attribute to the hr_job.name field.
[ADD] add spanish translation.
[ADD] add the es_VE.po file manually.
[ADD] add translation template to the hr_job_positions_extended module.
[IMP] level_job for LEVEL_JOB
[merge] [IMP] minors change in hr_job_position
[IMP] replace for attributes
[IMP] translatable fields
[IMP] form_view_ref deleted in link to job_id
[merge] [MERGE] add new module 'account_voucher_draft' that create an account.voucher
[FIX] rearregne the button position.
[FIX] syntax error in view definition.
[FIX] manage the view like the standard.
[FIX] syntax error.
[ADD] overwrite view to create the account voucher, hide the pay button and add
[CC] using rst syntax in the despcriptor.
[ADD] update the module descriptor to add a new dependecy, also extend the
[ADD] extend the account_voucher_draft module description.
[ADD] new method that will be used for the new button to 'pay' the
[ADD] new basic structure and files for the account_voucher_draft module.
[IMP] Allow to use different accounts as advances
[merge] [IMP] Adding Advance Payment Features to Account Voucher
[IMP] Advance Account becomes visible in Account Voucher
[IMP] Adding Advance Payment Features to Account Voucher
[merge] [ADD] fields is added in job positions
[DEL] attribute options of job_id in employee
[ADD] level to job position
[IMP] pep8
[ADD] help to fields
[ADD] reports to in hr.job
[ADD] module for three new fields in job positions
[ADD] analytic_entry_line_journal module was added
[IMP] Redefining field period_id in account analytic line model
[ADD] Module to group by Journal Entry
[ADD] Added Module to group by period on analytic entry lines
[IMP] Translating some strings into English
[merge] [FIX] Removing fields l10n_mx_street3 and l10n_mx_street4 dependant on OMXL

1136. By Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com

[MERGE] Merge to add access rule for user_story_long_term module, for we can have control about who can do actions in our models

1137. By Launchpad Translations on behalf of vauxoo

Launchpad automatic translations update.

1138. By Moisés López - http://www.vauxoo.com

[FIX] Fix unused-import with autoflake

1139. By Moisés López - http://www.vauxoo.com

[MERGE] [FIX] Fix unused variable with autoflake and pylint

1140. By Moisés López - http://www.vauxoo.com

[MERGE][FIX][expired_task_information] Fix W1401 anomalous-backslash-in-string. Add prefix "r" to string

1141. By Launchpad Translations on behalf of vauxoo

Launchpad automatic translations update.

1142. By Jorge Angel Naranjo Rogel - http://www.vauxoo.com

[ADD][invoice_discount]Were added fields to get in the lines of invoice the amount without discount and the amount of discount

1143. By Sabrina Romero - http://www.vauxoo.com

[FIX][group_xml_id] type field deprecated in 'ir.ui.view' model and trailing whitespace fixed.

1144. By Moisés López - http://www.vauxoo.com

[MERGE] [FIX] Fix pylint error W0403 - relative-import

1145. By Moisés López - http://www.vauxoo.com

[FIX] Change import to full path example:
  before "import decimal_precision"
  now "from openerp.addons.decimal_precision import decimal_precision"

1146. By Moisés López - http://www.vauxoo.com

[MERGE] [FIX] trailing whitespace pylint error C0303 and
[FIX] autopep8 ignoring E501 & E128 and
[FIX] reimported

1147. By Moisés López - http://www.vauxoo.com

[MERGE] Set standard in all __openerp__.py files

1148. By Launchpad Translations on behalf of vauxoo

Launchpad automatic translations update.

1149. By Launchpad Translations on behalf of vauxoo

Launchpad automatic translations update.

1150. By Katherine Zaoral <email address hidden>

[MERGE] add new module account_model_plans

1151. By Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com

[MERGE] Merge to main branch

1152. By Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com

[PYLINT]

1153. By Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com

[PYLINT]

Unmerged revisions

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 18:08:34 +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 18:08:34 +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 18:08:34 +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 18:08:34 +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,112 @@
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+ urlbase = self.pool.get('ir.config_parameter').get_param(cr, SUPERUSER_ID, 'web.base.url')
1168+ link = '#id={i}&view_type=form&model=user.story'.format(i=model_brw.accep_crit_id and model_brw.accep_crit_id.id, urlbase=urlbase)
1169+ return link
1170+
1171+ def approve(self, cr, uid, ids, context=None):
1172+ context = context or {}
1173+ criterial_brw2 = self.browse(cr, uid, ids[0])
1174+ criterial_brw = self.browse(cr, SUPERUSER_ID, ids[0])
1175+ if criterial_brw.accepted:
1176+ return True
1177+ data_obj = self.pool.get('ir.model.data')
1178+ compose_obj = self.pool.get('mail.compose.message')
1179+ user_story_brw = criterial_brw.accep_crit_id
1180+ partner_ids = [i.id for i in user_story_brw.message_follower_ids]
1181+ partner_ids.append(user_story_brw.owner_id.partner_id.id)
1182+ if user_story_brw.user_id:
1183+ partner_ids.append(user_story_brw.user_id.partner_id.id)
1184+ if user_story_brw.user_execute_id:
1185+ partner_ids.append(user_story_brw.user_execute_id.partner_id.id)
1186+ partner_ids = list(set(partner_ids))
1187+ template = data_obj.get_object(cr, uid, 'user_story', 'template_approve_aceptabilty_criterial')
1188+ mail = self.pool.get('email.template').generate_email(cr, SUPERUSER_ID, template.id, ids[0])
1189+ compose_id = compose_obj.create(cr, uid, {
1190+ 'res_model': 'user.story',
1191+ 'model': 'user.story',
1192+ 'res_id': user_story_brw.id,
1193+ 'partner_ids': [(6, 0, partner_ids)],
1194+ 'partner_id':0,
1195+ 'body': mail.get('body'),
1196+ })
1197+ criterial_brw2.write({'accepted': True})
1198+ compose_obj.send_mail(cr, uid, [compose_id])
1199+ return True
1200+
1201+ def disapprove(self, cr, uid, ids, context=None):
1202+ context = context or {}
1203+ criterial_brw = self.browse(cr, SUPERUSER_ID, ids[0])
1204+ if criterial_brw.accepted:
1205+ return True
1206+ data_obj = self.pool.get('ir.model.data')
1207+ user_story_brw = criterial_brw.accep_crit_id
1208+ partner_ids = [i.id for i in user_story_brw.message_follower_ids]
1209+ partner_ids.append(user_story_brw.owner_id.partner_id.id)
1210+ if user_story_brw.user_id:
1211+ partner_ids.append(user_story_brw.user_id.partner_id.id)
1212+ if user_story_brw.user_execute_idi:
1213+ partner_ids.append(user_story_brw.user_execute_id.partner_id.id)
1214+ partner_ids = list(set(partner_ids))
1215+ model_data_id = data_obj._get_id(cr, uid, 'user_story',
1216+ 'email_compose_message_wizard_inherit_form_without_partner')
1217+ res_id = data_obj.browse(cr, uid, model_data_id, context=context).res_id
1218+ ction = {
1219+ 'type': 'ir.actions.act_window',
1220+ 'res_model': 'mail.compose.message',
1221+ 'src_model': 'user.story',
1222+ 'view_mode': 'form',
1223+ 'view_mode':'form,tree',
1224+ 'view_id': res_id,
1225+ 'view_type': 'form',
1226+ 'views': [[res_id, 'form']],
1227+ 'target': 'new',
1228+ 'context': {
1229+ 'default_res_model': 'user.story',
1230+ 'default_mail_compose_log': True,
1231+ 'default_model': 'user.story',
1232+ 'default_res_id': user_story_brw.id,
1233+ 'default_partner_ids': [(6, 0, partner_ids)],
1234+ 'default_body': _('<b>Description the cause of disapproval</b>'),
1235+ }
1236+ }
1237+ return ction
1238+
1239+ def ask_review(self, cr, uid, ids, context=None):
1240+ context = context or {}
1241+ criterial_brw = self.browse(cr, SUPERUSER_ID, ids[0])
1242+ if criterial_brw.accepted:
1243+ return True
1244+ data_obj = self.pool.get('ir.model.data')
1245+ compose_obj = self.pool.get('mail.compose.message')
1246+ user_story_brw = criterial_brw.accep_crit_id
1247+ partner_ids = [i.id for i in user_story_brw.message_follower_ids]
1248+ partner_ids.append(user_story_brw.owner_id.partner_id.id)
1249+ if user_story_brw.user_id:
1250+ partner_ids.append(user_story_brw.user_id.partner_id.id)
1251+ if user_story_brw.user_execute_id:
1252+ partner_ids.append(user_story_brw.user_execute_id.partner_id.id)
1253+ partner_ids = list(set(partner_ids))
1254+ template = data_obj.get_object(cr, uid, 'user_story', 'template_ask_aceptabilty_criterial')
1255+ mail = self.pool.get('email.template').generate_email(cr, SUPERUSER_ID, template.id, ids[0])
1256+ compose_id = compose_obj.create(cr, uid, {
1257+ 'res_model': 'user.story',
1258+ 'model': 'user.story',
1259+ 'res_id': user_story_brw.id,
1260+ 'partner_ids': [(6, 0, partner_ids)],
1261+ 'partner_id':0,
1262+ 'body': mail.get('body'),
1263+ })
1264+ compose_obj.send_mail(cr, uid, [compose_id])
1265+ return True
1266+
1267 def _get_user_story_field(self, cr, uid, ids, fieldname, arg, context=None):
1268 """
1269 Method used as the function for extracting values for the user.story
1270@@ -441,7 +550,7 @@
1271 'accep_crit_id': fields.many2one('user.story',
1272 'User Story',
1273 ondelete='cascade',
1274- required=True),
1275+ ),
1276 'accepted': fields.boolean('Accepted',
1277 help='Check if this criterion apply'),
1278 'development': fields.boolean('Development'),
1279
1280=== modified file 'user_story/tests/test_user_story.py'
1281--- user_story/tests/test_user_story.py 2014-10-03 07:19:35 +0000
1282+++ user_story/tests/test_user_story.py 2014-10-15 18:08:34 +0000
1283@@ -2,6 +2,7 @@
1284 from openerp.osv.orm import except_orm
1285 from openerp import SUPERUSER_ID
1286 from openerp.tools import mute_logger
1287+import threading
1288
1289
1290 class TestUserStory(TransactionCase):
1291@@ -9,6 +10,7 @@
1292 def setUp(self):
1293 super(TestUserStory, self).setUp()
1294 self.story = self.registry('user.story')
1295+ self.criterial = self.registry('acceptability.criteria')
1296 self.project = self.registry('project.project')
1297 self.user = self.registry('res.users')
1298 self.data = self.registry('ir.model.data')
1299@@ -35,33 +37,47 @@
1300 'name': 'User Story Test',
1301 'owner_id': user_test_id,
1302 'project_id': project_id,
1303- 'accep_crit_ids': [(0, 0, {'name': 'Criterial Test 1', 'scenario': 'Test 1'}),
1304- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1305- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1306- ]
1307- })
1308 # Adding user story group to the user created previously
1309+ 'accep_crit_ids': [(0, 0,
1310+ {'name': 'Criterial Test 1',
1311+ 'scenario': 'Test 1'}),
1312+ (0, 0,
1313+ {'name': 'Criterial Test 2',
1314+ 'scenario': 'Test 2'}),
1315+ (0, 0,
1316+ {'name': 'Criterial Test 3',
1317+ 'scenario': 'Test 3'}),
1318+ ]
1319+ })
1320+ #Adding user story group to the user created previously
1321 self.user.write(cr, SUPERUSER_ID, [user_test_id], {
1322 'groups_id': [(4, us_manager_group.id)]
1323 })
1324 # Try that a user with user story group can create a user story, this group must allow create user story without problems
1325 self.assertTrue(self.story.create(cr, user_test_id, {
1326- 'name': 'User Story Test',
1327- 'owner_id': user_test_id,
1328- 'project_id': project_id,
1329- 'accep_crit_ids': [(0, 0, {'name': 'Criterial Test 1', 'scenario': 'Test 1'}),
1330- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1331- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1332- ]
1333+ 'name': 'User Story Test',
1334+ 'owner_id': user_test_id,
1335+ 'project_id': project_id,
1336+ 'accep_crit_ids': [(0, 0,
1337+ {'name': 'Criterial Test 1',
1338+ 'scenario': 'Test 1'}),
1339+ (0, 0,
1340+ {'name': 'Criterial Test 2',
1341+ 'scenario': 'Test 2'}),
1342+ (0, 0,
1343+ {'name': 'Criterial Test 3',
1344+ 'scenario': 'Test 3'}),
1345+ ]
1346
1347 }), "An user with user story group manager cannot create an user story")
1348
1349 @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.osv.orm')
1350 def test_write_method(self):
1351 cr, uid = self.cr, self.uid
1352- # Search groups that allow manage user story
1353- us_manager_group = self.data.get_object(cr, uid, 'user_story', 'group_user_story_manager')
1354- # Creating user to try the create method
1355+ #Search groups that allow manage user story
1356+ us_manager_group = self.data.get_object(cr, uid, 'user_story',
1357+ 'group_user_story_manager')
1358+ #Creating user to try the create method
1359 user_test_id = self.user.create(cr, SUPERUSER_ID, {
1360 'name': 'User Test',
1361 'login': 'test_create_user'
1362@@ -77,13 +93,20 @@
1363 'name': 'User Story Test',
1364 'owner_id': user_test_id,
1365 'project_id': project_id,
1366- 'accep_crit_ids': [(0, 0, {'name': 'Criterial Test 1', 'scenario': 'Test 1'}),
1367- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1368- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1369- ]
1370- })
1371- # Try that a user without user story group cannot write an user story
1372- self.assertRaises(except_orm, self.story.write, cr, user_test_id, [story_id],
1373+ 'accep_crit_ids': [(0, 0,
1374+ {'name': 'Criterial Test 1',
1375+ 'scenario': 'Test 1'}),
1376+ (0, 0,
1377+ {'name': 'Criterial Test 2',
1378+ 'scenario': 'Test 2'}),
1379+ (0, 0,
1380+ {'name': 'Criterial Test 3',
1381+ 'scenario': 'Test 3'}),
1382+ ]
1383+ })
1384+ #Try that a user without user story group cannot write an user story
1385+ self.assertRaises(except_orm, self.story.write, cr,
1386+ user_test_id, [story_id],
1387 {
1388 'name': 'User Story Test Changed',
1389 })
1390@@ -99,9 +122,10 @@
1391 @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.osv.orm')
1392 def test_unlink_method(self):
1393 cr, uid = self.cr, self.uid
1394- # Search groups that allow manage user story
1395- us_manager_group = self.data.get_object(cr, uid, 'user_story', 'group_user_story_manager')
1396- # Creating user to try the create method
1397+ #Search groups that allow manage user story
1398+ us_manager_group = self.data.get_object(cr, uid, 'user_story',
1399+ 'group_user_story_manager')
1400+ #Creating user to try the create method
1401 user_test_id = self.user.create(cr, SUPERUSER_ID, {
1402 'name': 'User Test',
1403 'login': 'test_create_user'
1404@@ -117,27 +141,35 @@
1405 'name': 'User Story Test',
1406 'owner_id': user_test_id,
1407 'project_id': project_id,
1408- 'accep_crit_ids': [(0, 0, {'name': 'Criterial Test 1', 'scenario': 'Test 1'}),
1409- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1410- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1411- ]
1412- })
1413- # Try that a user without user story group cannot remove an user story
1414- self.assertRaises(except_orm, self.story.unlink, cr, user_test_id, [story_id])
1415- # Adding user story group to the user created previously
1416+ 'accep_crit_ids': [(0, 0,
1417+ {'name': 'Criterial Test 1',
1418+ 'scenario': 'Test 1'}),
1419+ (0, 0,
1420+ {'name': 'Criterial Test 2',
1421+ 'scenario': 'Test 2'}),
1422+ (0, 0,
1423+ {'name': 'Criterial Test 3',
1424+ 'scenario': 'Test 3'}),
1425+ ]
1426+ })
1427+ #Try that a user without user story group cannot remove an user story
1428+ self.assertRaises(except_orm, self.story.unlink,
1429+ cr, user_test_id, [story_id])
1430+ #Adding user story group to the user created previously
1431 self.user.write(cr, SUPERUSER_ID, [user_test_id], {
1432 'groups_id': [(4, us_manager_group.id)]
1433 })
1434- # Try that a user with user story group can remove a user story, this group must allow create user story without problems
1435- self.assertTrue(self.story.unlink(cr, user_test_id, [story_id]),
1436- "An user with user story group manager cannot remove an user story")
1437-
1438+ #Try that a user with user story group can remove a user story, this group must allow create user story without problems
1439+ self.assertTrue(self.story.unlink(cr, user_test_id, [story_id] ),
1440+ "An user with user story group manager cannot remove "
1441+ "an user story")
1442 @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.osv.orm')
1443 def test_copy_method(self):
1444 cr, uid = self.cr, self.uid
1445- # Search groups that allow manage user story
1446- us_manager_group = self.data.get_object(cr, uid, 'user_story', 'group_user_story_manager')
1447- # Creating user to try the create method
1448+ #Search groups that allow manage user story
1449+ us_manager_group = self.data.get_object(cr, uid, 'user_story',
1450+ 'group_user_story_manager')
1451+ #Creating user to try the create method
1452 user_test_id = self.user.create(cr, SUPERUSER_ID, {
1453 'name': 'User Test',
1454 'login': 'test_create_user'
1455@@ -153,17 +185,60 @@
1456 'name': 'User Story Test',
1457 'owner_id': user_test_id,
1458 'project_id': project_id,
1459- 'accep_crit_ids': [(0, 0, {'name': 'Criterial Test 1', 'scenario': 'Test 1'}),
1460- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1461- (0, 0, {'name': 'Criterial Test 2', 'scenario': 'Test 2'}),
1462- ]
1463- })
1464- # Try that a user without user story group cannot copy an user story
1465- self.assertRaises(except_orm, self.story.copy, cr, user_test_id, story_id)
1466- # Adding user story group to the user created previously
1467+ 'accep_crit_ids': [(0, 0,
1468+ {'name': 'Criterial Test 1',
1469+ 'scenario': 'Test 1'}),
1470+ (0, 0,
1471+ {'name': 'Criterial Test 2',
1472+ 'scenario': 'Test 2'}),
1473+ (0, 0,
1474+ {'name': 'Criterial Test 3',
1475+ 'scenario': 'Test 3'}),
1476+ ]
1477+ })
1478+ #Try that a user without user story group cannot copy an user story
1479+ self.assertRaises(except_orm, self.story.copy, cr,
1480+ user_test_id, story_id)
1481+ #Adding user story group to the user created previously
1482 self.user.write(cr, SUPERUSER_ID, [user_test_id], {
1483 'groups_id': [(4, us_manager_group.id)]
1484 })
1485- # Try that a user with user story group can copy a user story, this group must allow create user story without problems
1486- self.assertTrue(self.story.copy(cr, user_test_id, story_id),
1487- "An user with user story group manager cannot remove an user story")
1488+ #Try that a user with user story group can copy a user story, this group must allow create user story without problems
1489+ self.assertTrue(self.story.copy(cr, user_test_id, story_id ),
1490+ "An user with user story group manager cannot "
1491+ "remove an user story")
1492+
1493+ @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.osv.orm')
1494+ def test_acceptability_criterial_buttons(self):
1495+ cr, uid = self.cr, self.uid
1496+ self.test_create_method()
1497+ threading.currentThread().testing = True
1498+ #Search the user and the user story to change the criterials
1499+ user_id = self.user.search(cr, uid, [('name', '=', 'User Test')])
1500+ story_id = self.story.search(cr, uid,
1501+ [('name', '=', 'User Story Test')])
1502+ user_brw = user_id and self.user.browse(cr, uid, user_id[0])
1503+ story_brw = story_id and self.story.browse(cr, uid, story_id[0])
1504+ i = 0
1505+ for criterial in user_brw and story_brw and story_brw.accep_crit_ids:
1506+ if i == 0:
1507+ mes = 'El criterio%{0}%ha sido aceptado por%'.\
1508+ format(criterial.name)
1509+ self.criterial.approve(cr, user_brw.id, [criterial.id])
1510+ m_id = self.message.search(cr, uid,
1511+ [('res_id', '=', story_brw.id),
1512+ ('body', 'ilike', mes)])
1513+ self.assertTrue(m_id, "The message was not created")
1514+ cri_brw = self.criterial.browse(cr, uid, criterial.id)
1515+ self.assertTrue(cri_brw.accepted,
1516+ "The criterial was not accepted")
1517+
1518+ elif i == 1:
1519+ mes = 'El criterio%{0}%ha sido terminado por%'.\
1520+ format(criterial.name)
1521+ self.criterial.ask_review(cr, user_brw.id, [criterial.id])
1522+ m_id = self.message.search(cr, uid,
1523+ [('res_id', '=', story_brw.id),
1524+ ('body', 'ilike', mes)])
1525+ self.assertTrue(m_id, "The message was not created")
1526+ i+=1
1527
1528=== modified file 'user_story/view/userstory_view.xml'
1529--- user_story/view/userstory_view.xml 2014-09-23 06:13:41 +0000
1530+++ user_story/view/userstory_view.xml 2014-10-15 18:08:34 +0000
1531@@ -8,16 +8,16 @@
1532 <field name="arch" type="xml">
1533 <form string="User Story" version="7.0">
1534 <header>
1535- <button name="do_draft" string="Draft" type="object" states="open,pending,done,cancelled"/>
1536- <button name="do_progress" string="Progress" type="object" states="draft,pending,done,cancelled"/>
1537- <button name="do_pending" string="Pending" type="object" states="draft,open,done,cancelled"/>
1538- <button name="do_done" string="Done" type="object" states="draft,open,pending,cancelled"/>
1539- <button name="do_cancel" string="Cancel" type="object" states="draft,open,pending,done"/>
1540- <field name="state" widget="statusbar"/>
1541+ <button name="do_draft" string="Draft" type="object" states="open,pending,done,cancelled"/>
1542+ <button name="do_progress" string="Progress" type="object" states="draft,pending,done,cancelled"/>
1543+ <button name="do_pending" string="Pending" type="object" states="draft,open,done,cancelled"/>
1544+ <button name="do_done" string="Done" type="object" states="draft,open,pending,cancelled"/>
1545+ <button name="do_cancel" string="Cancel" type="object" states="draft,open,pending,done"/>
1546+ <field name="state" widget="statusbar"/>
1547 <label for='help'/>
1548 <field name='help'/>
1549- </header>
1550- <sheet string="User Story">
1551+ </header>
1552+ <sheet string="User Story">
1553 <div class="oe_right">
1554 <field name="date" select="1"
1555 string="Created at"/>
1556@@ -28,10 +28,10 @@
1557 -->
1558 <h2 class="no_print"><label for="approved" string="0.- Is this User Story Approved to work with?"/><field name="approved"/></h2>
1559 <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>
1560- <h2><field name="name"/></h2>
1561- <h3>
1562- <label for="project_id" string="2.- Related Project" class="oe_horizontal_separator oe_clear"/>
1563- </h3>
1564+ <h2><field name="name"/></h2>
1565+ <h3>
1566+ <label for="project_id" string="2.- Related Project" class="oe_horizontal_separator oe_clear"/>
1567+ </h3>
1568 <div>
1569 <field name="project_id" domain="[('child_ids','=',False)]" context="{'current_model': 'project.project'}" />
1570 <div class="no_print" attrs="{'invisible':[('help','=',False)]}">
1571@@ -75,11 +75,16 @@
1572 </p>
1573 </div>
1574 <div class="no_print oe_right">
1575- <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"/>
1576+ <button name="do_approval"
1577+ type="object"
1578+ attrs="{'invisible':[('approved','=',True)]}"
1579+ states="draft"
1580+ 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."
1581+ string="I approve start to work with this Story"/>
1582 <h3>This User Story was approved by: <field name="approval_user_id" readonly="True"/></h3>
1583 </div>
1584 <field name="description" colspan="4" nolabel="1" attrs="{'readonly':[('approved','=',True)]}" placeholder="Add a description here ..." widget="html"/>
1585- <h1><label for="accep_crit_ids" string="4.- Aceptability Criteria" class="oe_horizontal_separator oe_clear"/></h1>
1586+ <h1><label for="accep_crit_ids" string="4.- Aceptability Criteria" class="oe_horizontal_separator oe_clear"/></h1>
1587 <field name="accep_crit_ids" colspan="4" nolabel="1">
1588 <tree string="Acceptability Criteria" editable="bottom">
1589 <field name="name"/>
1590@@ -111,7 +116,7 @@
1591 <a href="/user_story/static/src/demo/TestUS.xmind" target="_NEW">here</a>
1592 </p>
1593 </div>
1594- <separator colspan="4" string="5.- Technical Conclusions" class="oe_horizontal_separator oe_clear"/>
1595+ <separator colspan="4" string="5.- Technical Conclusions" class="oe_horizontal_separator oe_clear"/>
1596 <div class="no_print" attrs="{'invisible':[('help','=',False)]}">
1597 <p class="oe_grey">
1598 Here you need to declare technically how will be
1599@@ -171,7 +176,7 @@
1600 </field>
1601 </page>
1602 </notebook>
1603- </sheet>
1604+ </sheet>
1605 <div class="oe_chatter">
1606 <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
1607 <field name="message_ids" widget="mail_thread"/>
1608@@ -223,7 +228,6 @@
1609 </h1>
1610 <group>
1611 <field name="scenario"/>
1612- <field name="accep_crit_id"/>
1613 <field name="accepted"/>
1614 <field name="development"/>
1615 <field name="difficulty" invisible="1"/>
1616@@ -289,6 +293,32 @@
1617 </search>
1618 </field>
1619 </record>
1620+ <record model="ir.ui.view" id="email_compose_message_wizard_inherit_form_without_partner">
1621+ <field name="name">mail.compose.message.form</field>
1622+ <field name="model">mail.compose.message</field>
1623+ <field name="priority">9999</field>
1624+ <field name="groups_id" eval="[(3,ref('base.group_user'))]"/>
1625+ <field name="arch" type="xml">
1626+ <form string="Compose Email" version="7.0">
1627+ <group>
1628+ <!-- truly invisible fields for control and options -->
1629+ <field name="composition_mode" invisible="1"/>
1630+ <field name="model" invisible="1"/>
1631+ <field name="res_id" invisible="1"/>
1632+ <field name="parent_id" invisible="1"/>
1633+ <!-- visible wizard -->
1634+ <field name="subject" placeholder="Subject..."/>
1635+ </group>
1636+ <field name="body"/>
1637+ <field name="attachment_ids" widget="many2many_binary"/>
1638+ <footer>
1639+ <button string="Send" name="send_mail" type="object" class="oe_highlight"/>
1640+ or
1641+ <button string="Cancel" class="oe_link" special="cancel" />
1642+ </footer>
1643+ </form>
1644+ </field>
1645+ </record>
1646
1647 <record id="view_userstory_search" model="ir.ui.view">
1648 <field name="name">user.story.search</field>
1649
1650=== added directory 'user_story/wizard'
1651=== added file 'user_story/wizard/__init__.py'
1652--- user_story/wizard/__init__.py 1970-01-01 00:00:00 +0000
1653+++ user_story/wizard/__init__.py 2014-10-15 18:08:34 +0000
1654@@ -0,0 +1,1 @@
1655+from . import message_compose
1656
1657=== added file 'user_story/wizard/message_compose.py'
1658--- user_story/wizard/message_compose.py 1970-01-01 00:00:00 +0000
1659+++ user_story/wizard/message_compose.py 2014-10-15 18:08:34 +0000
1660@@ -0,0 +1,42 @@
1661+# -*- coding: utf-8 -*-
1662+##############################################################################
1663+#
1664+# OpenERP, Open Source Management Solution
1665+# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
1666+#
1667+# This program is free software: you can redistribute it and/or modify
1668+# it under the terms of the GNU General Public License as published by
1669+# the Free Software Foundation, either version 3 of the License, or
1670+# (at your option) any later version.
1671+#
1672+# This program is distributed in the hope that it will be useful,
1673+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1674+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1675+# GNU General Public License for more details.
1676+#
1677+# You should have received a copy of the GNU General Public License
1678+# along with this program. If not, see <http://www.gnu.org/licenses/>
1679+#
1680+##############################################################################
1681+
1682+from openerp.osv import osv, fields
1683+
1684+class mail_compose_message(osv.TransientModel):
1685+ _inherit = 'mail.compose.message'
1686+
1687+ def _get_templates(self, cr, uid, context=None):
1688+ if context is None:
1689+ context = {}
1690+ email_template_obj = self.pool.get('email.template')
1691+ if not email_template_obj.check_access_rights(cr, uid, 'read', raise_exception=False):
1692+ return []
1693+ else:
1694+ return super(mail_compose_message, self)._get_templates(cr, uid, context=context)
1695+ return []
1696+
1697+
1698+ _columns = {
1699+ # incredible hack of the day: size=-1 means we want an int db column instead of an str one
1700+ 'template_id': fields.selection(_get_templates, 'Template', size=-1),
1701+ }
1702+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: