To set utm values (medium, source and campaign) on created record, the system use default function which check cookies and other funny things. But for website form creating a record, the medium value would be overrided always to Website whilst that should be a fallback (and the set medium should have priority). closes #10848 opw-668853
13 lines
419 B
Python
13 lines
419 B
Python
from openerp import models, SUPERUSER_ID
|
|
|
|
class Lead(models.Model):
|
|
_inherit = 'crm.lead'
|
|
|
|
def website_form_input_filter(self, request, values):
|
|
values['medium_id'] = (
|
|
values.get('medium_id') or
|
|
self.default_get(['medium_id']).get('medium_id') or
|
|
self.sudo().env['ir.model.data'].xmlid_to_res_id('utm.utm_medium_website')
|
|
)
|
|
return values
|