Merge lp:~therp-nl/eficent-openerp-project-management/6.1-mig_project_communications_mailgate into lp:eficent-openerp-project-management/6.1
- 6.1-mig_project_communications_mailgate
- Merge into 6.1
Proposed by
Stefan Rijnhart (Opener)
Status: | Work in progress |
---|---|
Proposed branch: | lp:~therp-nl/eficent-openerp-project-management/6.1-mig_project_communications_mailgate |
Merge into: | lp:eficent-openerp-project-management/6.1 |
Diff against target: |
490 lines (+84/-168) 14 files modified
project_category/analytic_account_category.py (+2/-2) project_communications_mailgate/__init__.py (+2/-2) project_communications_mailgate/__openerp__.py (+1/-1) project_communications_mailgate/project.py (+31/-36) project_communications_mailgate/project_communications_mailgate.py (+20/-100) project_communications_mailgate/security/ir.model.access.csv (+0/-3) project_cost/account_analytic_account.py (+8/-4) project_cost_plan_purchase/account_analytic_line_plan.py (+4/-4) project_cost_plan_sale/account_analytic_line_plan.py (+4/-4) project_hr_stakeholder/project_hr_stakeholder.py (+1/-1) project_invoice/invoice.py (+1/-1) project_procurement/purchase_requisition.py (+2/-2) project_scope_wbs/project_scope_wbs.py (+7/-7) project_time_sequence/project_time_sequence.py (+1/-1) |
To merge this branch: | bzr merge lp:~therp-nl/eficent-openerp-project-management/6.1-mig_project_communications_mailgate |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Eficent | Pending | ||
Review via email:
|
Commit message
Description of the change
Work in progress, not yet tested.
To post a comment you must log in.
Unmerged revisions
- 10. By Stefan Rijnhart (Opener)
-
[MIG] Adapt project_
communications_ mailgate to new mail module - 9. By Stefan Rijnhart (Opener)
-
[FIX] Remove mutable defaults from function arguments
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'project_category/analytic_account_category.py' | |||
2 | --- project_category/analytic_account_category.py 2012-10-18 23:30:03 +0000 | |||
3 | +++ project_category/analytic_account_category.py 2013-01-04 15:10:41 +0000 | |||
4 | @@ -40,7 +40,7 @@ | |||
5 | 40 | def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100): | 40 | def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100): |
6 | 41 | if not args: | 41 | if not args: |
7 | 42 | args=[] | 42 | args=[] |
9 | 43 | if not context: | 43 | if context is None: |
10 | 44 | context={} | 44 | context={} |
11 | 45 | if name: | 45 | if name: |
12 | 46 | # Be sure name_search is symetric to name_get | 46 | # Be sure name_search is symetric to name_get |
13 | @@ -77,4 +77,4 @@ | |||
14 | 77 | _parent_order = 'name' | 77 | _parent_order = 'name' |
15 | 78 | _order = 'parent_left' | 78 | _order = 'parent_left' |
16 | 79 | 79 | ||
17 | 80 | analytic_account_category() | ||
18 | 81 | \ No newline at end of file | 80 | \ No newline at end of file |
19 | 81 | analytic_account_category() | ||
20 | 82 | 82 | ||
21 | === modified file 'project_communications_mailgate/__init__.py' | |||
22 | --- project_communications_mailgate/__init__.py 2012-10-02 20:55:15 +0000 | |||
23 | +++ project_communications_mailgate/__init__.py 2013-01-04 15:10:41 +0000 | |||
24 | @@ -1,8 +1,8 @@ | |||
25 | 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
26 | 2 | ############################################################################## | 2 | ############################################################################## |
27 | 3 | # | 3 | # |
30 | 4 | # OpenERP, Open Source Management Solution | 4 | # Copyright (C) 2011 Eficent (<http://www.eficent.com/>) |
31 | 5 | # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). | 5 | # Jordi Ballester Alomar <jordi.ballester@eficent.com> |
32 | 6 | # | 6 | # |
33 | 7 | # This program is free software: you can redistribute it and/or modify | 7 | # This program is free software: you can redistribute it and/or modify |
34 | 8 | # it under the terms of the GNU Affero General Public License as | 8 | # it under the terms of the GNU Affero General Public License as |
35 | 9 | 9 | ||
36 | === modified file 'project_communications_mailgate/__openerp__.py' | |||
37 | --- project_communications_mailgate/__openerp__.py 2012-10-02 20:55:15 +0000 | |||
38 | +++ project_communications_mailgate/__openerp__.py 2013-01-04 15:10:41 +0000 | |||
39 | @@ -26,7 +26,7 @@ | |||
40 | 26 | "author": "Jordi Ballester (Eficent)", | 26 | "author": "Jordi Ballester (Eficent)", |
41 | 27 | "website": "http://www.eficent.com", | 27 | "website": "http://www.eficent.com", |
42 | 28 | "category": "Generic Modules/Projects & Services", | 28 | "category": "Generic Modules/Projects & Services", |
44 | 29 | "depends": ["project", "mail_gateway"], | 29 | "depends": ["project", "mail"], |
45 | 30 | "description": """This module is an interface that synchronises mails with OpenERP Project. | 30 | "description": """This module is an interface that synchronises mails with OpenERP Project. |
46 | 31 | 31 | ||
47 | 32 | It allows updating projects as soon as a new mail arrives in our configured mail server. | 32 | It allows updating projects as soon as a new mail arrives in our configured mail server. |
48 | 33 | 33 | ||
49 | === modified file 'project_communications_mailgate/project.py' | |||
50 | --- project_communications_mailgate/project.py 2012-10-02 20:55:15 +0000 | |||
51 | +++ project_communications_mailgate/project.py 2013-01-04 15:10:41 +0000 | |||
52 | @@ -19,45 +19,40 @@ | |||
53 | 19 | # | 19 | # |
54 | 20 | ############################################################################## | 20 | ############################################################################## |
55 | 21 | 21 | ||
59 | 22 | import tools | 22 | from openerp.osv import orm |
60 | 23 | from osv import fields, osv | 23 | from openerp.tools.translate import _ |
58 | 24 | from tools.translate import _ | ||
61 | 25 | 24 | ||
62 | 26 | 25 | ||
64 | 27 | class project(osv.osv): | 26 | class project(orm.Model): |
65 | 28 | 27 | ||
66 | 29 | _inherit = "project.project" | 28 | _inherit = "project.project" |
67 | 30 | 29 | ||
96 | 31 | def set_draft(self, cr, uid, ids, *args, **kwargs): | 30 | def set_draft(self, cr, uid, ids, context=None): |
97 | 32 | res = super(project, self).set_draft(cr, uid, ids, *args, **kwargs) | 31 | res = super(project, self).set_draft(cr, uid, ids, context=context) |
98 | 33 | projects = self.browse(cr, uid, ids) | 32 | projects = self.browse(cr, uid, ids, context=context) |
99 | 34 | self._history(cr, uid, projects, _('Draft')) | 33 | self.message_append(cr, uid, projects, _('Draft'), context=context) |
100 | 35 | return res | 34 | return res |
101 | 36 | 35 | ||
102 | 37 | def set_open(self, cr, uid, ids, *args, **kwargs): | 36 | def set_open(self, cr, uid, ids, context=None): |
103 | 38 | res = super(project, self).set_open(cr, uid, ids, *args, **kwargs) | 37 | res = super(project, self).set_open(cr, uid, ids, context=context) |
104 | 39 | projects = self.browse(cr, uid, ids) | 38 | projects = self.browse(cr, uid, ids, context=context) |
105 | 40 | self._history(cr, uid, projects, _('Open')) | 39 | self.message_append(cr, uid, projects, _('Open'), context=context) |
106 | 41 | return res | 40 | return res |
107 | 42 | 41 | ||
108 | 43 | def set_pending(self, cr, uid, ids, *args, **kwargs): | 42 | def set_pending(self, cr, uid, ids, context=None): |
109 | 44 | res = super(project, self).set_pending(cr, uid, ids, *args, **kwargs) | 43 | res = super(project, self).set_pending(cr, uid, ids, context=context) |
110 | 45 | projects = self.browse(cr, uid, ids) | 44 | projects = self.browse(cr, uid, ids, context=context) |
111 | 46 | self._history(cr, uid, projects, _('Pending')) | 45 | self.message_append(cr, uid, projects, _('Pending'), context=context) |
112 | 47 | return res | 46 | return res |
113 | 48 | 47 | ||
114 | 49 | def set_done(self, cr, uid, ids, *args, **kwargs): | 48 | def set_done(self, cr, uid, ids, context=None): |
115 | 50 | res = super(project, self).set_done(cr, uid, ids, *args, **kwargs) | 49 | res = super(project, self).set_done(cr, uid, ids, context=context) |
116 | 51 | projects = self.browse(cr, uid, ids) | 50 | projects = self.browse(cr, uid, ids, context=context) |
117 | 52 | self._history(cr, uid, projects, _('Done')) | 51 | self.message_append(cr, uid, projects, _('Done'), context=context) |
118 | 53 | return res | 52 | return res |
119 | 54 | 53 | ||
120 | 55 | def set_cancel(self, cr, uid, ids, *args, **kwargs): | 54 | def set_cancel(self, cr, uid, ids, context=None): |
121 | 56 | res = super(project, self).set_cancel(cr, uid, ids, *args, **kwargs) | 55 | res = super(project, self).set_cancel(cr, uid, ids, context=context) |
122 | 57 | projects = self.browse(cr, uid, ids) | 56 | projects = self.browse(cr, uid, ids, context=context) |
123 | 58 | self._history(cr, uid, projects, _('Cancel')) | 57 | self.message_append(cr, uid, projects, _('Cancel'), context=context) |
124 | 59 | return res | 58 | return res |
125 | 60 | |||
126 | 61 | |||
127 | 62 | project() | ||
128 | 63 | |||
129 | 64 | 59 | ||
130 | === modified file 'project_communications_mailgate/project_communications_mailgate.py' | |||
131 | --- project_communications_mailgate/project_communications_mailgate.py 2012-10-02 20:55:15 +0000 | |||
132 | +++ project_communications_mailgate/project_communications_mailgate.py 2013-01-04 15:10:41 +0000 | |||
133 | @@ -19,110 +19,30 @@ | |||
134 | 19 | # | 19 | # |
135 | 20 | ############################################################################## | 20 | ############################################################################## |
136 | 21 | 21 | ||
143 | 22 | from osv import fields,osv | 22 | from openerp.osv import fields, orm |
144 | 23 | from tools.translate import _ | 23 | |
145 | 24 | import binascii | 24 | |
146 | 25 | 25 | class project_communications_mailgate(orm.Model): | |
141 | 26 | |||
142 | 27 | class project_communications_mailgate(osv.osv): | ||
147 | 28 | _name = "project.project" | 26 | _name = "project.project" |
149 | 29 | _inherit = ['mailgate.thread','project.project'] | 27 | _inherit = ['mail.thread','project.project'] |
150 | 30 | 28 | ||
151 | 31 | _columns={ | 29 | _columns={ |
163 | 32 | 'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('model','=',_name)], readonly=True), | 30 | 'message_ids': fields.one2many( |
164 | 33 | } | 31 | 'mail.message', 'res_id', 'Messages', |
165 | 34 | 32 | domain=[('model','=',_name)], readonly=True), | |
166 | 35 | def message_new(self, cr, uid, msg, context=None): | 33 | } |
167 | 36 | # """ | 34 | |
168 | 37 | # Automatically calls when new email message arrives | 35 | def message_thread_followers(self, cr, uid, ids, context=None): |
169 | 38 | # | 36 | if not ids: |
170 | 39 | # @param self: The object pointer | 37 | return {} |
171 | 40 | # @param cr: the current row, from the database cursor, | 38 | if isinstance(ids, (int, long)): |
172 | 41 | # @param uid: the current user’s ID for security checks | 39 | ids = [ids] |
162 | 42 | # """ | ||
173 | 43 | res = {} | 40 | res = {} |
242 | 44 | # mailgate_obj = self.pool.get('email.server.tools') | 41 | for project in self.browse(cr, uid, ids, context=context): |
243 | 45 | # subject = msg.get('subject') | 42 | user_email = (project.user_id and project.user_id.address_id |
244 | 46 | # body = msg.get('body') | 43 | and project.user_id.address_id.email) or False |
245 | 47 | # msg_from = msg.get('from') | 44 | if user_email: |
246 | 48 | # priority = msg.get('priority') | 45 | res.setdefault(project.id, []).append(user_email) |
179 | 49 | |||
180 | 50 | # data = { | ||
181 | 51 | # 'name': subject, | ||
182 | 52 | # 'description': body, | ||
183 | 53 | # } | ||
184 | 54 | # res = mailgate_obj.get_partner(cr, uid, msg_from) | ||
185 | 55 | # if res: | ||
186 | 56 | # data.update(res) | ||
187 | 57 | # res = self.create(cr, uid, data) | ||
188 | 58 | |||
189 | 59 | # attachments = msg.get('attachments', []) | ||
190 | 60 | # for attachment in attachments or []: | ||
191 | 61 | # data_attach = { | ||
192 | 62 | # 'name': attachment, | ||
193 | 63 | # 'datas':binascii.b2a_base64(str(attachments.get(attachment))), | ||
194 | 64 | # 'datas_fname': attachment, | ||
195 | 65 | # 'description': 'Mail attachment', | ||
196 | 66 | # 'res_model': self._name, | ||
197 | 67 | # 'res_id': res, | ||
198 | 68 | # } | ||
199 | 69 | # self.pool.get('ir.attachment').create(cr, uid, data_attach) | ||
200 | 70 | # | ||
201 | 71 | return res | ||
202 | 72 | |||
203 | 73 | def message_update(self, cr, uid, id, msg, data={}, context=None): | ||
204 | 74 | mailgate_obj = self.pool.get('email.server.tools') | ||
205 | 75 | subject = data.get('subject') | ||
206 | 76 | body = data.get('body') | ||
207 | 77 | msg_from = data.get('from') | ||
208 | 78 | msg_to = data.get('to') | ||
209 | 79 | priority = data.get('priority') | ||
210 | 80 | attachments = data.get('attachments', []) | ||
211 | 81 | |||
212 | 82 | # msg_actions, body_data = mailgate_obj.msg_act_get(msg) | ||
213 | 83 | # data.update({ | ||
214 | 84 | # 'description': body_data, | ||
215 | 85 | # }) | ||
216 | 86 | # act = 'do_'+default_act | ||
217 | 87 | # if 'state' in msg_actions: | ||
218 | 88 | # if msg_actions['state'] in ['draft','close','cancel','open','pending']: | ||
219 | 89 | # act = 'do_' + msg_actions['state'] | ||
220 | 90 | |||
221 | 91 | # if 'priority' in msg_actions: | ||
222 | 92 | # if msg_actions['priority'] in ('1','2','3','4','5'): | ||
223 | 93 | # data['priority'] = msg_actions['priority'] | ||
224 | 94 | # | ||
225 | 95 | # self.write(cr, uid, [id], data) | ||
226 | 96 | msg_dict = {'new': 'Send', 'reply': 'Reply', 'forward': 'Forward'} | ||
227 | 97 | self._history(cr, uid, id, _(msg_dict['new']), history=True, subject=subject, email=msg_to, details=body, email_from=msg_from, message_id=None, attach=attachments) | ||
228 | 98 | # getattr(self,act)(cr, uid, [id]) | ||
229 | 99 | return {} | ||
230 | 100 | |||
231 | 101 | def message_followers(self, cr, uid, ids, context=None): | ||
232 | 102 | res = [] | ||
233 | 103 | if isinstance(ids, (str, int, long)): | ||
234 | 104 | select = [ids] | ||
235 | 105 | else: | ||
236 | 106 | select = ids | ||
237 | 107 | for project in self.browse(cr, uid, select, context=context): | ||
238 | 108 | user_email = (project.user_id and project.user_id.address_id and project.user_id.address_id.email) or False | ||
239 | 109 | res += [(user_email, False, False, project.priority)] | ||
240 | 110 | if isinstance(ids, (str, int, long)): | ||
241 | 111 | return len(res) and res[0] or False | ||
247 | 112 | return res | 46 | return res |
248 | 113 | 47 | ||
249 | 114 | def msg_send(self, cr, uid, id, *args, **argv): | ||
250 | 115 | return True | ||
251 | 116 | |||
252 | 117 | def _history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=[], context=None): | ||
253 | 118 | mailgate_pool = self.pool.get('mailgate.thread') | ||
254 | 119 | return mailgate_pool.history(cr, uid, cases, keyword, history=history,\ | ||
255 | 120 | subject=subject, email=email, \ | ||
256 | 121 | details=details, email_from=email_from,\ | ||
257 | 122 | message_id=message_id, attach=attach, \ | ||
258 | 123 | context=context) | ||
259 | 124 | |||
260 | 125 | |||
261 | 126 | project_communications_mailgate() | ||
262 | 127 | |||
263 | 128 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 48 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
264 | 129 | 49 | ||
265 | === removed directory 'project_communications_mailgate/security' | |||
266 | === removed file 'project_communications_mailgate/security/ir.model.access.csv' | |||
267 | --- project_communications_mailgate/security/ir.model.access.csv 2012-10-02 20:55:15 +0000 | |||
268 | +++ project_communications_mailgate/security/ir.model.access.csv 1970-01-01 00:00:00 +0000 | |||
269 | @@ -1,3 +0,0 @@ | |||
270 | 1 | "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" | ||
271 | 2 | "access_project_communications_mailgate_message_project_manager","project.mailgate.message.manager","mail_gateway.model_mailgate_message","project.group_project_manager",1,1,1,1 | ||
272 | 3 | "access_project_communications_mailgate_message_project_user","project.mailgate.message.user","mail_gateway.model_mailgate_message","project.group_project_user",1,1,1,1 | ||
273 | 4 | 0 | ||
274 | === modified file 'project_cost/account_analytic_account.py' | |||
275 | --- project_cost/account_analytic_account.py 2012-10-02 20:55:15 +0000 | |||
276 | +++ project_cost/account_analytic_account.py 2013-01-04 15:10:41 +0000 | |||
277 | @@ -33,7 +33,9 @@ | |||
278 | 33 | _inherit = 'account.analytic.account' | 33 | _inherit = 'account.analytic.account' |
279 | 34 | 34 | ||
280 | 35 | def _compute_level_tree_plan(self, cr, uid, ids, child_ids, res, field_names, context=None): | 35 | def _compute_level_tree_plan(self, cr, uid, ids, child_ids, res, field_names, context=None): |
282 | 36 | def recursive_computation(account_id, res, repeated_account_ids=[]): | 36 | def recursive_computation(account_id, res, repeated_account_ids=None): |
283 | 37 | if repeated_account_ids is None: | ||
284 | 38 | repeated_account_ids = [] | ||
285 | 37 | currency_obj = self.pool.get('res.currency') | 39 | currency_obj = self.pool.get('res.currency') |
286 | 38 | account = self.browse(cr, uid, account_id) | 40 | account = self.browse(cr, uid, account_id) |
287 | 39 | for son in account.child_ids: | 41 | for son in account.child_ids: |
288 | @@ -54,7 +56,9 @@ | |||
289 | 54 | return res | 56 | return res |
290 | 55 | 57 | ||
291 | 56 | def _compute_level_tree_commit(self, cr, uid, ids, child_ids, res, field_names, context=None): | 58 | def _compute_level_tree_commit(self, cr, uid, ids, child_ids, res, field_names, context=None): |
293 | 57 | def recursive_computation(account_id, res, repeated_account_ids=[]): | 59 | def recursive_computation(account_id, res, repeated_account_ids=None): |
294 | 60 | if repeated_account_ids is None: | ||
295 | 61 | repeated_account_ids = [] | ||
296 | 58 | currency_obj = self.pool.get('res.currency') | 62 | currency_obj = self.pool.get('res.currency') |
297 | 59 | account = self.browse(cr, uid, account_id) | 63 | account = self.browse(cr, uid, account_id) |
298 | 60 | for son in account.child_ids: | 64 | for son in account.child_ids: |
299 | @@ -200,11 +204,11 @@ | |||
300 | 200 | return True | 204 | return True |
301 | 201 | 205 | ||
302 | 202 | def copy(self, cr, uid, id, default=None, context=None): | 206 | def copy(self, cr, uid, id, default=None, context=None): |
304 | 203 | if not default: | 207 | if default is None: |
305 | 204 | default = {} | 208 | default = {} |
306 | 205 | default['plan_line_ids'] = [] | 209 | default['plan_line_ids'] = [] |
307 | 206 | default['commit_line_ids'] = [] | 210 | default['commit_line_ids'] = [] |
308 | 207 | return super(account_analytic_account, self).copy(cr, uid, id, default, context=context) | 211 | return super(account_analytic_account, self).copy(cr, uid, id, default, context=context) |
309 | 208 | 212 | ||
310 | 209 | 213 | ||
311 | 210 | account_analytic_account() | ||
312 | 211 | \ No newline at end of file | 214 | \ No newline at end of file |
313 | 215 | account_analytic_account() | ||
314 | 212 | 216 | ||
315 | === modified file 'project_cost_plan_purchase/account_analytic_line_plan.py' | |||
316 | --- project_cost_plan_purchase/account_analytic_line_plan.py 2012-10-02 20:55:15 +0000 | |||
317 | +++ project_cost_plan_purchase/account_analytic_line_plan.py 2013-01-04 15:10:41 +0000 | |||
318 | @@ -43,23 +43,23 @@ | |||
319 | 43 | } | 43 | } |
320 | 44 | 44 | ||
321 | 45 | 45 | ||
323 | 46 | def copy(self, cr, uid, id, default={}, context=None): | 46 | def copy(self, cr, uid, id, default=None, context=None): |
324 | 47 | if context is None: | 47 | if context is None: |
325 | 48 | context = {} | 48 | context = {} |
326 | 49 | 49 | ||
328 | 50 | if not default: | 50 | if default is None: |
329 | 51 | default = {} | 51 | default = {} |
330 | 52 | 52 | ||
331 | 53 | default['purchase_line_id'] = False | 53 | default['purchase_line_id'] = False |
332 | 54 | 54 | ||
333 | 55 | return super(account_analytic_line_plan, self).copy(cr, uid, id, default, context) | 55 | return super(account_analytic_line_plan, self).copy(cr, uid, id, default, context) |
334 | 56 | 56 | ||
336 | 57 | def copy_data(self, cr, uid, id, default={}, context=None): | 57 | def copy_data(self, cr, uid, id, default=None, context=None): |
337 | 58 | 58 | ||
338 | 59 | if context is None: | 59 | if context is None: |
339 | 60 | context = {} | 60 | context = {} |
340 | 61 | 61 | ||
342 | 62 | if not default: | 62 | if default is None: |
343 | 63 | default = {} | 63 | default = {} |
344 | 64 | 64 | ||
345 | 65 | default['purchase_line_id'] = False | 65 | default['purchase_line_id'] = False |
346 | 66 | 66 | ||
347 | === modified file 'project_cost_plan_sale/account_analytic_line_plan.py' | |||
348 | --- project_cost_plan_sale/account_analytic_line_plan.py 2012-10-02 20:55:15 +0000 | |||
349 | +++ project_cost_plan_sale/account_analytic_line_plan.py 2013-01-04 15:10:41 +0000 | |||
350 | @@ -43,11 +43,11 @@ | |||
351 | 43 | } | 43 | } |
352 | 44 | 44 | ||
353 | 45 | 45 | ||
355 | 46 | def copy(self, cr, uid, id, default={}, context=None): | 46 | def copy(self, cr, uid, id, default=None, context=None): |
356 | 47 | if context is None: | 47 | if context is None: |
357 | 48 | context = {} | 48 | context = {} |
358 | 49 | 49 | ||
360 | 50 | if not default: | 50 | if default is None: |
361 | 51 | default = {} | 51 | default = {} |
362 | 52 | 52 | ||
363 | 53 | default['sale_line_id'] = False | 53 | default['sale_line_id'] = False |
364 | @@ -55,11 +55,11 @@ | |||
365 | 55 | res = super(account_analytic_line_plan, self).copy(cr, uid, id, default, context) | 55 | res = super(account_analytic_line_plan, self).copy(cr, uid, id, default, context) |
366 | 56 | return res | 56 | return res |
367 | 57 | 57 | ||
369 | 58 | def copy_data(self, cr, uid, id, default={}, context=None): | 58 | def copy_data(self, cr, uid, id, default=None, context=None): |
370 | 59 | 59 | ||
371 | 60 | if context is None: | 60 | if context is None: |
372 | 61 | context = {} | 61 | context = {} |
374 | 62 | if not default: | 62 | if default is None: |
375 | 63 | default = {} | 63 | default = {} |
376 | 64 | 64 | ||
377 | 65 | default['sale_line_id'] = False | 65 | default['sale_line_id'] = False |
378 | 66 | 66 | ||
379 | === modified file 'project_hr_stakeholder/project_hr_stakeholder.py' | |||
380 | --- project_hr_stakeholder/project_hr_stakeholder.py 2012-10-02 20:55:15 +0000 | |||
381 | +++ project_hr_stakeholder/project_hr_stakeholder.py 2013-01-04 15:10:41 +0000 | |||
382 | @@ -106,7 +106,7 @@ | |||
383 | 106 | 106 | ||
384 | 107 | } | 107 | } |
385 | 108 | 108 | ||
387 | 109 | def name_get(self, cr, uid, ids, context={}): | 109 | def name_get(self, cr, uid, ids, context=None): |
388 | 110 | if not ids: | 110 | if not ids: |
389 | 111 | return [] | 111 | return [] |
390 | 112 | res = [] | 112 | res = [] |
391 | 113 | 113 | ||
392 | === modified file 'project_invoice/invoice.py' | |||
393 | --- project_invoice/invoice.py 2012-10-02 20:55:15 +0000 | |||
394 | +++ project_invoice/invoice.py 2013-01-04 15:10:41 +0000 | |||
395 | @@ -32,7 +32,7 @@ | |||
396 | 32 | class account_invoice(osv.osv): | 32 | class account_invoice(osv.osv): |
397 | 33 | _inherit = "account.invoice" | 33 | _inherit = "account.invoice" |
398 | 34 | 34 | ||
400 | 35 | def _line_analytic_accounts_get(self, cr, uid, ids, field_name, arg, context={}): | 35 | def _line_analytic_accounts_get(self, cr, uid, ids, field_name, arg, context=None): |
401 | 36 | result = {} | 36 | result = {} |
402 | 37 | for inv in self.browse(cr, uid, ids, context): | 37 | for inv in self.browse(cr, uid, ids, context): |
403 | 38 | str_data = '' | 38 | str_data = '' |
404 | 39 | 39 | ||
405 | === modified file 'project_procurement/purchase_requisition.py' | |||
406 | --- project_procurement/purchase_requisition.py 2012-10-02 20:55:15 +0000 | |||
407 | +++ project_procurement/purchase_requisition.py 2013-01-04 15:10:41 +0000 | |||
408 | @@ -25,8 +25,8 @@ | |||
409 | 25 | class purchase_requisition(osv.osv): | 25 | class purchase_requisition(osv.osv): |
410 | 26 | _inherit = "purchase.requisition" | 26 | _inherit = "purchase.requisition" |
411 | 27 | 27 | ||
414 | 28 | def copy_data(self, cr, uid, id, default={}, context=None): | 28 | def copy_data(self, cr, uid, id, default=None, context=None): |
415 | 29 | if not default: | 29 | if default is None: |
416 | 30 | default = {} | 30 | default = {} |
417 | 31 | default.update({ | 31 | default.update({ |
418 | 32 | 'state':'draft', | 32 | 'state':'draft', |
419 | 33 | 33 | ||
420 | === modified file 'project_scope_wbs/project_scope_wbs.py' | |||
421 | --- project_scope_wbs/project_scope_wbs.py 2012-12-13 04:18:54 +0000 | |||
422 | +++ project_scope_wbs/project_scope_wbs.py 2013-01-04 15:10:41 +0000 | |||
423 | @@ -29,7 +29,7 @@ | |||
424 | 29 | class task(osv.osv): | 29 | class task(osv.osv): |
425 | 30 | _inherit = 'project.task' | 30 | _inherit = 'project.task' |
426 | 31 | 31 | ||
428 | 32 | def _project_complete_wbs_name(self, cr, uid, ids, prop, unknow_none, unknow_dict): | 32 | def _project_complete_wbs_name(self, cr, uid, ids, prop, unknow_none, context=None): |
429 | 33 | 33 | ||
430 | 34 | if not ids: | 34 | if not ids: |
431 | 35 | return [] | 35 | return [] |
432 | @@ -45,14 +45,14 @@ | |||
433 | 45 | for task in tasks: | 45 | for task in tasks: |
434 | 46 | if task.project_id: | 46 | if task.project_id: |
435 | 47 | task_project_id = task.project_id.id | 47 | task_project_id = task.project_id.id |
437 | 48 | data_project = project_obj.read(cr, uid, task_project_id, ['complete_wbs_name'], context=[]) | 48 | data_project = project_obj.read(cr, uid, task_project_id, ['complete_wbs_name'], context=context) |
438 | 49 | if data_project: | 49 | if data_project: |
439 | 50 | res.append((task.id, data_project['complete_wbs_name'])) | 50 | res.append((task.id, data_project['complete_wbs_name'])) |
440 | 51 | else: | 51 | else: |
441 | 52 | res.append((task.id, '')) | 52 | res.append((task.id, '')) |
442 | 53 | return dict(res) | 53 | return dict(res) |
443 | 54 | 54 | ||
445 | 55 | def _project_complete_wbs_code(self, cr, uid, ids, prop, unknow_none, unknow_dict): | 55 | def _project_complete_wbs_code(self, cr, uid, ids, prop, unknow_none, context=None): |
446 | 56 | 56 | ||
447 | 57 | if not ids: | 57 | if not ids: |
448 | 58 | return [] | 58 | return [] |
449 | @@ -68,7 +68,7 @@ | |||
450 | 68 | for task in tasks: | 68 | for task in tasks: |
451 | 69 | if task.project_id: | 69 | if task.project_id: |
452 | 70 | task_project_id = task.project_id.id | 70 | task_project_id = task.project_id.id |
454 | 71 | data_project = project_obj.read(cr, uid, task_project_id, ['complete_wbs_code'], context=[]) | 71 | data_project = project_obj.read(cr, uid, task_project_id, ['complete_wbs_code'], context=context) |
455 | 72 | if data_project: | 72 | if data_project: |
456 | 73 | res.append((task.id, data_project['complete_wbs_code'])) | 73 | res.append((task.id, data_project['complete_wbs_code'])) |
457 | 74 | else: | 74 | else: |
458 | @@ -81,11 +81,11 @@ | |||
459 | 81 | _columns = { | 81 | _columns = { |
460 | 82 | 'project_complete_wbs_name': fields.function(_project_complete_wbs_name, method=True, type='char', string='WBS path name', size=250, help='Project Complete WBS path name', | 82 | 'project_complete_wbs_name': fields.function(_project_complete_wbs_name, method=True, type='char', string='WBS path name', size=250, help='Project Complete WBS path name', |
461 | 83 | store={ | 83 | store={ |
463 | 84 | 'project.task': (lambda self, cr, uid, ids, c={}: ids, ['project_id'], 10), | 84 | 'project.task': (lambda self, cr, uid, ids, c=None: ids, ['project_id'], 10), |
464 | 85 | }), | 85 | }), |
465 | 86 | 'project_complete_wbs_code': fields.function(_project_complete_wbs_code, method=True, type='char', string='WBS path code', size=250, help='Project Complete WBS path code', | 86 | 'project_complete_wbs_code': fields.function(_project_complete_wbs_code, method=True, type='char', string='WBS path code', size=250, help='Project Complete WBS path code', |
466 | 87 | store={ | 87 | store={ |
468 | 88 | 'project.task': (lambda self, cr, uid, ids, c={}: ids, ['project_id'], 10), | 88 | 'project.task': (lambda self, cr, uid, ids, c=None: ids, ['project_id'], 10), |
469 | 89 | }), | 89 | }), |
470 | 90 | 90 | ||
471 | 91 | } | 91 | } |
472 | @@ -327,4 +327,4 @@ | |||
473 | 327 | 327 | ||
474 | 328 | project() | 328 | project() |
475 | 329 | 329 | ||
476 | 330 | |||
477 | 331 | \ No newline at end of file | 330 | \ No newline at end of file |
478 | 331 | |||
479 | 332 | 332 | ||
480 | === modified file 'project_time_sequence/project_time_sequence.py' | |||
481 | --- project_time_sequence/project_time_sequence.py 2012-10-02 20:55:15 +0000 | |||
482 | +++ project_time_sequence/project_time_sequence.py 2013-01-04 15:10:41 +0000 | |||
483 | @@ -112,7 +112,7 @@ | |||
484 | 112 | 112 | ||
485 | 113 | } | 113 | } |
486 | 114 | 114 | ||
488 | 115 | def do_link_predecessors(self, cr, uid, task_id, link_predecessors_data={}, context=None): | 115 | def do_link_predecessors(self, cr, uid, task_id, link_predecessors_data, context=None): |
489 | 116 | 116 | ||
490 | 117 | task_br = self.browse(cr, uid, task_id, context=context) | 117 | task_br = self.browse(cr, uid, task_id, context=context) |
491 | 118 | 118 |