Skip to Content
Menu
This question has been flagged
1 Reply
2609 Views

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
Discard
Author Best Answer

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

Avatar
Discard
Related Posts Replies Views Activity
1
May 23
4872
0
Dec 17
3211
1
Jul 16
2755
1
Jun 24
317
1
Jun 23
1592