我要覆盖在website_sale_wishlist模块下定义的“ update_wishlist_view”功能。这是函数:
update_wishlist_view: function() {
if (this.wishlist_product_ids.length > 0) {
$('#my_wish').show();
$('.my_wish_quantity').text(this.wishlist_product_ids.length);
}
else {
$('#my_wish').hide();
}
}
我该怎么做?
答案 0 :(得分:0)
您可以这样做:
odoo.define('website_sale_wishlist_extension', function (require) {
"use strict";
var ProductWishlist = require('website_sale_wishlist.wishlist');
ProductWishlist.include({
update_wishlist_view: function() {
// execute your code after super call if apply
this._super.apply(this, arguments);
// execute your code before super call if apply
}
});
});