diff --git a/car_rental/data/base_automation.xml b/car_rental/data/base_automation.xml index 4ae295871..37da84123 100644 --- a/car_rental/data/base_automation.xml +++ b/car_rental/data/base_automation.xml @@ -1,8 +1,46 @@ - Create Product - Server Actions + Create Product on_create + + Update the Hours + + on_create + + + Update Stage When In Service + + on_create_or_write + ["|", ("state", "=", "new"), ("state", "=", "running")] + + + Update Stage When Service Is Done + + on_write + ["|", ("state", "=", "done"), ("state", "=", "cancelled")] + + + Update Car Status When Returned + + on_write + [("x_studio_rental_status", "=", "return")] + [("x_studio_rental_status", "=", "returned")] + + + Update Stage When Picked Up + + on_write + [("x_studio_rental_status", "=", "pickup")] + [("x_studio_rental_status", "=", "return")] + + + Update Car Status When Booked + + on_create_or_write + ["|", ("state", "=", "draft"), ("state", "=", "sent")] + [("state", "=", "sale")] + diff --git a/car_rental/data/ir_actions_server.xml b/car_rental/data/ir_actions_server.xml index a42b7109b..63c5b21c4 100644 --- a/car_rental/data/ir_actions_server.xml +++ b/car_rental/data/ir_actions_server.xml @@ -6,6 +6,33 @@ code +product = env['product.template'].create({ + 'name': record.display_name, + 'detailed_type': 'product', + 'rent_ok': True +}) +record.write({'x_product_name_fleet': [[6,0, product.ids]]}) + + + + Update the Hours - Server Actions + + code + + + + + + + Update Stage When In Service - Server Actions + + code + + + + + Update Stage When Service Is Done - Server Actions + + code + + + + + Update Car Status When Returned - Server Actions + + code + + + + + Update Stage When Picked Up - Server Actions + + code + + + + + Update Car Status When Booked - Server Actions + + code + +