odoo.define('vad_base_extend.basic_fields', function (require) {
"use strict";
var BasicField = require('web.basic_fields');
var StateSelectionWidget = BasicField.StateSelectionWidget; console.log("Hello")
var VADStateSelectionWidget = StateSelectionWidget.include({ _prepareDropdownValues: function () {
console.log("Hello 01")
var _data = [];
_.map(this.field.selection || [], function (selection_item) {
var value = {
'name': selection_item[0],
'tooltip': selection_item[1], };
if (selection_item[0] === 'doing') {
value.state_class = 'vad_oe_project_kanban_legend vad_o_status_yellow'; value.state_name = 'Đang thực hiện'; }
else if (selection_item[0] === 'waiting') {
value.state_class = 'vad_oe_project_kanban_legend vad_o_status_blue'; value.state_name = 'Chờ'; }
else if (selection_item[0] === 'ready_to_next') {
value.state_class = 'vad_oe_project_kanban_legend vad_o_status_purple'; value.state_name = 'Sẵn sàng chuyển giai đoạn'; }
else if (selection_item[0] === 'done') {
value.state_class = 'vad_oe_project_kanban_legend vad_o_status_green'; value.state_name = 'Hoàn thành'; }
else if (selection_item[0] === 'need_back') {
value.state_class = 'vad_oe_project_kanban_legend vad_o_status_orange'; value.state_name = 'Lùi giai đoạn'; }
else if (selection_item[0] === 'blocked') {
value.state_class = 'vad_oe_project_kanban_legend vad_o_status_red'; value.state_name = 'Hoãn'; }
else if (selection_item[0] === 'cancel') {
value.state_class = 'vad_oe_project_kanban_legend vad_o_status_grey'; value.state_name = 'Huỷ'; }
else {
value.state_class = 'vad_oe_project_kanban_legend vad_o_status_blue'; value.state_name = 'Chờ'; }
_data.push(value);
});
return _data; }, });
return VADStateSelectionWidget });
I check the console log in my web just Hello, didn't show Hello 01
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Buchhaltung
- Lager
- PoS
- Project
- MRP
Diese Frage wurde gekennzeichnet
1
Antworten
1641
Ansichten
Hi,
Try to use extend instead of include:const VADStateSelectionWidget = StateSelectionWidget.extend({
/**
* display the label next to the icon
* @override
*/
_render() {
this._super.apply(this, arguments);
}
_prepareDropdownValues: function () {
}
});
Hope it helps
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!
Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!
RegistrierenVerknüpfte Beiträge | Antworten | Ansichten | Aktivität | |
---|---|---|---|---|
|
0
Jan. 24
|
1334 | ||
|
1
Sept. 23
|
2639 | ||
|
2
Apr. 23
|
4738 | ||
|
2
Jan. 23
|
7225 | ||
get the model in js
Gelöst
|
|
3
März 25
|
3142 |