Merge lp:~openerp-commiter/openobject-addons/dev-addons2-rha1 into lp:~openerp/openobject-addons/trunk-fix-osvmem-read

Proposed by Rifakat Husen (OpenERP)
Status: Merged
Merged at revision: 4403
Proposed branch: lp:~openerp-commiter/openobject-addons/dev-addons2-rha1
Merge into: lp:~openerp/openobject-addons/trunk-fix-osvmem-read
Diff against target: 293 lines (+61/-11)
19 files modified
account/report/account_balance.py (+2/-0)
account/wizard/account_move_journal.py (+1/-1)
account/wizard/account_open_closed_fiscalyear.py (+2/-0)
account/wizard/account_report_balance_sheet.py (+8/-0)
account/wizard/account_report_common.py (+4/-1)
account/wizard/account_report_common_account.py (+6/-0)
account/wizard/account_report_common_journal.py (+8/-0)
account/wizard/account_report_common_partner.py (+6/-0)
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_validate_account_move.py (+3/-0)
account/wizard/account_vat.py (+3/-0)
auction/wizard/auction_lots_invoice.py (+2/-2)
mrp/mrp.py (+2/-1)
product/pricelist.py (+1/-1)
stock/stock.py (+8/-0)
stock/wizard/stock_invoice_onshipping.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-commiter/openobject-addons/dev-addons2-rha1
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+48772@code.launchpad.net

Description of the change

Account: Improve osv memory wizards

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-14 00:11:01 +0000
3+++ account/report/account_balance.py 2011-02-07 11:16:20 +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_move_journal.py'
15--- account/wizard/account_move_journal.py 2011-01-17 11:40:49 +0000
16+++ account/wizard/account_move_journal.py 2011-02-07 11:16:20 +0000
17@@ -148,7 +148,7 @@
18
19 journal_id = self._get_journal(cr, uid, context)
20 period_id = self._get_period(cr, uid, context)
21- target_move = self.read(cr, uid, ids, [])[0]['target_move']
22+ target_move = self.read(cr, uid, ids, [], context=context)[0]['target_move']
23
24 name = _("Journal Items")
25 if journal_id:
26
27=== modified file 'account/wizard/account_open_closed_fiscalyear.py'
28--- account/wizard/account_open_closed_fiscalyear.py 2011-01-14 00:11:01 +0000
29+++ account/wizard/account_open_closed_fiscalyear.py 2011-02-07 11:16:20 +0000
30@@ -35,6 +35,8 @@
31 move_obj = self.pool.get('account.move')
32
33 data = self.read(cr, uid, ids, [], context=context)[0]
34+ if isinstance(data['fyear_id'], tuple):
35+ data['fyear_id'] = data['fyear_id'][0]
36 data_fyear = fy_obj.browse(cr, uid, data['fyear_id'], context=context)
37 if not data_fyear.end_journal_period_id:
38 raise osv.except_osv(_('Error !'), _('No End of year journal defined for the fiscal year'))
39
40=== modified file 'account/wizard/account_report_balance_sheet.py'
41--- account/wizard/account_report_balance_sheet.py 2011-01-14 00:11:01 +0000
42+++ account/wizard/account_report_balance_sheet.py 2011-02-07 11:16:20 +0000
43@@ -66,6 +66,14 @@
44 if context is None:
45 context = {}
46 data['form'].update(self.read(cr, uid, ids, ['display_type','reserve_account_id'])[0])
47+
48+ for field in data['form'].keys():
49+ if isinstance(data['form'][field], tuple):
50+ data['form'][field] = data['form'][field][0]
51+ for ctx_field in data['form']['used_context'].keys():
52+ if isinstance(data['form']['used_context'][ctx_field], tuple):
53+ data['form']['used_context'][ctx_field] = data['form']['used_context'][ctx_field][0]
54+
55 if not data['form']['reserve_account_id']:
56 raise osv.except_osv(_('Warning'),_('Please define the Reserve and Profit/Loss account for current user company !'))
57 data = self.pre_print_report(cr, uid, ids, data, context=context)
58
59=== modified file 'account/wizard/account_report_common.py'
60--- account/wizard/account_report_common.py 2011-01-14 00:11:01 +0000
61+++ account/wizard/account_report_common.py 2011-02-07 11:16:20 +0000
62@@ -131,7 +131,10 @@
63 data = {}
64 data['ids'] = context.get('active_ids', [])
65 data['model'] = context.get('active_model', 'ir.ui.menu')
66- 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]
67+ 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]
68+ for field in data['form'].keys():
69+ if isinstance(data['form'][field], tuple):
70+ data['form'][field] = data['form'][field][0]
71 used_context = self._build_contexts(cr, uid, ids, data, context=context)
72 data['form']['periods'] = used_context.get('periods', False) and used_context['periods'] or []
73 data['form']['used_context'] = used_context
74
75=== modified file 'account/wizard/account_report_common_account.py'
76--- account/wizard/account_report_common_account.py 2011-01-14 00:11:01 +0000
77+++ account/wizard/account_report_common_account.py 2011-02-07 11:16:20 +0000
78@@ -39,6 +39,12 @@
79 if context is None:
80 context = {}
81 data['form'].update(self.read(cr, uid, ids, ['display_account'], context=context)[0])
82+ for field in data['form'].keys():
83+ if isinstance(data['form'][field], tuple):
84+ data['form'][field] = data['form'][field][0]
85+ for ctx_field in data['form']['used_context'].keys():
86+ if isinstance(data['form']['used_context'][ctx_field], tuple):
87+ data['form']['used_context'][ctx_field] = data['form']['used_context'][ctx_field][0]
88 return data
89
90 account_common_account_report()
91
92=== modified file 'account/wizard/account_report_common_journal.py'
93--- account/wizard/account_report_common_journal.py 2011-01-14 00:11:01 +0000
94+++ account/wizard/account_report_common_journal.py 2011-02-07 11:16:20 +0000
95@@ -42,6 +42,14 @@
96 if context is None:
97 context = {}
98 data['form'].update(self.read(cr, uid, ids, ['amount_currency'], context=context)[0])
99+
100+ for field in data['form'].keys():
101+ if isinstance(data['form'][field], tuple):
102+ data['form'][field] = data['form'][field][0]
103+ for ctx_field in data['form']['used_context'].keys():
104+ if isinstance(data['form']['used_context'][ctx_field], tuple):
105+ data['form']['used_context'][ctx_field] = data['form']['used_context'][ctx_field][0]
106+
107 fy_ids = data['form']['fiscalyear_id'] and [data['form']['fiscalyear_id']] or self.pool.get('account.fiscalyear').search(cr, uid, [('state', '=', 'draft')], context=context)
108 period_list = data['form']['periods'] or self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', fy_ids)], context=context)
109 data['form']['active_ids'] = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', data['form']['journal_ids']), ('period_id', 'in', period_list)], context=context)
110
111=== modified file 'account/wizard/account_report_common_partner.py'
112--- account/wizard/account_report_common_partner.py 2011-01-14 00:11:01 +0000
113+++ account/wizard/account_report_common_partner.py 2011-02-07 11:16:20 +0000
114@@ -40,6 +40,12 @@
115 if context is None:
116 context = {}
117 data['form'].update(self.read(cr, uid, ids, ['result_selection'], context=context)[0])
118+ for field in data['form'].keys():
119+ if isinstance(data['form'][field], tuple):
120+ data['form'][field] = data['form'][field][0]
121+ for ctx_field in data['form']['used_context'].keys():
122+ if isinstance(data['form']['used_context'][ctx_field], tuple):
123+ data['form']['used_context'][ctx_field] = data['form']['used_context'][ctx_field][0]
124 return data
125
126 account_common_partner_report()
127
128=== modified file 'account/wizard/account_report_general_ledger.py'
129--- account/wizard/account_report_general_ledger.py 2011-01-14 00:11:01 +0000
130+++ account/wizard/account_report_general_ledger.py 2011-02-07 11:16:20 +0000
131@@ -50,7 +50,7 @@
132 if context is None:
133 context = {}
134 data = self.pre_print_report(cr, uid, ids, data, context=context)
135- data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby'])[0])
136+ data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby'], context=context)[0])
137 if not data['form']['fiscalyear_id']:# GTK client problem onchange does not consider in save record
138 data['form'].update({'initial_balance': False})
139 if data['form']['landscape']:
140
141=== modified file 'account/wizard/account_report_partner_balance.py'
142--- account/wizard/account_report_partner_balance.py 2011-01-14 00:11:01 +0000
143+++ account/wizard/account_report_partner_balance.py 2011-02-07 11:16:20 +0000
144@@ -42,7 +42,7 @@
145 if context is None:
146 context = {}
147 data = self.pre_print_report(cr, uid, ids, data, context=context)
148- data['form'].update(self.read(cr, uid, ids, ['display_partner'])[0])
149+ data['form'].update(self.read(cr, uid, ids, ['display_partner'], context=context)[0])
150 return {
151 'type': 'ir.actions.report.xml',
152 'report_name': 'account.partner.balance',
153
154=== modified file 'account/wizard/account_report_partner_ledger.py'
155--- account/wizard/account_report_partner_ledger.py 2011-01-14 00:11:01 +0000
156+++ account/wizard/account_report_partner_ledger.py 2011-02-07 11:16:20 +0000
157@@ -47,7 +47,7 @@
158 if context is None:
159 context = {}
160 data = self.pre_print_report(cr, uid, ids, data, context=context)
161- data['form'].update(self.read(cr, uid, ids, ['initial_balance', 'reconcil', 'page_split', 'amount_currency'])[0])
162+ data['form'].update(self.read(cr, uid, ids, ['initial_balance', 'reconcil', 'page_split', 'amount_currency'], context=context)[0])
163 if data['form']['page_split']:
164 return {
165 'type': 'ir.actions.report.xml',
166
167=== modified file 'account/wizard/account_report_profit_loss.py'
168--- account/wizard/account_report_profit_loss.py 2011-01-14 00:11:01 +0000
169+++ account/wizard/account_report_profit_loss.py 2011-02-07 11:16:20 +0000
170@@ -42,7 +42,7 @@
171 if context is None:
172 context = {}
173 data = self.pre_print_report(cr, uid, ids, data, context=context)
174- data['form'].update(self.read(cr, uid, ids, ['display_type'])[0])
175+ data['form'].update(self.read(cr, uid, ids, ['display_type'], context=context)[0])
176 if data['form']['display_type']:
177 return {
178 'type': 'ir.actions.report.xml',
179
180=== modified file 'account/wizard/account_validate_account_move.py'
181--- account/wizard/account_validate_account_move.py 2011-01-14 00:11:01 +0000
182+++ account/wizard/account_validate_account_move.py 2011-02-07 11:16:20 +0000
183@@ -34,6 +34,9 @@
184 if context is None:
185 context = {}
186 data = self.read(cr, uid, ids, context=context)[0]
187+ for field in data.keys():
188+ if isinstance(data[field], tuple):
189+ data[field] = data[field][0]
190 ids_move = obj_move.search(cr, uid, [('state','=','draft'),('journal_id','=',data['journal_id']),('period_id','=',data['period_id'])])
191 if not ids_move:
192 raise osv.except_osv(_('Warning'), _('Specified Journal does not have any account move entries in draft state for this period'))
193
194=== modified file 'account/wizard/account_vat.py'
195--- account/wizard/account_vat.py 2011-01-14 00:11:01 +0000
196+++ account/wizard/account_vat.py 2011-02-07 11:16:20 +0000
197@@ -47,6 +47,9 @@
198 datas = {'ids': context.get('active_ids', [])}
199 datas['model'] = 'account.tax.code'
200 datas['form'] = self.read(cr, uid, ids)[0]
201+ for field in datas['form'].keys():
202+ if isinstance(datas['form'][field], tuple):
203+ datas['form'][field] = datas['form'][field][0]
204 datas['form']['company_id'] = self.pool.get('account.tax.code').browse(cr, uid, [datas['form']['chart_tax_id']], context=context)[0].company_id.id
205 return {
206 'type': 'ir.actions.report.xml',
207
208=== modified file 'auction/wizard/auction_lots_invoice.py'
209--- auction/wizard/auction_lots_invoice.py 2011-01-14 00:11:01 +0000
210+++ auction/wizard/auction_lots_invoice.py 2011-02-07 11:16:20 +0000
211@@ -46,7 +46,7 @@
212 @param context: A standard dictionary
213 @return: A dictionary which of fields with values.
214 """
215- if context is None:
216+ if context is None:
217 context = {}
218 res = super(auction_lots_invoice, self).default_get(cr, uid, fields, context=context)
219 service = netsvc.LocalService("object_proxy")
220@@ -103,7 +103,7 @@
221 @param ids: List of Auction lots make invoice buyer’s IDs
222 @return: dictionary of account invoice form.
223 """
224- if context is None:
225+ if context is None:
226 context = {}
227 service = netsvc.LocalService("object_proxy")
228 datas = {'ids' : context.get('active_ids',[])}
229
230=== modified file 'mrp/mrp.py'
231--- mrp/mrp.py 2011-01-17 13:51:36 +0000
232+++ mrp/mrp.py 2011-02-07 11:16:20 +0000
233@@ -573,6 +573,7 @@
234 """
235 results = []
236 bom_obj = self.pool.get('mrp.bom')
237+ uom_obj = self.pool.get('product.uom')
238 prod_line_obj = self.pool.get('mrp.production.product.line')
239 workcenter_line_obj = self.pool.get('mrp.production.workcenter.line')
240 for production in self.browse(cr, uid, ids):
241@@ -590,7 +591,7 @@
242 if not bom_id:
243 raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product"))
244
245- factor = production.product_qty * production.product_uom.factor / bom_point.product_uom.factor
246+ factor = uom_obj._compute_qty(cr, uid, production.product_uom.id, production.product_qty, bom_point.product_uom.id)
247 res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, properties)
248 results = res[0]
249 results2 = res[1]
250
251=== modified file 'product/pricelist.py'
252--- product/pricelist.py 2011-01-17 08:00:48 +0000
253+++ product/pricelist.py 2011-02-07 11:16:20 +0000
254@@ -264,7 +264,7 @@
255 product_obj.price_get(cr, uid, [product_id],
256 price_type.field)[product_id], round=False, context=context)
257
258- if price:
259+ if price or price == 0.0:
260 price_limit = price
261
262 price = price * (1.0+(res['price_discount'] or 0.0))
263
264=== modified file 'stock/stock.py'
265--- stock/stock.py 2011-01-24 16:13:46 +0000
266+++ stock/stock.py 2011-02-07 11:16:20 +0000
267@@ -1886,6 +1886,14 @@
268 @return: True
269 """
270 self.write(cr, uid, ids, {'state': 'confirmed'})
271+
272+ # fix for bug lp:707031
273+ # called write of related picking because changing move availability does
274+ # not trigger workflow of picking in order to change the state of picking
275+ wf_service = netsvc.LocalService('workflow')
276+ for move in self.browse(cr, uid, ids, context):
277+ if move.picking_id:
278+ wf_service.trg_write(uid, 'stock.picking', move.picking_id.id, cr)
279 return True
280
281 #
282
283=== modified file 'stock/wizard/stock_invoice_onshipping.py'
284--- stock/wizard/stock_invoice_onshipping.py 2011-01-17 08:00:48 +0000
285+++ stock/wizard/stock_invoice_onshipping.py 2011-02-07 11:16:20 +0000
286@@ -127,7 +127,7 @@
287 res = picking_pool.action_invoice_create(cr, uid, active_ids,
288 journal_id = onshipdata_obj[0]['journal_id'],
289 group = onshipdata_obj[0]['group'],
290- type = None,
291+ type = context.get('inv_type'),
292 context=context)
293 return res
294

Subscribers

People subscribed via source and target branches