Skip to content
Snippets Groups Projects
Commit db28e23e authored by Yannick Tivisse's avatar Yannick Tivisse
Browse files

[FIX] website_portal_sale: Remove useless/broken link to backend from my/order,quote

portal_sale: Remove invalid 'get_formview_action' overwrite

This commit https://github.com/odoo/odoo/commit/ecd58457ed2311cfec8cae9d01b04ce995b31ec7 has removed some backend portal actions, but didn't remove them from the template links.
parent 88d8a2ca
Branches
Tags
No related merge requests found
......@@ -22,12 +22,3 @@ class AccountInvoice(models.Model):
action='/mail/view',
model=self._name,
res_id=self.id)[self.partner_id.id]
@api.multi
def get_formview_action(self):
# NOTE : if this method is call as sudo, the only to determine if the user is portal is to check the uid from context
# This was introduced with https://github.com/odoo/odoo/commit/f5fedbcb18a57ee9aeab952f3ff95f692f7a863c, and should be better fixed.
uid = self.env.context.get('uid', self.env.user.id)
if self.env['res.users'].sudo().browse(uid).share:
return self.env['ir.actions.act_window'].for_xml_id('portal_sale', 'portal_action_invoices')
return super(AccountInvoice, self).get_formview_action()
......@@ -22,13 +22,3 @@ class SaleOrder(models.Model):
action='/mail/view',
model=self._name,
res_id=self.id)[self.partner_id.id]
@api.multi
def get_formview_action(self):
# NOTE : if this method is call as sudo, the only to determine if the user is portal is to check the uid from context
# This was introduced with https://github.com/odoo/odoo/commit/f5fedbcb18a57ee9aeab952f3ff95f692f7a863c, and should be better fixed.
uid = self.env.context.get('uid', self.env.user.id)
if self.env['res.users'].sudo().browse(uid).share:
action_xmlid = 'action_quotations_portal' if self.state in ('draft', 'sent') else 'action_orders_portal'
return self.env['ir.actions.act_window'].for_xml_id('portal_sale', action_xmlid)
return super(SaleOrder, self).get_formview_action()
......@@ -381,19 +381,4 @@
</t>
</template>
<template id="sale_backend_link" inherit_id='website_portal_sale.portal_my_orders' customize_show="True" name="Link to Sales Backend" active="False">
<xpath expr="//h3[@class='page-header']" position="inside">
<a href="/web#action=portal_sale.action_orders_portal" target="_blank" class="btn btn-default btn-xs pull-right"> Access the complete Sale application</a>
</xpath>
</template>
<template id="sales_backend_access" inherit_id='website_portal_sale.orders_followup' customize_show="True" name="Backend Access" active="False">
<xpath expr="//div[@id='optional_placeholder']" position="inside">
<h4 class="text-muted text-center mt64 mb64">
If you wish to access the complete application to manage your orders, you can follow
<a href="/web#action=portal_sale.action_orders_portal">this link</a>.
</h4>
</xpath>
</template>
</odoo>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment