测试优化代码后的代码扫描效果,优化部分代码审查问题
This commit is contained in:
@@ -8,10 +8,7 @@ const { Component, xml } = owl;
|
||||
|
||||
export class BarcodeHandlerField extends Component {
|
||||
setup() {
|
||||
console.log('99999999111');
|
||||
this.actionService = useService("action")
|
||||
console.log(this.actionService)
|
||||
|
||||
const barcode = useService("barcode");
|
||||
// this.rpc = useService("rpc");
|
||||
// useBus(barcode.bus, "barcode_scanned", this.onBarcodeScanned.bind(this));
|
||||
@@ -20,9 +17,6 @@ export class BarcodeHandlerField extends Component {
|
||||
async _rpc(params) {
|
||||
// const { data } = await this.env.services.rpc('/web/dataset/call_kw', params);
|
||||
const response = await this.env.services.rpc('/web/dataset/call_kw', params);
|
||||
console.log('response', response);
|
||||
console.log('response.result', response.result);
|
||||
|
||||
// return response
|
||||
const responseObject = JSON.parse(response)
|
||||
return responseObject;
|
||||
@@ -33,8 +27,6 @@ export class BarcodeHandlerField extends Component {
|
||||
this.props.update(barcode);
|
||||
// const actionService = useService("action");
|
||||
// const productId = 12345
|
||||
console.log('111222222222211111');
|
||||
|
||||
// 根据条形码获取相关数据,例如产品ID
|
||||
const response = await this._rpc({
|
||||
model: 'mrp.workorder',
|
||||
@@ -42,11 +34,10 @@ export class BarcodeHandlerField extends Component {
|
||||
args: [barcode],
|
||||
kwargs:{},
|
||||
});
|
||||
// console.log(productId.result)
|
||||
if (response.result) {
|
||||
const action = response.result;
|
||||
console.log(action)
|
||||
console.log('11111111111111111111111111111111111');
|
||||
// const action = response.result;
|
||||
// console.log(action)
|
||||
// console.log('11111111111111111111111111111111111');
|
||||
// 通过产品ID执行操作并跳转到表单视图
|
||||
// await this.actionService.doAction({
|
||||
// // type: 'ir.actions.act_window',
|
||||
|
||||
Reference in New Issue
Block a user