优化警告问题
This commit is contained in:
@@ -11,7 +11,6 @@ export class Many2OneRadioField extends RadioField {
|
||||
// 你自己的代码
|
||||
}
|
||||
|
||||
|
||||
onImageClick(event) {
|
||||
// 放大图片逻辑
|
||||
// 获取图片元素
|
||||
@@ -47,7 +46,6 @@ export class Many2OneRadioField extends RadioField {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Many2OneRadioField.template = "jikimo_frontend.Many2OneRadioField"
|
||||
|
||||
@@ -15,23 +15,24 @@ export class MyCustomWidget extends Many2ManyCheckboxesField {
|
||||
// 放大图片逻辑
|
||||
// 获取图片元素
|
||||
const img = event.target;
|
||||
const close = img.nextSibling
|
||||
const close = img.nextSibling;
|
||||
|
||||
// 实现放大图片逻辑
|
||||
// 比如使用 CSS 放大
|
||||
img.parentElement.classList.add('zoomed');
|
||||
close.classList.add('img_close')
|
||||
close.classList.add('img_close');
|
||||
}
|
||||
|
||||
onCloseClick(event) {
|
||||
const close = event.target;
|
||||
const img = close.previousSibling
|
||||
img.parentElement.classList.remove('zoomed')
|
||||
close.classList.remove('img_close')
|
||||
const img = close.previousSibling;
|
||||
img.parentElement.classList.remove('zoomed');
|
||||
close.classList.remove('img_close');
|
||||
}
|
||||
}
|
||||
|
||||
MyCustomWidget.template = "jikimo_frontend.MyCustomWidget"
|
||||
MyCustomWidget.template = "jikimo_frontend.MyCustomWidget";
|
||||
// MyCustomWidget.supportedTypes = ['many2many'];
|
||||
|
||||
registry.category("fields").add("custom_many2many_checkboxes", MyCustomWidget);
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import {patch} from '@web/core/utils/patch';
|
||||
// import { Dialog } from "@web/core/dialog/dialog";
|
||||
import {_t} from "@web/core/l10n/translation";
|
||||
import {FormStatusIndicator} from "@web/views/form/form_status_indicator/form_status_indicator"
|
||||
import {FormStatusIndicator} from "@web/views/form/form_status_indicator/form_status_indicator";
|
||||
|
||||
var Dialog = require('web.Dialog');
|
||||
// var {patch} = require("web.utils") 这句话也行
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** @odoo-module */
|
||||
|
||||
import {patch} from '@web/core/utils/patch';
|
||||
import {ListRenderer} from "@web/views/list/list_renderer"
|
||||
import {ListRenderer} from "@web/views/list/list_renderer";
|
||||
|
||||
// var {patch} = require("web.utils") 这句话也行
|
||||
|
||||
@@ -17,7 +17,7 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', {
|
||||
|
||||
const table = this.tableRef.el;
|
||||
const headers = [...table.querySelectorAll("thead th:not(.o_list_actions_header)")];
|
||||
const column_num = headers.length
|
||||
const column_num = headers.length;
|
||||
|
||||
if (!this.columnWidths || !this.columnWidths.length) {
|
||||
// no column widths to restore
|
||||
|
||||
@@ -8,4 +8,4 @@ patch(ListRenderer.prototype, '/jikimo_frontend/static/src/views/list_nums/list_
|
||||
const nbCols = this._super(...arguments);
|
||||
return nbCols + 1;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,9 +3,9 @@ import logging
|
||||
from datetime import datetime
|
||||
import requests
|
||||
import cpca
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
||||
# from odoo.exceptions import UserError
|
||||
# from odoo.exceptions import ValidationError
|
||||
from odoo import api, fields, models
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -44,12 +44,18 @@ class JdEclp(models.Model):
|
||||
|
||||
@api.depends('name')
|
||||
def _check_is_out(self):
|
||||
"""
|
||||
判断是否为出库单
|
||||
"""
|
||||
if self.name:
|
||||
is_check_out = self.name.split('/')
|
||||
self.check_out = is_check_out[1]
|
||||
|
||||
@api.depends('carrier_tracking_ref')
|
||||
def query_bill_pdf(self):
|
||||
"""
|
||||
查询物流面单,并赋值给bill
|
||||
"""
|
||||
self.bill = self.env['ir.attachment'].sudo().search([('name', '=', self.carrier_tracking_ref)])
|
||||
|
||||
@api.depends('origin')
|
||||
@@ -84,7 +90,6 @@ class JdEclp(models.Model):
|
||||
self.receiverTownName = self.receiverTownName
|
||||
except Exception as e:
|
||||
print(f"Error address is none: {e}")
|
||||
pass
|
||||
|
||||
def create_order(self):
|
||||
# sale_order_id = self.env['sale.order'].search([('name', '=', self.origin)])
|
||||
|
||||
@@ -212,7 +212,7 @@ class FinishStatusChange(models.Model):
|
||||
action['context'] = {'default_picking_ids': self.ids}
|
||||
return action
|
||||
|
||||
out_start_time = str(datetime.now())
|
||||
# out_start_time = str(datetime.now())
|
||||
json2 = {
|
||||
'params': {
|
||||
'model_name': 'jikimo.process.order',
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
import time
|
||||
import json
|
||||
import base64
|
||||
import shutil
|
||||
@@ -11,7 +10,7 @@ from zipfile import ZipFile
|
||||
from datetime import datetime, timedelta
|
||||
import requests
|
||||
from odoo.http import request
|
||||
from odoo import fields, models, api, _
|
||||
from odoo import fields, models, api
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.exceptions import MissingError
|
||||
from odoo.exceptions import ValidationError
|
||||
@@ -470,7 +469,7 @@ class WorkCenterBarcode(models.Model):
|
||||
raise UserError('NC下发执行超时, 请检查下发状态')
|
||||
|
||||
def get__state(self):
|
||||
pay_time = str(datetime.now())
|
||||
# pay_time = str(datetime.now())
|
||||
json = {
|
||||
'params': {
|
||||
'model_name': 'jikimo.process.order',
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -48,4 +48,4 @@ odoo.define('my_module.barcode_handler', function (require) {
|
||||
return {
|
||||
BarcodeHandlerField: BarcodeHandlerField,
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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``;
|
||||
|
||||
@@ -2,15 +2,11 @@
|
||||
import base64
|
||||
import logging
|
||||
import os
|
||||
import json
|
||||
import hashlib
|
||||
import time
|
||||
from datetime import datetime
|
||||
import requests
|
||||
from odoo import fields, models, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo import fields, models
|
||||
# from odoo.exceptions import ValidationError
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.addons.sf_machine_connect.models import py2opcua, ftp_operate
|
||||
from odoo.addons.sf_machine_connect.models import ftp_operate
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -17,16 +17,10 @@ class CustomKanbanController extends KanbanController {
|
||||
this.workOrders = await this.getAllWorkOrders();
|
||||
// this.workOrdersNew = this.workOrders;
|
||||
// console.log('lines222222222', this.workOrders);
|
||||
//
|
||||
// console.log(typeof this.workOrders);
|
||||
// console.log(Array.isArray(this.workOrders));
|
||||
//
|
||||
// console.log(this.workOrders.every(order =>
|
||||
// typeof order === 'object' && order.id !== undefined));
|
||||
|
||||
|
||||
|
||||
|
||||
// var aDiv = document.getElementsByClassName('o_kanban_record')
|
||||
// for (var i = 0; i < aDiv.length; i++) {
|
||||
// console.log(aDiv[i])
|
||||
@@ -37,7 +31,6 @@ class CustomKanbanController extends KanbanController {
|
||||
buttonClick(ev) {
|
||||
const button = ev.currentTarget;
|
||||
const id = button.getAttribute('data-id');
|
||||
|
||||
// console.log('true_id', id);
|
||||
// const context = {production_line_show: 'shengchanxian1'}
|
||||
this.env.services.rpc('/web/dataset/call_kw', {
|
||||
@@ -58,8 +51,8 @@ class CustomKanbanController extends KanbanController {
|
||||
// console.log('response', response);
|
||||
location.reload();
|
||||
window.onload = function () {
|
||||
button.classList.add('choose')
|
||||
}
|
||||
button.classList.add('choose');
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -82,8 +75,6 @@ class CustomKanbanController extends KanbanController {
|
||||
// 你可以在这里处理响应,例如将其存储在控制器的状态中
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
CustomKanbanController.template = "sf_manufacturing.CustomKanbanView1";
|
||||
@@ -94,4 +85,4 @@ export const customKanbanView = {
|
||||
};
|
||||
|
||||
// Register it to the views registry
|
||||
registry.category("views").add("custom_kanban1", customKanbanView);
|
||||
registry.category("views").add("custom_kanban1", customKanbanView);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import models, fields, api, _
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class SfQualityPoint(models.Model):
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
odoo.define('sf_warehouse.custom_kanban', function (require) {
|
||||
"use strict"
|
||||
"use strict";
|
||||
var KanbanRenderer = require('web.KanbanRenderer');
|
||||
|
||||
KanbanRenderer.include({
|
||||
_render: function () {
|
||||
var self = this;
|
||||
return this._super.apply(this, arguments).then(function () {
|
||||
|
||||
var colorGuide = $('<div class="color-guide"> \
|
||||
<span class="color-guide-item" style="background-color: red;"></span> \
|
||||
<span class="color-guide-item" style="background-color: green;"></span> \
|
||||
@@ -16,5 +15,4 @@ odoo.define('sf_warehouse.custom_kanban', function (require) {
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
import { CharField } from '@web/views/fields/char/char_field';
|
||||
|
||||
|
||||
import {registry} from "@web/core/registry";
|
||||
import {CharField} from '@web/views/fields/char/char_field';
|
||||
|
||||
// 继承CharField组件实现自定义组件:当光标聚焦于输入框时,选中输入框内容
|
||||
class CustomChar extends CharField {
|
||||
@@ -20,7 +18,7 @@ class CustomChar extends CharField {
|
||||
// 当光标聚焦于输入框时,选中输入框内容
|
||||
this.input.el.addEventListener('focus', function () {
|
||||
this.select();
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -72,13 +70,13 @@ class CustomChar extends CharField {
|
||||
// }
|
||||
// }
|
||||
|
||||
// this.$input.on('focus', function () {
|
||||
// $(this).select();
|
||||
// });
|
||||
// this.$input.on('focus', function () {
|
||||
// $(this).select();
|
||||
// });
|
||||
|
||||
|
||||
// 当光标聚焦于输入框时,选中输入框内容
|
||||
|
||||
}
|
||||
|
||||
registry.category("fields").add("custom_char", CustomChar);
|
||||
registry.category("fields").add("custom_char", CustomChar);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/** @odoo-module */
|
||||
|
||||
import { KanbanController } from "@web/views/kanban/kanban_controller";
|
||||
import { kanbanView } from "@web/views/kanban/kanban_view";
|
||||
import { registry } from "@web/core/registry";
|
||||
import {KanbanController} from "@web/views/kanban/kanban_controller";
|
||||
import {kanbanView} from "@web/views/kanban/kanban_view";
|
||||
import {registry} from "@web/core/registry";
|
||||
|
||||
// the controller usually contains the Layout and the renderer.
|
||||
class CustomKanbanController extends KanbanController {
|
||||
@@ -18,4 +18,4 @@ export const customKanbanView = {
|
||||
};
|
||||
|
||||
// Register it to the views registry
|
||||
registry.category("views").add("custom_kanban", customKanbanView);
|
||||
registry.category("views").add("custom_kanban", customKanbanView);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
import { Many2OneField } from '@web/views/fields/many2one/many2one_field';
|
||||
|
||||
import {registry} from "@web/core/registry";
|
||||
import {Many2OneField} from '@web/views/fields/many2one/many2one_field';
|
||||
|
||||
|
||||
// 继承FieldMany2One组件实现自定义组件:当光标聚焦于输入框时,选中输入框内容
|
||||
@@ -17,12 +16,13 @@ class CustomMany2One extends Many2OneField {
|
||||
// console.log('CustomMany2One.setup11111111111111');
|
||||
super.setup();
|
||||
}
|
||||
|
||||
onMounted() {
|
||||
// console.log('CustomMany2One.onMounted1');
|
||||
// 当光标聚焦于输入框时,选中输入框内容
|
||||
this.input.el.addEventListener('focus', function () {
|
||||
this.select();
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,15 +26,15 @@ export class StepViewer extends Component {
|
||||
model: this.props.record.resModel,
|
||||
id: JSON.stringify(this.props.record.data['id']),
|
||||
field: this.props.name
|
||||
}
|
||||
url = url_props['base_url'].replace('http://', 'https://') + '/web/content/' + url_props['model'] + '/' + url_props['id'] + '/' + url_props['field'] + '?download=true'
|
||||
};
|
||||
url = url_props['base_url'].replace('http://', 'https://') + '/web/content/' + url_props['model'] + '/' + url_props['id'] + '/' + url_props['field'] + '?download=true';
|
||||
// url = 'http://localhost:8069'+'/web/content/'+url_props['model']+'/'+url_props['id']+'/'+url_props['field']+'?download=true'
|
||||
// console.log('url111111', url)
|
||||
return url
|
||||
return url;
|
||||
} else {
|
||||
url = "data:model/gltf-binary;base64," + this.props.value;
|
||||
// console.log('url2', url)
|
||||
return url
|
||||
return url;
|
||||
// localStorage.setItem('url',url)
|
||||
// let new_url = localStorage.getItem(('url'))
|
||||
// var oViewer = document.getElementsByTagName('model-viewer')[0];
|
||||
|
||||
Reference in New Issue
Block a user