~txerpa-openerp/openobject-client-web/txerpa

« back to all changes in this revision

Viewing changes to addons/openerp/widgets/form/_binary.py

  • Committer: Biel - txerpa.com
  • Date: 2013-08-09 12:30:58 UTC
  • mfrom: (4670.2.245 openobject-client-web)
  • Revision ID: biel.massot@txerpa.com-20130809123058-892zu673ti1j8yjd
Actualizo a la ultima revision de trunk. Hay muchos bugs correjidos desde 2012. Elimino la revision 4873 por problemas de rendimiento en el dashboard de Contabilidad

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
        self.state = attrs.get('state')
93
93
        self.field = self.name.split('/')[-1]
94
94
        if attrs.get('widget'):
95
 
            self.src = tools.url('/openerp/form/binary_image_get_image', model=self.model, id=self.id, field=self.field, nocache=random.randint(0,2**32))
 
95
            extra_url_params = {}
 
96
            if not (self.id and self.id != 'None'):
 
97
                # during record creation provide current value (from default_get())
 
98
                # so we do not need to call default_get() twice
 
99
                extra_url_params['default_value'] = self.value
 
100
            self.src = tools.url('/openerp/form/binary_image_get_image', model=self.model, id=self.id, field=self.field, nocache=random.randint(0,2**32), **extra_url_params)
96
101
            self.height = attrs.get('img_height', attrs.get('height', None))
97
102
            self.width = attrs.get('img_width', attrs.get('width', None))
98
103
            self.validator = validators.Binary()