Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
5334 Prikazi

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
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
dec. 22
16351
1
apr. 20
142
1
jun. 19
4280
2
jun. 18
89
0
mar. 18
5896