Skip to Content
Menu
This question has been flagged
4395 Views

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
Discard
Related Posts Replies Views Activity
2
Dec 22
14201
1
Apr 20
142
1
Jun 19
3242
2
Jun 18
89
0
Mar 18
4898