[FIX] account_voucher: it is authorized to enter invoice with negative amount, therefore the check amount constraint must take that into account

bzr revid: dle@openerp.com-20140402083713-tayk4r76bmrp9luf
This commit is contained in:
Denis Ledoux 2014-04-02 10:37:13 +02:00
parent 3bf57cbbdc
commit e8775beded
1 changed files with 1 additions and 1 deletions

View File

@ -1683,7 +1683,7 @@ class account_bank_statement_line(osv.osv):
def _check_amount(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
if obj.voucher_id:
diff = abs(obj.amount) - obj.voucher_id.amount
diff = abs(obj.amount) - abs(obj.voucher_id.amount)
if not self.pool.get('res.currency').is_zero(cr, uid, obj.statement_id.currency, diff):
return False
return True