跳至內容
選單
此問題已被標幟
3 回覆
6221 瀏覽次數

I Want to open direct form view instead on Summary window on calendar. So, how to open direct form view when click on calendar view? For this i work on web_calendar module widgets.js file. I find following code but i didn't get upto result because i rarely use js:

var self = this;
    this._super(parent, {
        title: this.get_title(),
        size: 'small',
        buttons: this._buttons ? [
            {text: _t("Create"), classes: 'btn-primary', click: function () {
                if (!self.quick_add()) {
                    self.focus();
                }
            }},
            {text: _t("Edit"), click: function () {
                self.slow_add();
            }},
            {text: _t("Cancel"), close: true},
        ] : [],
        $content: QWeb.render('CalendarView.quick_create', {widged: this})
    });

Thanks in Advance.

頭像
捨棄
最佳答案

I am on odoo 11 and to go from calendar directly to form view, the only thing I had to do is setting the attribute quick_add="False" in the xml calendar tag. I could imagine this also works on earlier Odoo versions but don't know.

<field name="arch" type="xml">
<calendar ... quick_add="False">
<field name="name"/>
</calendar>
</field>
頭像
捨棄

How to do this using inheritance in odoo15?

最佳答案

Yes the parameter quick_add works for me too on v9 and v10.

<calendar string="Calendar" quick_add="False">
</calendar>
頭像
捨棄
最佳答案

Hello Pawan,
You can inherit the QuickCreate class and call slow_add method.

QuickCreate.include({
    start: function(){
        var self = this;
        return this._super().then(function(){
            self.slow_add()
        })
    },
})
Hope it will help you.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
7月 18
4311
1
5月 25
4430
1
11月 22
1956
1
11月 22
2173
0
8月 22
2515