Ejemplo n.º 1
0
 def create(self, cr, uid, vals, context={}):
     if vals.get('logo', False):
         vals['logo'] = extras.crop_image(vals['logo'], 192)
         vals['logo_medium'] = extras.crop_image(vals['logo'], 64)
         vals['logo_small'] = extras.crop_image(vals['logo'], 48)
     return super(kemas_specialization_course,
                  self).create(cr, uid, vals, context)
Ejemplo n.º 2
0
 def write(self, cr, uid, ids, vals, context={}):
     result = super(kemas_recording_series, self).write(cr, uid, ids, vals, context)
     for record_id in ids:
         if vals.get('logo', False):
             vals_write = {}
             vals_write['logo'] = extras.crop_image(vals['logo'], 192)
             vals_write['logo_medium'] = extras.crop_image(vals['logo'], 64)
             vals_write['logo_small'] = extras.crop_image(vals['logo'], 48)
             super(kemas_recording_series, self).write(cr, uid, [record_id['id']], vals_write, context)
     return result
Ejemplo n.º 3
0
 def create(self, cr, uid, vals, context={}):
     try:
         vals['image'] = extras.crop_image(vals['image'], 256)
     except:
         None
     vals['name'] = extras.elimina_tildes(vals['name'])
     return super(res_partner, self).create(cr, uid, vals, context)
Ejemplo n.º 4
0
 def write(self, cr, uid, ids, vals, context={}):
     result = super(kemas_recording, self).write(cr, uid, ids, vals, context)
     for record_id in ids:
         if vals.get('logo', False):
             vals_write = {}
             vals_write['logo'] = extras.crop_image(vals['logo'], 160)
             vals_write['logo_landscape'] = extras.resize_image(vals['logo'], 112)
             super(kemas_recording, self).write(cr, uid, [record_id], vals_write, context)
     return result
Ejemplo n.º 5
0
 def write(self, cr, uid, ids, vals, context={}):
     if vals.get('name'):
         vals['name'] = extras.elimina_tildes(vals['name'])
     
     if vals.get('image') and 1 not in ids:
         try:
             vals['image'] = extras.crop_image(vals['image'], 256)
         except:
             None
     return super(res_partner, self).write(cr, uid, ids, vals, context) 
Ejemplo n.º 6
0
 def create(self, cr, uid, vals, *args, **kwargs):
     if vals.get('logo', False):
         vals['logo'] = extras.crop_image(vals['logo'], 192)
         vals['logo_medium'] = extras.crop_image(vals['logo'], 64)
         vals['logo_small'] = extras.crop_image(vals['logo'], 48)
     return super(osv.osv, self).create(cr, uid, vals, *args, **kwargs)
Ejemplo n.º 7
0
 def create(self, cr, uid, vals, context={}):
     if vals.get('logo', False):
         vals['logo'] = extras.crop_image(vals['logo'], 192)
         vals['logo_medium'] = extras.crop_image(vals['logo'], 64)
         vals['logo_small'] = extras.crop_image(vals['logo'], 48)
     return super(kemas_ministry, self).create(cr, uid, vals, context)