Odoo Help


2 Answers

Mitul Shingala

--Mitul Shingala--
--Mitul Shingala--

Odoo Developer

Mitul Shingala
14/06/19 09.59


you can call the method from the xml


see the below link: 

from xml call method like here call the method get_months : 

<t t-foreach="get_months" t-as="month"> (you can use <span t-esc="method_name"/> also for print the data on report.)


into .py render method. so from xml access the key 'get_months' and from that call the method. and from that self._get_method is doing the calculation(as per your need.)

from dictionary ket it call the method like =>  'get_months': self._get_months(data['form']['date_from']),


--Haresh Kansara--

Odoo Application Engineer

I have completed odoo training from Odoo India, and i have formerly worked there as an application engineer. And currently works as an application engineer. 

I have worked on different projects like Sales, Purchase, MRP, Account etc. I have also worked on website development.

I can help you to:

- Develop new module

- Customise existing module

- Provide Odoo Functional / Technical training

Connect me at: https://www.linkedin.com/in/haresh-kansara-50048914b

Haresh Kansara
14/06/19 11.09

Hi Akshay,

You can write code like:

<t t-set="total_value" t-value="o.do_calc()"/>

<t t-esc="total_value"/>

Here o means self(current object) or you can use any model's method like 

<t t-set="total_value" t-value="request.env['model.name'].do_calc()"/>

 Hope it will helpful for you.

Thanks and regards

Haresh Kansara

Ask a Question
Keep Informed
1 follower(s)
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 eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now