add website_membership_signup_required: force to create user before add to cart a membership product
This commit is contained in:
parent
80f24bcc46
commit
c4d32c6add
22 changed files with 1202 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="auth_signup_fields_firstname_lastname" name="Auth Signup fields (firstname / lastname)" inherit_id="auth_signup.fields">
|
||||
<xpath expr="//div[hasclass('field-name')]" position="replace">
|
||||
<div class="mb-3 field-firstname">
|
||||
<label for="firstname">First name</label>
|
||||
<input type="text" name="firstname" t-att-value="firstname" id="firstname"
|
||||
class="form-control form-control-sm" placeholder="e.g. John"
|
||||
required="required"
|
||||
t-att-readonly="'readonly' if only_passwords else None"
|
||||
t-att-autofocus="'autofocus' if login and not only_passwords else None"/>
|
||||
</div>
|
||||
<div class="mb-3 field-lastname">
|
||||
<label for="lastname">Last name</label>
|
||||
<input type="text" name="lastname" t-att-value="lastname" id="lastname"
|
||||
class="form-control form-control-sm" placeholder="e.g. Doe"
|
||||
required="required"
|
||||
t-att-readonly="'readonly' if only_passwords else None"/>
|
||||
</div>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="res_config_settings_view_form_membership_signup" model="ir.ui.view">
|
||||
<field name="name">res.config.settings.view.form.inherit.membership.signup</field>
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="website_sale.res_config_settings_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//setting[@id='website_checkout_registration']" position="after">
|
||||
<setting string="Membership signup required"
|
||||
help="When enabled, anonymous visitors trying to add a membership product to cart are redirected to /web/signup before the product is added. Applies per-website, only in b2b (guest checkout) mode.">
|
||||
<field name="membership_signup_required"/>
|
||||
</setting>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue