From 1d70ecd80d591e98a3f0a422df3dfe2ace3b0f5d Mon Sep 17 00:00:00 2001 From: Richard Mathot Date: Fri, 23 May 2014 11:55:48 +0200 Subject: [PATCH 1/2] [IMP] website: add max_height and max_width options to image Qweb widget --- addons/website/models/ir_qweb.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/website/models/ir_qweb.py b/addons/website/models/ir_qweb.py index ad2b63a6dd9..40b407a040a 100644 --- a/addons/website/models/ir_qweb.py +++ b/addons/website/models/ir_qweb.py @@ -265,10 +265,16 @@ class Image(orm.AbstractModel): if options is None: options = {} classes = ['img', 'img-responsive'] + options.get('class', '').split() - return ir_qweb.HTMLSafe('' % ( + size_params = [] + if options.has_key('max_width'): + size_params.append("max_width=%i" % options['max_width']) + if options.has_key('max_height'): + size_params.append("max_height=%i" % options['max_height']) + + return ir_qweb.HTMLSafe('' % ( ' '.join(itertools.imap(werkzeug.utils.escape, classes)), record._model._name, - field_name, record.id)) + field_name, record.id, '&'.join(size_params))) local_url_re = re.compile(r'^/(?P[^]]+)/static/(?P.+)$') def from_html(self, cr, uid, model, column, element, context=None): From 15ea4563afec91c0a7449f37f5ccb3d9ceea3538 Mon Sep 17 00:00:00 2001 From: Richard Mathot Date: Fri, 23 May 2014 11:58:25 +0200 Subject: [PATCH 2/2] [FIX] website_crm_partner_assign: better display of partners logos --- .../views/website_crm_partner_assign.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_crm_partner_assign/views/website_crm_partner_assign.xml b/addons/website_crm_partner_assign/views/website_crm_partner_assign.xml index 6d5b93793ad..0dd5616070b 100644 --- a/addons/website_crm_partner_assign/views/website_crm_partner_assign.xml +++ b/addons/website_crm_partner_assign/views/website_crm_partner_assign.xml @@ -86,8 +86,8 @@