Skip to Content
Menu
This question has been flagged
3 Replies
5519 Views

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.

Avatar
Discard
Best Answer

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>
Avatar
Discard

How to do this using inheritance in odoo15?

Best Answer

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

<calendar string="Calendar" quick_add="False">
</calendar>
Avatar
Discard
Best Answer

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.

Avatar
Discard
Related Posts Replies Views Activity
0
Jul 18
3415
1
Jul 23
2459
1
Nov 22
931
1
Nov 22
1186
0
Aug 22
896