[IMP] crm: make crm.lead phone field editable

Before this commit, the user could not edit the lead phone field
when a customer was assigned. The phone field was related to the
phone of that customer.

Now, the field related to the phone of the customer is removed.
We can edit the phone field of the lead without modifying the customer
one.

task-2083470

closes odoo/odoo#38350

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
mcm-odoo
2019-11-06 15:10:26 +00:00
parent c957949b8c
commit dbca5aa5b5
2 changed files with 2 additions and 11 deletions
-2
View File
@@ -120,9 +120,7 @@ class Lead(models.Model):
expected_revenue = fields.Monetary('Prorated Revenue', currency_field='company_currency', store=True, compute="_compute_expected_revenue")
date_deadline = fields.Date('Expected Closing', help="Estimate of the date on which the opportunity will be won.")
color = fields.Integer('Color Index', default=0)
partner_address_name = fields.Char('Partner Contact Name', related='partner_id.name', readonly=True)
partner_address_email = fields.Char('Partner Contact Email', related='partner_id.email', readonly=True)
partner_address_phone = fields.Char('Partner Contact Phone', related='partner_id.phone', readonly=True)
partner_is_blacklisted = fields.Boolean('Partner is blacklisted', related='partner_id.is_blacklisted', readonly=True)
company_currency = fields.Many2one(string='Currency', related='company_id.currency_id', readonly=True, relation="res.currency")
user_email = fields.Char('User Email', related='user_id.email', readonly=True)
+2 -9
View File
@@ -177,16 +177,9 @@
<i class="fa fa-ban" style="color: red;" role="img" title="This email is blacklisted for mass mailing"
aria-label="Blacklisted" attrs="{'invisible': ['|', ('partner_is_blacklisted', '=', False), ('partner_address_email', '=', False)]}" groups="base.group_user"/>
<field name="partner_address_email"
attrs="{'invisible': [('partner_address_email', '==', False)]}" widget="email" string="Email"/>
attrs="{'invisible': [('partner_address_email', '=', False)]}" widget="email" string="Email"/>
</div>
<field string="Phone"
name="partner_address_phone"
widget="phone" options="{'enable_sms': True}"
readonly="1"
attrs="{'invisible': [('partner_address_phone', '==', False)]}"/>
<field name="phone"
widget="phone" options="{'enable_sms': True}"
attrs="{'invisible': [('partner_address_phone', '!=', False)]}"/>
<field name="phone" widget="phone" options="{'enable_sms': True}"/>
</group>
<group attrs="{'invisible': [('type', '=', 'opportunity')]}">
<label for="contact_name"/>