Community mailing list archives

community@mail.odoo.com

Re: DOMAIN FILTERS FOR PRODUCTS

by
mudoko
- 03/16/2016 09:51:48
I have created one2many field(location_id ) on the res.users form, then in  rule on stock.location object  i add  [('id','=',user.location_id.id)]
, created a new user assigned the particular location but what i get when i login with the new user:
The requested operation cannot be completed due to security restrictions. Please contact your system administrator.

(Document type: stock.warehouse, Operation: read) 


Systems developer

Laballieds,

Nairobi:gate 256, Nairobi.

P.O.Box - 45855 -00100, Nairobi.

Tel:+254 721449067

Email petypi@gmail.com

Mobile: +254 721449067

Website www.softlinkoptions.com


On Wed, Mar 16, 2016 at 10:31 AM, Peter Mudoko <petypi@gmail.com> wrote:

Thanks Hans

On Mar 16, 2016 10:09, "Hans Yonathan" <hans.yonathan@falinwa.com> wrote:

Domain with name(ie: location_id.name) is a bad practice,

You can just use id(ie: location_id.id) instead, or without using ‘name’ or ‘id’ I think it can work too(ie: location_id)

 

Thank You.

 

Best Regards,

Hans Yonathan

CTO

FALINWA Limited

Expert in Finance, Information System & Business Intelligence

Odoo Silver Partner

Website: www.falinwa.com

Tel. 13670137019 (China - Shenzhen)

 

From: Peter Mudoko [mailto:petypi@gmail.com]
Sent: Wednesday, March 16, 2016 2:53 PM
To: Community <community@mail.odoo.com>
Subject: DOMAIN FILTERS FOR PRODUCTS

 

Hi guys i want to limit which products users can access(in internal transfers and receipts/deliveries) per location(or warehouse) i have created many2one field location_id in product_template so have added in internal transfers form,product_id fielddomain = [('product_id.product_tmpl_id.location_id.name,'=',location_id.name)] . I am planning to do same for receipt and deliveries) , am i on the right path or their is a simplar way of doing it. I want users to view only products assigned to their warehouse. Thanks in advance

 

Systems developer

Laballieds,

Nairobi:gate 256, Nairobi.

P.O.Box - 45855 -00100, Nairobi.

Tel:+254 721449067

Email petypi@gmail.com

Mobile: +254 721449067

Website www.softlinkoptions.com

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe