| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Inventory (stock)
• Purchase (purchase) • Sales (sale_management) • Discuss (mail) • Invoicing (account) |
| Lines of code | 468 |
| Technical Name |
top_sales_purchase_line_location |
| License | LGPL-3 |
| Website | https://www.topbusiness.io |
| Versions | 18.0 19.0 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Inventory (stock)
• Purchase (purchase) • Sales (sale_management) • Discuss (mail) • Invoicing (account) |
| Lines of code | 468 |
| Technical Name |
top_sales_purchase_line_location |
| License | LGPL-3 |
| Website | https://www.topbusiness.io |
| Versions | 18.0 19.0 |
Product Sales & Purchase By Location
Advanced location management for sales orders, purchase orders, and internal transfers with user access control
Sale Order Location
Add location field on sale order lines. Products will be delivered from the selected location. Delivery orders are created based on selected location.
Purchase Order Location
Add location field on purchase order lines. Products will be received at the selected location. Purchase receipts are created based on selected location.
Separate Receipts
Each different location gets its own separate inventory receipt. Products are automatically grouped by location for better organization.
Internal Transfers
Add location field on internal transfer lines. Products transferred to selected destination location. Transfers grouped by destination location.
User Access Control
Set allowed users on warehouse locations. Users can only see and select locations they have access to in sale/purchase orders.
Data Validation
Prevents duplicate product+location combinations in same order. Ensures data integrity and prevents errors.
Smart Filtering
Domain restrictions on stock picking location fields. Filters locations by usage type and company automatically.
Portal Integration
Location information visible in customer portal. Customers can see delivery locations on their orders.
Report Integration
Location information included in sale order reports. Better tracking and reporting capabilities.
Installation Steps
-
Upload the Module
Copy the module folder to your Odoo addons directory or upload via Apps menu.
-
Update Apps List
Go to Apps menu, click "Update Apps List" to refresh available modules.
-
Install the Module
Search for "Product Sales & Purchase By Location" and click Install.
-
Configure Locations
Go to Inventory → Locations → Open a location → Set "Allowed Users" field to restrict access.
-
Start Using
Create sale/purchase orders and select locations on order lines. The system will automatically handle location grouping.
How to Use
Sale Orders
- Create a new Sale Order
- Add products to order lines
- Select a location for each product line (only locations you have access to will be shown)
- Confirm the order
- Products will be delivered from the selected locations
- Separate delivery orders are created for each different location
Purchase Orders
- Create a new Purchase Order
- Add products to order lines
- Select a destination location for each product line
- Confirm the order
- Products will be received at the selected locations
- Separate inventory receipts are created for each different location
Internal Transfers
- Create a new Internal Transfer
- Add products to move lines
- Select destination location for each product line
- Confirm the transfer
- Separate internal transfers are created for each different destination location
Setting User Access Rights
- Go to Inventory → Locations
- Open the location you want to restrict
- In the "Allowed Users" field, select the users who should have access
- If no users are selected, all users can access the location
- Save the location
- Only selected users will see this location in sale/purchase orders
Technical Details
Module Structure
- Models:
- sale.order.line - Adds line_location_id field with user-based domain
- purchase.order.line - Adds line_location_id field with user-based domain
- stock.move - Adds line_location_dest_id for internal transfers
- stock.location - Adds allowed_user_ids Many2many field
- stock.picking - Handles location grouping for internal transfers
- stock.rule - Handles location in stock move creation
- sale.order - Validation and grouping logic
- purchase.order - Validation and receipt grouping
- Views:
- sale_order_views.xml - Location field in sale order lines
- purchase_order_views.xml - Location field in purchase order lines
- stock_location_views.xml - Allowed users field in location form
- stock_picking_views.xml - Location field in internal transfers
Key Features Implementation
- Location Filtering: Dynamic domain based on current user's access rights
- Receipt Grouping: Automatic separation of receipts by location
- Move Creation: Override _prepare_stock_moves to set correct locations
- Validation: Prevent duplicate product+location in same order
- User Access: Many2many relation between locations and users
API Methods
_get_location_domain()- Returns domain filtered by user access_prepare_stock_moves()- Sets location_dest_id from line location_create_picking()- Groups moves by locationbutton_confirm()- Regroups moves after confirmationaction_confirm()- Handles internal transfer grouping
Need Help or Customization?
Get in touch with TopBusiness for support, customization, or implementation assistance
Website
www.topbusiness.io
+201011827324
Copyright © 2024 TopBusiness
Website: topbusiness.io | WhatsApp: +201011827324
This module is licensed under LGPL-3. You can modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3).
Please log in to comment on this module