Odooers论坛

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

How to assign a user to a specific warehouse

形象
odoo
形象
丢弃
2 答案
0
形象
odoo
最佳答案

Hi,

1. add custom field to Users Model:

Settings -> Technical -> fields , and add this information

1.1. first field (to restrict warehouse)


1.2. to restrict "location"


2. go to user form view add show added fields from previous step:

2.1. display first field

"Allowed warehouses", "allowed locations"

 

3. to give more dynamic manipulation create new group:

for example: restriction will just be applied to users who belong to specific group



4. add the following record rules by going to :

Settings -> Technical -> record rules

4.1. first one "to restrict wrehouses"

[('id','in',[w.id for w in user.x_warehouse_ids])]


4.2. second "to restrict picking type"

[('warehouse_id','in',[w.id for w in user.x_warehouse_ids])]


4.3. third "to restrict loction in reports" (optional):

[('location_id','in',[ws.id for ws in user.x_loc_ids])]


5. add warehouse user to "X group" which we created in step 3:



6. add warehouse to this user:

for example "warehouse 1" and locations for this warehouse



7. Test user dashboard will be:

Notes : he will only see operations for warehouse 1, i have created 3 warehouses, also he will only see products which are in specified allowed locations



Hope this will help.


形象
丢弃
0
形象
odoo
最佳答案

This has to be done using record rules and access groups. Refer the Odoo documentation in the below link

https://www.odoo.com/documentation/15.0/developer/howtos/rdtraining/B_acl_irrules.html


形象
丢弃