here is a code i am using in the scheduled action this code run perfectly if i run this manually but it didnot work every min.
i am accessing the
mrp.production this module in the selection
orders = env['mrp.production'].search([('state', 'in', ['confirmed', 'to_close'])])
for order in orders:
order.write({
'qty_producing': order.product_qty,
})
move_lines = order.move_raw_ids
for move in move_lines:
move.write({
'quantity_done': move.product_uom_qty,
})
order.write({
'state': 'done',
})
image of my settings
https://drive.google.com/file/d/1Lh1XkGNDKr7WHBNM4ttE6NnqNk6bKx37/view?usp=sharing