Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
3580 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
říj 22
2384
0
úno 24
92
2
srp 25
474
2
kvě 25
1464
1
dub 25
1362