Javascript 需要一些帮助来扩展openerp JS“;模块";
有了这个发展,我只想在我的时间表上显示四舍五入的数字 实际上,我的JS文件已经启动了,但它看起来像是Javascript 需要一些帮助来扩展openerp JS“;模块";,javascript,openerp,Javascript,Openerp,有了这个发展,我只想在我的时间表上显示四舍五入的数字 实际上,我的JS文件已经启动了,但它看起来像是openerp.new_module(见下文)从未被调用过 openerp.new_module = function(instance){ var module = instance.hr_timesheet_sheet // loading the namespace of the 'sample' module var _super_ = module.WeeklyTim
openerp.new_module
(见下文)从未被调用过
openerp.new_module = function(instance){
var module = instance.hr_timesheet_sheet // loading the namespace of the 'sample' module
var _super_ = module.WeeklyTimesheet.prototype.sum_box;
module.WeeklyTimesheet.include({
sum_box : function(){
//_super_.call(this); // calling the original Foo.bar() method
var line_total = 0;
_.each(account.days[day_count].lines, function(line) {
line_total += line.unit_amount;
});
return Math.round(line_total*100)/100;
},
});
};
提前非常感谢。您是否已将js注册到
\uu openerp\uuu.py
?另外,请确保已正确刷新浏览器缓存,并查看此情况,因为某些功能需要覆盖不同的设置。是的,这两个功能都已完成。这已经通过在openerp.new_模块之前及其内部添加window.console.log(“test”)进行了验证。之前的那张是印刷的,里面的那张不是。