Accept Merge Request #697: (feature/制造代码优化 -> develop)
Merge Request: 物流可见性控制,优化警告问题 Created By: @马广威 Accepted By: @马广威 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/697?initial=true
This commit is contained in:
@@ -11,7 +11,6 @@ export class Many2OneRadioField extends RadioField {
|
|||||||
// 你自己的代码
|
// 你自己的代码
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onImageClick(event) {
|
onImageClick(event) {
|
||||||
// 放大图片逻辑
|
// 放大图片逻辑
|
||||||
// 获取图片元素
|
// 获取图片元素
|
||||||
@@ -47,7 +46,6 @@ export class Many2OneRadioField extends RadioField {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Many2OneRadioField.template = "jikimo_frontend.Many2OneRadioField"
|
Many2OneRadioField.template = "jikimo_frontend.Many2OneRadioField"
|
||||||
|
|||||||
@@ -15,23 +15,24 @@ export class MyCustomWidget extends Many2ManyCheckboxesField {
|
|||||||
// 放大图片逻辑
|
// 放大图片逻辑
|
||||||
// 获取图片元素
|
// 获取图片元素
|
||||||
const img = event.target;
|
const img = event.target;
|
||||||
const close = img.nextSibling
|
const close = img.nextSibling;
|
||||||
|
|
||||||
// 实现放大图片逻辑
|
// 实现放大图片逻辑
|
||||||
// 比如使用 CSS 放大
|
// 比如使用 CSS 放大
|
||||||
img.parentElement.classList.add('zoomed');
|
img.parentElement.classList.add('zoomed');
|
||||||
close.classList.add('img_close')
|
close.classList.add('img_close');
|
||||||
}
|
}
|
||||||
|
|
||||||
onCloseClick(event) {
|
onCloseClick(event) {
|
||||||
const close = event.target;
|
const close = event.target;
|
||||||
const img = close.previousSibling
|
const img = close.previousSibling;
|
||||||
img.parentElement.classList.remove('zoomed')
|
img.parentElement.classList.remove('zoomed');
|
||||||
close.classList.remove('img_close')
|
close.classList.remove('img_close');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MyCustomWidget.template = "jikimo_frontend.MyCustomWidget"
|
MyCustomWidget.template = "jikimo_frontend.MyCustomWidget";
|
||||||
// MyCustomWidget.supportedTypes = ['many2many'];
|
// MyCustomWidget.supportedTypes = ['many2many'];
|
||||||
|
|
||||||
registry.category("fields").add("custom_many2many_checkboxes", MyCustomWidget);
|
registry.category("fields").add("custom_many2many_checkboxes", MyCustomWidget);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import {patch} from '@web/core/utils/patch';
|
import {patch} from '@web/core/utils/patch';
|
||||||
// import { Dialog } from "@web/core/dialog/dialog";
|
// import { Dialog } from "@web/core/dialog/dialog";
|
||||||
import {_t} from "@web/core/l10n/translation";
|
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 Dialog = require('web.Dialog');
|
||||||
// var {patch} = require("web.utils") 这句话也行
|
// var {patch} = require("web.utils") 这句话也行
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/** @odoo-module */
|
/** @odoo-module */
|
||||||
|
|
||||||
import {patch} from '@web/core/utils/patch';
|
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") 这句话也行
|
// var {patch} = require("web.utils") 这句话也行
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', {
|
|||||||
|
|
||||||
const table = this.tableRef.el;
|
const table = this.tableRef.el;
|
||||||
const headers = [...table.querySelectorAll("thead th:not(.o_list_actions_header)")];
|
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) {
|
if (!this.columnWidths || !this.columnWidths.length) {
|
||||||
// no column widths to restore
|
// no column widths to restore
|
||||||
@@ -66,8 +66,8 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// 判断 this.state.columns 是否存在且长度大于零
|
// 判断 this.state.columns 是否存在且长度大于零
|
||||||
if (this.state.columns && this.state.columns.length > 0 &&
|
if (this.state.columns && this.state.columns.length > 0
|
||||||
this.state.columns[0].name === "sequence") {
|
&& this.state.columns[0].name === "sequence") {
|
||||||
widths[1] = { type: "relative", value: 0.1 };
|
widths[1] = { type: "relative", value: 0.1 };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import logging
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import requests
|
import requests
|
||||||
import cpca
|
import cpca
|
||||||
from odoo.exceptions import UserError
|
# from odoo.exceptions import UserError
|
||||||
from odoo.exceptions import ValidationError
|
# from odoo.exceptions import ValidationError
|
||||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
from odoo import api, fields, models
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -40,9 +40,22 @@ class JdEclp(models.Model):
|
|||||||
# bill = fields.Many2one('ir.attachment', string='物流面单', compute='query_bill_pdf')
|
# bill = fields.Many2one('ir.attachment', string='物流面单', compute='query_bill_pdf')
|
||||||
# bill_show = fields.Binary(string='物流面单展示', readonly=True, related='self.bill.datas')
|
# bill_show = fields.Binary(string='物流面单展示', readonly=True, related='self.bill.datas')
|
||||||
bill_show = fields.Binary(string='物流面单展示', readonly=True)
|
bill_show = fields.Binary(string='物流面单展示', readonly=True)
|
||||||
|
check_out = fields.Char(string='查询是否为出库单', compute='_check_is_out')
|
||||||
|
|
||||||
|
@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')
|
@api.depends('carrier_tracking_ref')
|
||||||
def query_bill_pdf(self):
|
def query_bill_pdf(self):
|
||||||
|
"""
|
||||||
|
查询物流面单,并赋值给bill
|
||||||
|
"""
|
||||||
self.bill = self.env['ir.attachment'].sudo().search([('name', '=', self.carrier_tracking_ref)])
|
self.bill = self.env['ir.attachment'].sudo().search([('name', '=', self.carrier_tracking_ref)])
|
||||||
|
|
||||||
@api.depends('origin')
|
@api.depends('origin')
|
||||||
@@ -77,7 +90,6 @@ class JdEclp(models.Model):
|
|||||||
self.receiverTownName = self.receiverTownName
|
self.receiverTownName = self.receiverTownName
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error address is none: {e}")
|
print(f"Error address is none: {e}")
|
||||||
pass
|
|
||||||
|
|
||||||
def create_order(self):
|
def create_order(self):
|
||||||
# sale_order_id = self.env['sale.order'].search([('name', '=', self.origin)])
|
# 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}
|
action['context'] = {'default_picking_ids': self.ids}
|
||||||
return action
|
return action
|
||||||
|
|
||||||
out_start_time = str(datetime.now())
|
# out_start_time = str(datetime.now())
|
||||||
json2 = {
|
json2 = {
|
||||||
'params': {
|
'params': {
|
||||||
'model_name': 'jikimo.process.order',
|
'model_name': 'jikimo.process.order',
|
||||||
|
|||||||
@@ -1,14 +1,27 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
|
<record id="add_check_out_view_picking_form" model="ir.ui.view">
|
||||||
|
<field name="name">增加一个check_out字段</field>
|
||||||
|
<field name="model">stock.picking</field>
|
||||||
|
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//form//sheet//div[@name='button_box']" position="inside">
|
||||||
|
<field name="check_out" invisible="True"/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<record id="custom_view_picking_form" model="ir.ui.view">
|
<record id="custom_view_picking_form" model="ir.ui.view">
|
||||||
<field name="name">物流</field>
|
<field name="name">物流</field>
|
||||||
<field name="model">stock.picking</field>
|
<field name="model">stock.picking</field>
|
||||||
<field name="inherit_id" ref="stock.view_picking_form"/>
|
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//form//header" position="inside">
|
<xpath expr="//form//header//button[@name='action_assign']" position="after">
|
||||||
<button string="京东物流下单" name="create_order" type="object" confirm="是否确认物流下单" class="btn-primary"/>
|
<button string="京东物流下单" name="create_order" type="object" confirm="是否确认物流下单" class="btn-primary"
|
||||||
<button string="获取物流面单" name="get_bill" type="object" confirm="是否获取物流面单" class="btn-primary"/>
|
attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
|
<button string="获取物流面单" name="get_bill" type="object" confirm="是否获取物流面单" class="btn-primary"
|
||||||
|
attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -20,24 +33,24 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//group//field[@name='carrier_id']" position="after">
|
<xpath expr="//group//field[@name='carrier_id']" position="after">
|
||||||
<!-- <field name="senderNickName" domain="[('self.name', 'like', '%OUT%')]"/> -->
|
<!-- <field name="senderNickName" domain="[('self.name', 'like', '%OUT%')]"/> -->
|
||||||
<field name="senderNickName" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
<field name="senderNickName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="expressItemName" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
<field name="expressItemName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="deliveryType" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
<field name="deliveryType" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="receiverName" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
<field name="receiverName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="receiverMobile" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
<field name="receiverMobile" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="receiverProvinceName" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
<field name="receiverProvinceName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="receiverCityName" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
<field name="receiverCityName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="receiverCountyName" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
<field name="receiverCountyName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="receiverTownName" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
<field name="receiverTownName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="receiverCompany" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
<field name="receiverCompany" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="remark" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
<field name="remark" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="grossWeight"/>
|
<field name="grossWeight" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="grossVolume"/>
|
<field name="grossVolume" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="pickupBeginTime"/>
|
<field name="pickupBeginTime" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
<field name="bill_show"/>
|
<field name="bill_show" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//group//field[@name='group_id']" position="after">
|
<xpath expr="//group//field[@name='group_id']" position="after">
|
||||||
<field name="bill_show" widget="pdf_viewer"/>
|
<field name="bill_show" widget="pdf_viewer" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<!-- <xpath expr="//group[@name='other_infos']" position="after"> -->
|
<!-- <xpath expr="//group[@name='other_infos']" position="after"> -->
|
||||||
<!-- <div> -->
|
<!-- <div> -->
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import os
|
import os
|
||||||
import time
|
|
||||||
import json
|
import json
|
||||||
import base64
|
import base64
|
||||||
import logging
|
import logging
|
||||||
@@ -9,7 +8,7 @@ from zipfile import ZipFile
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
import requests
|
import requests
|
||||||
from odoo.http import request
|
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 UserError
|
||||||
from odoo.addons.sf_machine_connect.models import py2opcua, ftp_operate
|
from odoo.addons.sf_machine_connect.models import py2opcua, ftp_operate
|
||||||
|
|
||||||
@@ -466,7 +465,7 @@ class WorkCenterBarcode(models.Model):
|
|||||||
raise UserError('NC下发执行超时, 请检查下发状态')
|
raise UserError('NC下发执行超时, 请检查下发状态')
|
||||||
|
|
||||||
def get__state(self):
|
def get__state(self):
|
||||||
pay_time = str(datetime.now())
|
# pay_time = str(datetime.now())
|
||||||
json = {
|
json = {
|
||||||
'params': {
|
'params': {
|
||||||
'model_name': 'jikimo.process.order',
|
'model_name': 'jikimo.process.order',
|
||||||
|
|||||||
@@ -97,13 +97,12 @@ export class CodeField extends Component {
|
|||||||
} else {
|
} else {
|
||||||
if (records[0].state === '占用') {
|
if (records[0].state === '占用') {
|
||||||
// console.log('此托盘已占用,请检查')
|
// console.log('此托盘已占用,请检查')
|
||||||
alert('此托盘已占用,请检查')
|
alert('此托盘已占用,请检查');
|
||||||
} else {
|
} else {
|
||||||
// console.log('此托盘已损坏,请登记')
|
// console.log('此托盘已损坏,请登记')
|
||||||
alert('此托盘已损坏,请登记')
|
alert('此托盘已损坏,请登记');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const searchInput = this.autocompleteContainerRef.el.querySelector("input");
|
const searchInput = this.autocompleteContainerRef.el.querySelector("input");
|
||||||
searchInput.value = barcode;
|
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
|
// Register the field in the registry
|
||||||
CodeField.props = standardFieldProps;
|
CodeField.props = standardFieldProps;
|
||||||
registry.category("fields").add("code", CodeField);
|
registry.category("fields").add("code", CodeField);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const { Component, xml } = owl;
|
|||||||
|
|
||||||
export class BarcodeHandlerField extends Component {
|
export class BarcodeHandlerField extends Component {
|
||||||
setup() {
|
setup() {
|
||||||
this.actionService = useService("action")
|
this.actionService = useService("action");
|
||||||
const barcode = useService("barcode");
|
const barcode = useService("barcode");
|
||||||
// this.rpc = useService("rpc");
|
// this.rpc = useService("rpc");
|
||||||
// useBus(barcode.bus, "barcode_scanned", this.onBarcodeScanned.bind(this));
|
// 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 { data } = await this.env.services.rpc('/web/dataset/call_kw', params);
|
||||||
const response = await this.env.services.rpc('/web/dataset/call_kw', params);
|
const response = await this.env.services.rpc('/web/dataset/call_kw', params);
|
||||||
// return response
|
// return response
|
||||||
const responseObject = JSON.parse(response)
|
const responseObject = JSON.parse(response);
|
||||||
return responseObject;
|
return responseObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,8 +58,7 @@ export class BarcodeHandlerField extends Component {
|
|||||||
} else {
|
} else {
|
||||||
// console.error("Barcode not found or RPC call failed.");
|
// console.error("Barcode not found or RPC call failed.");
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BarcodeHandlerField.template = xml``;
|
BarcodeHandlerField.template = xml``;
|
||||||
|
|||||||
@@ -2,15 +2,11 @@
|
|||||||
import base64
|
import base64
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import json
|
|
||||||
import hashlib
|
|
||||||
import time
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import requests
|
from odoo import fields, models
|
||||||
from odoo import fields, models, api, _
|
# from odoo.exceptions import ValidationError
|
||||||
from odoo.exceptions import ValidationError
|
|
||||||
from odoo.exceptions import UserError
|
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__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -17,16 +17,10 @@ class CustomKanbanController extends KanbanController {
|
|||||||
this.workOrders = await this.getAllWorkOrders();
|
this.workOrders = await this.getAllWorkOrders();
|
||||||
// this.workOrdersNew = this.workOrders;
|
// this.workOrdersNew = this.workOrders;
|
||||||
// console.log('lines222222222', this.workOrders);
|
// console.log('lines222222222', this.workOrders);
|
||||||
//
|
|
||||||
// console.log(typeof this.workOrders);
|
// console.log(typeof this.workOrders);
|
||||||
// console.log(Array.isArray(this.workOrders));
|
// console.log(Array.isArray(this.workOrders));
|
||||||
//
|
|
||||||
// console.log(this.workOrders.every(order =>
|
// console.log(this.workOrders.every(order =>
|
||||||
// typeof order === 'object' && order.id !== undefined));
|
// typeof order === 'object' && order.id !== undefined));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// var aDiv = document.getElementsByClassName('o_kanban_record')
|
// var aDiv = document.getElementsByClassName('o_kanban_record')
|
||||||
// for (var i = 0; i < aDiv.length; i++) {
|
// for (var i = 0; i < aDiv.length; i++) {
|
||||||
// console.log(aDiv[i])
|
// console.log(aDiv[i])
|
||||||
@@ -37,7 +31,6 @@ class CustomKanbanController extends KanbanController {
|
|||||||
buttonClick(ev) {
|
buttonClick(ev) {
|
||||||
const button = ev.currentTarget;
|
const button = ev.currentTarget;
|
||||||
const id = button.getAttribute('data-id');
|
const id = button.getAttribute('data-id');
|
||||||
|
|
||||||
// console.log('true_id', id);
|
// console.log('true_id', id);
|
||||||
// const context = {production_line_show: 'shengchanxian1'}
|
// const context = {production_line_show: 'shengchanxian1'}
|
||||||
this.env.services.rpc('/web/dataset/call_kw', {
|
this.env.services.rpc('/web/dataset/call_kw', {
|
||||||
@@ -58,8 +51,8 @@ class CustomKanbanController extends KanbanController {
|
|||||||
// console.log('response', response);
|
// console.log('response', response);
|
||||||
location.reload();
|
location.reload();
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
button.classList.add('choose')
|
button.classList.add('choose');
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -82,8 +75,6 @@ class CustomKanbanController extends KanbanController {
|
|||||||
// 你可以在这里处理响应,例如将其存储在控制器的状态中
|
// 你可以在这里处理响应,例如将其存储在控制器的状态中
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomKanbanController.template = "sf_manufacturing.CustomKanbanView1";
|
CustomKanbanController.template = "sf_manufacturing.CustomKanbanView1";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from odoo import models, fields, api, _
|
from odoo import models, fields
|
||||||
|
|
||||||
|
|
||||||
class SfQualityPoint(models.Model):
|
class SfQualityPoint(models.Model):
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
odoo.define('sf_warehouse.custom_kanban', function (require) {
|
odoo.define('sf_warehouse.custom_kanban', function (require) {
|
||||||
"use strict"
|
"use strict";
|
||||||
var KanbanRenderer = require('web.KanbanRenderer');
|
var KanbanRenderer = require('web.KanbanRenderer');
|
||||||
|
|
||||||
KanbanRenderer.include({
|
KanbanRenderer.include({
|
||||||
_render: function () {
|
_render: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
return this._super.apply(this, arguments).then(function () {
|
return this._super.apply(this, arguments).then(function () {
|
||||||
|
|
||||||
var colorGuide = $('<div class="color-guide"> \
|
var colorGuide = $('<div class="color-guide"> \
|
||||||
<span class="color-guide-item" style="background-color: red;"></span> \
|
<span class="color-guide-item" style="background-color: red;"></span> \
|
||||||
<span class="color-guide-item" style="background-color: green;"></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 **/
|
/** @odoo-module **/
|
||||||
|
|
||||||
import { registry } from "@web/core/registry";
|
import {registry} from "@web/core/registry";
|
||||||
import { CharField } from '@web/views/fields/char/char_field';
|
import {CharField} from '@web/views/fields/char/char_field';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 继承CharField组件实现自定义组件:当光标聚焦于输入框时,选中输入框内容
|
// 继承CharField组件实现自定义组件:当光标聚焦于输入框时,选中输入框内容
|
||||||
class CustomChar extends CharField {
|
class CustomChar extends CharField {
|
||||||
@@ -20,7 +18,7 @@ class CustomChar extends CharField {
|
|||||||
// 当光标聚焦于输入框时,选中输入框内容
|
// 当光标聚焦于输入框时,选中输入框内容
|
||||||
this.input.el.addEventListener('focus', function () {
|
this.input.el.addEventListener('focus', function () {
|
||||||
this.select();
|
this.select();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -72,9 +70,9 @@ class CustomChar extends CharField {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// this.$input.on('focus', function () {
|
// this.$input.on('focus', function () {
|
||||||
// $(this).select();
|
// $(this).select();
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
|
||||||
// 当光标聚焦于输入框时,选中输入框内容
|
// 当光标聚焦于输入框时,选中输入框内容
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/** @odoo-module */
|
/** @odoo-module */
|
||||||
|
|
||||||
import { KanbanController } from "@web/views/kanban/kanban_controller";
|
import {KanbanController} from "@web/views/kanban/kanban_controller";
|
||||||
import { kanbanView } from "@web/views/kanban/kanban_view";
|
import {kanbanView} from "@web/views/kanban/kanban_view";
|
||||||
import { registry } from "@web/core/registry";
|
import {registry} from "@web/core/registry";
|
||||||
|
|
||||||
// the controller usually contains the Layout and the renderer.
|
// the controller usually contains the Layout and the renderer.
|
||||||
class CustomKanbanController extends KanbanController {
|
class CustomKanbanController extends KanbanController {
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/** @odoo-module **/
|
/** @odoo-module **/
|
||||||
|
|
||||||
import { registry } from "@web/core/registry";
|
import {registry} from "@web/core/registry";
|
||||||
import { Many2OneField } from '@web/views/fields/many2one/many2one_field';
|
import {Many2OneField} from '@web/views/fields/many2one/many2one_field';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 继承FieldMany2One组件实现自定义组件:当光标聚焦于输入框时,选中输入框内容
|
// 继承FieldMany2One组件实现自定义组件:当光标聚焦于输入框时,选中输入框内容
|
||||||
@@ -17,12 +16,13 @@ class CustomMany2One extends Many2OneField {
|
|||||||
// console.log('CustomMany2One.setup11111111111111');
|
// console.log('CustomMany2One.setup11111111111111');
|
||||||
super.setup();
|
super.setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted() {
|
onMounted() {
|
||||||
// console.log('CustomMany2One.onMounted1');
|
// console.log('CustomMany2One.onMounted1');
|
||||||
// 当光标聚焦于输入框时,选中输入框内容
|
// 当光标聚焦于输入框时,选中输入框内容
|
||||||
this.input.el.addEventListener('focus', function () {
|
this.input.el.addEventListener('focus', function () {
|
||||||
this.select();
|
this.select();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,15 +26,15 @@ export class StepViewer extends Component {
|
|||||||
model: this.props.record.resModel,
|
model: this.props.record.resModel,
|
||||||
id: JSON.stringify(this.props.record.data['id']),
|
id: JSON.stringify(this.props.record.data['id']),
|
||||||
field: this.props.name
|
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'
|
// url = 'http://localhost:8069'+'/web/content/'+url_props['model']+'/'+url_props['id']+'/'+url_props['field']+'?download=true'
|
||||||
// console.log('url111111', url)
|
// console.log('url111111', url)
|
||||||
return url
|
return url;
|
||||||
} else {
|
} else {
|
||||||
url = "data:model/gltf-binary;base64," + this.props.value;
|
url = "data:model/gltf-binary;base64," + this.props.value;
|
||||||
// console.log('url2', url)
|
// console.log('url2', url)
|
||||||
return url
|
return url;
|
||||||
// localStorage.setItem('url',url)
|
// localStorage.setItem('url',url)
|
||||||
// let new_url = localStorage.getItem(('url'))
|
// let new_url = localStorage.getItem(('url'))
|
||||||
// var oViewer = document.getElementsByTagName('model-viewer')[0];
|
// var oViewer = document.getElementsByTagName('model-viewer')[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user