I want to let the definition of a field be dependant upon the value of another field. Concretely, I want the definition of the field product.standard_price to be dependant upon the value of the boolean field product.puchase_ok in such a way that standard_price is either equal to the value of another field or is defined in the standard way (as in the product-module). I am thinking that the definition of the standard_price field should be determined as a function operating like this (in pseudo-code):
"If (purchase_ok): standard_price = standard defintion of the field
Else: standard_price = foo"
where "foo" is another field in the model.
Is my thinking correct and if so, how can such a function be implemented? (I know how to let a field be defined as a function -- I am more in doubt about the actual implementation of the function).
EDIT: The server is running v7.
your server is v7 or v8