[FIX]Image medium and small functions. Demo images converted from jpg to png

bzr revid: dle@openerp.com-20121001152529-lzdisf4o45xye6hs
This commit is contained in:
Denis Ledoux dle@openerp.com 2012-10-01 17:25:29 +02:00
parent b736feca4c
commit ba355e566e
3 changed files with 1788 additions and 1251 deletions

File diff suppressed because it is too large Load Diff

View File

@ -68,8 +68,8 @@ class fleet_vehicle_model(osv.Model):
'brand' : fields.many2one('fleet.vehicle.model.brand', 'Model Brand', required=True, help='Brand of the vehicle'),
'vendors': fields.many2many('res.partner','fleet_vehicle_model_vendors','model_id', 'partner_id',string='Vendors',required=False),
'image': fields.related('brand','image',type="binary",string="Logo",store=False),
'image_medium': fields.related('model_id','image_medium',type="binary",string="Logo",store=False),
'image_small': fields.related('model_id','image_small',type="binary",string="Logo",store=False),
'image_medium': fields.related('brand','image_medium',type="binary",string="Logo",store=False),
'image_small': fields.related('brand','image_small',type="binary",string="Logo",store=False),
}
class fleet_vehicle_model_brand(osv.Model):
@ -93,7 +93,7 @@ class fleet_vehicle_model_brand(osv.Model):
'image_medium': fields.function(_get_image, fnct_inv=_set_image,
string="Medium-sized photo", type="binary", multi="_get_image",
store = {
'hr.employee': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
'fleet.vehicle.model.brand': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
},
help="Medium-sized logo of the brand. It is automatically "\
"resized as a 128x128px image, with aspect ratio preserved. "\
@ -101,7 +101,7 @@ class fleet_vehicle_model_brand(osv.Model):
'image_small': fields.function(_get_image, fnct_inv=_set_image,
string="Smal-sized photo", type="binary", multi="_get_image",
store = {
'hr.employee': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
'fleet.vehicle.model.brand': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
},
help="Small-sized photo of the brand. It is automatically "\
"resized as a 64x64px image, with aspect ratio preserved. "\

View File

@ -7,7 +7,7 @@
<field name="arch" type="xml">
<form string="Model" version="7.0">
<sheet>
<field name="image" widget='image' class="oe_left oe_avatar"/>
<field name="image_medium" widget='image' class="oe_left oe_avatar"/>
<group col="2">
<group>
<field name="brand" on_change="on_change_brand(brand)"/>
@ -62,7 +62,7 @@
<sheet>
<group>
<div>
<field name="image" widget="image" class="oe_left oe_avatar"/>
<field name="image_medium" widget="image" class="oe_left oe_avatar"/>
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name" class="oe_inline" />
@ -115,7 +115,7 @@
<field name="state" widget="statusbar" clickable="True" />
</header>
<sheet>
<field name="image" widget='image' class="oe_left oe_avatar"/>
<field name="image_medium" widget='image' class="oe_left oe_avatar"/>
<div class="oe_title">
<label for="model_id" class="oe_edit_only"/>
<h1>
@ -231,7 +231,7 @@
<t t-name="kanban-box">
<div class="oe_kanban_vignette oe_semantic_html_override">
<a type="open" href="#" class="oe_kanban_action oe_kanban_action_a">
<img t-att-src="kanban_image('fleet.vehicle', 'image', record.id.value)" class="oe_kanban_image"/>
<img t-att-src="kanban_image('fleet.vehicle', 'image_small', record.id.value)" class="oe_employee_picture"/>
</a>
<div class="oe_kanban_details">
<h4 class="oe_partner_heading">