1

这是我用来调用表单视图的代码:

get_view_form_dimension: function() {
    var self = this;
    var action_manager = new openerp.web.ActionManager(this);
    var dialog = new openerp.web.Dialog(this, {
        width: 800,
        buttons : [
            {text: _t("Cancel"), click: function() { $(this).dialog('destroy'); }},
            {text: _t("Save"), click: function() {
                var form_view = action_manager.inner_viewmanager.views.form.controller;

                form_view.do_save(function() {
                    $.jstree._reference("#new_tree").destroy();
                    self.get_tree_structure();
                });
                $(this).dialog('destroy');


            }}
        ]
    }).open();

    action_manager.appendTo(dialog.$element);
    action_manager.do_action({
        res_model : 'df.bi.dimension',
        res_id: self.process_id,
        views : [[false, 'form']],
        type : 'ir.actions.act_window',
        flags : {
            search_view: false,
            sidebar : false,
            views_switcher : false,
            action_buttons : false,
            pager: false
        }

    });


},

我如何将值设置为这种方法会上升的形式?或者如果存在其他解决方案,请告诉我?对不起我的英语不好!

4

1 回答 1

1

使用默认值向 do_action 调用添加上下文字段,如下所示:

context: {'default_account_id': 5, 'default_name': 'hello'},
于 2013-04-18T03:25:01.000 回答