コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3643 ビュー

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>


アバター
破棄
著作者 最善の回答

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

アバター
破棄
関連投稿 返信 ビュー 活動
1
5月 23
7174
0
12月 17
3980
1
7月 16
4025
1
6月 24
1210
1
6月 23
2961