I’m looking for an example on how to manage checks before update.
I’ve seen the code:
actions = iter(args)
for..., values in zip(actions, actions)
But what’s the best practice to parse ‘values’ to identify for instance a field quantity in a list (could have create + write in the same update)?
Cause you could have several format: {'quantity': [[create, [[write or [[add and [create etc., so for the moment I test the different format with poor code like that:
I have a position model with a list of pricing (children model).
When user modify pricings quantities I need to send a message if sum(pricings.quantity)>position.quantity.
If I do it in the children model I cannot see all the modification done for existing pricing of the list because a user could change quantities in 2 item of a list, create a new one and save after.
Checking after means doing a rollback if limit quantity is achieved ?