[MERGE] branch merged with lp:~openerp-dev/openobject-addons/trunk-dev-addons3

bzr revid: mtr@mtr-20110127113018-pndbu1ygwlogpcpi
This commit is contained in:
mtr 2011-01-27 17:00:18 +05:30
commit a955e43980
2 changed files with 5 additions and 5 deletions

View File

@ -314,7 +314,6 @@ class account_bank_statement(osv.osv):
return state=='draft'
def button_confirm_bank(self, cr, uid, ids, context=None):
done = []
obj_seq = self.pool.get('ir.sequence')
if context is None:
context = {}
@ -355,7 +354,6 @@ class account_bank_statement(osv.osv):
self.write(cr, uid, [st.id], {'name': st_number}, context=context)
self.log(cr, uid, st.id, _('Statement %s is confirmed, journal items are created.') % (st_number,))
done.append(st.id)
return self.write(cr, uid, ids, {'state':'confirm'}, context=context)
def button_cancel(self, cr, uid, ids, context=None):

View File

@ -722,13 +722,16 @@ class account_voucher(osv.osv):
for line in inv.line_ids:
#create one move line per voucher line where amount is not 0.0
if not line.amount:
if not line.amount and not inv.payment_option == 'with_writeoff':
continue
#we check if the voucher line is fully paid or not and create a move line to balance the payment and initial invoice if needed
if line.amount == line.amount_unreconciled:
amount = line.move_line_id.amount_residual #residual amount in company currency
else:
amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=context_multi_currency)
if inv.payment_option == 'with_writeoff':
amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.amount_unreconciled or line.amount, context=context_multi_currency)
else:
amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=context_multi_currency)
move_line = {
'journal_id': inv.journal_id.id,
'period_id': inv.period_id.id,
@ -749,7 +752,6 @@ class account_voucher(osv.osv):
line.type = 'cr'
else:
line.type = 'dr'
if (line.type=='dr'):
line_total += amount
move_line['debit'] = amount