Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
5203 Zobrazení

Im customizing the search dialog in many2one field.

SO im customizing in form_common.js

_search_create_popup: function(view, ids, context) {


        new SelectCreateDialog(this, _.extend({}, (this.options || {}), {

        //alert('SelectCreateDialog: '+ JSON.stringify(self.field));

            res_model: self.field.relation,

            domain: self.build_domain(),

            context: new data.CompoundContext(self.build_context(), context || {}),

            title: (view === 'search' ? _t("Search: ") : _t("Create: ")) + this.string,

            initial_ids: ids ? _.map(ids, function(x) {return x[0];}) : undefined,

            initial_view: view,

            disable_multiple_selection: multiple_selection,

            on_selected: function(element_ids) {

                      var newcontext = {'po_ids': [1,2,3,4]};  // to add this elemnet in context

                     self.add_id(element_ids[0]);

                    self.focus();

        }

}


My query id how to add the new element in  var newcontext = {'po_ids': [1,2,3,4]};  in this.context ,

Anyone help me to resolve this issue.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
pro 22
16134
1
dub 20
142
1
čvn 19
4137
2
čvn 18
89
0
bře 18
5743