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

Change value of a field from Python

By
José
on 12/29/14, 3:03 PM 444 views

Hello, I am override a method in Odoo 8. This method is of the model sale.order:

def onchange_pricelist_id(self, cr, uid, ids, pricelist_id, order_lines, context=None):

How can I change a value of a field (in view) from this method? Thanks.

0
José
On 12/30/14, 12:06 PM

Baiju KS, thanks for your answer, finally I decide to use the new api and use @api.onchange to manipulate fields values. But that information is very useful, thanks!

0

Baiju

--Baiju--
3154
| 5 4 8
Kochi, India
--Baiju--
ODOO technical and functional

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

Baiju
On 12/29/14, 11:47 PM

Hi Jose,

You have to give return value in this format.(from your function, its old api, ie v7)

It have to be a dictionary in this format.

            return {'value': {'field_name1': value1, 'field_name2': value2, 'field_name3': value3 }}

Hope this is what you want. If not please update me.

 

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: 12/29/14, 3:03 PM
Seen: 444 times
Last updated: 3/16/15, 8:10 AM