Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3101 มุมมอง

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