Comment 1 for bug 973972

Revision history for this message
Carlos Menjivar-Openerp Honduras (carlosmenjivar-openerp-honduras) wrote :

SOLUCION

def create(self,cr,uid,vals,context=None):
  new_name = False
  if vals.get('patient_id',False) and vals['patient_id'].strip() == '':
   new_name = True
  elif not vals.get('patient_id',False):
   new_name = True
  if new_name:
   vals.update({'patient_id':self.pool.get('ir.sequence').get(cr, uid, 'medical.patient')})
  return super(patient_data, self).create(cr, uid, vals, context)

CON ESTO SE OBTENDRA LA SECUENCIA SOLO SI EL REGISTRO SE CREA DE LO CONTRARIO NO SE INCREMENTARA LA SECUENCIA