houssine 5 years ago
parent
commit
c8881872e6
  1. 2
      easy_my_coop/controllers/main.py
  2. 12
      easy_my_coop/view/product_view.xml
  3. 4
      easy_my_coop/view/subscription_template.xml

2
easy_my_coop/controllers/main.py

@ -275,7 +275,7 @@ class WebsiteSubscription(http.Controller):
max_amount = max_amount - partner.total_value
if company.unmix_share_type:
share = self.get_selected_share(kwargs)
if partner.cooperator_type != share.short_name:
if partner.cooperator_type != share.default_code:
values = self.fill_values(values, is_company, logged)
values["error_msg"] = (_("You can't subscribe two "
"different types of share"))

12
easy_my_coop/view/product_view.xml

@ -35,7 +35,17 @@
</xpath>
</field>
</record>
<record id="product_template_only_form_view" model="ir.ui.view">
<field name="name">product.template.product.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<field name="default_code" position="attributes">
<attribute name="attrs">{'required': [('is_share', '=', True)]}</attribute>
</field>
</field>
</record>
<record id="share_product_action" model="ir.actions.act_window">
<field name="name">Share type</field>

4
easy_my_coop/view/subscription_template.xml

@ -86,11 +86,11 @@
</div>
</div>
<div name="confirm_email_container" t-attf-class="form-group #{error and 'email_from' in error and 'has-error' or ''}">
<div t-if="not logged" name="confirm_email_container" t-attf-class="form-group #{error and 'email_from' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="confirm_email">Confirm Email</label>
<div class="col-md-7 col-sm-8 bottom-line" style="padding-bottom:20px">
<input type="confirm_email" class="form-control mandatory-field" name="confirm_email"
required="required" t-att-readonly="logged"
t-att-required="not logged" t-att-readonly="logged"
t-attf-value="#{confirm_email or ''}" placeholder="didier.bourdon@bees-coop.be"/>
</div>
</div>

Loading…
Cancel
Save