Merge lp:~openerp-dev/openobject-addons/trunk-project-onboarding-imp-msa into lp:~openerp-dev/openobject-addons/trunk-project-onboarding

Proposed by Mitesh Savani (OpenERP)
Status: Merged
Merged at revision: 9409
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-project-onboarding-imp-msa
Merge into: lp:~openerp-dev/openobject-addons/trunk-project-onboarding
Diff against target: 179 lines (+43/-14)
9 files modified
calendar/controllers/main.py (+9/-2)
edi/controllers/main.py (+12/-2)
point_of_sale/controllers/main.py (+1/-1)
project/project.py (+8/-0)
project/project_view.xml (+7/-1)
project/static/src/css/project.css (+3/-1)
project_timesheet/project_timesheet_view.xml (+1/-1)
website/views/website_templates.xml (+1/-3)
website_sale/views/website_sale.xml (+1/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-project-onboarding-imp-msa
Reviewer Review Type Date Requested Status
OpenERP R&D Team Pending
Review via email: mp+218557@code.launchpad.net

Description of the change

[ADD]: Add image in kanban view of project.task which is attached in task comments.

project_timesheet: if there is zero hour than it will not display in project kanban view.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'calendar/controllers/main.py'
2--- calendar/controllers/main.py 2014-05-06 16:33:34 +0000
3+++ calendar/controllers/main.py 2014-05-07 07:01:55 +0000
4@@ -48,8 +48,15 @@
5 if attendee:
6 attendee_data['current_attendee'] = attendee[0]
7
8- values = dict(init="s.calendar.event('%s', '%s', '%s', '%s' , '%s');" % (db, action, id, 'form', json.dumps(attendee_data)))
9- return request.render('web.webclient_bootstrap', values)
10+ css = '<link rel="stylesheet" href="/web/css/web.assets_backend"/>'
11+ js = '<script type="text/javascript" src="/web/js/web.assets_backend"></script>'
12+
13+ return webmain.html_template % {
14+ 'js': js,
15+ 'css': css,
16+ 'modules': simplejson.dumps(webmain.module_boot(db)),
17+ 'init': "s.calendar.event('%s', '%s', '%s', '%s' , '%s');" % (db, action, id, 'form', json.dumps(attendee_data)),
18+ }
19
20 # Function used, in RPC to check every 5 minutes, if notification to do for an event or not
21 @http.route('/calendar/notify', type='json', auth="none")
22
23=== modified file 'edi/controllers/main.py'
24--- edi/controllers/main.py 2014-05-06 16:33:34 +0000
25+++ edi/controllers/main.py 2014-05-07 07:01:55 +0000
26@@ -1,3 +1,4 @@
27+import simplejson
28 import werkzeug.urls
29
30 import openerp
31@@ -9,12 +10,21 @@
32 def import_url(self, url):
33 # http://hostname:8069/edi/import_url?url=URIEncodedURL
34 req = openerp.http.request
35+ modules = webmain.module_boot(req) + ['edi']
36+ modules_str = ','.join(modules)
37+ modules_json = simplejson.dumps(modules)
38+ css = '<link rel="stylesheet" href="/web/css/web.assets_backend"/>'
39+ js = '<script type="text/javascript" src="/web/js/web.assets_backend"></script>'
40
41 # `url` may contain a full URL with a valid query string, we basically want to watch out for XML brackets and double-quotes
42 safe_url = werkzeug.url_quote_plus(url,':/?&;=')
43
44- values = dict(init='s.edi.edi_import("%s");' % safe_url)
45- return req.render('web.webclient_bootstrap', values)
46+ return webmain.html_template % {
47+ 'js': js,
48+ 'css': css,
49+ 'modules': modules_json,
50+ 'init': 's.edi.edi_import("%s");' % safe_url,
51+ }
52
53 @openerp.http.route('/edi/import_edi_url', type='json', auth='none')
54 def import_edi_url(self, url):
55
56=== modified file 'point_of_sale/controllers/main.py'
57--- point_of_sale/controllers/main.py 2014-05-06 16:33:34 +0000
58+++ point_of_sale/controllers/main.py 2014-05-07 07:01:55 +0000
59@@ -8,7 +8,7 @@
60
61 from openerp import http
62 from openerp.http import request
63-from openerp.addons.web.controllers.main import module_boot, login_redirect
64+from openerp.addons.web.controllers.main import manifest_list, module_boot, html_template, login_redirect
65
66 _logger = logging.getLogger(__name__)
67
68
69=== modified file 'project/project.py'
70--- project/project.py 2014-05-06 07:04:47 +0000
71+++ project/project.py 2014-05-07 07:01:55 +0000
72@@ -795,6 +795,13 @@
73 for work in self.pool.get('project.task.work').browse(cr, uid, ids, context=context):
74 if work.task_id: result[work.task_id.id] = True
75 return result.keys()
76+ def _get_attachment(self, cr, uid, ids, field_name, arg, context):
77+ res={}
78+ attachment_obj=self.pool.get('ir.attachment')
79+ for result in self.browse(cr, uid, ids, context=None):
80+ attachment_id=attachment_obj.search(cr, uid, [('res_id','=',result.id)])
81+ res[result.id]= attachment_id
82+ return res
83
84 _columns = {
85 'active': fields.function(_is_template, store=True, string='Not a Template Task', type='boolean', help="This field is computed automatically and have the same behavior than the boolean 'active' field: if the task is linked to a template or unactivated project, it will be hidden unless specifically asked."),
86@@ -853,6 +860,7 @@
87 'id': fields.integer('ID', readonly=True),
88 'color': fields.integer('Color Index'),
89 'user_email': fields.related('user_id', 'email', type='char', string='User Email', readonly=True),
90+ 'attachment_res':fields.function(_get_attachment,type='many2many',relation="ir.attachment",string="attachments",readonly=True),
91 }
92 _defaults = {
93 'stage_id': _get_default_stage_id,
94
95=== modified file 'project/project_view.xml'
96--- project/project_view.xml 2014-05-06 08:39:37 +0000
97+++ project/project_view.xml 2014-05-07 07:01:55 +0000
98@@ -531,9 +531,10 @@
99 <field name="date_deadline"/>
100 <field name="message_summary"/>
101 <field name="categ_ids"/>
102+ <field name="attachment_res"/>
103 <templates>
104 <t t-name="kanban-box">
105- <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
106+ <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click oe_kanban_task">
107 <div class="oe_dropdown_toggle oe_dropdown_kanban" groups="base.group_user">
108 <span class="oe_e">í</span>
109 <ul class="oe_dropdown_menu">
110@@ -579,6 +580,11 @@
111 <t t-raw="record.message_summary.raw_value"/>
112 <field name="categ_ids"/>
113 </div>
114+ <div>
115+ <t t-foreach="record.attachment_res.raw_value.slice(0,3)" t-as="attachment_img">
116+ <img t-att-src="kanban_image('ir.attachment', 'datas', attachment_img)" class="oe_kanban_image" t-att-data-member_id="attachment_img"/>
117+ </t>
118+ </div>
119 </div>
120 <div class="oe_clear"></div>
121 </div>
122
123=== modified file 'project/static/src/css/project.css'
124--- project/static/src/css/project.css 2014-05-06 06:04:33 +0000
125+++ project/static/src/css/project.css 2014-05-07 07:01:55 +0000
126@@ -6,7 +6,9 @@
127 .oe_kanban_project_list > a > span:hover{
128 text-decoration: underline;
129 }
130-
131+.oe_kanban_task{
132+ width: 275px;
133+}
134 .openerp .project_kanban_content{
135 margin-right: 15px;
136 margin-left: 15px;
137
138=== modified file 'project_timesheet/project_timesheet_view.xml'
139--- project_timesheet/project_timesheet_view.xml 2014-05-05 06:37:08 +0000
140+++ project_timesheet/project_timesheet_view.xml 2014-05-07 07:01:55 +0000
141@@ -14,7 +14,7 @@
142 <field name="partner_id"/>
143 </field>
144 <xpath expr="//div[contains(@class, 'oe_kanban_project_list')]" position="inside">
145- <a t-if="record.use_timesheets.raw_value" style="margin-right: 10px"
146+ <a t-if="record.use_timesheets.raw_value and record.hours_quantity > 0" style="margin-right: 10px"
147 name="open_timesheets" type="object"><field name="hours_quantity"/> Hours</a>
148 </xpath>
149 </field>
150
151=== modified file 'website/views/website_templates.xml'
152--- website/views/website_templates.xml 2014-05-06 15:33:35 +0000
153+++ website/views/website_templates.xml 2014-05-07 07:01:55 +0000
154@@ -276,9 +276,7 @@
155 <script type="text/javascript" src="/website/static/lib/ace/theme-monokai.js"></script>
156 <script type="text/javascript" src="/website/static/lib/ace/mode-xml.js"></script>
157 <script type="text/javascript" src="/website/static/lib/vkbeautify/vkbeautify.0.99.00.beta.js"></script>
158- <t t-call="web.jqueryui_conflict">
159- <script type="text/javascript" src="/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js"></script>
160- </t>
161+ <script type="text/javascript" src="/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js"></script>
162 <!-- mutation observers shim backed by mutation events (8 < IE < 11, Safari < 6, FF < 14, Chrome < 17) -->
163 <script type="text/javascript" src="/website/static/lib//jquery.mjs.nestedSortable/jquery.mjs.nestedSortable.js"></script>
164 <script type="text/javascript" src="/website/static/lib/MutationObservers/test/sidetable.js"></script>
165
166=== modified file 'website_sale/views/website_sale.xml'
167--- website_sale/views/website_sale.xml 2014-05-06 15:33:35 +0000
168+++ website_sale/views/website_sale.xml 2014-05-07 07:01:55 +0000
169@@ -95,9 +95,7 @@
170 <template id="products" name="Products">
171 <t t-call="website.layout">
172 <t t-set="head">
173- <t t-call="web.jqueryui_conflict">
174- <script type="text/javascript" src="/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js"></script>
175- </t>
176+ <script type="text/javascript" src="/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js"></script>
177 <link rel='stylesheet' href="/web/static/lib/jquery.ui/css/smoothness/jquery-ui-1.9.1.custom.css"/>
178 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
179 <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>

Subscribers

People subscribed via source and target branches

to all changes: