-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] mgmtsystem_indicators_report: Finish migration
- Loading branch information
Showing
11 changed files
with
87 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...components/dynamic_selection_indicators_report/dynamic_selection_indicators_report.esm.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** @odoo-module **/ | ||
|
||
import {SelectionField} from "@web/views/fields/selection/selection_field"; | ||
import {registry} from "@web/core/registry"; | ||
|
||
export class DynamicSelectionIndicatorsReportField extends SelectionField { | ||
get options() { | ||
return this.props.record.data.selection_options.split(",").map((value) => { | ||
return [value, value]; | ||
}); | ||
} | ||
|
||
get string() { | ||
console.log(this.props.value, this.options); | ||
return this.props.value; | ||
} | ||
|
||
onChange(ev) { | ||
const value = JSON.parse(ev.target.value); | ||
|
||
this.props.update(value); | ||
} | ||
} | ||
|
||
DynamicSelectionIndicatorsReportField.supportedTypes = ["char"]; | ||
DynamicSelectionIndicatorsReportField.legacySpecialData = undefined; | ||
|
||
registry | ||
.category("fields") | ||
.add("dynamic_selection_indicators_report", DynamicSelectionIndicatorsReportField); |
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions
35
...ators_report/static/src/components/indicators_report_value/indicators_report_value.esm.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** @odoo-module **/ | ||
|
||
const {Component} = owl; | ||
|
||
import {Field} from "@web/views/fields/field"; | ||
import {registry} from "@web/core/registry"; | ||
|
||
export class IndicatorsReportValueField extends Component { | ||
get field_props() { | ||
var result = { | ||
name: "value_" + this.props.record.data.value_type, | ||
type: this.props.record.fields["value_" + this.props.record.data.value_type] | ||
.type, | ||
record: this.props.record, | ||
}; | ||
if (this.props.record.data.value_type === "selection") { | ||
result.fieldInfo = { | ||
widget: "dynamic_selection_indicators_report", | ||
FieldComponent: registry | ||
.category("fields") | ||
.get("dynamic_selection_indicators_report"), | ||
}; | ||
} | ||
return result; | ||
} | ||
} | ||
|
||
IndicatorsReportValueField.components = {Field}; | ||
IndicatorsReportValueField.template = | ||
"mgmtsystem_indicators_report.IndicatorsReportValueField"; | ||
|
||
console.log("HI!!!"); | ||
registry | ||
.category("fields") | ||
.add("mgmtsystem_indicators_report_value", IndicatorsReportValueField); |
10 changes: 10 additions & 0 deletions
10
...dicators_report/static/src/components/indicators_report_value/indicators_report_value.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<templates xml:space="preserve"> | ||
|
||
|
||
<t t-name="mgmtsystem_indicators_report.IndicatorsReportValueField" owl="1"> | ||
|
||
<Field t-props="field_props" t-if="props.record.data.value_type" /> | ||
|
||
</t> | ||
</templates> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,6 @@ | |
/> | ||
</group> | ||
</sheet> | ||
<div class="oe_chatter" /> | ||
</form> | ||
</field> | ||
</record> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,7 +84,6 @@ | |
</page> | ||
</notebook> | ||
</sheet> | ||
<div class="oe_chatter" /> | ||
</form> | ||
</field> | ||
</record> | ||
|
1 change: 1 addition & 0 deletions
1
setup/mgmtsystem_indicators_report/odoo/addons/mgmtsystem_indicators_report
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../mgmtsystem_indicators_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |