Browse Source

Modif select pays

12.0
Juliana 4 years ago
parent
commit
79b59171fb
  1. 2
      controllers/main.py
  2. 25
      views/templates.xml

2
controllers/main.py

@ -11,4 +11,4 @@ class VracoopWebsiteSale(WebsiteSale):
def _get_mandatory_billing_fields(self):
res = super(VracoopWebsiteSale, self)._get_mandatory_billing_fields()
return ["name", "email", "phone", "country_id"]
return ["name", "email", "phone"]

25
views/templates.xml

@ -10,6 +10,31 @@
</label>
</div>
</xpath>
<xpath expr="//select[@id='country_id']" position="replace">
<select id="country_id" name="country_id" t-attf-class="form-control #{error.get('country_id') and 'is-invalid' or ''}">
<t t-foreach="countries" t-as="c">
<t t-if="country">
<option t-att-value="c.id" t-att-selected="c.id == (country and country.id or -1)">
<t t-esc="c.name" />
</option>
</t>
<t t-else="">
<t t-if="c.id == 75">
<option t-att-value="c.id" selected="1">
<t t-esc="c.name" />
</option>
</t>
<t t-else="">
<option t-att-value="c.id" t-att-selected="c.id == (country and country.id or -1)">
<t t-esc="c.name" />
</option>
</t>
</t>
</t>
</select>
</xpath>
</template>
</odoo>
Loading…
Cancel
Save