Merge lp:~vauxoo/addons-vauxoo/7.0-pylint-addons-vauxoo-1-dev-sergio into lp:addons-vauxoo/7.0
- 7.0-pylint-addons-vauxoo-1-dev-sergio
- Merge into 7.0
Status: | Needs review |
---|---|
Proposed branch: | lp:~vauxoo/addons-vauxoo/7.0-pylint-addons-vauxoo-1-dev-sergio |
Merge into: | lp:addons-vauxoo/7.0 |
Diff against target: |
832 lines (+202/-164) 18 files modified
bzr_to_task/bzr_to_task.py (+32/-22) contract_enterprise_openerp/__init__.py (+5/-5) contract_enterprise_openerp/model/__init__.py (+5/-5) contract_enterprise_openerp/model/account_analytic_analysis.py (+21/-15) email_template_att_dinamic/__init__.py (+7/-7) email_template_att_dinamic/model/__init__.py (+7/-7) email_template_att_dinamic/model/email_template.py (+26/-19) email_template_comment/__init__.py (+7/-7) email_template_comment/model/__init__.py (+7/-7) email_template_comment/model/email_template.py (+9/-8) email_template_comment/model/mail_compose_message.py (+13/-10) email_template_followers/__init__.py (+7/-7) email_template_followers/model/__init__.py (+7/-7) email_template_followers/model/email_template.py (+10/-8) email_template_followers/model/mail_compose_message.py (+21/-15) project_followers_rule/__init__.py (+1/-2) project_followers_rule/model/__init__.py (+0/-3) project_followers_rule/model/project.py (+17/-10) |
To merge this branch: | bzr merge lp:~vauxoo/addons-vauxoo/7.0-pylint-addons-vauxoo-1-dev-sergio |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Moisés López - http://www.vauxoo.com | Pending | ||
Review via email: mp+241141@code.launchpad.net |
Commit message
Description of the change
Pylint was applied to the next modules:
- project_
- account_
- contract_
- email_template_
- email_template_
- email_template_
To post a comment you must log in.
Unmerged revisions
- 1153. By Sergio Ernesto Tostado Sánchez - http://www.vauxoo.com
-
[PYLINT]
[project_ followers_ rule,account_ invoice_ number, contract_ enterprise_ openerp, email_template_ att_dinamic, email_template_ comment, email_template_ followers] Pylint was applied to the listed modules - 1152. By Luis Torres - http://www.vauxoo.com
-
[IMP][email_
template_ att_dinamic] Added pylint to module. - 1151. By Luis Torres - http://www.vauxoo.com
-
[IMP][bzr_
to_task] Completed pylint
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bzr_to_task/bzr_to_task.py' |
2 | --- bzr_to_task/bzr_to_task.py 2014-09-30 14:38:46 +0000 |
3 | +++ bzr_to_task/bzr_to_task.py 2014-11-07 20:48:51 +0000 |
4 | @@ -1,4 +1,4 @@ |
5 | -#-*- coding:utf-8 -*- |
6 | +# -*- coding:utf-8 -*- |
7 | # |
8 | # |
9 | # OpenERP, Open Source Management Solution |
10 | @@ -31,9 +31,10 @@ |
11 | _columns = { |
12 | 'sprint_id': fields.many2one('sprint.kanban', 'Sprint', |
13 | ondelete="cascade"), |
14 | - 'url_branch': fields.char('Url Branch', 264, help="Here you must place" |
15 | - " the bazar url without 's' in the protocol ie." |
16 | - " http://bazaar.launchpad.net/~vauxoo/addons-vauxoo/7.0"), |
17 | + 'url_branch': fields.char( |
18 | + 'Url Branch', 264, help="Here you must place the bazar url " |
19 | + "without 's' in the protocol ie." |
20 | + " http://bazaar.launchpad.net/~vauxoo/addons-vauxoo/7.0"), |
21 | 'merge_proposal': fields.char('Merge Proposal', 264), |
22 | 'blueprint': fields.char('Blueprint', 264), |
23 | 'res_id': fields.char('Revno', 64), |
24 | @@ -73,15 +74,19 @@ |
25 | } |
26 | if user_ids: |
27 | task_data['user_id'] = user_ids[0] |
28 | - task_ids = task_obj.search(cr, uid, [('project_id', '=', ids[ |
29 | - 0]), ('revno', '=', task_data['revno'])]) |
30 | + task_ids = task_obj.search( |
31 | + cr, uid, [('project_id', '=', ids[0]), |
32 | + ('revno', '=', task_data['revno'])]) |
33 | if not task_ids: |
34 | - if inferior and inferior <= task_data['revno'] and int(res_id) >= task_data['revno']: |
35 | - self.write(cr, uid, ids, { |
36 | - 'tasks': [(0, 0, task_data)]}) |
37 | + if inferior and inferior <= task_data['revno'] and\ |
38 | + int(res_id) >= task_data['revno']: |
39 | + self._write(cr, uid, ids, { |
40 | + 'tasks': [(0, 0, task_data)]}) |
41 | else: |
42 | - raise osv.except_osv(('Error'), ('Fields: URL Branch, From Revno and Revno are required to execute this operation, \ |
43 | - also From Revno must be minor than Revno')) |
44 | + raise osv.except_osv(('Error'), ( |
45 | + 'Fields: URL Branch, From Revno and Revno are required to ' |
46 | + 'execute this operation, also From Revno must be minor than ' |
47 | + 'Revno')) |
48 | return True |
49 | |
50 | |
51 | @@ -90,9 +95,10 @@ |
52 | _columns = { |
53 | 'revno': fields.integer('Revno'), |
54 | 'from_revno': fields.integer('From Revno'), |
55 | - 'url_branch': fields.char('Url Branch', 264, help="Here you must place" |
56 | - " the bazar url without 's' in the protocol ie." |
57 | - " http://bazaar.launchpad.net/~vauxoo/addons-vauxoo/7.0"), |
58 | + 'url_branch': fields.char( |
59 | + 'Url Branch', 264, help="Here you must place the bazar url " |
60 | + "without 's' in the protocol ie. " |
61 | + "http://bazaar.launchpad.net/~vauxoo/addons-vauxoo/7.0"), |
62 | } |
63 | _defaults = { |
64 | 'res_id': 0, |
65 | @@ -157,17 +163,21 @@ |
66 | tw_data['user_id'] = user_ids[0] |
67 | else: |
68 | tw_data['user_id'] = uid |
69 | - tw_ids = tw_obj.search(cr, uid, [('task_id', '=', ids[ |
70 | - 0]), ('revno', '=', tw_data['revno'])]) |
71 | + tw_ids = tw_obj.search( |
72 | + cr, uid, [('task_id', '=', ids[0]), |
73 | + ('revno', '=', tw_data['revno'])]) |
74 | if not tw_ids: |
75 | - if inferior and inferior <= tw_data['revno'] and int(res_id) >= tw_data['revno']: |
76 | - self.write(cr, uid, ids, { |
77 | - 'work_ids': [(0, 0, tw_data), ], }) |
78 | + if inferior and inferior <= tw_data['revno'] and\ |
79 | + int(res_id) >= tw_data['revno']: |
80 | + self._write(cr, uid, ids, { |
81 | + 'work_ids': [(0, 0, tw_data), ], }) |
82 | deadline = self.set_work_time(cr, uid, ids, context) |
83 | - self.write(cr, uid, ids, {'date_deadline': deadline}) |
84 | + self._write(cr, uid, ids, {'date_deadline': deadline}) |
85 | else: |
86 | - raise osv.except_osv(('Error'), ('Fields: URL Branch, From Revno and Revno are required to execute this operation, \ |
87 | - also From Revno must be minor than Revno')) |
88 | + raise osv.except_osv(('Error'), ( |
89 | + 'Fields: URL Branch, From Revno and Revno are required to ' |
90 | + 'execute this operation, also From Revno must be minor than ' |
91 | + 'Revno')) |
92 | return True |
93 | |
94 | |
95 | |
96 | === modified file 'contract_enterprise_openerp/__init__.py' |
97 | --- contract_enterprise_openerp/__init__.py 2014-10-03 00:28:23 +0000 |
98 | +++ contract_enterprise_openerp/__init__.py 2014-11-07 20:48:51 +0000 |
99 | @@ -1,13 +1,13 @@ |
100 | -#!/usr/bin/python |
101 | +# !/usr/bin/python |
102 | # -*- encoding: utf-8 -*- |
103 | -############################################################################### |
104 | +# ############################################################################# |
105 | # Module Writen to OpenERP, Open Source Management Solution |
106 | # Copyright (C) Vauxoo (<http://vauxoo.com>). |
107 | # All Rights Reserved |
108 | -############### Credits ###################################################### |
109 | +# ############## Credits ##################################################### |
110 | # Coded by: Luis Escobar <luis@vauxoo.com> |
111 | # Audited by: Nhomar Hernandez <nhomar@vauxoo.com> |
112 | -############################################################################### |
113 | +# ############################################################################# |
114 | # This program is free software: you can redistribute it and/or modify |
115 | # it under the terms of the GNU Affero General Public License as published |
116 | # by the Free Software Foundation, either version 3 of the License, or |
117 | @@ -20,6 +20,6 @@ |
118 | # |
119 | # You should have received a copy of the GNU Affero General Public License |
120 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
121 | -############################################################################### |
122 | +# ############################################################################# |
123 | |
124 | from . import model |
125 | |
126 | === modified file 'contract_enterprise_openerp/model/__init__.py' |
127 | --- contract_enterprise_openerp/model/__init__.py 2014-10-03 00:28:23 +0000 |
128 | +++ contract_enterprise_openerp/model/__init__.py 2014-11-07 20:48:51 +0000 |
129 | @@ -1,13 +1,13 @@ |
130 | -#!/usr/bin/python |
131 | +# !/usr/bin/python |
132 | # -*- encoding: utf-8 -*- |
133 | -############################################################################### |
134 | +# ############################################################################# |
135 | # Module Writen to OpenERP, Open Source Management Solution |
136 | # Copyright (C) Vauxoo (<http://vauxoo.com>). |
137 | # All Rights Reserved |
138 | -############### Credits ###################################################### |
139 | +# ############## Credits ##################################################### |
140 | # Coded by: Luis Escobar <luis@vauxoo.com> |
141 | # Audited by: Nhomar Hernandez <nhomar@vauxoo.com> |
142 | -############################################################################### |
143 | +# ############################################################################# |
144 | # This program is free software: you can redistribute it and/or modify |
145 | # it under the terms of the GNU Affero General Public License as published |
146 | # by the Free Software Foundation, either version 3 of the License, or |
147 | @@ -20,6 +20,6 @@ |
148 | # |
149 | # You should have received a copy of the GNU Affero General Public License |
150 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
151 | -############################################################################### |
152 | +# ############################################################################# |
153 | |
154 | from . import account_analytic_analysis |
155 | |
156 | === modified file 'contract_enterprise_openerp/model/account_analytic_analysis.py' |
157 | --- contract_enterprise_openerp/model/account_analytic_analysis.py 2014-10-03 07:19:35 +0000 |
158 | +++ contract_enterprise_openerp/model/account_analytic_analysis.py 2014-11-07 20:48:51 +0000 |
159 | @@ -1,13 +1,13 @@ |
160 | -#!/usr/bin/python |
161 | +# !/usr/bin/python |
162 | # -*- encoding: utf-8 -*- |
163 | -############################################################################### |
164 | +# ############################################################################# |
165 | # Module Writen to OpenERP, Open Source Management Solution |
166 | # Copyright (C) Vauxoo (<http://vauxoo.com>). |
167 | # All Rights Reserved |
168 | -############### Credits ###################################################### |
169 | +# ############## Credits ##################################################### |
170 | # Coded by: Luis Escobar <luis@vauxoo.com> |
171 | # Audited by: Nhomar Hernandez <nhomar@vauxoo.com> |
172 | -############################################################################### |
173 | +# ############################################################################# |
174 | # This program is free software: you can redistribute it and/or modify |
175 | # it under the terms of the GNU Affero General Public License as published |
176 | # by the Free Software Foundation, either version 3 of the License, or |
177 | @@ -20,7 +20,7 @@ |
178 | # |
179 | # You should have received a copy of the GNU Affero General Public License |
180 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
181 | -############################################################################### |
182 | +# ############################################################################# |
183 | import logging |
184 | |
185 | from openerp.osv import osv, fields |
186 | @@ -47,9 +47,11 @@ |
187 | |
188 | def _check_duplicity(self, cr, uid, ids, context=None): |
189 | obj_warranty = self.browse(cr, uid, ids[0], context=context) |
190 | - pids = self.search(cr, uid, |
191 | - [('enterprise_key', '=', obj_warranty.enterprise_key), |
192 | - ('id', '<>', obj_warranty.id)]) |
193 | + pids = self.search( |
194 | + cr, |
195 | + uid, |
196 | + [('enterprise_key', '=', obj_warranty.enterprise_key), |
197 | + ('id', '<>', obj_warranty.id)]) |
198 | if len(pids) > 0: |
199 | return False |
200 | return True |
201 | @@ -60,8 +62,10 @@ |
202 | attached."""), |
203 | 'end_date': fields.date('End date', help="""day when this contract will |
204 | end by OpenERP and is shown in the contract PDF attached."""), |
205 | - 'enterprise_key': fields.char('Enterprise Contract Key', 64, |
206 | - help="""Key given by OpenERP i.e: twa-1234355352ff"""), |
207 | + 'enterprise_key': fields.char( |
208 | + 'Enterprise Contract Key', |
209 | + 64, |
210 | + help="""Key given by OpenERP i.e: twa-1234355352ff"""), |
211 | 'contract_id': fields.many2one('account.analytic.account', 'Contract', |
212 | help='Contract linked to warranty'), |
213 | } |
214 | @@ -76,9 +80,11 @@ |
215 | class account_analytic_account(osv.Model): |
216 | _inherit = 'account.analytic.account' |
217 | _columns = { |
218 | - 'license_oerp': fields.boolean('This contract has Enterprise License', |
219 | - help='This check enables the management of warranties'), |
220 | - 'warranty_oerp_ids': fields.one2many('account.warranty_oerp', |
221 | - 'contract_id', 'Warranties Enterprise', help="""List of Warranties |
222 | - Enterprise"""), |
223 | + 'license_oerp': fields.boolean( |
224 | + 'This contract has Enterprise License', |
225 | + help='This check enables the management of warranties'), |
226 | + 'warranty_oerp_ids': fields.one2many( |
227 | + 'account.warranty_oerp', |
228 | + 'contract_id', 'Warranties Enterprise', |
229 | + help="""List of Warranties Enterprise"""), |
230 | } |
231 | |
232 | === modified file 'email_template_att_dinamic/__init__.py' |
233 | --- email_template_att_dinamic/__init__.py 2014-10-03 00:28:23 +0000 |
234 | +++ email_template_att_dinamic/__init__.py 2014-11-07 20:48:51 +0000 |
235 | @@ -1,15 +1,15 @@ |
236 | -#!/usr/bin/python |
237 | +# !/usr/bin/python |
238 | # -*- encoding: utf-8 -*- |
239 | -########################################################################### |
240 | +# ############################################################################# |
241 | # Module Writen to OpenERP, Open Source Management Solution |
242 | # Copyright (C) 2013 Vauxoo (<http://vauxoo.com>). |
243 | # All Rights Reserved |
244 | -###############Credits###################################################### |
245 | +# ##############Credits######################################################## |
246 | # Coded by: vauxoo consultores (info@vauxoo.com) |
247 | -############################################################################# |
248 | +# ############################################################################# |
249 | # This program is free software: you can redistribute it and/or modify |
250 | -# it under the terms of the GNU Affero General Public License as published by |
251 | -# the Free Software Foundation, either version 3 of the License, or |
252 | +# it under the terms of the GNU Affero General Public License as published |
253 | +# by the Free Software Foundation, either version 3 of the License, or |
254 | # (at your option) any later version. |
255 | # |
256 | # This program is distributed in the hope that it will be useful, |
257 | @@ -19,6 +19,6 @@ |
258 | # |
259 | # You should have received a copy of the GNU Affero General Public License |
260 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
261 | -################################################################################ |
262 | +# ############################################################################# |
263 | |
264 | from . import model |
265 | |
266 | === modified file 'email_template_att_dinamic/model/__init__.py' |
267 | --- email_template_att_dinamic/model/__init__.py 2014-10-03 00:28:23 +0000 |
268 | +++ email_template_att_dinamic/model/__init__.py 2014-11-07 20:48:51 +0000 |
269 | @@ -1,15 +1,15 @@ |
270 | -#!/usr/bin/python |
271 | +# !/usr/bin/python |
272 | # -*- encoding: utf-8 -*- |
273 | -########################################################################### |
274 | +# ############################################################################# |
275 | # Module Writen to OpenERP, Open Source Management Solution |
276 | # Copyright (C) 2013 Vauxoo (<http://vauxoo.com>). |
277 | # All Rights Reserved |
278 | -###############Credits###################################################### |
279 | +# ##############Credits######################################################## |
280 | # Coded by: vauxoo consultores (info@vauxoo.com) |
281 | -############################################################################# |
282 | +# ############################################################################# |
283 | # This program is free software: you can redistribute it and/or modify |
284 | -# it under the terms of the GNU Affero General Public License as published by |
285 | -# the Free Software Foundation, either version 3 of the License, or |
286 | +# it under the terms of the GNU Affero General Public License as published |
287 | +# by the Free Software Foundation, either version 3 of the License, or |
288 | # (at your option) any later version. |
289 | # |
290 | # This program is distributed in the hope that it will be useful, |
291 | @@ -19,6 +19,6 @@ |
292 | # |
293 | # You should have received a copy of the GNU Affero General Public License |
294 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
295 | -################################################################################ |
296 | +# ############################################################################# |
297 | |
298 | from . import email_template |
299 | |
300 | === modified file 'email_template_att_dinamic/model/email_template.py' |
301 | --- email_template_att_dinamic/model/email_template.py 2014-10-03 07:19:35 +0000 |
302 | +++ email_template_att_dinamic/model/email_template.py 2014-11-07 20:48:51 +0000 |
303 | @@ -1,15 +1,15 @@ |
304 | -#!/usr/bin/python |
305 | +# !/usr/bin/python |
306 | # -*- encoding: utf-8 -*- |
307 | -########################################################################### |
308 | +# ############################################################################# |
309 | # Module Writen to OpenERP, Open Source Management Solution |
310 | # Copyright (C) 2013 Vauxoo (<http://vauxoo.com>). |
311 | # All Rights Reserved |
312 | -###############Credits###################################################### |
313 | +# ##############Credits######################################################## |
314 | # Coded by: vauxoo consultores (info@vauxoo.com) |
315 | -############################################################################# |
316 | +# ############################################################################# |
317 | # This program is free software: you can redistribute it and/or modify |
318 | -# it under the terms of the GNU Affero General Public License as published by |
319 | -# the Free Software Foundation, either version 3 of the License, or |
320 | +# it under the terms of the GNU Affero General Public License as published |
321 | +# by the Free Software Foundation, either version 3 of the License, or |
322 | # (at your option) any later version. |
323 | # |
324 | # This program is distributed in the hope that it will be useful, |
325 | @@ -19,10 +19,11 @@ |
326 | # |
327 | # You should have received a copy of the GNU Affero General Public License |
328 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
329 | -################################################################################ |
330 | +# ############################################################################# |
331 | |
332 | |
333 | from openerp.osv import osv, fields |
334 | +import ast |
335 | |
336 | |
337 | class email_template(osv.Model): |
338 | @@ -30,10 +31,12 @@ |
339 | _inherit = "email.template" |
340 | |
341 | _columns = { |
342 | - 'att_default': fields.boolean('Add attachment', help='Add attachment of record by default'), |
343 | - 'att_other_field': fields.text('Add attachment from other filed', |
344 | - help='specify from which fields are to get attachments' |
345 | - '(only fields with relation to ir.attachment)') |
346 | + 'att_default': fields.boolean( |
347 | + 'Add attachment', help='Add attachment of record by default'), |
348 | + 'att_other_field': fields.text( |
349 | + 'Add attachment from other filed', help='specify from which fields' |
350 | + ' are to get attachments (only fields with relation to ir.' |
351 | + 'attachment)') |
352 | } |
353 | |
354 | |
355 | @@ -41,28 +44,32 @@ |
356 | _inherit = 'mail.compose.message' |
357 | |
358 | def onchange_template_id(self, cr, uid, ids, template_id, |
359 | - composition_mode, model, res_id, context=None): |
360 | + composition_mode, model, res_id, context=None): |
361 | if not context: |
362 | context = {} |
363 | |
364 | template_obj = self.pool.get('email.template') |
365 | |
366 | res = super(mail_compose_message, |
367 | - self).onchange_template_id(cr, uid, ids, template_id, |
368 | - composition_mode, model, res_id, context=context) |
369 | + self).onchange_template_id( |
370 | + cr, uid, ids, template_id, |
371 | + composition_mode, model, res_id, context=context) |
372 | attach = [] |
373 | if template_id: |
374 | |
375 | template = template_obj.browse(cr, uid, template_id, context) |
376 | |
377 | if template and template.att_default: |
378 | - attach = self.pool.get('ir.attachment').search(cr, uid, |
379 | - [('res_id', '=', res_id), ('res_model', '=', model)]) |
380 | + attach = self.pool.get('ir.attachment').search( |
381 | + cr, uid, [('res_id', '=', res_id), |
382 | + ('res_model', '=', model)]) |
383 | |
384 | if template and template.att_other_field: |
385 | - att_field_render = template_obj.render_template(cr, uid, |
386 | - template.att_other_field, template.model, res_id, context=context) |
387 | - attach += [id_att for id_att in eval("[" + att_field_render + "]") if att_field_render] |
388 | + att_field_render = template_obj.render_template( |
389 | + cr, uid, template.att_other_field, template.model, |
390 | + res_id, context=context) |
391 | + attach += [id_att for id_att in ast.literal_eval( |
392 | + "[" + att_field_render + "]") if att_field_render] |
393 | |
394 | attach += res.get('value', {}).pop('attachment_ids', []) |
395 | res.get('value', {}).update({'attachment_ids': [(6, 0, attach)]}) |
396 | |
397 | === modified file 'email_template_comment/__init__.py' |
398 | --- email_template_comment/__init__.py 2014-10-03 00:28:23 +0000 |
399 | +++ email_template_comment/__init__.py 2014-11-07 20:48:51 +0000 |
400 | @@ -1,15 +1,15 @@ |
401 | -#!/usr/bin/python |
402 | +# !/usr/bin/python |
403 | # -*- encoding: utf-8 -*- |
404 | -########################################################################### |
405 | +# ############################################################################# |
406 | # Module Writen to OpenERP, Open Source Management Solution |
407 | # Copyright (C) 2013 Vauxoo (<http://vauxoo.com>). |
408 | # All Rights Reserved |
409 | -###############Credits###################################################### |
410 | +# ##############Credits######################################################## |
411 | # Coded by: vauxoo consultores (info@vauxoo.com) |
412 | -############################################################################# |
413 | +# ############################################################################# |
414 | # This program is free software: you can redistribute it and/or modify |
415 | -# it under the terms of the GNU Affero General Public License as published by |
416 | -# the Free Software Foundation, either version 3 of the License, or |
417 | +# it under the terms of the GNU Affero General Public License as published |
418 | +# by the Free Software Foundation, either version 3 of the License, or |
419 | # (at your option) any later version. |
420 | # |
421 | # This program is distributed in the hope that it will be useful, |
422 | @@ -19,6 +19,6 @@ |
423 | # |
424 | # You should have received a copy of the GNU Affero General Public License |
425 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
426 | -################################################################################ |
427 | +# ############################################################################# |
428 | |
429 | from . import model |
430 | |
431 | === modified file 'email_template_comment/model/__init__.py' |
432 | --- email_template_comment/model/__init__.py 2014-10-03 00:28:23 +0000 |
433 | +++ email_template_comment/model/__init__.py 2014-11-07 20:48:51 +0000 |
434 | @@ -1,15 +1,15 @@ |
435 | -#!/usr/bin/python |
436 | +# !/usr/bin/python |
437 | # -*- encoding: utf-8 -*- |
438 | -########################################################################### |
439 | +# ############################################################################# |
440 | # Module Writen to OpenERP, Open Source Management Solution |
441 | # Copyright (C) 2013 Vauxoo (<http://vauxoo.com>). |
442 | # All Rights Reserved |
443 | -###############Credits###################################################### |
444 | +# ##############Credits######################################################## |
445 | # Coded by: vauxoo consultores (info@vauxoo.com) |
446 | -############################################################################# |
447 | +# ############################################################################# |
448 | # This program is free software: you can redistribute it and/or modify |
449 | -# it under the terms of the GNU Affero General Public License as published by |
450 | -# the Free Software Foundation, either version 3 of the License, or |
451 | +# it under the terms of the GNU Affero General Public License as published |
452 | +# by the Free Software Foundation, either version 3 of the License, or |
453 | # (at your option) any later version. |
454 | # |
455 | # This program is distributed in the hope that it will be useful, |
456 | @@ -19,7 +19,7 @@ |
457 | # |
458 | # You should have received a copy of the GNU Affero General Public License |
459 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
460 | -################################################################################ |
461 | +# ############################################################################# |
462 | |
463 | from . import email_template |
464 | from . import mail_compose_message |
465 | |
466 | === modified file 'email_template_comment/model/email_template.py' |
467 | --- email_template_comment/model/email_template.py 2014-10-03 07:19:35 +0000 |
468 | +++ email_template_comment/model/email_template.py 2014-11-07 20:48:51 +0000 |
469 | @@ -1,15 +1,15 @@ |
470 | -#!/usr/bin/python |
471 | +# !/usr/bin/python |
472 | # -*- encoding: utf-8 -*- |
473 | -########################################################################### |
474 | +# ############################################################################# |
475 | # Module Writen to OpenERP, Open Source Management Solution |
476 | # Copyright (C) 2013 Vauxoo (<http://vauxoo.com>). |
477 | # All Rights Reserved |
478 | -###############Credits###################################################### |
479 | +# ##############Credits######################################################## |
480 | # Coded by: vauxoo consultores (info@vauxoo.com) |
481 | -############################################################################# |
482 | +# ############################################################################# |
483 | # This program is free software: you can redistribute it and/or modify |
484 | -# it under the terms of the GNU Affero General Public License as published by |
485 | -# the Free Software Foundation, either version 3 of the License, or |
486 | +# it under the terms of the GNU Affero General Public License as published |
487 | +# by the Free Software Foundation, either version 3 of the License, or |
488 | # (at your option) any later version. |
489 | # |
490 | # This program is distributed in the hope that it will be useful, |
491 | @@ -19,7 +19,7 @@ |
492 | # |
493 | # You should have received a copy of the GNU Affero General Public License |
494 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
495 | -################################################################################ |
496 | +# ############################################################################# |
497 | |
498 | |
499 | from openerp.osv import osv, fields |
500 | @@ -30,6 +30,7 @@ |
501 | _inherit = 'email.template' |
502 | |
503 | _columns = { |
504 | - 'composition_mode_comment': fields.boolean('Composition Mode', |
505 | + 'composition_mode_comment': fields.boolean( |
506 | + 'Composition Mode', |
507 | help='Create Composition mode like comment'), |
508 | } |
509 | |
510 | === modified file 'email_template_comment/model/mail_compose_message.py' |
511 | --- email_template_comment/model/mail_compose_message.py 2014-10-03 07:19:35 +0000 |
512 | +++ email_template_comment/model/mail_compose_message.py 2014-11-07 20:48:51 +0000 |
513 | @@ -1,15 +1,15 @@ |
514 | -#!/usr/bin/python |
515 | +# !/usr/bin/python |
516 | # -*- encoding: utf-8 -*- |
517 | -########################################################################### |
518 | +# ############################################################################# |
519 | # Module Writen to OpenERP, Open Source Management Solution |
520 | # Copyright (C) 2013 Vauxoo (<http://vauxoo.com>). |
521 | # All Rights Reserved |
522 | -###############Credits###################################################### |
523 | +# ##############Credits######################################################## |
524 | # Coded by: vauxoo consultores (info@vauxoo.com) |
525 | -############################################################################# |
526 | +# ############################################################################# |
527 | # This program is free software: you can redistribute it and/or modify |
528 | -# it under the terms of the GNU Affero General Public License as published by |
529 | -# the Free Software Foundation, either version 3 of the License, or |
530 | +# it under the terms of the GNU Affero General Public License as published |
531 | +# by the Free Software Foundation, either version 3 of the License, or |
532 | # (at your option) any later version. |
533 | # |
534 | # This program is distributed in the hope that it will be useful, |
535 | @@ -19,7 +19,7 @@ |
536 | # |
537 | # You should have received a copy of the GNU Affero General Public License |
538 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
539 | -################################################################################ |
540 | +# ############################################################################# |
541 | |
542 | |
543 | from openerp.osv import osv |
544 | @@ -34,12 +34,15 @@ |
545 | context = {} |
546 | |
547 | email_template_obj = self.pool.get('email.template') |
548 | - result = super(mail_compose_message, self).default_get(cr, uid, fields, context=context) |
549 | + result = super(mail_compose_message, self).default_get( |
550 | + cr, uid, fields, context=context) |
551 | |
552 | template_id = context.get('default_template_id', []) |
553 | |
554 | - template_id = isinstance(template_id, (int, long)) and [template_id] or template_id |
555 | - for template in email_template_obj.browse(cr, uid, template_id, context=context): |
556 | + template_id = isinstance(template_id, (int, long)) \ |
557 | + and [template_id] or template_id |
558 | + for template in email_template_obj.browse(cr, uid, template_id, |
559 | + context=context): |
560 | if template.composition_mode_comment: |
561 | result['composition_mode'] = 'comment' |
562 | |
563 | |
564 | === modified file 'email_template_followers/__init__.py' |
565 | --- email_template_followers/__init__.py 2014-10-03 00:28:23 +0000 |
566 | +++ email_template_followers/__init__.py 2014-11-07 20:48:51 +0000 |
567 | @@ -1,15 +1,15 @@ |
568 | -#!/usr/bin/python |
569 | +# !/usr/bin/python |
570 | # -*- encoding: utf-8 -*- |
571 | -########################################################################### |
572 | +# ############################################################################# |
573 | # Module Writen to OpenERP, Open Source Management Solution |
574 | # Copyright (C) 2013 Vauxoo (<http://vauxoo.com>). |
575 | # All Rights Reserved |
576 | -###############Credits###################################################### |
577 | +# ##############Credits######################################################## |
578 | # Coded by: vauxoo consultores (info@vauxoo.com) |
579 | -############################################################################# |
580 | +# ############################################################################# |
581 | # This program is free software: you can redistribute it and/or modify |
582 | -# it under the terms of the GNU Affero General Public License as published by |
583 | -# the Free Software Foundation, either version 3 of the License, or |
584 | +# it under the terms of the GNU Affero General Public License as published |
585 | +# by the Free Software Foundation, either version 3 of the License, or |
586 | # (at your option) any later version. |
587 | # |
588 | # This program is distributed in the hope that it will be useful, |
589 | @@ -19,6 +19,6 @@ |
590 | # |
591 | # You should have received a copy of the GNU Affero General Public License |
592 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
593 | -################################################################################ |
594 | +# ############################################################################# |
595 | |
596 | from . import model |
597 | |
598 | === modified file 'email_template_followers/model/__init__.py' |
599 | --- email_template_followers/model/__init__.py 2014-10-03 00:28:23 +0000 |
600 | +++ email_template_followers/model/__init__.py 2014-11-07 20:48:51 +0000 |
601 | @@ -1,15 +1,15 @@ |
602 | -#!/usr/bin/python |
603 | +# !/usr/bin/python |
604 | # -*- encoding: utf-8 -*- |
605 | -########################################################################### |
606 | +# ############################################################################# |
607 | # Module Writen to OpenERP, Open Source Management Solution |
608 | # Copyright (C) 2013 Vauxoo (<http://vauxoo.com>). |
609 | # All Rights Reserved |
610 | -###############Credits###################################################### |
611 | +# ##############Credits######################################################## |
612 | # Coded by: vauxoo consultores (info@vauxoo.com) |
613 | -############################################################################# |
614 | +# ############################################################################# |
615 | # This program is free software: you can redistribute it and/or modify |
616 | -# it under the terms of the GNU Affero General Public License as published by |
617 | -# the Free Software Foundation, either version 3 of the License, or |
618 | +# it under the terms of the GNU Affero General Public License as published |
619 | +# by the Free Software Foundation, either version 3 of the License, or |
620 | # (at your option) any later version. |
621 | # |
622 | # This program is distributed in the hope that it will be useful, |
623 | @@ -19,7 +19,7 @@ |
624 | # |
625 | # You should have received a copy of the GNU Affero General Public License |
626 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
627 | -################################################################################ |
628 | +# ############################################################################# |
629 | |
630 | from . import mail_compose_message |
631 | from . import email_template |
632 | |
633 | === modified file 'email_template_followers/model/email_template.py' |
634 | --- email_template_followers/model/email_template.py 2014-10-03 07:19:35 +0000 |
635 | +++ email_template_followers/model/email_template.py 2014-11-07 20:48:51 +0000 |
636 | @@ -1,15 +1,15 @@ |
637 | -#!/usr/bin/python |
638 | +# !/usr/bin/python |
639 | # -*- encoding: utf-8 -*- |
640 | -########################################################################### |
641 | +# ############################################################################# |
642 | # Module Writen to OpenERP, Open Source Management Solution |
643 | # Copyright (C) 2013 Vauxoo (<http://vauxoo.com>). |
644 | # All Rights Reserved |
645 | -###############Credits###################################################### |
646 | +# ##############Credits######################################################## |
647 | # Coded by: vauxoo consultores (info@vauxoo.com) |
648 | -############################################################################# |
649 | +# ############################################################################# |
650 | # This program is free software: you can redistribute it and/or modify |
651 | -# it under the terms of the GNU Affero General Public License as published by |
652 | -# the Free Software Foundation, either version 3 of the License, or |
653 | +# it under the terms of the GNU Affero General Public License as published |
654 | +# by the Free Software Foundation, either version 3 of the License, or |
655 | # (at your option) any later version. |
656 | # |
657 | # This program is distributed in the hope that it will be useful, |
658 | @@ -19,7 +19,7 @@ |
659 | # |
660 | # You should have received a copy of the GNU Affero General Public License |
661 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
662 | -################################################################################ |
663 | +# ############################################################################# |
664 | |
665 | |
666 | from openerp.osv import osv, fields |
667 | @@ -30,7 +30,9 @@ |
668 | _inherit = "email.template" |
669 | |
670 | _columns = { |
671 | - 'add_followers': fields.boolean('Add Followers', help='Choice to add followers in template') |
672 | + 'add_followers': fields.boolean( |
673 | + 'Add Followers', |
674 | + help='Choice to add followers in template') |
675 | } |
676 | |
677 | _defaults = { |
678 | |
679 | === modified file 'email_template_followers/model/mail_compose_message.py' |
680 | --- email_template_followers/model/mail_compose_message.py 2014-10-03 07:19:35 +0000 |
681 | +++ email_template_followers/model/mail_compose_message.py 2014-11-07 20:48:51 +0000 |
682 | @@ -1,15 +1,15 @@ |
683 | -#!/usr/bin/python |
684 | +# !/usr/bin/python |
685 | # -*- encoding: utf-8 -*- |
686 | -########################################################################### |
687 | +# ############################################################################# |
688 | # Module Writen to OpenERP, Open Source Management Solution |
689 | # Copyright (C) 2013 Vauxoo (<http://vauxoo.com>). |
690 | # All Rights Reserved |
691 | -###############Credits###################################################### |
692 | +# ##############Credits######################################################## |
693 | # Coded by: vauxoo consultores (info@vauxoo.com) |
694 | -############################################################################# |
695 | +# ############################################################################# |
696 | # This program is free software: you can redistribute it and/or modify |
697 | -# it under the terms of the GNU Affero General Public License as published by |
698 | -# the Free Software Foundation, either version 3 of the License, or |
699 | +# it under the terms of the GNU Affero General Public License as published |
700 | +# by the Free Software Foundation, either version 3 of the License, or |
701 | # (at your option) any later version. |
702 | # |
703 | # This program is distributed in the hope that it will be useful, |
704 | @@ -19,7 +19,7 @@ |
705 | # |
706 | # You should have received a copy of the GNU Affero General Public License |
707 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
708 | -################################################################################ |
709 | +# ############################################################################# |
710 | |
711 | |
712 | from openerp.osv import osv |
713 | @@ -30,14 +30,16 @@ |
714 | |
715 | _inherit = 'mail.compose.message' |
716 | |
717 | - def generate_email_for_composer(self, cr, uid, template_id, res_id, context=None): |
718 | + def generate_email_for_composer(self, cr, uid, template_id, |
719 | + res_id, context=None): |
720 | |
721 | - values = super(mail_compose_message, self).generate_email_for_composer(cr, uid, |
722 | - template_id, res_id, context=context) |
723 | + values = super(mail_compose_message, self).generate_email_for_composer( |
724 | + cr, uid, template_id, res_id, context=context) |
725 | |
726 | email_template_obj = self.pool.get('email.template') |
727 | |
728 | - email_template = email_template_obj.browse(cr, uid, template_id, context=context) |
729 | + email_template = email_template_obj.browse(cr, uid, template_id, |
730 | + context=context) |
731 | if values.get('partner_ids', False) and email_template.add_followers: |
732 | partners_to_notify = set([]) |
733 | partner_follower = self.pool.get('mail.followers') |
734 | @@ -47,9 +49,13 @@ |
735 | ('res_id', '=', context.get('active_id')), |
736 | ], context=context) |
737 | |
738 | - partners_to_notify |= set(fo.partner_id.id |
739 | - for fo in partner_follower.browse(cr, SUPERUSER_ID, fol_ids, context=context)) |
740 | + partners_to_notify |= set(fo.partner_id.id for fo in |
741 | + partner_follower.browse(cr, SUPERUSER_ID, |
742 | + fol_ids, |
743 | + context=context)) |
744 | |
745 | - partners_followers_notify = values.get('partner_ids', []) + list(partners_to_notify) |
746 | - values.update({'partner_ids': list(set(partners_followers_notify))}) |
747 | + partners_followers_notify = values.get('partner_ids', []) + \ |
748 | + list(partners_to_notify) |
749 | + values.update( |
750 | + {'partner_ids': list(set(partners_followers_notify))}) |
751 | return values |
752 | |
753 | === modified file 'project_followers_rule/__init__.py' |
754 | --- project_followers_rule/__init__.py 2014-10-03 00:28:23 +0000 |
755 | +++ project_followers_rule/__init__.py 2014-11-07 20:48:51 +0000 |
756 | @@ -21,6 +21,5 @@ |
757 | # |
758 | # You should have received a copy of the GNU Affero General Public License |
759 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
760 | -# |
761 | -# |
762 | + |
763 | from . import model |
764 | |
765 | === modified file 'project_followers_rule/model/__init__.py' |
766 | --- project_followers_rule/model/__init__.py 2014-10-03 00:28:23 +0000 |
767 | +++ project_followers_rule/model/__init__.py 2014-11-07 20:48:51 +0000 |
768 | @@ -21,8 +21,5 @@ |
769 | # |
770 | # You should have received a copy of the GNU Affero General Public License |
771 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
772 | -# |
773 | -# |
774 | |
775 | from . import project |
776 | - |
777 | |
778 | === modified file 'project_followers_rule/model/project.py' |
779 | --- project_followers_rule/model/project.py 2014-10-03 07:19:35 +0000 |
780 | +++ project_followers_rule/model/project.py 2014-11-07 20:48:51 +0000 |
781 | @@ -21,7 +21,6 @@ |
782 | # |
783 | # You should have received a copy of the GNU Affero General Public License |
784 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
785 | -# |
786 | |
787 | from openerp.osv import osv, fields |
788 | |
789 | @@ -31,12 +30,13 @@ |
790 | |
791 | def _get_followers(self, cr, uid, ids, field_name, arg, context=None): |
792 | result = {} |
793 | - for project in self.browse(cr, uid, ids, context=context): |
794 | + for project_obj in self.browse(cr, uid, ids, context=context): |
795 | task_ids = self.pool.get('project.task').search( |
796 | - cr, uid, [('project_id', '=', project.id)]) |
797 | - for task in self.pool.get('project.task').browse(cr, uid, task_ids): |
798 | + cr, uid, [('project_id', '=', project_obj.id)]) |
799 | + for task in self.pool.get('project.task').browse(cr, uid, |
800 | + task_ids): |
801 | if task.message_follower_ids: |
802 | - result[project.id] = [ |
803 | + result[project_obj.id] = [ |
804 | follower.id for follower in task.message_follower_ids] |
805 | return result |
806 | |
807 | @@ -44,13 +44,20 @@ |
808 | for cond in args: |
809 | partner_ids = cond[2] |
810 | task_ids = self.pool.get('project.task').search( |
811 | - cr, uid, [('message_follower_ids', 'in', partner_ids), |
812 | - ('project_id.privacy_visibility', '=', 'followers')]) |
813 | + cr, |
814 | + uid, |
815 | + [('message_follower_ids', 'in', partner_ids), |
816 | + ('project_id.privacy_visibility', '=', 'followers')]) |
817 | project_ids = set(task.project_id.id for task in self.pool.get( |
818 | 'project.task').browse(cr, uid, task_ids)) |
819 | return [('id', 'in', tuple(project_ids))] |
820 | _columns = { |
821 | - 'followers_tasks_ids': fields.function(_get_followers, type='many2many', |
822 | - relation="res.partner", string="Followers Task", method=True, store=False, |
823 | - fnct_search=_search_project), |
824 | + 'followers_tasks_ids': fields.function( |
825 | + _get_followers, |
826 | + type='many2many', |
827 | + relation="res.partner", |
828 | + string="Followers Task", |
829 | + method=True, |
830 | + store=False, |
831 | + fnct_search=_search_project), |
832 | } |