Hi everyone!
I'm coding a server action to check the available quantity of the products before booking them!
I want this server action be launched only when the user is going to save or confirm the order and not when he wants to cancel it. Could you help please?
produit = env['product.product'].search([('default_code', '=', record.product_id.default_code)])
if record.product_uom_qty > record.product_id.immediately_usable_qty:
if action != model.action_cancel() or action != model.action_create_reservation():
raise Warning(str(record.product_id.default_code) + ": Seulement " + str(record.product_id.immediately_usable_qty) + " en stock!")