[IMP] res_partner, res_users: removed the onchange_image, updated used images and classes in views.
bzr revid: tde@openerp.com-20120806155325-198jhpc2chmufzu1
This commit is contained in:
parent
4d9ff0d5f9
commit
176140590b
|
@ -145,9 +145,6 @@ class res_partner(osv.osv):
|
|||
|
||||
def _set_image(self, cr, uid, id, name, value, args, context=None):
|
||||
return self.write(cr, uid, [id], {'image': tools.resize_image_big(value)}, context=context)
|
||||
|
||||
def onchange_image(self, cr, uid, ids, value, context=None):
|
||||
return {'value': tools.get_resized_images(value)}
|
||||
|
||||
_order = "name"
|
||||
_columns = {
|
||||
|
@ -250,7 +247,7 @@ class res_partner(osv.osv):
|
|||
|
||||
def onchange_type(self, cr, uid, ids, is_company, context=None):
|
||||
# get value as for an onchange on the image
|
||||
value = self.onchange_image(cr, uid, ids, self._get_default_image(cr, uid, is_company, context), context=context)['value']
|
||||
value = tools.get_resized_images(self._get_default_image(cr, uid, is_company, context))
|
||||
value['title'] = False
|
||||
if is_company:
|
||||
value['parent_id'] = False
|
||||
|
@ -318,7 +315,7 @@ class res_partner(osv.osv):
|
|||
self.update_address(cr, uid, update_ids, vals, context)
|
||||
if 'image' not in vals :
|
||||
image_value = self._get_default_image(cr, uid, vals.get('is_company', False) or context.get('default_is_company'), context)
|
||||
vals.update(self.onchange_image(cr, uid, [], image_value, context=context)['value'])
|
||||
vals.update(tools.get_resized_images(image_value))
|
||||
return super(res_partner,self).create(cr, uid, vals, context=context)
|
||||
|
||||
def update_address(self, cr, uid, ids, vals, context=None):
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Partners" version="7.0">
|
||||
<sheet>
|
||||
<field name="image_small" widget='image' class="oe_avatar oe_left" on_change="onchange_image(image_small)"/>
|
||||
<field name="image_small" widget='image' class="oe_avatar oe_left"/>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="name" default_focus="1" placeholder="Name" />
|
||||
|
|
|
@ -178,9 +178,6 @@ class users(osv.osv):
|
|||
def _set_image(self, cr, uid, id, name, value, args, context=None):
|
||||
return self.write(cr, uid, [id], {'image': tools.resize_image_big(value)}, context=context)
|
||||
|
||||
def onchange_image(self, cr, uid, ids, value, context=None):
|
||||
return {'value': tools.get_resized_images(value)}
|
||||
|
||||
_columns = {
|
||||
'id': fields.integer('ID'),
|
||||
'name': fields.char('User Name', size=64, required=True, select=True,
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
<form string="Users" version="7.0">
|
||||
<field name="id" invisible="1"/>
|
||||
<sheet>
|
||||
<field name="image_medium" widget='image' on_change="onchange_image(image_medium)" class="oe_avatar oe_left"/>
|
||||
<field name="image_medium" widget='image' class="oe_avatar oe_left"/>
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
<h1><field name="name"/></h1>
|
||||
|
@ -203,7 +203,7 @@
|
|||
<form string="Users" version="7.0">
|
||||
<sheet>
|
||||
<div class="oe_right oe_avatar">
|
||||
<field name="image_small" widget='image' on_change="onchange_image(image_small)"/>
|
||||
<field name="image_small" widget='image' class="oe_image_small"/>
|
||||
</div>
|
||||
<h1>
|
||||
<field name="name" readonly="1" class="oe_inline"/>
|
||||
|
|
Loading…
Reference in New Issue