Compare commits
6 Commits
master_sf_
...
feature/71
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aec2d1c516 | ||
|
|
8b66fda899 | ||
|
|
6321e7ef23 | ||
|
|
23dd88b7ba | ||
|
|
f164488e48 | ||
|
|
25b53794bb |
@@ -10,8 +10,8 @@ from odoo.exceptions import ValidationError, UserError
|
|||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
|
|
||||||
|
|
||||||
from OCC.Extend.DataExchange import read_step_file
|
# from OCC.Extend.DataExchange import read_step_file
|
||||||
from OCC.Extend.DataExchange import write_stl_file
|
# from OCC.Extend.DataExchange import write_stl_file
|
||||||
|
|
||||||
|
|
||||||
class ResProductMo(models.Model):
|
class ResProductMo(models.Model):
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ from datetime import datetime
|
|||||||
import requests
|
import requests
|
||||||
from odoo import http
|
from odoo import http
|
||||||
from odoo.http import request
|
from odoo.http import request
|
||||||
from OCC.Extend.DataExchange import read_step_file
|
# from OCC.Extend.DataExchange import read_step_file
|
||||||
from OCC.Extend.DataExchange import write_stl_file
|
# from OCC.Extend.DataExchange import write_stl_file
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
from odoo.exceptions import ValidationError, UserError
|
from odoo.exceptions import ValidationError, UserError
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import requests
|
|||||||
import os
|
import os
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
# from OCC.Core.GProp import GProp_GProps
|
# from OCC.Core.GProp import GProp_GProps
|
||||||
from OCC.Extend.DataExchange import read_step_file
|
# from OCC.Extend.DataExchange import read_step_file
|
||||||
from OCC.Extend.DataExchange import write_stl_file
|
# from OCC.Extend.DataExchange import write_stl_file
|
||||||
from odoo.addons.sf_base.commons.common import Common
|
from odoo.addons.sf_base.commons.common import Common
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
{
|
{
|
||||||
'name': '机企猫智能工厂 库存管理',
|
'name': '机企猫智能工厂 库存管理',
|
||||||
'version': '1.0',
|
'version': '1.2',
|
||||||
'summary': '智能工厂库存管理',
|
'summary': '智能工厂库存管理',
|
||||||
'sequence': 1,
|
'sequence': 1,
|
||||||
'description': """
|
'description': """
|
||||||
@@ -23,17 +23,16 @@
|
|||||||
'demo': [
|
'demo': [
|
||||||
],
|
],
|
||||||
'assets': {
|
'assets': {
|
||||||
|
|
||||||
'web.assets_qweb': [
|
'web.assets_qweb': [
|
||||||
],
|
],
|
||||||
|
|
||||||
'web.assets_backend': [
|
'web.assets_backend': [
|
||||||
# 'sf_warehouse/static/src/js/vanilla-masker.min.js',
|
# 'sf_warehouse/static/src/js/vanilla-masker.min.js',
|
||||||
'sf_warehouse/static/src/css/kanban_color_change.scss',
|
'sf_warehouse/static/src/css/kanban_color_change.scss',
|
||||||
'sf_warehouse/static/src/js/custom_kanban_controller.js',
|
'sf_warehouse/static/src/js/custom_kanban_controller.js',
|
||||||
'sf_warehouse/static/src/xml/custom_kanban_controller.xml',
|
'sf_warehouse/static/src/xml/custom_kanban_controller.xml',
|
||||||
|
'sf_warehouse/static/src/css/kanban_location_custom.scss',
|
||||||
|
'sf_warehouse/static/src/js/shelf_location_search.js',
|
||||||
]
|
]
|
||||||
|
|
||||||
},
|
},
|
||||||
'license': 'LGPL-3',
|
'license': 'LGPL-3',
|
||||||
'installable': True,
|
'installable': True,
|
||||||
|
|||||||
21
sf_warehouse/migrations/1.2/post-migrate.py
Normal file
21
sf_warehouse/migrations/1.2/post-migrate.py
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
from odoo import api, SUPERUSER_ID
|
||||||
|
|
||||||
|
def migrate(cr, version):
|
||||||
|
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||||
|
sf_shelf_model = env["sf.shelf"]
|
||||||
|
sf_shelf_location_model = env["sf.shelf.location"]
|
||||||
|
|
||||||
|
preproduction_shelf_ids = sf_shelf_location_model.get_preproduction_shelf_ids()
|
||||||
|
|
||||||
|
shelves = sf_shelf_model.search([])
|
||||||
|
for shelf in shelves:
|
||||||
|
if shelf.id not in preproduction_shelf_ids:
|
||||||
|
continue
|
||||||
|
|
||||||
|
shelf_barcode = shelf.barcode or ""
|
||||||
|
if not shelf_barcode:
|
||||||
|
continue
|
||||||
|
locations = sf_shelf_location_model.search([("shelf_id", "=", shelf.id)], order="id asc")
|
||||||
|
for index, location in enumerate(locations, start=1):
|
||||||
|
new_barcode = f"{shelf_barcode}-{index:03d}"
|
||||||
|
location.barcode = new_barcode
|
||||||
File diff suppressed because it is too large
Load Diff
198
sf_warehouse/static/src/css/kanban_location_custom.scss
Normal file
198
sf_warehouse/static/src/css/kanban_location_custom.scss
Normal file
@@ -0,0 +1,198 @@
|
|||||||
|
// 定义看板公共样式的Mixin
|
||||||
|
@mixin kanban-common-styles($record-count-each-row, $record-gap: 16px) {
|
||||||
|
$record-gap-total-width: $record-gap * ($record-count-each-row - 1);
|
||||||
|
|
||||||
|
display: flex !important;
|
||||||
|
flex-wrap: wrap !important;
|
||||||
|
overflow-x: hidden !important;
|
||||||
|
overflow-y: auto !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
gap: $record-gap !important;
|
||||||
|
width: 100% !important;
|
||||||
|
height: 100% !important;
|
||||||
|
|
||||||
|
// === 卡片基础样式(完全保留)===
|
||||||
|
.o_kanban_record {
|
||||||
|
flex: 0 0 calc((100% - #{$record-gap-total-width}) / #{$record-count-each-row}) !important;
|
||||||
|
height: calc((100% - #{$record-gap * 6}) / 6) !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
background-color: white !important;
|
||||||
|
border: 1px solid #dee2e6 !important;
|
||||||
|
border-radius: 4px !important;
|
||||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
|
||||||
|
min-width: calc((100% - #{$record-gap-total-width}) / #{$record-count-each-row}) !important;
|
||||||
|
max-width: calc((100% - #{$record-gap-total-width}) / #{$record-count-each-row}) !important;
|
||||||
|
position: relative;
|
||||||
|
transition: all 0.25s ease !important;
|
||||||
|
overflow: visible !important; // 允许悬停条溢出卡片边界
|
||||||
|
|
||||||
|
// === 状态标签(保留原设计)===
|
||||||
|
.status-label {
|
||||||
|
position: absolute;
|
||||||
|
top: 8px;
|
||||||
|
right: 8px;
|
||||||
|
padding: 3px 8px;
|
||||||
|
background: rgba(255, 255, 255, 0.9);
|
||||||
|
border: 1px solid #e0e0e0;
|
||||||
|
border-radius: 3px;
|
||||||
|
font-size: 11px;
|
||||||
|
color: #424242;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// === 优化:悬停信息条(核心改动)===
|
||||||
|
.status-hover-bar {
|
||||||
|
position: absolute;
|
||||||
|
bottom: calc(100% + 8px); // 默认显示在卡片上方
|
||||||
|
left: 0;
|
||||||
|
z-index: 1000;
|
||||||
|
min-width: max-content; // 宽度自适应内容
|
||||||
|
max-width: 300px; // 防止过宽
|
||||||
|
padding: 10px 12px;
|
||||||
|
background: rgba(255, 255, 255, 0.95);
|
||||||
|
border: 1px solid #e0e0e0;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||||
|
font-size: 12px;
|
||||||
|
color: #424242;
|
||||||
|
white-space: nowrap; // 强制单行显示
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none; // 避免阻挡卡片交互
|
||||||
|
transition: opacity 0.2s ease, transform 0.2s ease;
|
||||||
|
transform: translateY(10px);
|
||||||
|
|
||||||
|
// 三角形指示器
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 100%;
|
||||||
|
left: 15px;
|
||||||
|
border: 6px solid transparent;
|
||||||
|
border-top-color: rgba(0, 0, 0, 0.85);
|
||||||
|
}
|
||||||
|
|
||||||
|
div {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// === 悬停触发逻辑 ===
|
||||||
|
&:hover {
|
||||||
|
transform: translateY(-4px) !important;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
|
||||||
|
z-index: 10;
|
||||||
|
|
||||||
|
.status-hover-bar {
|
||||||
|
background: rgba(50, 50, 50, 0.9);
|
||||||
|
color: #fff !important;
|
||||||
|
font-size: 12px;
|
||||||
|
opacity: 0.9;
|
||||||
|
transform: translateY(0);
|
||||||
|
pointer-events: auto; // 悬停时允许交互
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// === 边界保护(智能定位)===
|
||||||
|
// 左侧卡片:左对齐
|
||||||
|
&:nth-child(#{$record-count-each-row}n+1) .status-hover-bar {
|
||||||
|
left: 0;
|
||||||
|
right: auto;
|
||||||
|
&::after { left: 15px; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 右侧卡片:右对齐
|
||||||
|
&:nth-child(#{$record-count-each-row}n) .status-hover-bar {
|
||||||
|
left: auto;
|
||||||
|
right: 0;
|
||||||
|
&::after {
|
||||||
|
left: auto;
|
||||||
|
right: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&:nth-child(#{$record-count-each-row}n + #{$record-count-each-row - 1}) .status-hover-bar {
|
||||||
|
left: auto;
|
||||||
|
right: 0;
|
||||||
|
&::after {
|
||||||
|
left: auto;
|
||||||
|
right: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 顶部卡片:悬停条显示在下方
|
||||||
|
&:nth-child(-n+#{$record-count-each-row}) .status-hover-bar {
|
||||||
|
bottom: auto;
|
||||||
|
top: calc(100% + 8px);
|
||||||
|
&::after {
|
||||||
|
top: auto;
|
||||||
|
bottom: 100%;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-bottom-color: rgba(255, 255, 255, 0.95);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// === 禁用状态样式(保留原效果)===
|
||||||
|
&.kanban_color_3 {
|
||||||
|
opacity: 0.6;
|
||||||
|
&:hover {
|
||||||
|
opacity: 0.85;
|
||||||
|
.status-hover-bar {
|
||||||
|
background:rgba(0, 0, 0, 0.85);
|
||||||
|
color: white !important;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.15) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// === 看板视图样式(完全保留)===
|
||||||
|
.o_kanban_view {
|
||||||
|
// 卡片内部结构(不修改)
|
||||||
|
.o_kanban_record {
|
||||||
|
.o_kanban_record_bottom {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.oe_kanban_card.kanban_color_3,
|
||||||
|
.oe_kanban_card.kanban_color_1,
|
||||||
|
.oe_kanban_card.kanban_color_2 {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
.sf_kanban_custom_location_info_style {
|
||||||
|
display: flex !important;
|
||||||
|
justify-content: center !important;
|
||||||
|
align-items: center !important;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 15px;
|
||||||
|
color: #000000;
|
||||||
|
padding:0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sf_kanban_no {
|
||||||
|
display: flex !important;
|
||||||
|
justify-content: center !important;
|
||||||
|
align-items: center !important;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 不同列数的看板样式
|
||||||
|
.sf_kanban_location_style12 {
|
||||||
|
@include kanban-common-styles(12);
|
||||||
|
}
|
||||||
|
.sf_kanban_location_style19 {
|
||||||
|
@include kanban-common-styles(19);
|
||||||
|
}
|
||||||
|
.sf_kanban_location_style4 {
|
||||||
|
@include kanban-common-styles(4);
|
||||||
|
}
|
||||||
|
.sf_kanban_location_style3 {
|
||||||
|
@include kanban-common-styles(3);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,21 +1,197 @@
|
|||||||
/** @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 { KanbanRenderer } from "@web/views/kanban/kanban_renderer";
|
||||||
import {registry} from "@web/core/registry";
|
import { kanbanView } from "@web/views/kanban/kanban_view";
|
||||||
|
import { registry } from "@web/core/registry";
|
||||||
// the controller usually contains the Layout and the renderer.
|
import { useService } from "@web/core/utils/hooks";
|
||||||
class CustomKanbanController extends KanbanController {
|
import { useState, onWillStart, onWillUnmount, onMounted } from "@odoo/owl";
|
||||||
// Your logic here, override or insert new methods...
|
|
||||||
// if you override setup(), don't forget to call super.setup()
|
|
||||||
}
|
// 自定义看板渲染器
|
||||||
|
class CustomKanbanRenderer extends KanbanRenderer {
|
||||||
CustomKanbanController.template = "sf_warehouse.CustomKanbanView";
|
|
||||||
|
}
|
||||||
export const customKanbanView = {
|
|
||||||
...kanbanView, // contains the default Renderer/Controller/Model
|
// 自定义看板控制器
|
||||||
Controller: CustomKanbanController,
|
class CustomKanbanController extends KanbanController {
|
||||||
};
|
setup() {
|
||||||
|
super.setup();
|
||||||
// Register it to the views registry
|
this.orm = useService("orm");
|
||||||
registry.category("views").add("custom_kanban", customKanbanView);
|
this.searchModel = this.model.env.searchModel;
|
||||||
|
this.defaultPagerLimit = this.getSystemDefaultLimit();
|
||||||
|
this._onUpdate = (payload) => {
|
||||||
|
this._handleSearchUpdate(payload);
|
||||||
|
};
|
||||||
|
|
||||||
|
this.env.services.user.updateContext({
|
||||||
|
isBaseStyle: true
|
||||||
|
});
|
||||||
|
let self = this;
|
||||||
|
|
||||||
|
onWillStart(async () => {
|
||||||
|
try {
|
||||||
|
this.preproductionShelfIds = await this.orm.call(
|
||||||
|
'sf.shelf.location',
|
||||||
|
'get_preproduction_shelf_ids',
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
this.preproductionShelfIds = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
this.searchModel.on('update', self, self._onUpdate);
|
||||||
|
await this.loadShelfLayersData();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 组件销毁时移除监听
|
||||||
|
onWillUnmount(() => {
|
||||||
|
this.searchModel.off('update', self, self._onUpdate);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 监听视图切换事件以监控面包屑
|
||||||
|
onMounted(() => {
|
||||||
|
this.handleRouteChange()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
handleRouteChange() {
|
||||||
|
this.render(true);
|
||||||
|
let domain = this.searchModel.domain;
|
||||||
|
if (domain.length > 0) {
|
||||||
|
let shelfDomain = domain.find(item => item[0] === 'shelf_id');
|
||||||
|
if (shelfDomain && shelfDomain[2] && this.preproductionShelfIds && this.preproductionShelfIds.includes(shelfDomain[2])) {
|
||||||
|
this.onShelfChange(shelfDomain[2]);
|
||||||
|
} else {
|
||||||
|
this.setKanbanStyle('sf_kanban_location_style');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.setKanbanStyle('sf_kanban_location_style');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_handleSearchUpdate() {
|
||||||
|
try {
|
||||||
|
let domain = this.searchModel.domain;
|
||||||
|
if (domain.length > 0) {
|
||||||
|
let shelfDomain = domain.find(item => item[0] === 'shelf_id');
|
||||||
|
if (shelfDomain) {
|
||||||
|
let shelfId = shelfDomain[2];
|
||||||
|
if (shelfId && this.preproductionShelfIds.includes(shelfId)) {
|
||||||
|
this.onShelfChange(shelfId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//设置默认样式
|
||||||
|
this.updatePagerLimit(this.defaultPagerLimit);
|
||||||
|
this.setKanbanStyle('sf_kanban_location_style');
|
||||||
|
} catch (error) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载所有货架的层数数据
|
||||||
|
async loadShelfLayersData() {
|
||||||
|
this.shelfLayersMap = {};
|
||||||
|
const shelfIds = await this.orm.search('sf.shelf', []);
|
||||||
|
const shelves = await this.orm.read('sf.shelf', shelfIds, ['id', 'layer_capacity']);
|
||||||
|
|
||||||
|
shelves.forEach(shelf => {
|
||||||
|
this.shelfLayersMap[shelf.id] = shelf.layer_capacity;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
setKanbanStyle(style) {
|
||||||
|
this.env.services.user.updateContext({
|
||||||
|
isBaseStyle: style === 'sf_kanban_location_style'
|
||||||
|
});
|
||||||
|
const kanbanViewEl = document.querySelector('.o_kanban_renderer');
|
||||||
|
if (kanbanViewEl) {
|
||||||
|
let isHave = false;
|
||||||
|
// 移除所有现有的 sf_kanban_* 类
|
||||||
|
Array.from(kanbanViewEl.classList).forEach(cls => {
|
||||||
|
if (cls.startsWith('sf_kanban_location_style')) {
|
||||||
|
kanbanViewEl.classList.remove(cls);
|
||||||
|
isHave = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 添加新类
|
||||||
|
if (isHave) kanbanViewEl.classList.add(style);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前的搜索域
|
||||||
|
let domain = this.searchModel.domain;
|
||||||
|
let shelfDomain = domain.find(item => item[0] === 'shelf_id');
|
||||||
|
|
||||||
|
// 只有当shelf_id在preproductionShelfIds中时才删除幽灵看板
|
||||||
|
if (shelfDomain && this.preproductionShelfIds && this.preproductionShelfIds.includes(shelfDomain[2])) {
|
||||||
|
const ghostCards = document.querySelectorAll('.o_kanban_ghost');
|
||||||
|
ghostCards.forEach(card => {
|
||||||
|
card.remove();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
updatePagerLimit(limit) {
|
||||||
|
if (this.model.root.limit !== limit) {
|
||||||
|
this.model.root.limit = limit;
|
||||||
|
this.render(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理货架变更事件
|
||||||
|
async onShelfChange(shelfId) {
|
||||||
|
let style = 'sf_kanban_location_style';
|
||||||
|
let isBaseStyle = true;
|
||||||
|
if (shelfId) {
|
||||||
|
// 如果没有缓存,从服务器加载数据
|
||||||
|
if (!(shelfId in this.shelfLayersMap)) {
|
||||||
|
const [shelf] = await this.orm.read('sf.shelf', [shelfId], ['layer_capacity']);
|
||||||
|
this.shelfLayersMap[shelfId] = shelf.layer_capacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取该货架的层数
|
||||||
|
const layerCapacity = this.shelfLayersMap[shelfId];
|
||||||
|
// 根据层数设置不同的样式
|
||||||
|
if (layerCapacity >= 1) {
|
||||||
|
style = `sf_kanban_location_style${layerCapacity}`;
|
||||||
|
isBaseStyle = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isBaseStyle) {
|
||||||
|
this.updatePagerLimit(this.defaultPagerLimit);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.updatePagerLimit(500);
|
||||||
|
}
|
||||||
|
this.setKanbanStyle(style);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取系统默认分页记录数
|
||||||
|
*/
|
||||||
|
getSystemDefaultLimit() {
|
||||||
|
// 方法1:从用户服务获取默认值
|
||||||
|
const userService = this.env.services.user;
|
||||||
|
|
||||||
|
// 获取用户配置的默认分页大小
|
||||||
|
if (userService && userService.user_context && userService.user_context.limit) {
|
||||||
|
return userService.user_context.limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 方法3:使用Odoo核心默认值(通常为80)
|
||||||
|
return 80;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置自定义模板
|
||||||
|
CustomKanbanController.template = "sf_warehouse.CustomKanbanView";
|
||||||
|
|
||||||
|
export const customKanbanView = {
|
||||||
|
...kanbanView,
|
||||||
|
Controller: CustomKanbanController,
|
||||||
|
Renderer: CustomKanbanRenderer,
|
||||||
|
};
|
||||||
|
|
||||||
|
registry.category("views").add("custom_kanban", customKanbanView);
|
||||||
@@ -1,330 +1,344 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<!-- 货架视图 -->
|
<!-- 货架视图 -->
|
||||||
<record id="view_sf_shelf" model="ir.ui.view">
|
<record id="view_sf_shelf" model="ir.ui.view">
|
||||||
<field name="name">Sf Shelf</field>
|
<field name="name">Sf Shelf</field>
|
||||||
<field name="model">sf.shelf</field>
|
<field name="model">sf.shelf</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Sf Shelf">
|
<form string="Sf Shelf">
|
||||||
<header>
|
<header>
|
||||||
<field name="is_there_area" invisible="1"/>
|
<field name="is_there_area" invisible="1"/>
|
||||||
<button string="生成货位" name="create_location" type="object" class="oe_highlight"
|
<button string="生成货位" name="create_location" type="object" class="oe_highlight"
|
||||||
attrs="{'invisible': [('is_there_area', '=', True)]}"/>
|
attrs="{'invisible': [('is_there_area', '=', True)]}"/>
|
||||||
</header>
|
</header>
|
||||||
<sheet>
|
<sheet>
|
||||||
<group>
|
<group>
|
||||||
<field name="barcode" string="货架编码"/>
|
<field name="barcode" string="货架编码"/>
|
||||||
<field name="name" string="货架名称"/>
|
<field name="name" string="货架名称"/>
|
||||||
<field name="check_state" string="审核状态"/>
|
<field name="check_state" string="审核状态"/>
|
||||||
<field name="channel" string="通道"/>
|
<field name="channel" string="通道"/>
|
||||||
<field name="shelf_location_id" string="所属库区"/>
|
<field name="shelf_location_id" string="所属库区"/>
|
||||||
<field name="direction" string="方向"/>
|
<field name="direction" string="方向"/>
|
||||||
<field name="shelf_height" string="货架高度(m)"/>
|
<field name="shelf_height" string="货架高度(m)"/>
|
||||||
<field name="shelf_layer" string="货架层数"/>
|
<field name="shelf_layer" string="货架层数"/>
|
||||||
<field name="layer_capacity" string="层数容量"/>
|
<field name="layer_capacity" string="层数容量"/>
|
||||||
<field name="shelf_rotative_Boolean"/>
|
<field name="shelf_rotative_Boolean"/>
|
||||||
</group>
|
</group>
|
||||||
<notebook>
|
<notebook>
|
||||||
<page string="货位">
|
<page string="货位">
|
||||||
<button name="print_all_location_barcode" type="object" string="一键打印"
|
<button name="print_all_location_barcode" type="object" string="一键打印"
|
||||||
class="oe_highlight"/>
|
class="oe_highlight"/>
|
||||||
<field name="location_ids" widget="one2many_list">
|
<field name="location_ids" widget="one2many_list">
|
||||||
<tree string="Shelf Location">
|
<tree string="Shelf Location">
|
||||||
<field name="barcode" string="编码"/>
|
<field name="barcode" string="编码"/>
|
||||||
<field name="name" string="名称"/>
|
<field name="name" string="名称"/>
|
||||||
<field name="qr_code" string="条码" widget="image"/>
|
<field name="qr_code" string="条码" widget="image"/>
|
||||||
<button string="打印" name="print_single_location_qr_code" type="object"
|
<button string="打印" name="print_single_location_qr_code" type="object"
|
||||||
class="oe_highlight"/>
|
class="oe_highlight"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</page>
|
</page>
|
||||||
</notebook>
|
</notebook>
|
||||||
</sheet>
|
</sheet>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="view_sf_shelf_tree" model="ir.ui.view">
|
<record id="view_sf_shelf_tree" model="ir.ui.view">
|
||||||
<field name="name">Sf Shelf tree</field>
|
<field name="name">Sf Shelf tree</field>
|
||||||
<field name="model">sf.shelf</field>
|
<field name="model">sf.shelf</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="Sf Shelf">
|
<tree string="Sf Shelf">
|
||||||
<field name="barcode" string="货架编码"/>
|
<field name="barcode" string="货架编码"/>
|
||||||
<field name="name" string="名称"/>
|
<field name="name" string="名称"/>
|
||||||
<field name="shelf_location_id" string="所属库区"/>
|
<field name="shelf_location_id" string="所属库区"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- 货架action -->
|
<!-- 货架action -->
|
||||||
<record id="sf_shelf_action" model="ir.actions.act_window">
|
<record id="sf_shelf_action" model="ir.actions.act_window">
|
||||||
<field name="name">货架</field>
|
<field name="name">货架</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">sf.shelf</field>
|
<field name="res_model">sf.shelf</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<!-- <field name="view_id" ref="view_sf_shelf_tree"/> -->
|
<!-- <field name="view_id" ref="view_sf_shelf_tree"/> -->
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- 货架菜单 -->
|
<!-- 货架菜单 -->
|
||||||
<menuitem
|
<menuitem
|
||||||
id="sf_shelf_menu"
|
id="sf_shelf_menu"
|
||||||
name="货架"
|
name="货架"
|
||||||
parent="stock.menu_warehouse_config"
|
parent="stock.menu_warehouse_config"
|
||||||
sequence="19"
|
sequence="19"
|
||||||
action="sf_shelf_action"
|
action="sf_shelf_action"
|
||||||
groups="sf_base.group_sf_stock_user"/>
|
groups="sf_base.group_sf_stock_user"/>
|
||||||
|
|
||||||
|
|
||||||
<record id="view_shelf_location_tree" model="ir.ui.view">
|
<record id="view_shelf_location_tree" model="ir.ui.view">
|
||||||
<field name="name">Shelf Location tree</field>
|
<field name="name">Shelf Location tree</field>
|
||||||
<field name="model">sf.shelf.location</field>
|
<field name="model">sf.shelf.location</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="Shelf Location">
|
<tree string="Shelf Location">
|
||||||
<field name="barcode"/>
|
<field name="barcode"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="location_id"/>
|
<field name="location_id"/>
|
||||||
<!-- <field name="check_state" widget="label_selection"-->
|
<!-- <field name="check_state" widget="label_selection"-->
|
||||||
<!-- options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>-->
|
<!-- options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>-->
|
||||||
<!-- <button name="action_check" string="审核" type="object"-->
|
<!-- <button name="action_check" string="审核" type="object"-->
|
||||||
<!-- attrs="{'invisible': [('check_state','=', 'enable')]}"-->
|
<!-- attrs="{'invisible': [('check_state','=', 'enable')]}"-->
|
||||||
<!-- groups="sf_base.group_sf_stock_manager"-->
|
<!-- groups="sf_base.group_sf_stock_manager"-->
|
||||||
<!-- class="oe_highlight"/>-->
|
<!-- class="oe_highlight"/>-->
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
<!-- 货架货位移动历史按钮-->
|
<!-- 货架货位移动历史按钮-->
|
||||||
|
|
||||||
<record id="sf_stock_move_line_view_search" model="ir.ui.view">
|
<record id="sf_stock_move_line_view_search" model="ir.ui.view">
|
||||||
<field name="name">sf.view.picking.form</field>
|
<field name="name">sf.view.picking.form</field>
|
||||||
<field name="model">stock.move.line</field>
|
<field name="model">stock.move.line</field>
|
||||||
<field name="inherit_id" ref="stock.stock_move_line_view_search"/>
|
<field name="inherit_id" ref="stock.stock_move_line_view_search"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='product_id']" position="after">
|
<xpath expr="//field[@name='product_id']" position="after">
|
||||||
<field name='current_location_id'/>
|
<field name='current_location_id'/>
|
||||||
<field name='destination_location_id'/>
|
<field name='destination_location_id'/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="stock_move_line_action1" model="ir.actions.act_window">
|
<record id="stock_move_line_action1" model="ir.actions.act_window">
|
||||||
<field name="name">移动历史</field>
|
<field name="name">移动历史</field>
|
||||||
<field name="res_model">stock.move.line</field>
|
<field name="res_model">stock.move.line</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="search_view_id" ref="sf_stock_move_line_view_search"/>
|
<field name="search_view_id" ref="sf_stock_move_line_view_search"/>
|
||||||
<field name="view_id" ref="stock.view_move_line_tree"/>
|
<field name="view_id" ref="stock.view_move_line_tree"/>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="oe_view_nocontent_create">
|
<p class="oe_view_nocontent_create">
|
||||||
产品移动历史
|
产品移动历史
|
||||||
</p>
|
</p>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="view_shelf_location_form" model="ir.ui.view">
|
<record id="view_shelf_location_form" model="ir.ui.view">
|
||||||
<field name="name">Shelf Location form</field>
|
<field name="name">Shelf Location form</field>
|
||||||
<field name="model">sf.shelf.location</field>
|
<field name="model">sf.shelf.location</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Shelf Location" create="0">
|
<form string="Shelf Location" create="0">
|
||||||
<header>
|
<header>
|
||||||
<button string="货位变更"
|
<button string="货位变更"
|
||||||
name="%(sf_warehouse.sf_shelf_location_wizard_act)d"
|
name="%(sf_warehouse.sf_shelf_location_wizard_act)d"
|
||||||
type="action"
|
type="action"
|
||||||
context="{'default_name':name,
|
context="{'default_name':name,
|
||||||
'default_current_name':name,
|
'default_current_name':name,
|
||||||
'default_current_product_sn_ids':product_sn_ids,
|
'default_current_product_sn_ids':product_sn_ids,
|
||||||
'default_lot_id':product_sn_id,
|
'default_lot_id':product_sn_id,
|
||||||
'default_current_shelf_id':shelf_id,
|
'default_current_shelf_id':shelf_id,
|
||||||
'default_current_location_id':location_id,
|
'default_current_location_id':location_id,
|
||||||
'default_current_barcode_id':id,
|
'default_current_barcode_id':id,
|
||||||
'default_current_product_id':product_id,
|
'default_current_product_id':product_id,
|
||||||
}"
|
}"
|
||||||
class="btn-primary" attrs="{'invisible':[('location_status','!=','占用')]}"/>
|
class="btn-primary" attrs="{'invisible':[('location_status','!=','占用')]}"/>
|
||||||
<field name="location_status" invisible="1"/>
|
<field name="location_status" invisible="1"/>
|
||||||
<button string="禁用货位" name="action_location_status_disable" type="object"
|
<button string="禁用货位" name="action_location_status_disable" type="object"
|
||||||
class="oe_highlight"
|
class="oe_highlight"
|
||||||
attrs="{'invisible': [('location_status', '!=', '空闲')]}"/>
|
attrs="{'invisible': [('location_status', '!=', '空闲')]}"/>
|
||||||
<button string="启用货位" name="action_location_status_enable" type="object"
|
<button string="启用货位" name="action_location_status_enable" type="object"
|
||||||
class="oe_highlight"
|
class="oe_highlight"
|
||||||
attrs="{'invisible': [('location_status', '!=', '禁用')]}"/>
|
attrs="{'invisible': [('location_status', '!=', '禁用')]}"/>
|
||||||
</header>
|
</header>
|
||||||
<sheet>
|
<sheet>
|
||||||
<div class="oe_button_box" name="button_box">
|
<div class="oe_button_box" name="button_box">
|
||||||
<button name="%(stock_move_line_action1)d"
|
<button name="%(stock_move_line_action1)d"
|
||||||
type="action"
|
type="action"
|
||||||
class="oe_stat_button"
|
class="oe_stat_button"
|
||||||
context="{'search_default_current_location_id': [active_id]}"
|
context="{'search_default_current_location_id': [active_id]}"
|
||||||
icon="fa-exchange">
|
icon="fa-exchange">
|
||||||
<field string="当前位置历史" name="current_move_ids" widget="statinfo"/>
|
<field string="当前位置历史" name="current_move_ids" widget="statinfo"/>
|
||||||
</button>
|
</button>
|
||||||
<button name="%(stock_move_line_action1)d"
|
<button name="%(stock_move_line_action1)d"
|
||||||
type="action"
|
type="action"
|
||||||
class="oe_stat_button"
|
class="oe_stat_button"
|
||||||
context="{'search_default_destination_location_id': [active_id]}"
|
context="{'search_default_destination_location_id': [active_id]}"
|
||||||
icon="fa-exchange">
|
icon="fa-exchange">
|
||||||
<field string="目标位置历史" name="destination_move_ids" widget="statinfo"/>
|
<field string="目标位置历史" name="destination_move_ids" widget="statinfo"/>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<group>
|
<group>
|
||||||
<field name="barcode" readonly="1"/>
|
<field name="barcode" readonly="1"/>
|
||||||
<field name="name" readonly="1"/>
|
<field name="name" readonly="1"/>
|
||||||
<field name="rotative_Boolean" invisible="1"/>
|
<field name="rotative_Boolean" invisible="1"/>
|
||||||
<field name="shelf_id" readonly="1"/>
|
<field name="shelf_id" readonly="1"/>
|
||||||
<field name="location_id" readonly="1"/>
|
<field name="location_id" readonly="1"/>
|
||||||
<field name="product_id"/>
|
<field name="product_id"/>
|
||||||
<field name="product_sn_id" options="{'no_create': True}"
|
<field name="product_sn_id" options="{'no_create': True}"
|
||||||
attrs="{'invisible': [('product_sn_ids', '!=', [])]}"/>
|
attrs="{'invisible': [('product_sn_ids', '!=', [])]}"/>
|
||||||
<field name="product_sn_ids"
|
<field name="product_sn_ids"
|
||||||
attrs="{'invisible': [('product_sn_ids', '=', [])]}">
|
attrs="{'invisible': [('product_sn_ids', '=', [])]}">
|
||||||
<tree edit="1" create="0" delete="0" editable="bottom">
|
<tree edit="1" create="0" delete="0" editable="bottom">
|
||||||
<field name="lot_id" readonly="1"/>
|
<field name="lot_id" readonly="1"/>
|
||||||
<field name="qty" readonly="1"/>
|
<field name="qty" readonly="1"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
<field name="product_num" readonly="1"/>
|
<field name="product_num" readonly="1"/>
|
||||||
<field name="location_status"/>
|
<field name="location_status"/>
|
||||||
<field name="storage_time" widget="datetime"/>
|
<field name="storage_time" widget="datetime"/>
|
||||||
<field name="production_id" readonly="1"/>
|
<field name="production_id" readonly="1"/>
|
||||||
</group>
|
</group>
|
||||||
</sheet>
|
</sheet>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="shelf_location_kanban_view" model="ir.ui.view">
|
<record id="shelf_location_kanban_view" model="ir.ui.view">
|
||||||
<field name="name">shelf.location.kanban</field>
|
<field name="name">shelf.location.kanban</field>
|
||||||
<field name="model">sf.shelf.location</field>
|
<field name="model">sf.shelf.location</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<kanban class="o_kanban_mobile" js_class="custom_kanban" create="0">
|
<kanban class="sf_kanban_location_style" js_class="custom_kanban" create="0">
|
||||||
<templates>
|
<templates>
|
||||||
<t t-name="kanban-box">
|
<t t-name="kanban-box">
|
||||||
<div t-attf-class="oe_kanban_card oe_kanban_global_click
|
<t t-set='isBaseStyle' t-value="user_context.isBaseStyle"/>
|
||||||
#{record.location_status.raw_value == '空闲' ? 'kanban_color_1' : ''}
|
<div t-attf-class="oe_kanban_card oe_kanban_global_click
|
||||||
#{record.location_status.raw_value == '占用' ? 'kanban_color_2' : ''}
|
#{record.location_status.raw_value == '空闲' ? 'kanban_color_1' : ''}
|
||||||
#{record.location_status.raw_value == '禁用' ? 'kanban_color_3' : ''}">
|
#{record.location_status.raw_value == '占用' ? 'kanban_color_2' : ''}
|
||||||
<!-- 标题 -->
|
#{record.location_status.raw_value == '禁用' ? 'kanban_color_3' : ''}">
|
||||||
<div class="o_kanban_card_header">
|
|
||||||
<div class="o_kanban_card_header_title">
|
<!-- 所有情况都需要的数据 (隐藏) -->
|
||||||
<field name="name"/>
|
<div style="display:none">
|
||||||
</div>
|
<field name="location_status"/>
|
||||||
</div>
|
<field name="tool_name_id"/>
|
||||||
<!-- 内容 -->
|
</div>
|
||||||
<div class="o_kanban_record_bottom">
|
|
||||||
<field name="location_status"/>
|
<t t-if="isBaseStyle">
|
||||||
</div>
|
<div class="o_kanban_card_header">
|
||||||
<div class="o_kanban_record_bottom">
|
<div class="o_kanban_card_header_title">
|
||||||
<field name="product_sn_id"/>
|
<field name="name"/>
|
||||||
<span>|</span>
|
</div>
|
||||||
<field name="product_id"/>
|
</div>
|
||||||
</div>
|
<div class="o_kanban_record_bottom">
|
||||||
</div>
|
<field name="product_sn_id"/>
|
||||||
</t>
|
<field name="product_id"/>
|
||||||
<!-- <t t-name="kanban-box"> -->
|
</div>
|
||||||
<!-- <div t-attf-class="oe_kanban_card oe_kanban_global_click -->
|
</t>
|
||||||
<!-- #{record.location_status.raw_value == '空闲' ? 'kanban_color_1' : ''} -->
|
|
||||||
<!-- #{record.location_status.raw_value == '占用' ? 'kanban_color_2' : ''} -->
|
<t t-else="">
|
||||||
<!-- #{record.location_status.raw_value == '禁用' ? 'kanban_color_3' : ''}"> -->
|
<div class="o_kanban_record_bottom sf_kanban_custom_location_info_style">
|
||||||
<!-- 看板内容 -->
|
<field name="kanban_show_layer_info"/>
|
||||||
<!-- </div> -->
|
</div>
|
||||||
<!-- <div t-attf-class="oe_kanban_card"> -->
|
<!-- 添加RFID字段 -->
|
||||||
<!-- 标题 -->
|
<!-- <t t-if="record.data and record.data.display_rfid">
|
||||||
<!-- <div class="o_kanban_card_header"> -->
|
<div class="o_kanban_record_bottom">
|
||||||
<!-- <div class="o_kanban_card_header_title"> -->
|
<field name="display_rfid"/>
|
||||||
<!-- <field name="name"/> -->
|
</div>
|
||||||
<!-- </div> -->
|
</t>
|
||||||
<!-- </div> -->
|
<t t-if="record.data and record.data.tool_rfid">
|
||||||
<!-- 内容 -->
|
<div class="o_kanban_record_bottom">
|
||||||
<!-- <div class="o_kanban_record_bottom"> -->
|
<field name="tool_rfid"/>
|
||||||
<!-- <field name="location_status"/> -->
|
</div>
|
||||||
<!-- </div> -->
|
</t> -->
|
||||||
<!-- <div class="o_kanban_record_bottom"> -->
|
<!-- 悬停时显示的详细信息 -->
|
||||||
<!-- <field name="product_sn_id"/> -->
|
<div class="status-hover-bar">
|
||||||
<!-- <span> | </span> -->
|
<t t-if="record.product_id.value">
|
||||||
<!-- <field name="product_id"/> -->
|
<div>产品: <t t-esc="record.product_id.value"/></div>
|
||||||
<!-- </div> -->
|
</t>
|
||||||
<!-- </div> -->
|
<t t-if="record.product_sn_id.value">
|
||||||
<!-- </t> -->
|
<div>标签ID: <t t-esc="record.product_sn_id.value"/></div>
|
||||||
</templates>
|
</t>
|
||||||
</kanban>
|
<!-- <t t-if="record.display_rfid.value">
|
||||||
</field>
|
<div>rfid: <t t-esc="record.display_rfid.value"/></div>
|
||||||
</record>
|
</t>
|
||||||
|
<t t-if="record.tool_rfid.value">
|
||||||
<!-- 搜索视图 -->
|
<div>rfid: <t t-esc="record.tool_rfid.value"/></div>
|
||||||
<record id="shelf_location_search_view" model="ir.ui.view">
|
</t> -->
|
||||||
<field name="name">shelf.location.search</field>
|
<t t-if="record.tool_name_id and record.tool_name_id.value">
|
||||||
<field name="model">sf.shelf.location</field>
|
<div>功能刀具名称: <t t-esc="record.tool_name_id.value"/></div>
|
||||||
<field name="arch" type="xml">
|
</t>
|
||||||
<search string="货位">
|
<div>状态: <t t-esc="record.location_status.value"/></div>
|
||||||
<field name="barcode"/>
|
</div>
|
||||||
<field name="product_id"/>
|
</t>
|
||||||
<searchpanel class="account_root">
|
</div>
|
||||||
<!-- <field name="location_type" icon="fa-filter"/> -->
|
</t>
|
||||||
<!-- <field name="location_id" select="multi" icon="fa-filter"/> -->
|
</templates>
|
||||||
<field name="location_id" string="所属库区" icon="fa-filter"/>
|
</kanban>
|
||||||
<field name="shelf_id" string="货架"/>
|
</field>
|
||||||
<!-- <field name="location_status" icon="fa-filter"/> -->
|
</record>
|
||||||
</searchpanel>
|
<!-- 搜索视图 -->
|
||||||
</search>
|
<record id="shelf_location_search_view" model="ir.ui.view">
|
||||||
</field>
|
<field name="name">shelf.location.search</field>
|
||||||
</record>
|
<field name="model">sf.shelf.location</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
<record id="shelf_location_kanban_action_id" model="ir.actions.act_window">
|
<search string="货位">
|
||||||
<field name="name">货位看板</field>
|
<field name="barcode"/>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="product_id"/>
|
||||||
<field name="res_model">sf.shelf.location</field>
|
<searchpanel class="account_root">
|
||||||
<field name="view_mode">kanban,form</field>
|
<!-- <field name="location_type" icon="fa-filter"/> -->
|
||||||
<!-- <field name="domain">[('check_state','=','enable')]</field> -->
|
<!-- <field name="location_id" select="multi" icon="fa-filter"/> -->
|
||||||
</record>
|
<field name="location_id" string="所属库区" icon="fa-filter"/>
|
||||||
|
<field name="shelf_id" string="货架"/>
|
||||||
<!-- <record id="example_action" model="ir.actions.act_window"> -->
|
<!-- <field name="location_status" icon="fa-filter"/> -->
|
||||||
<!-- <field name="name">Example</field> -->
|
</searchpanel>
|
||||||
<!-- <field name="type">ir.actions.act_window</field> -->
|
</search>
|
||||||
<!-- <field name="res_model">stock.location</field> -->
|
</field>
|
||||||
<!-- <field name="view_mode">kanban</field> -->
|
</record>
|
||||||
<!-- <field name="searchpanel">true</field> -->
|
|
||||||
<!-- <field name="searchpanel_field_label">货架</field> -->
|
<record id="shelf_location_kanban_action_id" model="ir.actions.act_window">
|
||||||
<!-- <field name="searchpanel_field_name">parent_id</field> -->
|
<field name="name">货位看板</field>
|
||||||
<!-- <field name="searchpanel_field_group_by">['parent_id']</field> -->
|
<field name="type">ir.actions.act_window</field>
|
||||||
<!-- <field name="domain">[('location_type', '=', '货位')]</field> -->
|
<field name="res_model">sf.shelf.location</field>
|
||||||
<!-- </record> -->
|
<field name="view_mode">kanban,form</field>
|
||||||
|
<!-- <field name="domain">[('check_state','=','enable')]</field> -->
|
||||||
|
</record>
|
||||||
<menuitem id="shelf_location_kanban_menu" name="货位看板" parent="stock.menu_stock_root"
|
|
||||||
sequence="51"
|
<!-- <record id="example_action" model="ir.actions.act_window"> -->
|
||||||
action="shelf_location_kanban_action_id"
|
<!-- <field name="name">Example</field> -->
|
||||||
groups="sf_base.group_sf_stock_user"/>
|
<!-- <field name="type">ir.actions.act_window</field> -->
|
||||||
|
<!-- <field name="res_model">stock.location</field> -->
|
||||||
<record id="action_sf_shelf_location" model="ir.actions.act_window">
|
<!-- <field name="view_mode">kanban</field> -->
|
||||||
<field name="name">货位</field>
|
<!-- <field name="searchpanel">true</field> -->
|
||||||
<field name="type">ir.actions.act_window</field>
|
<!-- <field name="searchpanel_field_label">货架</field> -->
|
||||||
<field name="res_model">sf.shelf.location</field>
|
<!-- <field name="searchpanel_field_name">parent_id</field> -->
|
||||||
<field name="view_mode">tree,form</field>
|
<!-- <field name="searchpanel_field_group_by">['parent_id']</field> -->
|
||||||
</record>
|
<!-- <field name="domain">[('location_type', '=', '货位')]</field> -->
|
||||||
|
<!-- </record> -->
|
||||||
<!-- <record id="example_action" model="ir.actions.act_window"> -->
|
|
||||||
<!-- <field name="name">Example</field> -->
|
|
||||||
<!-- <field name="type">ir.actions.act_window</field> -->
|
<menuitem id="shelf_location_kanban_menu" name="货位看板" parent="stock.menu_stock_root"
|
||||||
<!-- <field name="res_model">stock.location</field> -->
|
sequence="51"
|
||||||
<!-- <field name="view_mode">kanban</field> -->
|
action="shelf_location_kanban_action_id"
|
||||||
<!-- <field name="searchpanel">true</field> -->
|
groups="sf_base.group_sf_stock_user"/>
|
||||||
<!-- <field name="searchpanel_field_label">货架</field> -->
|
|
||||||
<!-- <field name="searchpanel_field_name">parent_id</field> -->
|
<record id="action_sf_shelf_location" model="ir.actions.act_window">
|
||||||
<!-- <field name="searchpanel_field_group_by">['parent_id']</field> -->
|
<field name="name">货位</field>
|
||||||
<!-- <field name="domain">[('location_type', '=', '货位')]</field> -->
|
<field name="type">ir.actions.act_window</field>
|
||||||
<!-- </record> -->
|
<field name="res_model">sf.shelf.location</field>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
</record>
|
||||||
<!-- <menuitem id="menu_stock_location" name="货位状态" parent="stock.menu_stock_root" -->
|
|
||||||
<!-- sequence="50" -->
|
<!-- <record id="example_action" model="ir.actions.act_window"> -->
|
||||||
<!-- action="kanban_action_id"/> -->
|
<!-- <field name="name">Example</field> -->
|
||||||
|
<!-- <field name="type">ir.actions.act_window</field> -->
|
||||||
<menuitem id="menu_sf_shelf_location" name="货位" parent="stock.menu_warehouse_config"
|
<!-- <field name="res_model">stock.location</field> -->
|
||||||
sequence="20"
|
<!-- <field name="view_mode">kanban</field> -->
|
||||||
action="action_sf_shelf_location"
|
<!-- <field name="searchpanel">true</field> -->
|
||||||
groups="sf_base.group_sf_stock_user"/>
|
<!-- <field name="searchpanel_field_label">货架</field> -->
|
||||||
|
<!-- <field name="searchpanel_field_name">parent_id</field> -->
|
||||||
|
<!-- <field name="searchpanel_field_group_by">['parent_id']</field> -->
|
||||||
</data>
|
<!-- <field name="domain">[('location_type', '=', '货位')]</field> -->
|
||||||
</odoo>
|
<!-- </record> -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <menuitem id="menu_stock_location" name="货位状态" parent="stock.menu_stock_root" -->
|
||||||
|
<!-- sequence="50" -->
|
||||||
|
<!-- action="kanban_action_id"/> -->
|
||||||
|
|
||||||
|
<menuitem id="menu_sf_shelf_location" name="货位" parent="stock.menu_warehouse_config"
|
||||||
|
sequence="20"
|
||||||
|
action="action_sf_shelf_location"
|
||||||
|
groups="sf_base.group_sf_stock_user"/>
|
||||||
|
|
||||||
|
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
|
|||||||
Reference in New Issue
Block a user