Hi,
I am using odoo 14. I am using a 2 steps process in sales/delivery order. First step is to move products from WH/Stock --> WH/Output. Second step is WH/Output to Partner Location/Customers. In step 2, the customer may reject some items and they need to return back to WH/Stock.
Right now, the returned items stay in WH/Output. I need to create an automate process to auto return the undelivered item to WH/Stock after the user click "Validate" and "No backorder" in the picking of step 2.
I am thinking of inherit and intercept stock_move._action_cancel method after process_cancel_backorder, use the data in the cancelled stock_move to create a picking + stock_immediate_transfer object and process the transfer for returning the undelivered item to the warehouse. Does anyone have example code of how to create a picking+stock_immediate_transfer? Please share it with me. Thanks.
Regards,
Simon