[IMP] website_sale: replace signup by 'Sign In' in checkout

+ add link in confirmation page to propose the signup in b2c
This commit is contained in:
Jeremy Kersten
2017-09-30 12:21:27 +02:00
parent 4edf03b5d9
commit 29dec43ce8
2 changed files with 11 additions and 2 deletions
+4
View File
@@ -300,6 +300,10 @@ class Website(models.Model):
def is_user(self):
return self.env['ir.model.access'].check('ir.ui.menu', 'read', False)
@api.model
def is_public_user(self):
return request.env.user.id == request.website.user_id.id
@api.model
def get_template(self, template):
View = self.env['ir.ui.view']
+7 -2
View File
@@ -1142,8 +1142,7 @@
<t t-if="mode == ('new', 'billing')">
<h3 class="page-header mt32 ml16">Your Address
<small> or </small>
<t t-set='connect' t-value="request.env['ir.config_parameter'].sudo().get_param('auth_signup.allow_uninvited') == 'True' and ('signup', 'Sign Up') or ('login', 'Log In')"/>
<a t-attf-href='/web/{{connect[0]}}?redirect=/shop/checkout' class='btn btn-primary' style="margin-top: -11px"><t t-esc='connect[1]'/></a>
<a href='/web/login?redirect=/shop/checkout' class='btn btn-primary' style="margin-top: -11px">Log In</a>
</h3>
</t>
<t t-if="mode == ('edit', 'billing')">
@@ -1502,6 +1501,12 @@
</tbody>
</table>
<t t-call="website_sale.payment_confirmation_status" />
<t t-if="request.env['ir.config_parameter'].sudo().get_param('auth_signup.allow_uninvited') == 'True' and request.website.is_public_user()">
<p class='alert alert-info mt16'>
<a t-att-href='order.partner_id.signup_prepare() and order.partner_id.signup_url' class='btn btn-primary'>Sign Up</a>
Now to Follow Your Order
</p>
</t>
</div>
</div>
<div class="col-md-3 hidden-sm hidden-xs text-muted">