Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
924 Tampilan

We have Odoo 16 JavaScript code that we are wanting to update to Odoo 18 code which is as follows: -

odoo.define('module.custom_entry_form', function (require) {

'use strict';

    var viewRegistry = require('web.view_registry');

    var core = require('web.core');

    var FormController = require('web.FormController');

    var FormView = require('web.FormView');

    var FormRenderer = require('web.FormRenderer');

    var QWeb = core.qweb;


    const { Component } = owl;


    var CustomEntryFormController = FormController.extend({

        events: {

            'click': '_onClick',

        },

        custom_events: _.extend({}, FormController.prototype.custom_events, {

            open_create_event: '_openCreateEvent',

            open_edit_event: '_openEditEvent',


        }),...


Odoo 18 doesn't seem to recognize the 'custom_events:' keyword and I am wondering what I am missing or how to implement this?

Our current Odoo 18 code (which isn't working) is: -


/** @odoo-module **/

import { FormController } from "@web/views/form/form_controller";
import { formView } from "@web/views/form/form_view";
import { registry } from "@web/core/registry";
import { useListener } from "@odoo/owl";

export class CustomEntryFormController extends FormController {
setup() {
super.setup();
// You can handle any setup logic for your custom form controller
}
events: _.extend({}, FormController.prototype.events, {
'open_create_event': '_openCreateEvent',
})...

Any help would be most appreciated.

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Jul 25
433
1
Jul 25
5364
0
Jul 25
924
1
Jun 25
1059
1
Jun 25
1077