Odoo Help

0

How can i set team sales permissions in CRM?

By
SANTIAGO
on 2/5/13, 2:02 PM 3,867 views

In V6 you can set the permissions in crm.lead using this domain:

[('section_id','=',user.context_section_id.id)]

But in V7 context_section_id doesn't exist, so how can I filter this same domain in V7?

I'd tried this:

[('section_id.user_ids','in',[uid])]

and it gives me this error:

NameError: name 'uid' is not defined.

Also, trying this:

[('section_id','=',section_id.user_id)]

Gives:

NameError: name 'section_id' is not defined

So, it seems like there is no section_id for user_id

Maybe something like this would work:

'section_id','=',  'section_id' for 'member_id' of 'user_id' from 'sale_member_rel' table

But I don't know how to write this code...

Your question title is not clear. Please edit it. Also, make sure to escape your underscores to display them instead of writing in italic.

Fabrice Henrion (fhe)
on 2/5/13, 2:38 PM

in early versions of v7, i used "user.section_id.id" but I had to add "default_" for the later versions of v7

Ong Li Wee
on 2/28/13, 3:09 AM
2
Ong Li Wee
On 2/7/13, 1:08 AM

this worked for me ('section_id','=',user.default_section_id.id)

Hi. I'm Santiago's partner. With ('section_id','=',user.default_section_id.id) we can see another error: AttributeError: "Field 'default_section_id' does not exist in object 'browse_record(res.users, 27)'" We only use CRM module, not Sales module. Maybe that's why?

Miguel Fernández
on 2/7/13, 6:33 AM

Hi, do u have a test server? Try installing the following modules (CRM, Sales Management, Warehouse Management, Claim Management, LDAP, Document Management System). And you must set the default sales team under settings -> users -> preferences.

Ong Li Wee
on 2/7/13, 7:43 PM

Thank you On Li Wee! We do have a test server and I'm almost sure that if we install SALES module, your code will work! But we want to keep a clean install with only the CRM that we are using now...

SANTIAGO
on 2/8/13, 4:49 AM

this one works for me. FYI

Shanghai Open Stone Co., LTD., Oliver Yuan
on 4/7/13, 3:54 AM
1
Oliver Yuan
On 4/7/13, 3:47 AM

['|',('section_id.member_ids','in',[user.id]),('section_id','=',False)]

this can work, but cause can not read on res.partner select partner when create SO

陈帆
on 6/21/13, 7:47 AM
0

Fabien Pinckaers (fp)

--Fabien Pinckaers (fp)--
6669
| 6 8 8
fsdsdfsdf, Belgium
--Fabien Pinckaers (fp)--

Odoo Founder & CEO

Fabien Pinckaers (fp)
On 2/5/13, 4:41 PM

Try something like:

[('section_id.user_ids','in',[uid])]

0
陈帆
On 6/23/13, 11:59 PM

both ['|',('section_id.member_ids','in',[user.id]),('section_id','=',False)] and ['|', ('section_id','=',user.default_section_id.id), ,('section_id','=',False)] is worked to filter customer via sales teams.

and ['|',('section_id.member_ids','in',[user.id]),('section_id','=',False)] is the best filter.

but there have one issue.

when select partner in create SO, it raise error.

Access Denied

The requested operation cannot be completed due to security restrictions. Please contact your system administrator.

(Document type: Partner, Operation: read)

there may be have security conflict in those rules.

0
SANTIAGO
On 2/6/13, 4:54 AM

I'd tried this:

[('section_id.user_ids','in',[uid])]

and it gives me this error:

NameError: name 'uid' is not defined.

Also, trying this:

[('section_id','=',section_id.user_id)]

Gives:

NameError: name 'section_id' is not defined

So, it seems like there is no section_id for user_id

Maybe something like this would work:

'section_id','=',  'section_id' for 'member_id' of 'user_id' from 'sale_member_rel' table

but I don't know how to write this code...

Try to use user.id in place of uid, i hope that it will works

Yug Faa
on 2/6/13, 5:17 AM

Another error: ValueError: Invalid field 'user_ids' in leaf "<osv.ExtendedLeaf: ('user_ids', 'in', [27]) on crm_case_section (ctx: )>

SANTIAGO
on 2/6/13, 7:17 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)

Stats

Asked: 2/5/13, 2:02 PM
Seen: 3867 times
Last updated: 3/16/15, 8:10 AM