5 digits prices
Every screen in OpenERP is defined by one or more XML file(s).
The files can be edited through the client menu "Administration > Custom > Interface > View".
Existing views should not be edited or any changes will be lost when upgrading the module (the files will be overrided).
Let's try to add 4 decimals in the list price.
You have to look for the 'product.normal.form' in the menu. You can see that the cost price is given by the value 'list_price'
Create a new XML view that will inherit from 'product.normal.form' and add the following:
The newly defined 'list_price' will override the normal form.
The position value could be 'before', 'after' or 'replace'
The digits value are <total number of digits> , <number of digits after the decimal point>.
Edit the tools/config.py file and replace
'price_accuracy' : 2,
by
'price_accuracy' : 5,
Remove the tools/config.pyc file and restart the server.
To store the data, we have to change the DB constraint. Connect as the postgres user and use the psql command line tool.
su postgres psql <my db name> ALTER TABLE product_template ALTER list_price TYPE numeric(16,5);
Now, we should do the same changes for the standard_price. As this value is used in a Postgres view, we must first drop the view. (stop OpenERP before).
DROP VIEW report_mrp_inout
ALTER TABLE product_template ALTER standard_price TYPE numeric(16,5);
CREATE VIEW report_mrp_inout AS SELECT min(sm.id) AS id, to_char((sm.date_planned)::timestamp with time zone, 'YYYY:IW'::text) ............ GROUP BY to_char((sm.date_planned)::timestamp with time zone, 'YYYY:IW'::text);
Restart OpenERP, and you are done.
