Merge lp:~openerp-commiter/openobject-addons/dev-addons2-rha1 into lp:~openerp-dev/openobject-addons/trunk-dev-addons2
- dev-addons2-rha1
- Merge into trunk-dev-addons2
Proposed by
Rifakat Husen (OpenERP)
Status: | Merged |
---|---|
Merge reported by: | Rucha (Open ERP) |
Merged at revision: | not available |
Proposed branch: | lp:~openerp-commiter/openobject-addons/dev-addons2-rha1 |
Merge into: | lp:~openerp-dev/openobject-addons/trunk-dev-addons2 |
Diff against target: |
847 lines (+137/-98) 39 files modified
account/report/account_balance.py (+2/-0) account/wizard/account_automatic_reconcile.py (+4/-1) account/wizard/account_change_currency.py (+3/-3) account/wizard/account_chart.py (+7/-7) account/wizard/account_fiscalyear_close.py (+4/-1) account/wizard/account_fiscalyear_close_state.py (+3/-3) account/wizard/account_invoice_refund.py (+5/-1) account/wizard/account_move_bank_reconcile.py (+4/-4) account/wizard/account_move_journal.py (+1/-1) account/wizard/account_move_line_reconcile_select.py (+3/-3) account/wizard/account_move_line_unreconcile_select.py (+3/-3) account/wizard/account_open_closed_fiscalyear.py (+2/-0) account/wizard/account_reconcile.py (+8/-8) account/wizard/account_report_balance_sheet.py (+2/-1) account/wizard/account_report_common.py (+4/-1) account/wizard/account_report_general_ledger.py (+1/-1) account/wizard/account_report_partner_balance.py (+1/-1) account/wizard/account_report_partner_ledger.py (+1/-1) account/wizard/account_report_profit_loss.py (+1/-1) account/wizard/account_tax_chart.py (+9/-9) account/wizard/account_validate_account_move.py (+3/-0) account/wizard/account_vat.py (+3/-0) account_analytic_plans/wizard/account_crossovered_analytic.py (+3/-1) account_coda/wizard/account_coda_import.py (+10/-10) account_followup/wizard/account_followup_print.py (+2/-2) account_invoice_layout/report/special_message_invoice.py (+4/-1) auction/wizard/auction_lots_invoice.py (+2/-2) hr_recruitment/wizard/hr_recruitment_phonecall.py (+5/-5) hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py (+9/-9) lunch/wizard/lunch_order_confirm.py (+2/-2) point_of_sale/wizard/pos_payment.py (+3/-0) point_of_sale/wizard/pos_return.py (+2/-2) product/wizard/product_price.py (+2/-0) product_margin/product_margin_view.xml (+3/-0) project/wizard/project_task_delegate.py (+2/-0) project_gtd/wizard/project_gtd_fill.py (+3/-3) project_long_term/wizard/project_compute_phases.py (+5/-5) project_long_term/wizard/project_compute_tasks.py (+2/-2) stock/wizard/stock_move.py (+4/-4) |
To merge this branch: | bzr merge lp:~openerp-commiter/openobject-addons/dev-addons2-rha1 |
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenERP Core Team | Pending | ||
Review via email: mp+49781@code.launchpad.net |
Commit message
Description of the change
product_margin: group by doesn't work
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 'account/report/account_balance.py' |
2 | --- account/report/account_balance.py 2011-01-24 10:46:10 +0000 |
3 | +++ account/report/account_balance.py 2011-02-15 10:47:19 +0000 |
4 | @@ -71,6 +71,8 @@ |
5 | def lines(self, form, ids=[], done=None):#, level=1): |
6 | def _process_child(accounts, disp_acc, parent): |
7 | account_rec = [acct for acct in accounts if acct['id']==parent][0] |
8 | + if isinstance(account_rec['parent_id'], tuple): |
9 | + account_rec['parent_id'] = account_rec['parent_id'][0] |
10 | currency_obj = self.pool.get('res.currency') |
11 | acc_id = self.pool.get('account.account').browse(self.cr, self.uid, account_rec['id']) |
12 | currency = acc_id.currency_id and acc_id.currency_id or acc_id.company_id.currency_id |
13 | |
14 | === modified file 'account/wizard/account_automatic_reconcile.py' |
15 | --- account/wizard/account_automatic_reconcile.py 2011-01-14 00:11:01 +0000 |
16 | +++ account/wizard/account_automatic_reconcile.py 2011-02-15 10:47:19 +0000 |
17 | @@ -144,6 +144,9 @@ |
18 | if context is None: |
19 | context = {} |
20 | form = self.read(cr, uid, ids, [])[0] |
21 | + for m2o_field in ['journal_id','period_id','writeoff_acc_id']: |
22 | + if form[m2o_field] and isinstance(form[m2o_field], tuple): |
23 | + form[m2o_field] = form[m2o_field][0] |
24 | max_amount = form.get('max_amount', False) and form.get('max_amount') or 0.0 |
25 | power = form['power'] |
26 | allow_write_off = form['allow_write_off'] |
27 | @@ -252,4 +255,4 @@ |
28 | |
29 | account_automatic_reconcile() |
30 | |
31 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
32 | \ No newline at end of file |
33 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
34 | |
35 | === modified file 'account/wizard/account_change_currency.py' |
36 | --- account/wizard/account_change_currency.py 2011-01-14 00:11:01 +0000 |
37 | +++ account/wizard/account_change_currency.py 2011-02-15 10:47:19 +0000 |
38 | @@ -45,8 +45,8 @@ |
39 | obj_currency = self.pool.get('res.currency') |
40 | if context is None: |
41 | context = {} |
42 | - data = self.read(cr, uid, ids)[0] |
43 | - new_currency = data['currency_id'] |
44 | + data = self.browse(cr, uid, ids)[0] |
45 | + new_currency = data.currency_id.id |
46 | |
47 | invoice = obj_inv.browse(cr, uid, context['active_id'], context=context) |
48 | if invoice.currency_id.id == new_currency: |
49 | @@ -76,4 +76,4 @@ |
50 | |
51 | account_change_currency() |
52 | |
53 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
54 | \ No newline at end of file |
55 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
56 | |
57 | === modified file 'account/wizard/account_chart.py' |
58 | --- account/wizard/account_chart.py 2011-01-14 00:11:01 +0000 |
59 | +++ account/wizard/account_chart.py 2011-02-15 10:47:19 +0000 |
60 | @@ -79,17 +79,17 @@ |
61 | fy_obj = self.pool.get('account.fiscalyear') |
62 | if context is None: |
63 | context = {} |
64 | - data = self.read(cr, uid, ids, [], context=context)[0] |
65 | + data = self.browse(cr, uid, ids, context=context)[0] |
66 | result = mod_obj.get_object_reference(cr, uid, 'account', 'action_account_tree') |
67 | id = result and result[1] or False |
68 | result = act_obj.read(cr, uid, [id], context=context)[0] |
69 | result['periods'] = [] |
70 | - if data['period_from'] and data['period_to']: |
71 | - result['periods'] = period_obj.build_ctx_periods(cr, uid, data['period_from'], data['period_to']) |
72 | - result['context'] = str({'fiscalyear': data['fiscalyear'], 'periods': result['periods'], \ |
73 | - 'state': data['target_move']}) |
74 | - if data['fiscalyear']: |
75 | - result['name'] += ':' + fy_obj.read(cr, uid, [data['fiscalyear']], context=context)[0]['code'] |
76 | + if data.period_from and data.period_to: |
77 | + result['periods'] = period_obj.build_ctx_periods(cr, uid, data.period_from.id, data.period_to.id) |
78 | + result['context'] = str({'fiscalyear': data.fiscalyear.id, 'periods': result['periods'], \ |
79 | + 'state': data.target_move}) |
80 | + if data.fiscalyear: |
81 | + result['name'] += ':' + fy_obj.read(cr, uid, [data.fiscalyear.id], context=context)[0]['code'] |
82 | return result |
83 | |
84 | _defaults = { |
85 | |
86 | === modified file 'account/wizard/account_fiscalyear_close.py' |
87 | --- account/wizard/account_fiscalyear_close.py 2011-01-14 00:11:01 +0000 |
88 | +++ account/wizard/account_fiscalyear_close.py 2011-02-15 10:47:19 +0000 |
89 | @@ -56,7 +56,10 @@ |
90 | obj_acc_account = self.pool.get('account.account') |
91 | obj_acc_journal_period = self.pool.get('account.journal.period') |
92 | |
93 | - data = self.read(cr, uid, ids, context=context) |
94 | + data = self.read(cr, uid, ids, context=context) |
95 | + for m2o_field in ['fy_id','fy2_id','journal_id','period_id']: |
96 | + if isinstance(data[0][m2o_field], tuple): |
97 | + data[0][m2o_field] = data[0][m2o_field][0] |
98 | |
99 | if context is None: |
100 | context = {} |
101 | |
102 | === modified file 'account/wizard/account_fiscalyear_close_state.py' |
103 | --- account/wizard/account_fiscalyear_close_state.py 2011-01-14 00:11:01 +0000 |
104 | +++ account/wizard/account_fiscalyear_close_state.py 2011-02-15 10:47:19 +0000 |
105 | @@ -40,8 +40,8 @@ |
106 | @param ids: List of Account fiscalyear close state’s IDs |
107 | |
108 | """ |
109 | - for data in self.read(cr, uid, ids, context=context): |
110 | - fy_id = data['fy_id'] |
111 | + for data in self.browse(cr, uid, ids, context=context): |
112 | + fy_id = data.fy_id.id |
113 | |
114 | cr.execute('UPDATE account_journal_period ' \ |
115 | 'SET state = %s ' \ |
116 | @@ -61,4 +61,4 @@ |
117 | |
118 | account_fiscalyear_close_state() |
119 | |
120 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
121 | \ No newline at end of file |
122 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
123 | |
124 | === modified file 'account/wizard/account_invoice_refund.py' |
125 | --- account/wizard/account_invoice_refund.py 2011-01-14 00:11:01 +0000 |
126 | +++ account/wizard/account_invoice_refund.py 2011-02-15 10:47:19 +0000 |
127 | @@ -95,6 +95,8 @@ |
128 | description = False |
129 | company = res_users_obj.browse(cr, uid, uid, context=context).company_id |
130 | journal_id = form.get('journal_id', False) |
131 | + if isinstance(journal_id, tuple): |
132 | + journal_id = journal_id[0] |
133 | for inv in inv_obj.browse(cr, uid, context.get('active_ids'), context=context): |
134 | if inv.state in ['draft', 'proforma2', 'cancel']: |
135 | raise osv.except_osv(_('Error !'), _('Can not %s draft/proforma/cancel invoice.') % (mode)) |
136 | @@ -102,6 +104,8 @@ |
137 | raise osv.except_osv(_('Error !'), _('Can not %s invoice which is already reconciled, invoice should be unreconciled first. You can only Refund this invoice') % (mode)) |
138 | if form['period']: |
139 | period = form['period'] |
140 | + if isinstance(period, tuple): |
141 | + period = period[0] |
142 | else: |
143 | period = inv.period_id and inv.period_id.id or False |
144 | |
145 | @@ -217,4 +221,4 @@ |
146 | |
147 | account_invoice_refund() |
148 | |
149 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
150 | \ No newline at end of file |
151 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
152 | |
153 | === modified file 'account/wizard/account_move_bank_reconcile.py' |
154 | --- account/wizard/account_move_bank_reconcile.py 2011-01-14 00:11:01 +0000 |
155 | +++ account/wizard/account_move_bank_reconcile.py 2011-02-15 10:47:19 +0000 |
156 | @@ -41,15 +41,15 @@ |
157 | """ |
158 | if context is None: |
159 | context = {} |
160 | - data = self.read(cr, uid, ids, context=context)[0] |
161 | + data = self.browse(cr, uid, ids, context=context)[0] |
162 | cr.execute('select default_credit_account_id \ |
163 | - from account_journal where id=%s', (data['journal_id'],)) |
164 | + from account_journal where id=%s', (data.journal_id.id,)) |
165 | account_id = cr.fetchone()[0] |
166 | if not account_id: |
167 | raise osv.except_osv(_('Error'), _('You have to define \ |
168 | the bank account\nin the journal definition for reconciliation.')) |
169 | return { |
170 | - 'domain': "[('journal_id','=',%d), ('account_id','=',%d), ('state','<>','draft')]" % (data['journal_id'], account_id), |
171 | + 'domain': "[('journal_id','=',%d), ('account_id','=',%d), ('state','<>','draft')]" % (data.journal_id.id, account_id), |
172 | 'name': _('Standard Encoding'), |
173 | 'view_type': 'form', |
174 | 'view_mode': 'tree,form', |
175 | @@ -61,4 +61,4 @@ |
176 | |
177 | account_move_bank_reconcile() |
178 | |
179 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
180 | \ No newline at end of file |
181 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
182 | |
183 | === modified file 'account/wizard/account_move_journal.py' |
184 | --- account/wizard/account_move_journal.py 2011-01-17 11:40:49 +0000 |
185 | +++ account/wizard/account_move_journal.py 2011-02-15 10:47:19 +0000 |
186 | @@ -148,7 +148,7 @@ |
187 | |
188 | journal_id = self._get_journal(cr, uid, context) |
189 | period_id = self._get_period(cr, uid, context) |
190 | - target_move = self.read(cr, uid, ids, [])[0]['target_move'] |
191 | + target_move = self.read(cr, uid, ids, [], context=context)[0]['target_move'] |
192 | |
193 | name = _("Journal Items") |
194 | if journal_id: |
195 | |
196 | === modified file 'account/wizard/account_move_line_reconcile_select.py' |
197 | --- account/wizard/account_move_line_reconcile_select.py 2011-01-14 00:11:01 +0000 |
198 | +++ account/wizard/account_move_line_reconcile_select.py 2011-02-15 10:47:19 +0000 |
199 | @@ -39,9 +39,9 @@ |
200 | @return: dictionary of Open account move line window for reconcile on given account id |
201 | |
202 | """ |
203 | - data = self.read(cr, uid, ids, context=context)[0] |
204 | + data = self.browse(cr, uid, ids, context=context)[0] |
205 | return { |
206 | - 'domain': "[('account_id','=',%d),('reconcile_id','=',False),('state','<>','draft')]" % data['account_id'], |
207 | + 'domain': "[('account_id','=',%d),('reconcile_id','=',False),('state','<>','draft')]" % data.account_id.id, |
208 | 'name': _('Reconciliation'), |
209 | 'view_type': 'form', |
210 | 'view_mode': 'tree,form', |
211 | @@ -52,4 +52,4 @@ |
212 | |
213 | account_move_line_reconcile_select() |
214 | |
215 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
216 | \ No newline at end of file |
217 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
218 | |
219 | === modified file 'account/wizard/account_move_line_unreconcile_select.py' |
220 | --- account/wizard/account_move_line_unreconcile_select.py 2011-01-14 00:11:01 +0000 |
221 | +++ account/wizard/account_move_line_unreconcile_select.py 2011-02-15 10:47:19 +0000 |
222 | @@ -28,9 +28,9 @@ |
223 | 'account_id': fields.many2one('account.account','Account',required=True), |
224 | } |
225 | def action_open_window(self, cr, uid, ids, context=None): |
226 | - data = self.read(cr, uid, ids, context=context)[0] |
227 | + data = self.browse(cr, uid, ids, context=context)[0] |
228 | return { |
229 | - 'domain': "[('account_id','=',%d),('reconcile_id','<>',False),('state','<>','draft')]" % data['account_id'], |
230 | + 'domain': "[('account_id','=',%d),('reconcile_id','<>',False),('state','<>','draft')]" % data.account_id.id, |
231 | 'name': 'Unreconciliation', |
232 | 'view_type': 'form', |
233 | 'view_mode': 'tree,form', |
234 | @@ -41,4 +41,4 @@ |
235 | |
236 | account_move_line_unreconcile_select() |
237 | |
238 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
239 | \ No newline at end of file |
240 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
241 | |
242 | === modified file 'account/wizard/account_open_closed_fiscalyear.py' |
243 | --- account/wizard/account_open_closed_fiscalyear.py 2011-01-14 00:11:01 +0000 |
244 | +++ account/wizard/account_open_closed_fiscalyear.py 2011-02-15 10:47:19 +0000 |
245 | @@ -35,6 +35,8 @@ |
246 | move_obj = self.pool.get('account.move') |
247 | |
248 | data = self.read(cr, uid, ids, [], context=context)[0] |
249 | + if isinstance(data['fyear_id'], tuple): |
250 | + data['fyear_id'] = data['fyear_id'][0] |
251 | data_fyear = fy_obj.browse(cr, uid, data['fyear_id'], context=context) |
252 | if not data_fyear.end_journal_period_id: |
253 | raise osv.except_osv(_('Error !'), _('No End of year journal defined for the fiscal year')) |
254 | |
255 | === modified file 'account/wizard/account_reconcile.py' |
256 | --- account/wizard/account_reconcile.py 2011-01-14 00:11:01 +0000 |
257 | +++ account/wizard/account_reconcile.py 2011-02-15 10:47:19 +0000 |
258 | @@ -152,13 +152,13 @@ |
259 | period_obj = self.pool.get('account.period') |
260 | if context is None: |
261 | context = {} |
262 | - data = self.read(cr, uid, ids,context=context)[0] |
263 | - account_id = data['writeoff_acc_id'] |
264 | - context['date_p'] = data['date_p'] |
265 | - journal_id = data['journal_id'] |
266 | - context['comment'] = data['comment'] |
267 | - if data['analytic_id']: |
268 | - context['analytic_id'] = data['analytic_id'] |
269 | + data = self.browse(cr, uid, ids,context=context)[0] |
270 | + account_id = data.writeoff_acc_id.id |
271 | + context['date_p'] = data.date_p |
272 | + journal_id = data.journal_id.id |
273 | + context['comment'] = data.comment |
274 | + if data.analytic_id: |
275 | + context['analytic_id'] = data.analytic_id.id |
276 | if context['date_p']: |
277 | date = context['date_p'] |
278 | |
279 | @@ -173,4 +173,4 @@ |
280 | |
281 | account_move_line_reconcile_writeoff() |
282 | |
283 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
284 | \ No newline at end of file |
285 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
286 | |
287 | === modified file 'account/wizard/account_report_balance_sheet.py' |
288 | --- account/wizard/account_report_balance_sheet.py 2011-01-14 00:11:01 +0000 |
289 | +++ account/wizard/account_report_balance_sheet.py 2011-02-15 10:47:19 +0000 |
290 | @@ -65,7 +65,8 @@ |
291 | def _print_report(self, cr, uid, ids, data, context=None): |
292 | if context is None: |
293 | context = {} |
294 | - data['form'].update(self.read(cr, uid, ids, ['display_type','reserve_account_id'])[0]) |
295 | + record = self.browse(cr, uid, ids, context=context)[0] |
296 | + data['form'].update({'display_type':record.display_type, 'reserve_account_id':record.reserve_account_id.id}) |
297 | if not data['form']['reserve_account_id']: |
298 | raise osv.except_osv(_('Warning'),_('Please define the Reserve and Profit/Loss account for current user company !')) |
299 | data = self.pre_print_report(cr, uid, ids, data, context=context) |
300 | |
301 | === modified file 'account/wizard/account_report_common.py' |
302 | --- account/wizard/account_report_common.py 2011-01-14 00:11:01 +0000 |
303 | +++ account/wizard/account_report_common.py 2011-02-15 10:47:19 +0000 |
304 | @@ -131,7 +131,10 @@ |
305 | data = {} |
306 | data['ids'] = context.get('active_ids', []) |
307 | data['model'] = context.get('active_model', 'ir.ui.menu') |
308 | - data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to', 'fiscalyear_id', 'journal_ids', 'period_from', 'period_to', 'filter', 'chart_account_id', 'target_move'])[0] |
309 | + data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to', 'fiscalyear_id', 'journal_ids', 'period_from', 'period_to', 'filter', 'chart_account_id', 'target_move'], context=context)[0] |
310 | + for field in data['form'].keys(): |
311 | + if isinstance(data['form'][field], tuple): |
312 | + data['form'][field] = data['form'][field][0] |
313 | used_context = self._build_contexts(cr, uid, ids, data, context=context) |
314 | data['form']['periods'] = used_context.get('periods', False) and used_context['periods'] or [] |
315 | data['form']['used_context'] = used_context |
316 | |
317 | === modified file 'account/wizard/account_report_general_ledger.py' |
318 | --- account/wizard/account_report_general_ledger.py 2011-01-14 00:11:01 +0000 |
319 | +++ account/wizard/account_report_general_ledger.py 2011-02-15 10:47:19 +0000 |
320 | @@ -50,7 +50,7 @@ |
321 | if context is None: |
322 | context = {} |
323 | data = self.pre_print_report(cr, uid, ids, data, context=context) |
324 | - data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby'])[0]) |
325 | + data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby'], context=context)[0]) |
326 | if not data['form']['fiscalyear_id']:# GTK client problem onchange does not consider in save record |
327 | data['form'].update({'initial_balance': False}) |
328 | if data['form']['landscape']: |
329 | |
330 | === modified file 'account/wizard/account_report_partner_balance.py' |
331 | --- account/wizard/account_report_partner_balance.py 2011-01-14 00:11:01 +0000 |
332 | +++ account/wizard/account_report_partner_balance.py 2011-02-15 10:47:19 +0000 |
333 | @@ -42,7 +42,7 @@ |
334 | if context is None: |
335 | context = {} |
336 | data = self.pre_print_report(cr, uid, ids, data, context=context) |
337 | - data['form'].update(self.read(cr, uid, ids, ['display_partner'])[0]) |
338 | + data['form'].update(self.read(cr, uid, ids, ['display_partner'], context=context)[0]) |
339 | return { |
340 | 'type': 'ir.actions.report.xml', |
341 | 'report_name': 'account.partner.balance', |
342 | |
343 | === modified file 'account/wizard/account_report_partner_ledger.py' |
344 | --- account/wizard/account_report_partner_ledger.py 2011-01-14 00:11:01 +0000 |
345 | +++ account/wizard/account_report_partner_ledger.py 2011-02-15 10:47:19 +0000 |
346 | @@ -47,7 +47,7 @@ |
347 | if context is None: |
348 | context = {} |
349 | data = self.pre_print_report(cr, uid, ids, data, context=context) |
350 | - data['form'].update(self.read(cr, uid, ids, ['initial_balance', 'reconcil', 'page_split', 'amount_currency'])[0]) |
351 | + data['form'].update(self.read(cr, uid, ids, ['initial_balance', 'reconcil', 'page_split', 'amount_currency'], context=context)[0]) |
352 | if data['form']['page_split']: |
353 | return { |
354 | 'type': 'ir.actions.report.xml', |
355 | |
356 | === modified file 'account/wizard/account_report_profit_loss.py' |
357 | --- account/wizard/account_report_profit_loss.py 2011-01-14 00:11:01 +0000 |
358 | +++ account/wizard/account_report_profit_loss.py 2011-02-15 10:47:19 +0000 |
359 | @@ -42,7 +42,7 @@ |
360 | if context is None: |
361 | context = {} |
362 | data = self.pre_print_report(cr, uid, ids, data, context=context) |
363 | - data['form'].update(self.read(cr, uid, ids, ['display_type'])[0]) |
364 | + data['form'].update(self.read(cr, uid, ids, ['display_type'], context=context)[0]) |
365 | if data['form']['display_type']: |
366 | return { |
367 | 'type': 'ir.actions.report.xml', |
368 | |
369 | === modified file 'account/wizard/account_tax_chart.py' |
370 | --- account/wizard/account_tax_chart.py 2011-01-14 00:11:01 +0000 |
371 | +++ account/wizard/account_tax_chart.py 2011-02-15 10:47:19 +0000 |
372 | @@ -54,20 +54,20 @@ |
373 | period_obj = self.pool.get('account.period') |
374 | if context is None: |
375 | context = {} |
376 | - data = self.read(cr, uid, ids, [], context=context)[0] |
377 | + data = self.browse(cr, uid, ids, context=context)[0] |
378 | result = mod_obj.get_object_reference(cr, uid, 'account', 'action_tax_code_tree') |
379 | id = result and result[1] or False |
380 | result = act_obj.read(cr, uid, [id], context=context)[0] |
381 | - if data['period_id']: |
382 | - fiscalyear_id = period_obj.read(cr, uid, [data['period_id']], context=context)[0]['fiscalyear_id'][0] |
383 | - result['context'] = str({'period_id': data['period_id'], \ |
384 | + if data.period_id: |
385 | + fiscalyear_id = period_obj.read(cr, uid, [data.period_id.id], context=context)[0]['fiscalyear_id'][0] |
386 | + result['context'] = str({'period_id': data.period_id.id, \ |
387 | 'fiscalyear_id': fiscalyear_id, \ |
388 | - 'state': data['target_move']}) |
389 | + 'state': data.target_move}) |
390 | else: |
391 | - result['context'] = str({'state': data['target_move']}) |
392 | + result['context'] = str({'state': data.target_move}) |
393 | |
394 | - if data['period_id']: |
395 | - period_code = period_obj.read(cr, uid, [data['period_id']], context=context)[0]['code'] |
396 | + if data.period_id: |
397 | + period_code = period_obj.read(cr, uid, [data.period_id.id], context=context)[0]['code'] |
398 | result['name'] += period_code and (':' + period_code) or '' |
399 | return result |
400 | |
401 | @@ -78,4 +78,4 @@ |
402 | |
403 | account_tax_chart() |
404 | |
405 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
406 | \ No newline at end of file |
407 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
408 | |
409 | === modified file 'account/wizard/account_validate_account_move.py' |
410 | --- account/wizard/account_validate_account_move.py 2011-01-14 00:11:01 +0000 |
411 | +++ account/wizard/account_validate_account_move.py 2011-02-15 10:47:19 +0000 |
412 | @@ -34,6 +34,9 @@ |
413 | if context is None: |
414 | context = {} |
415 | data = self.read(cr, uid, ids, context=context)[0] |
416 | + for field in data.keys(): |
417 | + if isinstance(data[field], tuple): |
418 | + data[field] = data[field][0] |
419 | ids_move = obj_move.search(cr, uid, [('state','=','draft'),('journal_id','=',data['journal_id']),('period_id','=',data['period_id'])]) |
420 | if not ids_move: |
421 | raise osv.except_osv(_('Warning'), _('Specified Journal does not have any account move entries in draft state for this period')) |
422 | |
423 | === modified file 'account/wizard/account_vat.py' |
424 | --- account/wizard/account_vat.py 2011-01-14 00:11:01 +0000 |
425 | +++ account/wizard/account_vat.py 2011-02-15 10:47:19 +0000 |
426 | @@ -47,6 +47,9 @@ |
427 | datas = {'ids': context.get('active_ids', [])} |
428 | datas['model'] = 'account.tax.code' |
429 | datas['form'] = self.read(cr, uid, ids)[0] |
430 | + for field in datas['form'].keys(): |
431 | + if isinstance(datas['form'][field], tuple): |
432 | + datas['form'][field] = datas['form'][field][0] |
433 | datas['form']['company_id'] = self.pool.get('account.tax.code').browse(cr, uid, [datas['form']['chart_tax_id']], context=context)[0].company_id.id |
434 | return { |
435 | 'type': 'ir.actions.report.xml', |
436 | |
437 | === modified file 'account_analytic_plans/wizard/account_crossovered_analytic.py' |
438 | --- account_analytic_plans/wizard/account_crossovered_analytic.py 2011-01-14 00:11:01 +0000 |
439 | +++ account_analytic_plans/wizard/account_crossovered_analytic.py 2011-02-15 10:47:19 +0000 |
440 | @@ -45,6 +45,8 @@ |
441 | acc_ids = [x[0] for x in res] |
442 | |
443 | data = self.read(cr, uid, ids, [], context=context)[0] |
444 | + if isinstance(data['ref'],tuple): |
445 | + data['ref'] = data['ref'][0] |
446 | |
447 | obj_acc = self.pool.get('account.analytic.account').browse(cr, uid, data['ref'], context=context) |
448 | name = obj_acc.name |
449 | @@ -72,4 +74,4 @@ |
450 | |
451 | account_crossovered_analytic() |
452 | |
453 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
454 | \ No newline at end of file |
455 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
456 | |
457 | === modified file 'account_coda/wizard/account_coda_import.py' |
458 | --- account_coda/wizard/account_coda_import.py 2011-01-14 00:11:01 +0000 |
459 | +++ account_coda/wizard/account_coda_import.py 2011-02-15 10:47:19 +0000 |
460 | @@ -69,14 +69,14 @@ |
461 | if context is None: |
462 | context = {} |
463 | |
464 | - data = self.read(cr, uid, ids)[0] |
465 | + data = self.browse(cr, uid, ids)[0] |
466 | |
467 | - codafile = data['coda'] |
468 | - journal_code = journal_obj.browse(cr, uid, data['journal_id'], context=context).code |
469 | + codafile = data.coda |
470 | + journal_code = journal_obj.browse(cr, uid, data.journal_id.id, context=context).code |
471 | |
472 | period = account_period_obj.find(cr, uid, context=context)[0] |
473 | - def_pay_acc = data['def_payable'] |
474 | - def_rec_acc = data['def_receivable'] |
475 | + def_pay_acc = data.def_payable.id |
476 | + def_rec_acc = data.def_receivable.id |
477 | |
478 | err_log = "Errors:\n------\n" |
479 | nb_err=0 |
480 | @@ -96,7 +96,7 @@ |
481 | bank_statement["bank_statement_line"]={} |
482 | bank_statement_lines = {} |
483 | bank_statement['date'] = str2date(line[5:11]) |
484 | - bank_statement['journal_id']=data['journal_id'] |
485 | + bank_statement['journal_id']=data.journal_id.id |
486 | period_id = account_period_obj.search(cr, uid, [('date_start', '<=', time.strftime('%Y-%m-%d', time.strptime(bank_statement['date'], "%y/%m/%d"))), ('date_stop', '>=', time.strftime('%Y-%m-%d', time.strptime(bank_statement['date'], "%y/%m/%d")))]) |
487 | bank_statement['period_id'] = period_id and period_id[0] or False |
488 | bank_statement['state']='draft' |
489 | @@ -144,7 +144,7 @@ |
490 | bank_statement["bank_statement_line"]=bank_statement_lines |
491 | elif line[1] == '2': |
492 | st_line_name = line[2:6] |
493 | - bank_statement_lines[st_line_name].update({'account_id': data['awaiting_account']}) |
494 | + bank_statement_lines[st_line_name].update({'account_id': data.awaiting_account.id}) |
495 | |
496 | elif line[1] == '3': |
497 | # movement data record 3.1 |
498 | @@ -165,7 +165,7 @@ |
499 | else: |
500 | nb_err += 1 |
501 | err_log += _('The bank account %s is not defined for the partner %s.\n')%(cntry_number, contry_name) |
502 | - bank_statement_lines[st_line_name].update({'account_id': data['awaiting_account']}) |
503 | + bank_statement_lines[st_line_name].update({'account_id': data.awaiting_account.id}) |
504 | |
505 | bank_statement["bank_statement_line"]=bank_statement_lines |
506 | elif line[0]=='3': |
507 | @@ -296,7 +296,7 @@ |
508 | 'name': codafile, |
509 | 'statement_ids': [(6, 0, bkst_list,)], |
510 | 'note': str_log1+str_not+std_log+err_log, |
511 | - 'journal_id': data['journal_id'], |
512 | + 'journal_id': data.journal_id.id, |
513 | 'date': time.strftime("%Y-%m-%d"), |
514 | 'user_id': uid, |
515 | }) |
516 | @@ -336,4 +336,4 @@ |
517 | |
518 | account_coda_import() |
519 | |
520 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
521 | \ No newline at end of file |
522 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
523 | |
524 | === modified file 'account_followup/wizard/account_followup_print.py' |
525 | --- account_followup/wizard/account_followup_print.py 2011-01-14 00:11:01 +0000 |
526 | +++ account_followup/wizard/account_followup_print.py 2011-02-15 10:47:19 +0000 |
527 | @@ -48,10 +48,10 @@ |
528 | |
529 | if context is None: |
530 | context = {} |
531 | - data = self.read(cr, uid, ids, [], context=context)[0] |
532 | + data = self.browse(cr, uid, ids, context=context)[0] |
533 | model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_followup_print_all')], context=context) |
534 | resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] |
535 | - context.update({'followup_id': data['followup_id'], 'date':data['date']}) |
536 | + context.update({'followup_id': data.followup_id.id, 'date':data.date}) |
537 | return { |
538 | 'name': _('Select Partners'), |
539 | 'view_type': 'form', |
540 | |
541 | === modified file 'account_invoice_layout/report/special_message_invoice.py' |
542 | --- account_invoice_layout/report/special_message_invoice.py 2011-01-14 00:11:01 +0000 |
543 | +++ account_invoice_layout/report/special_message_invoice.py 2011-02-15 10:47:19 +0000 |
544 | @@ -37,7 +37,10 @@ |
545 | self.context = context |
546 | |
547 | def spcl_msg(self, form): |
548 | - account_msg_data = pooler.get_pool(self.cr.dbname).get('notify.message').browse(self.cr, self.uid, form['message']) |
549 | + msg_id = form['message'] |
550 | + if isinstance(msg_id, (tuple,list)): |
551 | + msg_id = msg_id[0] |
552 | + account_msg_data = pooler.get_pool(self.cr.dbname).get('notify.message').browse(self.cr, self.uid, msg_id) |
553 | msg = account_msg_data.msg |
554 | return msg |
555 | |
556 | |
557 | === modified file 'auction/wizard/auction_lots_invoice.py' |
558 | --- auction/wizard/auction_lots_invoice.py 2011-01-14 00:11:01 +0000 |
559 | +++ auction/wizard/auction_lots_invoice.py 2011-02-15 10:47:19 +0000 |
560 | @@ -46,7 +46,7 @@ |
561 | @param context: A standard dictionary |
562 | @return: A dictionary which of fields with values. |
563 | """ |
564 | - if context is None: |
565 | + if context is None: |
566 | context = {} |
567 | res = super(auction_lots_invoice, self).default_get(cr, uid, fields, context=context) |
568 | service = netsvc.LocalService("object_proxy") |
569 | @@ -103,7 +103,7 @@ |
570 | @param ids: List of Auction lots make invoice buyer’s IDs |
571 | @return: dictionary of account invoice form. |
572 | """ |
573 | - if context is None: |
574 | + if context is None: |
575 | context = {} |
576 | service = netsvc.LocalService("object_proxy") |
577 | datas = {'ids' : context.get('active_ids',[])} |
578 | |
579 | === modified file 'hr_recruitment/wizard/hr_recruitment_phonecall.py' |
580 | --- hr_recruitment/wizard/hr_recruitment_phonecall.py 2011-01-14 00:11:01 +0000 |
581 | +++ hr_recruitment/wizard/hr_recruitment_phonecall.py 2011-02-15 10:47:19 +0000 |
582 | @@ -69,7 +69,7 @@ |
583 | phonecall_case_obj = self.pool.get('crm.phonecall') |
584 | if context is None: |
585 | context = {} |
586 | - form = self.read(cr, uid, ids, [], context=context)[0] |
587 | + form = self.browse(cr, uid, ids, context=context)[0] |
588 | result = mod_obj._get_id(cr, uid, 'crm', 'view_crm_case_phonecalls_filter') |
589 | res = mod_obj.read(cr, uid, result, ['res_id'], context=context) |
590 | # Select the view |
591 | @@ -85,10 +85,10 @@ |
592 | #TODO: Take other info from job |
593 | new_phonecall_id = phonecall_case_obj.create(cr, uid, { |
594 | 'name': job.name, |
595 | - 'user_id': form['user_id'], |
596 | - 'categ_id': form['category_id'], |
597 | - 'description': form['note'], |
598 | - 'date': form['deadline'], |
599 | + 'user_id': form.user_id.id, |
600 | + 'categ_id': form.category_id.id, |
601 | + 'description': form.note, |
602 | + 'date': form.deadline, |
603 | 'description': job.description, |
604 | 'partner_id': job.partner_id.id, |
605 | 'partner_address_id': job.partner_address_id.id, |
606 | |
607 | === modified file 'hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py' |
608 | --- hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py 2011-01-14 00:11:01 +0000 |
609 | +++ hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py 2011-02-15 10:47:19 +0000 |
610 | @@ -63,13 +63,13 @@ |
611 | if context is None: |
612 | context = {} |
613 | result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter') |
614 | - data = self.read(cr, uid, ids, [], context=context)[0] |
615 | + data = self.browse(cr, uid, ids, context=context)[0] |
616 | |
617 | account_ids = {} |
618 | for line in self.pool.get('account.analytic.line').browse(cr, uid, context['active_ids'], context=context): |
619 | account_ids[line.account_id.id] = True |
620 | |
621 | - account_ids = account_ids.keys() #data['accounts'] |
622 | + account_ids = account_ids.keys() #data.accounts |
623 | for account in analytic_account_obj.browse(cr, uid, account_ids, context=context): |
624 | partner = account.partner_id |
625 | if (not partner) or not (account.pricelist_id): |
626 | @@ -121,17 +121,17 @@ |
627 | factor_name = '' |
628 | factor = invoice_factor_obj.browse(cr, uid, factor_id, context2) |
629 | |
630 | - if not data['product']: |
631 | + if not data.product: |
632 | if factor.customer_name: |
633 | factor_name = product.name+' - '+factor.customer_name |
634 | else: |
635 | factor_name = product.name |
636 | else: |
637 | - factor_name = product_obj.name_get(cr, uid, [data['product']], context=context)[0][1] |
638 | + factor_name = product_obj.name_get(cr, uid, [data.product.id], context=context)[0][1] |
639 | |
640 | if account.pricelist_id: |
641 | pl = account.pricelist_id.id |
642 | - price = pro_price_obj.price_get(cr,uid,[pl], data['product'] or product_id, qty or 1.0, account.partner_id.id)[pl] |
643 | + price = pro_price_obj.price_get(cr,uid,[pl], data.product.id or product_id, qty or 1.0, account.partner_id.id)[pl] |
644 | else: |
645 | price = 0.0 |
646 | |
647 | @@ -145,7 +145,7 @@ |
648 | 'invoice_line_tax_id': [(6,0,tax )], |
649 | 'invoice_id': last_invoice, |
650 | 'name': factor_name, |
651 | - 'product_id': data['product'] or product_id, |
652 | + 'product_id': data.product.id or product_id, |
653 | 'invoice_line_tax_id': [(6,0,tax)], |
654 | 'uos_id': product.uom_id.id, |
655 | 'account_id': account_id, |
656 | @@ -162,14 +162,14 @@ |
657 | for line in line_ids: |
658 | # set invoice_line_note |
659 | details = [] |
660 | - if data['date']: |
661 | + if data.date: |
662 | details.append(line['date']) |
663 | - if data['time']: |
664 | + if data.time: |
665 | if line['product_uom_id']: |
666 | details.append("%s %s" % (line['unit_amount'], product_uom_obj.browse(cr, uid, [line['product_uom_id']],context2)[0].name)) |
667 | else: |
668 | details.append("%s" % (line['unit_amount'], )) |
669 | - if data['name']: |
670 | + if data.name: |
671 | details.append(line['name']) |
672 | note.append(u' - '.join(map(lambda x: unicode(x) or '',details))) |
673 | |
674 | |
675 | === modified file 'lunch/wizard/lunch_order_confirm.py' |
676 | --- lunch/wizard/lunch_order_confirm.py 2011-01-14 00:11:01 +0000 |
677 | +++ lunch/wizard/lunch_order_confirm.py 2011-02-15 10:47:19 +0000 |
678 | @@ -46,8 +46,8 @@ |
679 | data = context and context.get('active_ids', []) or [] |
680 | order_ref = self.pool.get('lunch.order') |
681 | |
682 | - for confirm_obj in self.read(cr, uid, ids): |
683 | - order_ref.confirm(cr, uid, data, confirm_obj['confirm_cashbox'], context) |
684 | + for confirm_obj in self.browse(cr, uid, ids): |
685 | + order_ref.confirm(cr, uid, data, confirm_obj.confirm_cashbox.id, context) |
686 | return {'type': 'ir.actions.act_window_close'} |
687 | |
688 | lunch_order_confirm() |
689 | |
690 | === modified file 'point_of_sale/wizard/pos_payment.py' |
691 | --- point_of_sale/wizard/pos_payment.py 2011-01-24 16:13:46 +0000 |
692 | +++ point_of_sale/wizard/pos_payment.py 2011-02-15 10:47:19 +0000 |
693 | @@ -148,6 +148,9 @@ |
694 | order = order_obj.browse(cr, uid, active_id, context=context) |
695 | amount = order.amount_total - order.amount_paid |
696 | data = self.read(cr, uid, ids, context=context)[0] |
697 | + for m2o_field in ['product_id','pricelist_id','partner_id']: |
698 | + if data[m2o_field] and isinstance(data[m2o_field], (list,tuple)): |
699 | + data[m2o_field] = data[m2o_field][0] |
700 | if data['is_acc']: |
701 | amount = self.pool.get('product.product').browse(cr, uid, data['product_id'], context=context).list_price |
702 | |
703 | |
704 | === modified file 'point_of_sale/wizard/pos_return.py' |
705 | --- point_of_sale/wizard/pos_return.py 2011-01-14 00:11:01 +0000 |
706 | +++ point_of_sale/wizard/pos_return.py 2011-02-15 10:47:19 +0000 |
707 | @@ -353,8 +353,8 @@ |
708 | data = return_boj.read(cr,uid,return_id,[])[0] |
709 | |
710 | wf_service = netsvc.LocalService("workflow") |
711 | - self_data = self.read(cr, uid, ids)[0] |
712 | - order_obj.add_product(cr, uid, active_ids[0], self_data['product_id'], self_data['quantity'], context=context) |
713 | + self_data = self.browse(cr, uid, ids)[0] |
714 | + order_obj.add_product(cr, uid, active_ids[0], self_data.product_id.id, self_data.quantity, context=context) |
715 | |
716 | for order_id in order_obj.browse(cr, uid, active_ids, context=context): |
717 | prop_ids =property_obj.search(cr, uid, [('name', '=', 'property_stock_customer')]) |
718 | |
719 | === modified file 'product/wizard/product_price.py' |
720 | --- product/wizard/product_price.py 2011-01-14 00:11:01 +0000 |
721 | +++ product/wizard/product_price.py 2011-02-15 10:47:19 +0000 |
722 | @@ -53,6 +53,8 @@ |
723 | datas = {'ids': context.get('active_ids', [])} |
724 | res = self.read(cr, uid, ids, ['price_list','qty1', 'qty2','qty3','qty4','qty5'], context=context) |
725 | res = res and res[0] or {} |
726 | + if isinstance(res['price_list'], (tuple,list)): |
727 | + res['price_list'] = res['price_list'][0] |
728 | datas['form'] = res |
729 | return { |
730 | 'type': 'ir.actions.report.xml', |
731 | |
732 | === modified file 'product_margin/product_margin_view.xml' |
733 | --- product_margin/product_margin_view.xml 2011-01-14 00:11:01 +0000 |
734 | +++ product_margin/product_margin_view.xml 2011-02-15 10:47:19 +0000 |
735 | @@ -80,6 +80,9 @@ |
736 | <field name="expected_margin"/> |
737 | <field name="total_margin_rate" widget="progressbar"/> |
738 | <field name="expected_margin_rate" widget="progressbar"/> |
739 | + <field name="categ_id" invisible="1"/> |
740 | + <field name="uom_id" invisible="1"/> |
741 | + <field name="type" invisible="1"/> |
742 | </tree> |
743 | </field> |
744 | </record> |
745 | |
746 | === modified file 'project/wizard/project_task_delegate.py' |
747 | --- project/wizard/project_task_delegate.py 2011-01-14 00:11:01 +0000 |
748 | +++ project/wizard/project_task_delegate.py 2011-02-15 10:47:19 +0000 |
749 | @@ -105,6 +105,8 @@ |
750 | task_id = context.get('active_id', False) |
751 | task_pool = self.pool.get('project.task') |
752 | delegate_data = self.read(cr, uid, ids, context=context)[0] |
753 | + if isinstance(delegate_data['user_id'], tuple): |
754 | + delegate_data['user_id'] = delegate_data['user_id'][0] |
755 | delegate_data['name'] = tools.ustr(delegate_data['name']) |
756 | task_pool.do_delegate(cr, uid, task_id, delegate_data, context=context) |
757 | return {} |
758 | |
759 | === modified file 'project_gtd/wizard/project_gtd_fill.py' |
760 | --- project_gtd/wizard/project_gtd_fill.py 2011-01-14 00:11:01 +0000 |
761 | +++ project_gtd/wizard/project_gtd_fill.py 2011-02-15 10:47:19 +0000 |
762 | @@ -50,10 +50,10 @@ |
763 | def process(self, cr, uid, ids, context=None): |
764 | if not ids: |
765 | return {} |
766 | - data = self.read(cr, uid, ids, [], context=context) |
767 | - if not data[0]['task_ids']: |
768 | + data = self.browse(cr, uid, ids, context=context) |
769 | + if not data[0].task_ids: |
770 | return {} |
771 | - self.pool.get('project.task').write(cr, uid, data[0]['task_ids'], {'timebox_id':data[0]['timebox_to_id']}) |
772 | + self.pool.get('project.task').write(cr, uid, [x.id for x in data[0].task_ids], {'timebox_id':data[0].timebox_to_id.id}) |
773 | return {'type': 'ir.actions.act_window_close'} |
774 | |
775 | project_timebox_fill() |
776 | |
777 | === modified file 'project_long_term/wizard/project_compute_phases.py' |
778 | --- project_long_term/wizard/project_compute_phases.py 2011-01-14 00:11:01 +0000 |
779 | +++ project_long_term/wizard/project_compute_phases.py 2011-02-15 10:47:19 +0000 |
780 | @@ -45,12 +45,12 @@ |
781 | Compute the phases for scheduling. |
782 | """ |
783 | project_pool = self.pool.get('project.project') |
784 | - data = self.read(cr, uid, ids, [], context=context)[0] |
785 | - if not data['project_id'] and data['target_project'] == 'one': |
786 | + data = self.browse(cr, uid, ids, context=context)[0] |
787 | + if not data.project_id and data.target_project == 'one': |
788 | raise osv.except_osv(_('Error!'), _('Please Specify Project to be schedule')) |
789 | |
790 | - if data['project_id']: # If project mentioned find its phases |
791 | - project_ids = [data['project_id']] |
792 | + if data.project_id: # If project mentioned find its phases |
793 | + project_ids = [data.project_id.id] |
794 | else: # Else take all the draft,open,pending states phases |
795 | project_ids = project_pool.search(cr, uid, [], context=context) |
796 | |
797 | @@ -69,7 +69,7 @@ |
798 | id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id'] |
799 | result = act_obj.read(cr, uid, [id], context=context)[0] |
800 | result['target'] = 'current' |
801 | - result['context'] = {"search_default_project_id":data['project_id'], "default_project_id":data['project_id'], "search_default_responsible_id":uid, "search_default_current": 1} |
802 | + result['context'] = {"search_default_project_id":data.project_id.id or False, "default_project_id":data.project_id.id or False, "search_default_responsible_id":uid, "search_default_current": 1} |
803 | return result |
804 | |
805 | project_compute_phases() |
806 | |
807 | === modified file 'project_long_term/wizard/project_compute_tasks.py' |
808 | --- project_long_term/wizard/project_compute_tasks.py 2011-01-14 00:11:01 +0000 |
809 | +++ project_long_term/wizard/project_compute_tasks.py 2011-02-15 10:47:19 +0000 |
810 | @@ -37,8 +37,8 @@ |
811 | if context is None: |
812 | context = {} |
813 | context['compute_by'] = 'project' |
814 | - data = self.read(cr, uid, ids, [])[0] |
815 | - project_id = data['project_id'] |
816 | + data = self.browse(cr, uid, ids)[0] |
817 | + project_id = data.project_id.id |
818 | project_pool.schedule_tasks(cr, uid, [project_id], context=context) |
819 | return self._open_task_list(cr, uid, data, context=context) |
820 | |
821 | |
822 | === modified file 'stock/wizard/stock_move.py' |
823 | --- stock/wizard/stock_move.py 2011-02-09 07:18:57 +0000 |
824 | +++ stock/wizard/stock_move.py 2011-02-15 10:47:19 +0000 |
825 | @@ -98,9 +98,9 @@ |
826 | context = {} |
827 | move_obj = self.pool.get('stock.move') |
828 | move_ids = context['active_ids'] |
829 | - for data in self.read(cr, uid, ids): |
830 | + for data in self.browse(cr, uid, ids): |
831 | move_obj.action_consume(cr, uid, move_ids, |
832 | - data['product_qty'], data['location_id'], |
833 | + data.product_qty, data.location_id.id, |
834 | context=context) |
835 | return {'type': 'ir.actions.act_window_close'} |
836 | |
837 | @@ -159,9 +159,9 @@ |
838 | context = {} |
839 | move_obj = self.pool.get('stock.move') |
840 | move_ids = context['active_ids'] |
841 | - for data in self.read(cr, uid, ids): |
842 | + for data in self.browse(cr, uid, ids): |
843 | move_obj.action_scrap(cr, uid, move_ids, |
844 | - data['product_qty'], data['location_id'], |
845 | + data.product_qty, data.location_id.id, |
846 | context=context) |
847 | return {'type': 'ir.actions.act_window_close'} |
848 |