[FIX] account_voucher: display the multi-currency options each time needed
bzr revid: qdp-launchpad@openerp.com-20130513132422-q78dopdnnyd2x8dy
This commit is contained in:
@@ -247,13 +247,12 @@ class account_voucher(osv.osv):
|
||||
line_osv = self.pool.get("account.voucher.line")
|
||||
line_dr_ids = resolve_o2m_operations(cr, uid, line_osv, line_dr_ids, ['amount'], context)
|
||||
line_cr_ids = resolve_o2m_operations(cr, uid, line_osv, line_cr_ids, ['amount'], context)
|
||||
|
||||
#compute the field is_multi_currency that is used to hide/display options linked to secondary currency on the voucher
|
||||
is_multi_currency = False
|
||||
#loop on the voucher lines to see if one of these has a secondary currency. If yes, we need to see the options
|
||||
for voucher_line in line_dr_ids+line_cr_ids:
|
||||
line_currency = voucher_line.get('move_line_id', False) and self.pool.get('account.move.line').browse(cr, uid, voucher_line.get('move_line_id'), context=context).currency_id
|
||||
if line_currency:
|
||||
line_id = voucher_line.get('id') and self.pool.get('account.voucher.line').browse(cr, uid, voucher_line['id'], context=context).move_line_id.id or voucher_line.get('move_line_id')
|
||||
if line_id and self.pool.get('account.move.line').browse(cr, uid, line_id, context=context).currency_id:
|
||||
is_multi_currency = True
|
||||
break
|
||||
return {'value': {'writeoff_amount': self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount, type), 'is_multi_currency': is_multi_currency}}
|
||||
|
||||
Reference in New Issue
Block a user