3.3 KiB
3.3 KiB
Upgrade Guide - Version 18.0.1.1.0
Overview
This upgrade adds two major enhancements to the Subcontracting Inventory Move First module:
- Automatic creation of purchase order lines when linking subcontracting moves
- Filtering out subcontracting moves that have returns
Installation Steps
1. Update Module Files
Ensure all module files are updated to version 18.0.1.1.0
2. Upgrade Module in Odoo
# Option 1: Via Odoo UI
1. Go to Apps menu
2. Remove "Apps" filter
3. Search for "Subcontracting Inventory Move First"
4. Click "Upgrade" button
# Option 2: Via Command Line
./odoo-bin -u subcontracting_inventory_move_first -d your_database_name
3. Verify Installation
After upgrade, verify:
- The
has_returnfield is computed for all stock moves - The link dialog only shows moves without returns
- Linking a move creates a purchase order line automatically
What's New
Feature 1: Auto-Create Purchase Order Lines
Before: When linking a subcontracting move to a purchase order, you had to manually create the purchase order line.
After: The system automatically creates a purchase order line with:
- Product from the move
- Quantity from the move's demand quantity
- Unit of measure from the move
- Price from product's standard price
Example:
Subcontracting Move:
- Product: Component A
- Quantity: 100 Units
After Linking → Purchase Order Line Created:
- Product: Component A
- Quantity: 100
- UoM: Units
- Price: $10.00 (from product standard price)
Feature 2: Filter Moves with Returns
Before: All subcontracting moves were shown in the link dialog, including those with returns.
After: Only valid moves (without returns) are shown in the link dialog.
How it works:
- The system checks if any return move references the original move
- Moves with returns are automatically filtered out
- The
has_returnfield is available in tree views for manual filtering
Testing the Upgrade
Test Case 1: Auto-Create Purchase Order Line
- Create a subcontracting move with:
- Product: Test Product
- Quantity: 50
- Create a purchase order
- Click "Link Subcontracting Moves"
- Select the move and click "Link to Purchase Order"
- Expected Result: A purchase order line is automatically created with the product and quantity
Test Case 2: Filter Moves with Returns
- Create a subcontracting move and mark it as done
- Create a return for this move
- Create a new purchase order
- Click "Link Subcontracting Moves"
- Expected Result: The move with return should NOT appear in the list
Rollback Instructions
If you need to rollback:
- Restore the previous version files
- Downgrade the module:
./odoo-bin -u subcontracting_inventory_move_first -d your_database_name
Support
For issues or questions:
- Check the CHANGELOG.md for detailed changes
- Review the README.md for usage instructions
- Contact: Suherdy Yacob
Database Changes
New Fields Added:
stock.move.has_return(Boolean, Computed, Stored)
Modified Methods:
purchase.order.link_selected_subcontracting_move()- Now creates PO linespurchase.order.action_link_subcontracting_moves()- Updated domain filterstock.move._compute_has_return()- New compute method
No Data Migration Required
This upgrade does not require data migration. All changes are backward compatible.