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 select "March" we get 31 days in sequence like 1,2,3,4..........31 with their respective 'days' like Mon,Tue.....Sun . Now 31 field should be created with Label name Mon 1 June,Tue 2 June etc.......
This should happen with all 12 month.
this is rather tricky to do via the XML files.
More effective is to overwrite fields_view_get method (tested for OE 7.0), like so:
def fields_view_get(self, cr, uid, view_id=None, view_type=None,
context=None, toolbar=False, submenu=False):
overwriting to set dynamic label on the field reading_normal.
res = super(meter_reading_electricity, self).fields_view_get(
cr, uid, view_id=view_id, view_type=view_type,
context=context, toolbar=toolbar, submenu=submenu)
if view_type == 'form':
doc = etree.XML(res['arch'])
nodes = doc.xpath("//field[@name='reading_normal']")
nodes.set('string', 'My dynamic label')
res['arch'] = etree.tostring(doc)
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: 7/3/13, 11:03 AM|
|Seen: 871 times|
|Last updated: 11/10/15, 6:30 AM|