mirror of https://github.com/OCA/web.git
commit
cebb15ff28
|
@ -261,14 +261,17 @@ export class ProductLabelSectionAndNoteField extends Many2OneField {
|
||||||
|
|
||||||
updateLabel(value) {
|
updateLabel(value) {
|
||||||
this.changeProductVisibility = false;
|
this.changeProductVisibility = false;
|
||||||
this.props.record.update({
|
const new_name =
|
||||||
name:
|
|
||||||
this.productName &&
|
this.productName &&
|
||||||
this.productName !== value &&
|
this.productName !== value &&
|
||||||
this.isProductVisible.value
|
this.isProductVisible.value
|
||||||
? `${this.productName}\n${value}`
|
? `${this.productName}\n${value}`
|
||||||
: value,
|
: value;
|
||||||
});
|
// We need to update the record data directly because the record.update method
|
||||||
|
// updates the data asynchronously, and the new value will not be available
|
||||||
|
// in the `get Label` method immediately.
|
||||||
|
this.props.record.data.name = new_name;
|
||||||
|
this.props.record.update({name: new_name});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue