İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
3593 Görünümler

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
Vazgeç
En İyi Yanıt

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
Vazgeç
En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Eki 22
2404
0
Şub 24
92
2
Ağu 25
559
2
May 25
1496
1
Nis 25
1416