How can I set up an internal transfer between different warehouses in Odoo while ensuring that the receiving warehouse can view the transfer record created by the source warehouse, without exposing the entire list of transfer records from other warehouses?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
Hello
You want to set up inter-warehouse transfers in Odoo where each warehouse can see the transfers they are involved in (either sending or receiving) but not see all transfers happening across the entire organization. Here's how you can achieve this using a combination of security groups, record rules, and potentially some automation:
1. Security Groups:
- Create separate security groups for each warehouse. For example:
- Warehouse A User
- Warehouse B User
- Warehouse C User
- Assign users to the appropriate security group based on which warehouse they work at.
2. Record Rules (Crucial for Visibility Control):
- Record rules are the core of controlling which transfer records each warehouse can see. You'll create rules on the stock.picking model (which represents the transfer).
- Rule 1: Warehouse A Can See Transfers Where Source or Destination is Warehouse A
[('location_id.warehouse_id', '=', user.warehouse_id.id), ('company_id', '=', user.company_id.id)] or [('location_dest_id.warehouse_id', '=', user.warehouse_id.id), ('company_id', '=', user.company_id.id)]
- Apply this rule to the Warehouse A User group.
- This rule says: "A user in the 'Warehouse A User' group can see a transfer record if either the source location's warehouse or the destination location's warehouse is Warehouse A, and the company matches the user's company."
- Rule 2: Warehouse B Can See Transfers Where Source or Destination is Warehouse B
[('location_id.warehouse_id', '=', user.warehouse_id.id), ('company_id', '=', user.company_id.id)] or [('location_dest_id.warehouse_id', '=', user.warehouse_id.id), ('company_id', '=', user.company_id.id)]
- Apply this rule to the Warehouse B User group.
- This rule is the same as above, but it applies to Warehouse B.
- Repeat for Each Warehouse: Create similar record rules for each warehouse, adjusting the user.warehouse_id.id in the domain to match the correct warehouse.
How Record Rules Work
- Odoo automatically applies these rules whenever a user tries to access transfer records.
- The rules filter the records based on the conditions you define.
- Users will only see the transfer records that match the conditions in their assigned record rules.
Detailed Steps in Odoo
- Enable Developer Mode: Go to Settings and activate Developer Mode (also called Debug Mode).
- Create Security Groups:
- Go to Settings -> Users & Companies -> Groups.
- Create a new group (e.g., "Warehouse A User").
- In the "Inherited" tab, add the "Inventory / User" group. This gives them basic inventory access.
- Repeat for each warehouse.
- Assign Users to Groups:
- Go to Settings -> Users & Companies -> Users.
- Edit each user and assign them to the appropriate warehouse security group. Make sure they only have the group for their warehouse (and "Inventory / User").
- Create Record Rules:
- Go to Settings -> Technical -> Record Rules.
- Click "Create."
- Name: "Warehouse A Transfers"
- Model: stock.picking
- Groups: Select "Warehouse A User"
- Domain Filter: (Paste the Python code from above, replacing user.warehouse_id.id with the actual ID of Warehouse A's warehouse record. You can find the warehouse ID in the URL when you're viewing the warehouse form.) It's best practice to use the user.warehouse_id.id if you configure the user's warehouse in their user profile.
- Permissions: Check "Read" (and potentially "Write" if you want them to be able to edit transfers). Leave "Create" and "Delete" unchecked unless you want them to be able to create and delete all transfers that match the rule (which is usually not what you want).
- Apply to Read, Write, Create, Delete: Check the boxes to apply the rule to all operations.
- Repeat this process for each warehouse, creating a record rule for each.
Important Considerations and Enhancements
- User's Warehouse: The record rules rely on the user.warehouse_id field. Make sure you configure the "Warehouse" field on each user's profile (in the "Preferences" tab). If this field is not set, the rules won't work correctly.
- Company: The company_id check in the record rules is important if you have a multi-company Odoo setup. It ensures that users only see transfers within their company.
- Transfer Types: If you have different types of transfers (e.g., internal transfers, deliveries, receipts), you might need to create separate record rules for each type to fine-tune the visibility. You can add conditions to the domain filter to check the picking_type_id field on the stock.picking record.
- Automation (Optional): You can automate the process of assigning users to the correct warehouse security group when they are created. This can be done with a server action or a custom module.
- Testing: Thoroughly test the setup by logging in as users from different warehouses and verifying that they can only see the transfers they are supposed to see.
- Performance: Complex record rules can impact performance. Keep the rules as simple and efficient as possible. Use indexed fields in your domain filters.
- Security Review: Have a security expert review your record rules to ensure that they are correctly configured and don't have any unintended consequences.
Troubleshooting
- Record Rules Not Working: Double-check the following:
- Is Developer Mode enabled?
- Are the record rules active?
- Are the users assigned to the correct security groups?
- Is the user.warehouse_id field configured on each user's profile?
- Is the domain filter correct? Use the "Test Domain" button in the record rule form to verify that it's working as expected.
- Are there any conflicting record rules? Odoo applies all matching record rules, so conflicting rules can cause unexpected behavior.
- Too Many Records Visible: The domain filter is likely too broad. Narrow it down to only include the records that the user should see.
- Not Enough Records Visible: The domain filter is likely too restrictive. Broaden it to include all the records that the user should see.
By carefully implementing these security groups and record rules, you can create a secure and efficient inter-warehouse transfer system in Odoo. Remember to test thoroughly and adjust the configuration to meet your specific business requirements.
🚀 Did This Solve Your Problem?
If this answer helped you save time, money, or frustration, consider:
✅ Upvoting (👍) to help others find it faster
✅ Marking as "Best Answer" if it resolved your issue
Your feedback keeps the Odoo community strong! 💪
(Need further customization? Drop a comment—I’m happy to refine the solution!)
Hello ,
I have shared a post and also prepared a video demonstrating how to perform an internal stock transfer between multiple warehouses. Please review the link below. It should meet your requirements.
Hi,
Refer to the following for managing the inter-warehouse transfer.
* Forum : - https://www.odoo.com/sl_SI/forum/pomoc-1/solved-transfers-between-branches-multi-company-operations-260999
Hope it helps
i have a greet module for warehouse transfers if you are interested contact me eng.omar.imad@gmail.com
🚚 How to Make Internal Transfers in Odoo 🚚
Learn how to set up and perform internal transfers in Odoo with these simple steps!
⚙️ Activate Storage Locations and Multi-Step Routes
Go to the Inventory application.
Click on Configuration > Settings.
In the Warehouse section, check the boxes for Storage Locations and Multi-Step Routes.
Save the changes by clicking Save.
📦 Create an Internal Transfer
Go to the Inventory application.
On the dashboard, locate the Internal Transfers task card and click the # To Process button.
Click Create in the upper left corner of the page. This will take you to a new Internal Transfer form.
📍 Set Up the Transfer
The Operation Type will automatically appear as Internal Transfers.
The Source Location and Destination Location fields will default to WH/Stock, but you can change them to the locations you’re moving products from and to.
Once you’ve selected the locations, add the products you want to transfer.
And that’s it! 🎉 Your internal transfer is set up and ready to go.
https://www.odoo.com/documentation/18.0/applications/finance/accounting/bank/internal_transfers.html
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
0
Dec 24
|
837 | ||
|
0
May 25
|
132 | ||
|
0
Nov 23
|
928 | ||
|
3
Aug 24
|
5922 | ||
|
0
Feb 24
|
949 |