Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
3 Vastaukset
6246 Näkymät

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
Hylkää
Paras vastaus

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
Hylkää

How to do this using inheritance in odoo15?

Paras vastaus

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

<calendar string="Calendar" quick_add="False">
</calendar>
Avatar
Hylkää
Paras vastaus

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
heinäk. 18
4320
1
toukok. 25
4437
1
marrask. 22
1959
1
marrask. 22
2179
0
elok. 22
2524