Skip to Content
Menu
This question has been flagged
2966 Views

I need to call funcion of "FilterMenu" widged from "FavoriteMenu" widget that I extending. There is standard Odoo widget:

odoo.define('web.FilterMenu', function (require) {
  "use strict";

  var data_manager = require('web.data_manager');
  var search_filters = require('web.search_filters');
  var search_inputs = require('web.search_inputs');
  var Widget = require('web.Widget');

  return Widget.extend({
  ...

And another one that i extending:

odoo.define("favorite_editor.favorite", function (require) {
  "use strict";
  var FavoriteMenu = require('web.FavoriteMenu');
  var FilterMenu = require('web.FilterMenu');
  ...
  FavoriteMenu.include({
  ...
  edit_filter: function (filter, $filter, key) {
    var self = this;
    var filter_menu = new FilterMenu();
    fields = filter_menu.get_fields(); 

Function edit_filter called by pressing some button and its works fine.
Last row is wrong because in get_fields function this contains FavoriteMenu and not FilterMenu instance, but I need the FilterMenu instance.
Moreover I need the FilterMenu instance that already exists so as to use existing data.

Can someone suggest how to deal with it ?


Avatar
Discard