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: 238 lines (+35/-12)
16 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 (+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_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+49034@code.launchpad.net

Description of the change

Account : Improvement in osv memory wizard

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-02-07 13:29:42 +0000
3+++ account/report/account_balance.py 2011-02-09 09:26:59 +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-09 09:26:59 +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-09 09:26:59 +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-09 09:26:59 +0000
43@@ -65,7 +65,8 @@
44 def _print_report(self, cr, uid, ids, data, context=None):
45 if context is None:
46 context = {}
47- data['form'].update(self.read(cr, uid, ids, ['display_type','reserve_account_id'])[0])
48+ record = self.browse(cr, uid, ids, context=context)[0]
49+ data['form'].update({'display_type':record.display_type, 'reserve_account_id':record.reserve_account_id.id})
50 if not data['form']['reserve_account_id']:
51 raise osv.except_osv(_('Warning'),_('Please define the Reserve and Profit/Loss account for current user company !'))
52 data = self.pre_print_report(cr, uid, ids, data, context=context)
53
54=== modified file 'account/wizard/account_report_common.py'
55--- account/wizard/account_report_common.py 2011-01-14 00:11:01 +0000
56+++ account/wizard/account_report_common.py 2011-02-09 09:26:59 +0000
57@@ -131,7 +131,10 @@
58 data = {}
59 data['ids'] = context.get('active_ids', [])
60 data['model'] = context.get('active_model', 'ir.ui.menu')
61- 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]
62+ 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]
63+ for field in data['form'].keys():
64+ if isinstance(data['form'][field], tuple):
65+ data['form'][field] = data['form'][field][0]
66 used_context = self._build_contexts(cr, uid, ids, data, context=context)
67 data['form']['periods'] = used_context.get('periods', False) and used_context['periods'] or []
68 data['form']['used_context'] = used_context
69
70=== modified file 'account/wizard/account_report_general_ledger.py'
71--- account/wizard/account_report_general_ledger.py 2011-01-14 00:11:01 +0000
72+++ account/wizard/account_report_general_ledger.py 2011-02-09 09:26:59 +0000
73@@ -50,7 +50,7 @@
74 if context is None:
75 context = {}
76 data = self.pre_print_report(cr, uid, ids, data, context=context)
77- data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby'])[0])
78+ data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby'], context=context)[0])
79 if not data['form']['fiscalyear_id']:# GTK client problem onchange does not consider in save record
80 data['form'].update({'initial_balance': False})
81 if data['form']['landscape']:
82
83=== modified file 'account/wizard/account_report_partner_balance.py'
84--- account/wizard/account_report_partner_balance.py 2011-01-14 00:11:01 +0000
85+++ account/wizard/account_report_partner_balance.py 2011-02-09 09:26:59 +0000
86@@ -42,7 +42,7 @@
87 if context is None:
88 context = {}
89 data = self.pre_print_report(cr, uid, ids, data, context=context)
90- data['form'].update(self.read(cr, uid, ids, ['display_partner'])[0])
91+ data['form'].update(self.read(cr, uid, ids, ['display_partner'], context=context)[0])
92 return {
93 'type': 'ir.actions.report.xml',
94 'report_name': 'account.partner.balance',
95
96=== modified file 'account/wizard/account_report_partner_ledger.py'
97--- account/wizard/account_report_partner_ledger.py 2011-01-14 00:11:01 +0000
98+++ account/wizard/account_report_partner_ledger.py 2011-02-09 09:26:59 +0000
99@@ -47,7 +47,7 @@
100 if context is None:
101 context = {}
102 data = self.pre_print_report(cr, uid, ids, data, context=context)
103- data['form'].update(self.read(cr, uid, ids, ['initial_balance', 'reconcil', 'page_split', 'amount_currency'])[0])
104+ data['form'].update(self.read(cr, uid, ids, ['initial_balance', 'reconcil', 'page_split', 'amount_currency'], context=context)[0])
105 if data['form']['page_split']:
106 return {
107 'type': 'ir.actions.report.xml',
108
109=== modified file 'account/wizard/account_report_profit_loss.py'
110--- account/wizard/account_report_profit_loss.py 2011-01-14 00:11:01 +0000
111+++ account/wizard/account_report_profit_loss.py 2011-02-09 09:26:59 +0000
112@@ -42,7 +42,7 @@
113 if context is None:
114 context = {}
115 data = self.pre_print_report(cr, uid, ids, data, context=context)
116- data['form'].update(self.read(cr, uid, ids, ['display_type'])[0])
117+ data['form'].update(self.read(cr, uid, ids, ['display_type'], context=context)[0])
118 if data['form']['display_type']:
119 return {
120 'type': 'ir.actions.report.xml',
121
122=== modified file 'account/wizard/account_validate_account_move.py'
123--- account/wizard/account_validate_account_move.py 2011-01-14 00:11:01 +0000
124+++ account/wizard/account_validate_account_move.py 2011-02-09 09:26:59 +0000
125@@ -34,6 +34,9 @@
126 if context is None:
127 context = {}
128 data = self.read(cr, uid, ids, context=context)[0]
129+ for field in data.keys():
130+ if isinstance(data[field], tuple):
131+ data[field] = data[field][0]
132 ids_move = obj_move.search(cr, uid, [('state','=','draft'),('journal_id','=',data['journal_id']),('period_id','=',data['period_id'])])
133 if not ids_move:
134 raise osv.except_osv(_('Warning'), _('Specified Journal does not have any account move entries in draft state for this period'))
135
136=== modified file 'account/wizard/account_vat.py'
137--- account/wizard/account_vat.py 2011-01-14 00:11:01 +0000
138+++ account/wizard/account_vat.py 2011-02-09 09:26:59 +0000
139@@ -47,6 +47,9 @@
140 datas = {'ids': context.get('active_ids', [])}
141 datas['model'] = 'account.tax.code'
142 datas['form'] = self.read(cr, uid, ids)[0]
143+ for field in datas['form'].keys():
144+ if isinstance(datas['form'][field], tuple):
145+ datas['form'][field] = datas['form'][field][0]
146 datas['form']['company_id'] = self.pool.get('account.tax.code').browse(cr, uid, [datas['form']['chart_tax_id']], context=context)[0].company_id.id
147 return {
148 'type': 'ir.actions.report.xml',
149
150=== modified file 'auction/wizard/auction_lots_invoice.py'
151--- auction/wizard/auction_lots_invoice.py 2011-01-14 00:11:01 +0000
152+++ auction/wizard/auction_lots_invoice.py 2011-02-09 09:26:59 +0000
153@@ -46,7 +46,7 @@
154 @param context: A standard dictionary
155 @return: A dictionary which of fields with values.
156 """
157- if context is None:
158+ if context is None:
159 context = {}
160 res = super(auction_lots_invoice, self).default_get(cr, uid, fields, context=context)
161 service = netsvc.LocalService("object_proxy")
162@@ -103,7 +103,7 @@
163 @param ids: List of Auction lots make invoice buyer’s IDs
164 @return: dictionary of account invoice form.
165 """
166- if context is None:
167+ if context is None:
168 context = {}
169 service = netsvc.LocalService("object_proxy")
170 datas = {'ids' : context.get('active_ids',[])}
171
172=== modified file 'mrp/mrp.py'
173--- mrp/mrp.py 2011-02-07 13:29:42 +0000
174+++ mrp/mrp.py 2011-02-09 09:26:59 +0000
175@@ -573,6 +573,7 @@
176 """
177 results = []
178 bom_obj = self.pool.get('mrp.bom')
179+ uom_obj = self.pool.get('product.uom')
180 prod_line_obj = self.pool.get('mrp.production.product.line')
181 workcenter_line_obj = self.pool.get('mrp.production.workcenter.line')
182 for production in self.browse(cr, uid, ids):
183@@ -590,7 +591,7 @@
184 if not bom_id:
185 raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product"))
186
187- factor = production.product_qty * production.product_uom.factor / bom_point.product_uom.factor
188+ factor = uom_obj._compute_qty(cr, uid, production.product_uom.id, production.product_qty, bom_point.product_uom.id)
189 res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, properties)
190 results = res[0]
191 results2 = res[1]
192
193=== modified file 'product/pricelist.py'
194--- product/pricelist.py 2011-02-07 13:29:42 +0000
195+++ product/pricelist.py 2011-02-09 09:26:59 +0000
196@@ -264,7 +264,7 @@
197 product_obj.price_get(cr, uid, [product_id],
198 price_type.field)[product_id], round=False, context=context)
199
200- if price:
201+ if price or price == 0.0:
202 price_limit = price
203
204 price = price * (1.0+(res['price_discount'] or 0.0))
205
206=== modified file 'stock/stock.py'
207--- stock/stock.py 2011-02-07 13:29:42 +0000
208+++ stock/stock.py 2011-02-09 09:26:59 +0000
209@@ -1886,6 +1886,14 @@
210 @return: True
211 """
212 self.write(cr, uid, ids, {'state': 'confirmed'})
213+
214+ # fix for bug lp:707031
215+ # called write of related picking because changing move availability does
216+ # not trigger workflow of picking in order to change the state of picking
217+ wf_service = netsvc.LocalService('workflow')
218+ for move in self.browse(cr, uid, ids, context):
219+ if move.picking_id:
220+ wf_service.trg_write(uid, 'stock.picking', move.picking_id.id, cr)
221 return True
222
223 #
224
225=== modified file 'stock/wizard/stock_invoice_onshipping.py'
226--- stock/wizard/stock_invoice_onshipping.py 2011-02-08 07:23:53 +0000
227+++ stock/wizard/stock_invoice_onshipping.py 2011-02-09 09:26:59 +0000
228@@ -127,7 +127,7 @@
229 res = picking_pool.action_invoice_create(cr, uid, active_ids,
230 journal_id = onshipdata_obj[0]['journal_id'],
231 group = onshipdata_obj[0]['group'],
232- type = None,
233+ type = context.get('inv_type'),
234 context=context)
235 return res
236
237
238=== modified file 'stock/wizard/stock_move.py'

Subscribers

People subscribed via source and target branches