infinitegatorade
asked on
OpenERP Functional Field
How do I create a functional field in OpenERP? For example, given an existing "width" and "height" fields, how would I create an "area" field that automatically calculates itself using the other two fields?
ASKER
That looks like Python. Which file would that go in? I only see XML files when editing the view.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
ASKER
Note: the python needs to be added to /opt/openerp/server/opener p/addons/S OMETHING/S OMETHING.p y
It may look like this
Open in new window
In this case the _calculate_area is a function pointer and you should have that function in the same class.
Here is a sample function (Please note that I assume you have width and height defined as float or integer field on the same model)
Open in new window