[FIX] phone_valdation: fix default behaviour for numbers formatting

before this commit, the selection on res.company was by default hiding the country prefix. THe option was not available on res.company view.

We fix the default behaviour and add the option in the res.company view in debug mode.
This commit is contained in:
Rémi Rahir
2018-01-10 15:39:28 +01:00
parent 932ac72c7e
commit 13baea56b9
3 changed files with 19 additions and 1 deletions
+1
View File
@@ -16,6 +16,7 @@ formatting.
This module applies this feature to Leads and Contacts.""",
'data': [
'views/res_company_view.xml'
],
'depends': ['base'],
}
@@ -10,7 +10,7 @@ class ResCompany(models.Model):
phone_international_format = fields.Selection([
('no_prefix', 'No prefix'),
('prefix', 'Add international prefix'),
],string="Local Numbers", default="no_prefix",
], string="Local Numbers", default="prefix",
help="Always encode phone numbers using international format. Otherwise "
"numbers coming from the company's country are nationaly formatted. "
"International numbers are always using international format."
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
The purpose of this view is to move the VAT field at the top of the
company form. That way, the user will fill it first
-->
<odoo>
<record id="res_company_view_form_phone_validation" model="ir.ui.view">
<field name="name">res.company.view.form.phone_validation</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='phone']" position="after">
<field name="phone_international_format" groups="base.group_no_one"/>
</xpath>
</field>
</record>
</odoo>