Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
3611 Prikazi

how create custom widget for field with old values? its created it with empty template:

js:

odoo.define('status_widget', function (require) { "use strict";

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

 var core = require('web.core');
var statusWidget = form_common.AbstractField.extend({ 

 init: function (view, code) { 

 this._super(view, code); 

 }, 

 render_value: function() {
} });


 core.form_widget_registry.add('status_widget', statusWidget);});


xml:

<field name="user_id" position="after"> 

 <field name="test_selection" widget="status_widget"/> 

 </field>


Avatar
Opusti
Avtor Best Answer

I found file form_widgets.js in web module and extend classes from it

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
maj 23
7123
0
dec. 17
3961
1
jul. 16
4002
1
jun. 24
1195
1
jun. 23
2931