Skip to content
Snippets Groups Projects
Commit 90748117 authored by Fabien Pinckaers's avatar Fabien Pinckaers Committed by Thibault Delavallée
Browse files

[IMP] crm_phone_validation,crm: add config settings for phone validation in crm

parent 45fdd0b0
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,7 @@ class CRMSettings(models.TransientModel):
# TDE TODO: as it is not linked to ir.values anymore, it should be renamed, but not in stable
default_generate_lead_from_alias = fields.Boolean('Manual Assignation of Emails')
group_use_lead = fields.Boolean(string="Leads", implied_group='crm.group_use_lead')
module_crm_phone_validation = fields.Boolean("Phone Validation")
module_crm_voip = fields.Boolean("Asterisk (VoIP)")
def _find_default_lead_alias_id(self):
......
......@@ -49,6 +49,24 @@
</div>
</div>
</div>
<div class="col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_crm_phone_validation"/>
</div>
<div class="o_setting_right_pane">
<label for="module_crm_phone_validation"/>
<div class="text-muted">
Validate and normalize phone numbers.
</div>
<div class="content-group">
<div class="text-warning mt16" id="module_crm_phone_validation" attrs="{'invisible': [('module_crm_phone_validation','=',False)]}">
<p>
Save this page and come back here to set up the feature.
</p>
</div>
</div>
</div>
</div>
</div>
</xpath>
<xpath expr="//h2[@id='integration_h2']" position="attributes">
......
......@@ -12,6 +12,7 @@ CRM Phone Numbers Validation
This module allows for validate and format phone numbers for leads and contacts.""",
'data': [
'views/sale_config_settings_views.xml',
],
'depends': [
'phone_validation',
......
......@@ -3,3 +3,4 @@
from . import res_partner
from . import crm_lead
from . import sale_config_settings
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class SaleConfigSettings(models.TransientModel):
_inherit = 'sale.config.settings'
crm_phone_valid_method = fields.Boolean(related="company_id.phone_international_format", required=True)
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="sale_config_settings_view_form_inherit_phone_validatation" model="ir.ui.view">
<field name="name">sale.config.settings.view.form.inherit.phone.validatation</field>
<field name="model">sale.config.settings</field>
<field name="inherit_id" ref="crm.sale_config_settings_view_form_inherit_crm" />
<field name="arch" type="xml">
<xpath expr="//div[@id='module_crm_phone_validation']/p" position="replace">
<label for="crm_phone_valid_method"/>
<field name="crm_phone_valid_method"/>
</xpath>
</field>
</record>
</odoo>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment