[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:
@@ -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)
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
Reference in New Issue
Block a user