Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
3106 Представления

I need to modify a function in model.js. I couldn't inherit the .js file in odoo9. How can I inherit the .js file odoo?

Аватар
Отменить
Лучший ответ

You should first import the models using this statement:

var models = require('point_of_sale.models');

Then you can alter a specific function using:

models.TheWidgetThatContainsTheFunction.include({
    the_function_to_modify: function(){        //don't forget to include function vars!
         this.super();
         // ... do stuff here
         // return if necessary
    },
});


Аватар
Отменить
Автор

Thank you Pieter