Hello all –
I am using v.16, making customizations to the CRM module – adding attributes to leads - Twitter handle for example, so I'll use twitter_acct from hereon.
I am doing it via inherited views and models.
I was able to successfully create the views to display twitter_acct, store it and edit it in crm_lead table.
I was also able to add the appropriate column in res_partner.
I am failing to propagate the value of twitter_acct from crm_lead to res_partner while the record in res_partner is created when the new crm_lead record appears.
My guesswork:
1. in inherited crm_lead.py I added
CRM_LEAD_FIELDS_TO_MERGE, PARTNER_FIELDS_TO_SYNC
which contain the twitter_acct field.
+ added the twitter_acct var to
_prepare_customer_values res{}
+ copied
_prepare_values_from_partner and _merge_get_fields
since they are using
CRM_LEAD_FIELDS_TO_MERGE, PARTNER_ADDRESS_FIELDS_TO_SYNC
2. in my inherited res_partner.py modified default_get
if lead:
rec.update(
phone=lead.phone,
mobile=lead.mobile,
function=lead.function,
title=lead.title.id,
website=lead.website,
street=lead.street,
street2=lead.street2,
city=lead.city,
state_id=lead.state_id.id,
country_id=lead.country_id.id,
zip=lead.zip,
twitter_acct=lead.twitter_acct,
)
No luck. Twitter_acct does not propagate.
What am I missing?