Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
3542 Vistas

How can I filtter saleperson selection list based on sales channel in CRM. Now salesperson list all employees by default.

For example wanted behavior "America" sales channel have only 3 members, the sales person list shows only that 3 membes, and not all emplyees.

I tried to add domain filtter to salesperson field: <field name="user_id" domain="[('share', '=', False), ('user_id', '=', team_id.member.ids.id)]">

Avatar
Descartar
Mejor respuesta

Hello Simo,

The domain that you are using is wrong. member_ids is not a Many2many field. It is a One2many field.

Use the following domain,

domain="[('share', '=', False), ('sale_team_id', '=', team_id)]"

Hope this helps,

Thank You

Avatar
Descartar
Mejor respuesta

You have two fields sales channel and sales person and on the change of sales channel you needs sales person that are related to sales person. In odoo / openerp you can do this using domain. In other word you need dependent dropdown / many2one.

1 @api.onchange('campus_id')
2 def _campus_onchange(self):
3     res = {}
4     res['domain']={'department_id':[('campus_id', '=', self.campus_id.id)]}
5 return res

For further info and details visit: http://learnopenerp.blogspot.com/2016/10/onchange-many2one-filed-in-odoo.html


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
oct 22
2371
0
feb 24
92
2
ago 25
415
2
may 25
1444
1
abr 25
1350