Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
3577 Widoki

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)]">

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź

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


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
paź 22
2383
0
lut 24
92
2
sie 25
462
2
maj 25
1460
1
kwi 25
1360