Browse Source

[ADD] emc_wsite_portal: Cooperator Certificate

Add a button that allow to download the cooperator certificate.

There is some access right issue for now. So for the moment the function
`send_cooperator_certificate()` in the controller is not used.
pull/1/head
Rémy Taymans 7 years ago
parent
commit
313fc91e0c
  1. 13
      easy_my_coop_website_portal/controllers/main.py
  2. 6
      easy_my_coop_website_portal/views/easy_my_coop_website_portal_templates.xml

13
easy_my_coop_website_portal/controllers/main.py

@ -104,3 +104,16 @@ class CooperatorWebsiteAccount(WebsiteAccount):
"easy_my_coop_website_portal.portal_my_capital_releases", "easy_my_coop_website_portal.portal_my_capital_releases",
values values
) )
@http.route(['/my/cooperator_certificat/send'],
type='http', auth="user", website=True)
def send_cooperator_certificat(self, **kw):
partner = request.env.user.partner_id
certificat_email_template = request.env.ref(
'easy_my_coop.email_template_certificat_increase', False
).sudo()
if certificat_email_template:
certificat_email_template.send_mail(
partner.commercial_partner_id.id
)
return request.redirect(kw['nexturl'])

6
easy_my_coop_website_portal/views/easy_my_coop_website_portal_templates.xml

@ -85,6 +85,12 @@
<label>Legal Representative: </label> <label>Legal Representative: </label>
<t t-esc="coop.representative"/> <t t-esc="coop.representative"/>
</p> </p>
<p class="text-center">
<a t-att-href="'/report/pdf/easy_my_coop.cooperator_certificat_G001/%s' % coop.id"
class="btn btn-default">
Cooperator Certificate
</a>
</p>
</div> </div>
</xpath> </xpath>
</template> </template>

Loading…
Cancel
Save