Skip to content

Commit 70ef774

Browse files
committed
Merge PR OCA#949 into 17.0
Signed-off-by simahawk
2 parents 3b4c373 + 1159f32 commit 70ef774

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

date_range/static/src/js/tree_editor.esm.js

+10
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ patch(TreeEditor.prototype, {
4646
) {
4747
info.component = Select;
4848
}
49+
// Prevent issues when the domain is not initialized, for example in
50+
// Odoo Studio editing
51+
if (!this.env.domain) {
52+
return info;
53+
}
4954
let dateRanges = this.env.domain.dateRanges;
5055
if (this.update_operator && this.update_operator.split("daterange_")[1]) {
5156
dateRanges = this.env.domain.dateRanges.filter(
@@ -105,6 +110,11 @@ patch(TreeEditor.prototype, {
105110
super.updateLeafOperator.apply(this, arguments);
106111
this.update_operator = operator;
107112
const fieldDef = this.getFieldDef(node.path);
113+
// Prevent issues when the domain is not initialized, for example in
114+
// Odoo Studio editing
115+
if (!this.env.domain) {
116+
return;
117+
}
108118
let dateRanges = this.env.domain.dateRanges.filter(
109119
(range) => range.type_id[0] === Number(operator.split("daterange_")[1])
110120
);

0 commit comments

Comments
 (0)