~nhomar/+junk/arreglo-cadenas

« back to all changes in this revision

Viewing changes to retencion_islr/retencion_islr.py

  • Committer: Operador
  • Date: 2010-02-02 12:49:08 UTC
  • mfrom: (77.1.1 loc_ve_29122009)
  • Revision ID: operador@satelite-20100202124908-9jk4wwlc7ucs1h6j
Agregado filtro para evitar errores en la creacion de Comprobante ISLR

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
from osv import osv, fields
32
32
import time
33
33
from tools import config
 
34
from tools.translate import _
34
35
 
35
36
 
36
37
class account_retencion_islr(osv.osv):
113
114
        obj=self.pool.get('account.retencion.islr').browse(cr,uid,ids)
114
115
        total=0
115
116
        for i in obj[0].islr_line_ids:
 
117
            if i.amount >= i.invoice_id.check_total*0.15:
 
118
                raise osv.except_osv(_('Invalid action !'), _("La linea que contiene El documento '%s' luce como si el monto retenido estuviera incorrecto por favor verificar.!") % (i.invoice_id.reference))
116
119
            total+=i.amount
117
120
        self.write(cr,uid,ids,{'amount':total})
118
121
        self.write(cr, uid, ids, {'state':'confirmed'})