Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I would like to know how to add decimal precision for a specific field. I know thate there are already some values : http://localhost:8072/web?debug=#page=0&limit=80&view_type=list&model=decimal.precision&menu_id=90&action=81
And now, how to add a behaviour for a new field?
If you want to put new decimal precision for the field of your custom module then you have to do following things.
1) Create new record of decimal precision using xml file as like below.
<record forcecreate="True" id="decimal_custom_dp1" model="decimal.precision">
2) Then you can use your newly define decimal precision in you custom field as like below.
import openerp.addons.decimal_precision as dp
. . . .
'custom_field1': fields.float(string='Custom Field', digits_compute=dp.get_precision('Custom1') )
Now, you can see the decimal precision of 'custom_field1' according to set new decimal precision 'Custom1'. I hope it is helpful to you.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 10/31/14, 12:23 PM|
|Seen: 2329 times|
|Last updated: 3/16/15, 8:10 AM|