Odoo Help


How to call a method in a python xml?

Samba Faye
on 9/12/13, 8:01 AM 3,196 views

Hello I have two classes A and B. In A, I have a method that returns a value X, In B, I have a method that calls the method in B and reourne a value. It is this value that I want to get an xml file whitch representing the view. How will I call this method in the xml file to display this value?

xml files aren't capable of calling methods (except during module installation). The explanation is not very clear, perhaps you're looking for the on_change?

Daniel Reis
on 9/12/13, 8:45 AM
El hadji Dem
On 2/9/15, 11:11 AM

An example: https://github.com/factorlibre/openerp-extra-6.1/blob/master/dm_delivery/dm_delivery_data.xml

Samba Faye
On 9/12/13, 9:23 AM

I want to display the value returned by a method in the view

why don't you try fields.function field in python rather than using two models for displaying a result in xml.? try functional field to display the result

Abhishek H Menon
on 9/13/13, 4:03 AM

I don't know how to use fields.function. Can you give me an example please?

Samba Faye
on 9/13/13, 7:20 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 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 9/12/13, 8:01 AM
Seen: 3196 times
Last updated: 3/16/15, 8:10 AM