Ways to Handle Cancelled Pickings in Odoo
Batch Transfers in Odoo make warehouse operations faster by grouping deliveries and processing them together. However, a common issue arises when a picking is cancelled, it often still remains inside the Batch Transfer list, leading to:
- Confusion for warehouse staff
- Incorrect processing of cancelled pickings
- Extra manual cleanup work
In this blog, we’ll show you two ways to remove cancelled pickings from Batch Transfers in Odoo automatically:
- Using a Python customisation (for developers)
- Using an Automated Action (no code needed)
Method 1: Python Customisation
For development-focused projects, you can extend the stock.picking model to unlink pickings from batch transfers when cancelled automatically.
Example Code
How It Works
- Inherit action_cancel() → Runs when a picking is cancelled.
- Check for batch_id → If the picking belongs to a batch, it’s identified.
- Unlink picking from batch → Set Batch record blank.
- Log activity (optional) → Adds a note in chatter for transparency.
Method 2: Automated Action
(No Code Required)
If you prefer a configuration-only approach, Odoo’s Automated Actions can handle this automatically.
Steps to Configure
1. Navigate to:
Settings → Technical → Automation → Automated Actions
2. Create a New Automated Action
- Model: Transfer (stock.picking)
- Trigger: State is set to → Cancelled
- Apply On: Add domain → Status = Cancelled
- Action To Do: Update Record → Set Batch Transfer field to blank

Example Configuration
As shown in the screenshot:
- Trigger: When a transfer’s state changes to Cancelled
- Condition: Apply only if Status = Cancelled
- Action: Update the Batch Transfer field to empty
This way, the cancelled picking is automatically unlinked from its batch.
Which Method Should You Use?
Automated Action (Simple, No Code)
- Best for quick setups
- Works well if you just need to clear the Batch Transfer field
Python Customisation (Flexible, Advanced)
- Better for complex workflows
- Allows chatter logging, extra validations, or other custom rules