[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
This commit is contained in:
parent
f4b1d23cf2
commit
a747309ba8
|
@ -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}"/>
|
||||
|
|
Loading…
Reference in New Issue