Odoo Help

Welcome!

This community 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.

0

Update field lable using onchange function bug

By
George
on 9/1/15, 7:03 AM 617 views

Dear Friends,

               I would like to change field label(string) while onchange many2one field. I have configured few items in that object. I could not use fields_view_get. While i onchange i am able to update field string but is not reflected in the view.


def onchange_ini_temp_id(self, cr, uid, ids, initiative_category_id, context=None):

val = {}

view_id=None

view_type='form'

toolbar=False

submenu=False

res = super(project_project, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)

fields = res.get('fields', {})

doc = etree.XML(res['arch'])

for node in doc.xpath("//field[@name='release']"):

node.set('invisible', "0")

node.set('string', 'Test Data')

setup_modifiers(node, res['fields']['release'])

res['arch'] = etree.tostring(doc)

self.fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False)

return res


Thank you

Somewhere odoo had limits too. but you can create two view with each unique label and then pass right view on action, but with on_change to fix, forget odoo people support on this. After odoo 7, they left odoo community and users. Now odoo is buggy stable.

Zahin
on 9/1/15, 8:35 AM

Your Answer

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/1/15, 7:03 AM
Seen: 617 times
Last updated: 9/1/15, 8:35 AM