跳至內容
選單
此問題已被標幟
1 回覆
3513 瀏覽次數

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
7043
0
12月 17
3885
1
7月 16
3942
1
6月 24
1095
1
6月 23
2853