Say I have a custom web controller e.g.
@http.route(....)
def myroute(self, ...):
order = request.env['sale.order'].browse(some_id)
product = request.env['product.product'].ref('mymodule.product1')
product.write({'list_price': -100})
order._cart_update(product_id=product.id, set_qty=1, add_qty=1)
return request.render('mymodule.mytemplate', {...})
I'm concerned that the product update could be overwritten before it's added to the cart, which is theoretically possible if the controller method isn't atomic. Can anyone comment on how the framework will handle this?