1

Am using Odoo15 customized in file web\static\src\js\views\form_view.js as below method:

form_view.js

      odoo.define('web.FormRenderingEngine', function (require) {

       "use strict";

       process_group: function($group) {

              // custom Code

      }

   });

Am extending this file like as mention below:

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

return FormRenderingEngine.extend({

  process_group: function($group) {   // custom Code

}

}};

.extend or include doesn't work.

please anyone help me to resolve this.

Gautam Bothra
  • 565
  • 1
  • 8
  • 23

1 Answers1

0

If you look in the console log you will see the following error message:

Uncaught SyntaxError: functions cannot be labelled

It is related to form_view.js script. To create a new form renderer, you can extend the basic renderer or the form renderer like they did with the product configurator

Example:(extending the basic renderer)

odoo.define('web.FormRenderingEngine', function (require) {

"use strict";
var BasicRenderer = require('web.BasicRenderer');

var FormRenderingEngine = BasicRenderer.extend({
    process_group: function($group) {
        // custom Code
    },
});

return FormRenderingEngine;
});

In the FormRenderingEngine, you have a syntax error:

Uncaught SyntaxError: missing ) after argument list

It should end with });

Kenly
  • 24,317
  • 7
  • 44
  • 60
  • Hello, thank you for your support, I need one more help. I have to try to change the place of elements, how it's possible in odoo for the web. I need to move the search bar to a different location. – kinjal birare Jun 21 '22 at 06:06
  • The search bar is part of the control panel, check the [web.Legacy.ControlPanel](https://github.com/odoo/odoo/blob/15.0/addons/web/static/src/legacy/xml/base.xml#L6) template – Kenly Jun 21 '22 at 09:31
  • `
    Test Search
    ` We add like that.But I need to move the position of search.I move search in to left side menu..the How its possible ?
    – kinjal birare Jun 21 '22 at 10:45