优化警告问题

This commit is contained in:
mgw
2023-11-27 21:30:45 +08:00
parent 96df8f971c
commit 4f83c5f29a
19 changed files with 58 additions and 74 deletions

View File

@@ -97,13 +97,12 @@ export class CodeField extends Component {
} else {
if (records[0].state === '占用') {
// console.log('此托盘已占用,请检查')
alert('此托盘已占用,请检查')
alert('此托盘已占用,请检查');
} else {
// console.log('此托盘已损坏,请登记')
alert('此托盘已损坏,请登记')
alert('此托盘已损坏,请登记');
}
}
} else {
const searchInput = this.autocompleteContainerRef.el.querySelector("input");
searchInput.value = barcode;
@@ -114,7 +113,7 @@ export class CodeField extends Component {
}
}
}
CodeField.template = 'sf_machine_connect.CodeField'
CodeField.template = 'sf_machine_connect.CodeField';
// Register the field in the registry
CodeField.props = standardFieldProps;
registry.category("fields").add("code", CodeField);

View File

@@ -48,4 +48,4 @@ odoo.define('my_module.barcode_handler', function (require) {
return {
BarcodeHandlerField: BarcodeHandlerField,
};
});
});

View File

@@ -8,7 +8,7 @@ const { Component, xml } = owl;
export class BarcodeHandlerField extends Component {
setup() {
this.actionService = useService("action")
this.actionService = useService("action");
const barcode = useService("barcode");
// this.rpc = useService("rpc");
// useBus(barcode.bus, "barcode_scanned", this.onBarcodeScanned.bind(this));
@@ -18,7 +18,7 @@ export class BarcodeHandlerField extends Component {
// const { data } = await this.env.services.rpc('/web/dataset/call_kw', params);
const response = await this.env.services.rpc('/web/dataset/call_kw', params);
// return response
const responseObject = JSON.parse(response)
const responseObject = JSON.parse(response);
return responseObject;
}
@@ -58,8 +58,7 @@ export class BarcodeHandlerField extends Component {
} else {
// console.error("Barcode not found or RPC call failed.");
}
}
};
}
BarcodeHandlerField.template = xml``;