[IMP] product, hr, pos, mail_group: removed the onchange_image, updated used images and classes in views.
bzr revid: tde@openerp.com-20120806155354-sjkrmrffgb2ik4ba
This commit is contained in:
parent
a814343ab7
commit
c8c95d46f9
|
@ -160,9 +160,6 @@ class hr_employee(osv.osv):
|
||||||
def _set_image(self, cr, uid, id, name, value, args, context=None):
|
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)
|
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': {'image_medium': tools.resize_image_big(value), 'image_small': tools.resize_image_big(value)}}
|
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'country_id': fields.many2one('res.country', 'Nationality'),
|
'country_id': fields.many2one('res.country', 'Nationality'),
|
||||||
'birthday': fields.date("Date of Birth"),
|
'birthday': fields.date("Date of Birth"),
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Employee" version="7.0">
|
<form string="Employee" version="7.0">
|
||||||
<sheet>
|
<sheet>
|
||||||
<field name="image_small" widget='image' class="oe_right oe_form_field_image_small" on_change="onchange_image(image_small)"/>
|
<field name="image_small" widget='image' class="oe_right oe_image_small"/>
|
||||||
<div class="oe_title">
|
<div class="oe_title">
|
||||||
<label for="name" class="oe_edit_only"/>
|
<label for="name" class="oe_edit_only"/>
|
||||||
<h1>
|
<h1>
|
||||||
|
|
|
@ -65,9 +65,6 @@ class mail_group(osv.osv):
|
||||||
def _set_image(self, cr, uid, id, name, value, args, context=None):
|
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)
|
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)}
|
|
||||||
|
|
||||||
def get_member_ids(self, cr, uid, ids, field_names, args, context=None):
|
def get_member_ids(self, cr, uid, ids, field_names, args, context=None):
|
||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
|
@ -125,7 +122,7 @@ class mail_group(osv.osv):
|
||||||
"resized as a 180x180px image, with aspect ratio preserved. "\
|
"resized as a 180x180px image, with aspect ratio preserved. "\
|
||||||
"Use this field in form views or some kanban views."),
|
"Use this field in form views or some kanban views."),
|
||||||
'image_small': fields.function(_get_image, fnct_inv=_set_image,
|
'image_small': fields.function(_get_image, fnct_inv=_set_image,
|
||||||
string="Smal-sized photo", type="binary", multi="_get_image",
|
string="Small-sized photo", type="binary", multi="_get_image",
|
||||||
store = {
|
store = {
|
||||||
'mail.group': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
|
'mail.group': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
|
||||||
},
|
},
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
<sheet class="openerp_mail_group_sheet">
|
<sheet class="openerp_mail_group_sheet">
|
||||||
<group colspan="4" col="8">
|
<group colspan="4" col="8">
|
||||||
<group colspan="1" col="2">
|
<group colspan="1" col="2">
|
||||||
<field name="image_small" widget='image' on_change="onchange_image(image_small)"/>
|
<field name="image_small" widget='image' class="oe_image_small" nolabel="1"/>
|
||||||
</group>
|
</group>
|
||||||
<group colspan="7" col="6">
|
<group colspan="7" col="6">
|
||||||
<div class="oe_edit_only">
|
<div class="oe_edit_only">
|
||||||
|
|
|
@ -20,12 +20,6 @@
|
||||||
max-width: 80%;
|
max-width: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Resize group logo */
|
|
||||||
.openerp .oe_form_sheetbg.openerp_mail_group_sheet .oe_form_field_image > img {
|
|
||||||
max-width: 100px;
|
|
||||||
max-height: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Resize group description */
|
/* Resize group description */
|
||||||
.openerp .oe_form_sheetbg.openerp_mail_group_sheet .oe_form_field_text > textarea {
|
.openerp .oe_form_sheetbg.openerp_mail_group_sheet .oe_form_field_text > textarea {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
|
|
@ -1186,9 +1186,6 @@ class pos_category(osv.osv):
|
||||||
|
|
||||||
def _set_image(self, cr, uid, id, name, value, args, context=None):
|
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)
|
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 = {
|
_columns = {
|
||||||
'name': fields.char('Name', size=64, required=True, translate=True),
|
'name': fields.char('Name', size=64, required=True, translate=True),
|
||||||
|
|
|
@ -503,9 +503,6 @@ class product_product(osv.osv):
|
||||||
|
|
||||||
def _set_image(self, cr, uid, id, name, value, args, context=None):
|
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)
|
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)}
|
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'active': lambda *a: 1,
|
'active': lambda *a: 1,
|
||||||
|
|
|
@ -64,8 +64,7 @@
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Product" version="7.0">
|
<form string="Product" version="7.0">
|
||||||
<sheet>
|
<sheet>
|
||||||
<field name="image_small" widget="image" class="oe_avatar oe_right" on_change="onchange_image(image_small"/>
|
<field name="image_medium" widget="image" class="oe_avatar oe_right"/>
|
||||||
|
|
||||||
<div class="oe_title">
|
<div class="oe_title">
|
||||||
<div class="oe_edit_only">
|
<div class="oe_edit_only">
|
||||||
<label for="name" string="Product Name"/>
|
<label for="name" string="Product Name"/>
|
||||||
|
|
Loading…
Reference in New Issue