Help

0

Direct Open Form view window instead of Summary window on Calendar Odoo 10

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
3 Semua Jawaban
1
Avatar
Andreas Stange
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
0
Avatar
Darshan Patel
Best Answer

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

<calendar string="Calendar" quick_add="False">
</calendar>
Avatar
Discard
0
Avatar
Meet Dholakia
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