Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3460 Zobrazení

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
Zrušit
Autor Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
kvě 23
6885
0
pro 17
3858
1
čvc 16
3844
1
čvn 24
1055
1
čvn 23
2745