Browse Source

[FIX] fix the logo display in the mail template

pull/1/head
houssine 6 years ago
parent
commit
e269b49f84
  1. 14
      easy_my_coop/data/mail_template_data.xml
  2. 6
      easy_my_coop/models/company.py

14
easy_my_coop/data/mail_template_data.xml

@ -50,7 +50,7 @@
%endif
<div>
<img src=${object.company_id.logo_web}>
<img src=${object.company_id.logo_url}>
</div>
</div>
]]></field>
@ -102,7 +102,7 @@
%endif
<div>
<img src=${object.company_id.logo_web}>
<img src=${object.company_id.logo_url}>
</div>
</div>
]]></field>
@ -156,7 +156,7 @@
%endif
<div>
<img src=${object.company_id.logo_web}>
<img src=${object.company_id.logo_url}>
</div>
</div>
]]></field>
@ -211,7 +211,7 @@
%endif
<div>
<img src=${object.company_id.logo_web}>
<img src=${object.company_id.logo_url}>
</div>
</div>
]]></field>
@ -265,7 +265,7 @@
%endif
<div>
<img src=${object.company_id.logo_web}>
<img src=${object.company_id.logo_url}>
</div>
</div>
]]></field>
@ -319,7 +319,7 @@
%endif
<div>
<img src=${object.company_id.logo_web}>
<img src=${object.company_id.logo_url}>
</div>
</div>
]]></field>
@ -373,7 +373,7 @@
%endif
<div>
<img src=${object.company_id.logo_web}>
<img src=${object.company_id.logo_url}>
</div>
</div>
]]></field>

6
easy_my_coop/models/company.py

@ -5,6 +5,10 @@ from openerp import fields, models
class ResCompany(models.Model):
_inherit = 'res.company'
def _get_base_logo(self):
base_url = self.env['ir.config_parameter'].get_param('web.base.url')
self.logo_url = base_url + "/logo.png"
coop_email_contact = fields.Char(string="Contact email address for the"
" cooperator")
subscription_maximum_amount = fields.Float(string="Maximum authorised"
@ -38,3 +42,5 @@ class ResCompany(models.Model):
display_logo2 = fields.Boolean(string="Display logo 2")
bottom_logo1 = fields.Binary(string="Bottom logo 1")
bottom_logo2 = fields.Binary(string="Bottom logo 2")
logo_url = fields.Char(string="logo url",
compute="_get_base_logo")
Loading…
Cancel
Save