Hi!
I would like to add a button in contact that will link to crm.lead that the contact sold.
Because of the crm.lead salesman is link by a user_id I created a computed many2one field (stored) crm_user_id to the linked user:
record.crm_user_id = self.env['res.users'].search([('partner_id', '=', record.id)]).id
The id is right but when I want to use it for the domain I get this error:
Uncaught Error: NameError: name 'crm_user_id' is not defined
http://localhost:8069/web/content/654-6128a20/web.assets_backend.js:145
Traceback:
Error: NameError: name 'crm_user_id' is not defined
When I set a fixe value like 2 (the id of one on my user) instead of the var crm_user_id It works perfectly
The domain in question is set like that: