Odoo Help

2

0
3 Answers
1
Karim minaz United Arab Emirates
2/18/18, 1:45 PM

include js header in file

var Model = require('web.Model');

Define your function on python file:

@api.model
def function_name(self):
    data = {}
    return data


Then In your function call:

var model  = new Model('model_name').call('funcion_name').then(function(result){
    return result;
});
4
Avatar

Nikhil Krishnan United Arab Emirates

--Nikhil Krishnan--
11400
| 7 7 10
Sharjah, United Arab Emirates
--Nikhil Krishnan--

-- Nikhilkrishnan --

Exploring new ways in odoo..!
And want to become a key to the new odoo trends.

-> Odoo Consultancy,
-> Functional and Technical Consultant,
-> Requirement Collection and Analysis,
-> Module Customization,
-> Odoo ERP Community Contributor,
-> Handling ERP/Odoo projects,
-> ERP Workshop Facilitator.
Feel happy working with best and good supporting team.

#PITS Family

Nikhil Krishnan

nikhilkrishnan0101@gmail.com

Nikhil Krishnan United Arab Emirates
2/13/17, 4:15 AM

function1: function(parameters1,parameters2) { var variable = new instance.web.Model('model').call('test',[parameters1,parameters2]).then(function(result)

{

     $(".classtest").text(result);

            });

      },.
In "result" the value get from the python.

1
Avatar

ayman mohammed adam Saudi Arabia

--ayman mohammed adam--
--ayman mohammed adam--


ayman mohammed adam Saudi Arabia
2/6/17, 2:29 AM

Dear Onkar

var mod = new instance.web.Model("account.budget.plan.budget");

period= mod.call("calculate_period").then(function(result){}

);

account.budget.plan.budget: your Model

calculate_period:  Your Method

II hope i helped you..

Ask a Question
Writer
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.

Register
Odoo Training Center

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

Test it now