Suppose, in a custom module, I have fields for:
product_id, stock_location, stock_move, etc
And on another custom module I have a Float field, which will have a quantity, it will represent a fiscal year.
So, before I do any movement, I should check for this Float field, and somehow compare it's data with the product, or products I will be moving (product have a field called 'sale_price' but it could be even a custom Float also on product)
I don't know if I'm explaining myself, but what I want is to compare these fields, and give a constraint to the action, if custom_fiscal Float field has a lower value than the product_price Float one, then show a ValidationError or something like that.
I'm not sure if this scenario could be achievable by using a _constraint or _sql_constraint
Any ideas?