diff --git a/views/purchase_order_views.xml b/views/purchase_order_views.xml index db82482..d3093f3 100644 --- a/views/purchase_order_views.xml +++ b/views/purchase_order_views.xml @@ -55,22 +55,4 @@ parent="purchase.menu_purchase_root" sequence="15"/> - - - Link to Purchase Order - - - code - -if records: - # Get the active purchase order from context - po_id = env.context.get('default_purchase_order_id') or env.context.get('active_id') - if po_id: - po = env['purchase.order'].browse(po_id) - for record in records: - po.link_selected_subcontracting_move(record.id) -# Close the wizard window -action = {'type': 'ir.actions.act_window_close'} - - \ No newline at end of file diff --git a/views/stock_move_link_views.xml b/views/stock_move_link_views.xml index 459f1ec..5d36764 100644 --- a/views/stock_move_link_views.xml +++ b/views/stock_move_link_views.xml @@ -1,5 +1,24 @@ + + + Link to Purchase Order + + + code + +if records: + # Get the active purchase order from context + po_id = env.context.get('default_purchase_order_id') or env.context.get('active_id') + if po_id: + po = env['purchase.order'].browse(po_id) + for record in records: + po.link_selected_subcontracting_move(record.id) +# Close the wizard window +action = {'type': 'ir.actions.act_window_close'} + + + stock.move.link.subcontracting.tree