4
我想重新定义一个默认的ListView函数,但它似乎不工作,我们没有得到进入功能体。任何建议?我如何包括(或扩展)从ListView的Odoo核心功能(例如Instance.web.ListView.extend)
instance.web.ListView.extend({
do_search: function (domain, context, group_by) {
console.log("We need to go deeper") // We aren't get here
this.current_min = 1;
this.groups.datagroup = new DataGroup(
this, this.model, domain, context, group_by);
this.groups.datagroup.sort = this.dataset._sort;
if (_.isEmpty(group_by) && !context['group_by_no_leaf']) {
group_by = null;
}
this.no_leaf = !!context['group_by_no_leaf'];
this.grouped = !!group_by;
// Hide the pager in grouped mode
if (this.pager && this.grouped) {
this.pager.do_hide();
}
this.grouped = false;
return this.reload_content();
}
})();
它运作良好,谢谢! –
不错的答案。也为我工作。谢谢你,先生。 –