Skip to content
Snippets Groups Projects
Commit a747309b authored by Jeremy Kersten's avatar Jeremy Kersten
Browse files

[FIX] Add related field in sponsor model to allow public user to get logo from...

[FIX] Add related field in sponsor model to allow public user to get logo from res partner without give all the rights.

bzr revid: jke@openerp.com-20140324134446-vy2vxycwltb8oclf
parent f4b1d23c
No related branches found
No related tags found
No related merge requests found
......@@ -171,6 +171,7 @@ class event_sponsors(osv.osv):
'partner_id': fields.many2one('res.partner', 'Sponsor/Customer', required=True),
'url': fields.text('Sponsor Website'),
'sequence': fields.related('sponsor_type_id', 'sequence', string='Sequence', store=True),
'image_medium': fields.related('partner_id', 'image_medium', string='Logo')
}
def has_access_to_partner(self, cr, uid, ids, context=None):
......
......@@ -15,10 +15,10 @@
<h2 class="text-center mb32">Our Sponsors</h2>
</section>
<div class="row">
<div t-attf-class="col-md-#{(len(event.sponsor_ids) > 6) and 2 or (12/ len(event.sponsor_ids))} text-center" t-foreach="event.sponsor_ids" t-as="sponsor">
<div t-attf-class="col-md-#{(len(event.sponsor_ids) > 6) and 2 or (12/ len(event.sponsor_ids))} text-center mb16" t-foreach="event.sponsor_ids" t-as="sponsor">
<t t-if="sponsor.url">
<a t-att-href="sponsor.url" style="position: relative; display: inline-block;">
<span t-field="sponsor.partner_id.image"
<span t-field="sponsor.image_medium"
t-field-options='{"widget": "image", "class": "shadow"}'/>
<div class="ribbon-wrapper">
<div t-field="sponsor.sponsor_type_id" t-attf-class="ribbon ribbon_#{sponsor.sponsor_type_id.name}"/>
......@@ -27,7 +27,7 @@
</t>
<t t-if="not sponsor.url">
<span style="position: relative; display: inline-block;">
<span t-field="sponsor.partner_id.image"
<span t-field="sponsor.image_medium"
t-field-options='{"widget": "image", "class": "shadow"}'/>
<div class="ribbon-wrapper">
<div t-field="sponsor.sponsor_type_id" t-attf-class="ribbon ribbon_#{sponsor.sponsor_type_id.name}"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment