Compare commits

...

137 Commits

Author SHA1 Message Date
jinling.yang
6c6fe44d45 制造订单去掉上/下产线字段 2024-07-03 10:53:29 +08:00
jinling.yang
bb33a1d093 修复多面工单产线状态 2024-07-03 10:37:02 +08:00
jinling.yang
9ec37f5d5b 修复多面加工产线状态 2024-07-03 09:45:55 +08:00
马广威
0bc4072a8f Accept Merge Request #1130: (release/release_1.9 -> master)
Merge Request: SPRINT-MES-2024-03迭代优化升级

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1130?initial=true
2024-07-01 22:35:53 +08:00
马广威
957c5583bd Accept Merge Request #1129: (feature/修复制造订单数量 -> develop)
Merge Request: 修复制造订单数量

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1129#mr-1129-review-164092
2024-07-01 20:13:10 +08:00
jinling.yang
9c4c2b85dd 修复制造订单数量 2024-07-01 20:08:46 +08:00
jinling.yang
56af286500 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-07-01 18:30:18 +08:00
jinling.yang
cc83029c72 Merge branch 'feature/修复工单完成接口' into develop 2024-07-01 18:30:06 +08:00
杨金灵
79ab1cc573 Accept Merge Request #1128: (feature/修复工单完成接口 -> develop)
Merge Request: 修复工单完成接口

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1128?initial=true
2024-07-01 18:29:29 +08:00
jinling.yang
bda3df7806 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-07-01 18:29:16 +08:00
马广威
150b684354 Accept Merge Request #1127: (feature/sf物流方面缺陷与优化 -> develop)
Merge Request: Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/sf物流方面缺陷与优化

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1127?initial=true
2024-07-01 18:28:37 +08:00
jinling.yang
d69dc20fd1 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修复工单完成接口 2024-07-01 18:28:11 +08:00
jinling.yang
e9c9b77112 修复所有工单完成报库存问题 2024-07-01 18:27:59 +08:00
mgw
495f92bd80 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/sf物流方面缺陷与优化 2024-07-01 18:27:52 +08:00
马广威
8a97fd08e2 Accept Merge Request #1126: (feature/sf物流方面缺陷与优化 -> develop)
Merge Request: 状态补充条件

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1126?initial=true
2024-07-01 18:18:19 +08:00
mgw
1551ea4b12 状态补充条件 2024-07-01 18:17:48 +08:00
jinling.yang
75c5cca9a0 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-07-01 18:12:25 +08:00
jinling.yang
6b6be85057 去掉更改制造订单的状态等相关代码 2024-07-01 18:12:15 +08:00
jinling.yang
7fb3c32d07 修复工单完成接口 2024-07-01 17:48:45 +08:00
马广威
8203975142 Accept Merge Request #1125: (feature/sf物流方面缺陷与优化 -> develop)
Merge Request: 优化订单状态条件及物流的容错处理

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1125?initial=true
2024-07-01 17:28:45 +08:00
mgw
449cf5bfb1 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/sf物流方面缺陷与优化 2024-07-01 17:28:07 +08:00
mgw
d7d5ccc142 优化订单状态条件及物流的容错处理 2024-07-01 17:27:52 +08:00
jinling.yang
8710df6dc2 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-07-01 17:14:42 +08:00
jinling.yang
f5c1457707 Merge branch 'feature/优化解绑rfid' into develop 2024-07-01 17:13:57 +08:00
杨金灵
5155135cb4 Accept Merge Request #1124: (feature/优化解绑rfid -> develop)
Merge Request: 优化解绑rfid

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1124
2024-07-01 17:13:38 +08:00
jinling.yang
4421eed1d0 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-07-01 17:11:47 +08:00
jinling.yang
46e3a23492 优化解绑rfid 2024-07-01 17:11:34 +08:00
马广威
675b09390b Accept Merge Request #1123: (feature/sf物流方面缺陷与优化 -> develop)
Merge Request: 优化订单状态

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1123?initial=true
2024-07-01 16:57:22 +08:00
mgw
34251b4027 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/sf物流方面缺陷与优化 2024-07-01 16:56:43 +08:00
mgw
c4621d36a3 优化订单状态 2024-07-01 16:56:19 +08:00
jinling.yang
7bdc4b463a Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-07-01 15:42:22 +08:00
jinling.yang
ea88b5418f Merge branch 'feature/优化cnc工单接口' into develop 2024-07-01 15:42:10 +08:00
杨金灵
f5a64caf81 Accept Merge Request #1122: (feature/优化cnc工单接口 -> develop)
Merge Request: 优化cnc工单接口

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1122?initial=true
2024-07-01 15:41:52 +08:00
jinling.yang
1e5f26d645 工单开始和结束接口增加rfid_code不为空的条件 2024-07-01 15:29:55 +08:00
jinling.yang
ace32d9490 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-07-01 14:03:23 +08:00
马广威
5db2f1fc70 Accept Merge Request #1121: (feature/sf物流方面缺陷与优化 -> develop)
Merge Request: 优化物流提示

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1121?initial=true
2024-07-01 11:51:37 +08:00
mgw
960c940505 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/sf物流方面缺陷与优化 2024-07-01 11:50:49 +08:00
mgw
ee1629b40a 优化物流提示 2024-07-01 11:47:51 +08:00
jinling.yang
06de5f6a2d Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-07-01 10:50:19 +08:00
jinling.yang
c1eff705c2 Merge branch 'feature/修复表面工艺' into develop 2024-07-01 10:49:57 +08:00
杨金灵
8e3c7f9732 Accept Merge Request #1120: (feature/修复表面工艺 -> develop)
Merge Request: 修复表面工艺

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1120?initial=true
2024-07-01 10:49:38 +08:00
jinling.yang
2591e627f0 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修复表面工艺 2024-07-01 10:47:33 +08:00
jinling.yang
4c66d86ee6 修复表面工艺 2024-07-01 10:47:05 +08:00
禹翔辉
d4bc1c13ea Accept Merge Request #1119: (feature/工单优化-2 -> develop)
Merge Request: 优化工单扫描绑定托盘的提示信息

Created By: @禹翔辉
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @禹翔辉
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1119
2024-07-01 09:55:21 +08:00
yuxianghui
4c845ee9fd Merge branch 'feature/工单优化-1' into feature/工单优化-2 2024-07-01 09:53:11 +08:00
yuxianghui
726c3aede1 1、优化工单扫描绑定托盘的提示信息 2024-07-01 09:52:16 +08:00
黄焱
871c406c09 Accept Merge Request #1118: (feature/前端样式修改 -> develop)
Merge Request: // 修复表格内容覆盖表头bug

Created By: @黄焱
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @黄焱
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1118?initial=true
2024-07-01 09:49:05 +08:00
hy
2ba9695c34 // 修复表格内容覆盖表头bug 2024-07-01 09:47:50 +08:00
杨金灵
e1db34f25d Accept Merge Request #1117: (feature/修复无外协单和程序单 -> develop)
Merge Request: 修复无外协单和程序单

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1117
2024-07-01 09:31:43 +08:00
jinling.yang
e496555ff3 去掉注释代码 2024-06-30 19:29:36 +08:00
jinling.yang
404a41294c 修复表面工艺外协单状态 2024-06-30 19:16:48 +08:00
jinling.yang
e124560089 修复无外协单和程序单 2024-06-30 17:52:02 +08:00
jinling.yang
fd3a363bf6 修复无外协单和程序单 2024-06-30 16:51:40 +08:00
杨金灵
9f6563186c Accept Merge Request #1116: (feature/优化工单页面 -> develop)
Merge Request: 优化工单页面

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1116
2024-06-30 14:47:44 +08:00
jinling.yang
1b174c5805 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-06-30 14:41:38 +08:00
jinling.yang
849b7be20d Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-06-30 14:09:34 +08:00
jinling.yang
9d32bf8363 Merge branch 'feature/修复制造订单状态和多个编程单问题' into develop 2024-06-30 12:46:48 +08:00
杨金灵
998daaa7f7 Accept Merge Request #1115: (feature/修复制造订单状态和多个编程单问题 -> develop)
Merge Request: 修复制造订单状态和多个编程单问题

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1115?initial=true
2024-06-30 12:45:54 +08:00
jinling.yang
b23cb9af6e 优化编程状态字段的样式 2024-06-30 12:09:09 +08:00
jinling.yang
56adaddefc 1.修复编程状态字段类型2.优化工单rfid排放位置 2024-06-30 12:01:48 +08:00
jinling.yang
4a648fbd7b 1,修复制造订单状态:第一张装夹工单未就绪是,状态需为:待加工;所有工单完成后,状态需为:完成;2.修复多个产品确认制造订单未生产多个编程单问题3.优化工单页面:去掉非必要的字段 2024-06-30 11:45:52 +08:00
mgw
a3bf451d83 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/sf物流方面缺陷与优化 2024-06-28 17:03:06 +08:00
mgw
2919a3c159 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/sf物流方面缺陷与优化 2024-06-28 17:02:47 +08:00
马广威
8f6e2bc13d Accept Merge Request #1114: (feature/sf物流方面缺陷与优化 -> develop)
Merge Request: 排程单甘特图界面订单的hover提示中订单交期字段没有翻译成日期格式

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1114?initial=true
2024-06-28 17:01:43 +08:00
mgw
909230c1cc 排程单甘特图界面订单的hover提示中订单交期字段没有翻译成日期格式 2024-06-28 17:00:50 +08:00
马广威
db8c338588 Accept Merge Request #1113: (feature/sf物流方面缺陷与优化 -> develop)
Merge Request: 工单增加默认产品分组,组内排序从小到大

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1113?initial=true
2024-06-28 16:02:09 +08:00
mgw
f319a9adf4 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/sf物流方面缺陷与优化 2024-06-28 16:01:05 +08:00
mgw
172e420939 增加分组内排序 2024-06-28 16:00:50 +08:00
mgw
0c3727540e 工单增加默认产品分组 2024-06-28 14:51:53 +08:00
禹翔辉
5668722109 Accept Merge Request #1112: (feature/工单优化-1 -> develop)
Merge Request: 工单优化

Created By: @禹翔辉
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @禹翔辉
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1112
2024-06-28 14:25:01 +08:00
杨金灵
2d80355559 Accept Merge Request #1111: (feature/修复cmm程序接口 -> develop)
Merge Request: 修复cmm程序接口

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1111?initial=true
2024-06-28 14:24:23 +08:00
jinling.yang
d281026086 修复cmm程序接口 2024-06-28 14:23:03 +08:00
yuxianghui
5c35a8c38d Merge branch 'feature/添加权限、解决bug' into feature/工单优化-1 2024-06-28 14:22:35 +08:00
yuxianghui
3b24f90385 1、工单添加按Rfid搜索,隐藏多余的Rfid字段;2、优化程序创建日期; 2024-06-28 14:20:57 +08:00
杨金灵
14355606c7 Accept Merge Request #1110: (feature/优化ftp -> develop)
Merge Request: ftp优化

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1110
2024-06-28 12:03:05 +08:00
jinling.yang
5997cbcb0e download_program_file方法添加关闭ftp 2024-06-28 12:00:29 +08:00
jinling.yang
f07d7611d0 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-06-28 10:10:46 +08:00
马广威
b106d56f3f Accept Merge Request #1109: (feature/sf物流方面缺陷与优化 -> develop)
Merge Request: 修复隐藏项目

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1109?initial=true
2024-06-28 09:52:58 +08:00
mgw
3156052604 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/sf物流方面缺陷与优化 2024-06-28 09:51:50 +08:00
mgw
c8de75ceae 修复隐藏项目 2024-06-28 09:51:31 +08:00
马广威
d4b1f8f1a1 Accept Merge Request #1108: (feature/sf物流方面缺陷与优化 -> develop)
Merge Request: Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/sf物流方面缺陷与优化

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1108?initial=true
2024-06-28 09:45:59 +08:00
mgw
5378d62551 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/sf物流方面缺陷与优化 2024-06-28 09:44:24 +08:00
马广威
424f7196f8 Accept Merge Request #1107: (feature/sf物流方面缺陷与优化 -> develop)
Merge Request: 处理unlink传参问题2

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1107?initial=true
2024-06-28 09:19:58 +08:00
mgw
c2723d9d05 处理unlink传参问题2 2024-06-28 09:19:09 +08:00
jinling.yang
7bf001927a Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-06-28 09:17:56 +08:00
杨金灵
84d67d285e Accept Merge Request #1106: (feature/修复制造订单无采购单问题 -> develop)
Merge Request: 修复制造订单无采购单问题

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1106?initial=true
2024-06-28 09:16:32 +08:00
jinling.yang
a583b483e3 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修复制造订单无采购单问题 2024-06-27 20:10:22 +08:00
jinling.yang
719a96f983 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-06-27 20:10:01 +08:00
jinling.yang
08fd0b01d3 去掉程序下发按钮 2024-06-27 20:09:45 +08:00
jinling.yang
db7fbed177 去掉重新编程下发相关代码,修复多制造订单无采购调拨单,去掉程序下发按钮 2024-06-27 20:09:28 +08:00
马广威
ad149a58ea Accept Merge Request #1105: (feature/sf物流方面缺陷与优化 -> develop)
Merge Request: 处理unlink()参数问题

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1105?initial=true
2024-06-27 17:32:18 +08:00
mgw
0d96cd070c Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/sf物流方面缺陷与优化 2024-06-27 17:31:21 +08:00
mgw
37f030c2db 处理unlink()参数问题 2024-06-27 17:31:03 +08:00
禹翔辉
e2a62325f8 Accept Merge Request #1104: (feature/添加权限、解决bug -> develop)
Merge Request: 添加权限、解决bug

Created By: @禹翔辉
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @禹翔辉
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1104?initial=true
2024-06-27 17:26:20 +08:00
yuxianghui
0db103cfc7 Merge branch 'feature/调拨单优化1' into feature/添加权限、解决bug 2024-06-27 17:22:42 +08:00
yuxianghui
05f2cb553d 1、完成 采购/采购总监岗位权限增加 需求;2、完成 刀具出入库列表缺少单据跳转 需求;3、完成 设备详情的机内装刀时间比当前时间还晚 bug; 2024-06-27 17:21:37 +08:00
黄焱
c597471949 Accept Merge Request #1103: (feature/前端样式修改 -> develop)
Merge Request: 甘特修改背景颜色和不可拖拽模块

Created By: @黄焱
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @黄焱
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1103?initial=true
2024-06-27 10:14:10 +08:00
hy
70ffbafac4 甘特修改背景颜色和不可拖拽模块 2024-06-27 09:57:12 +08:00
jinling.yang
1cb7af072e 注释OCC代码 2024-06-27 09:52:20 +08:00
禹翔辉
4f6b1d0342 Accept Merge Request #1102: (feature/调拨单优化1 -> develop)
Merge Request: 1、完成 内部调拨单优化项 需求;2、解决 不同序列号调拨单选择同一个货位可以确认成功 bug;3、收货入库时扫描录入Rfid方法添加日志

Created By: @禹翔辉
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @禹翔辉
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1102?initial=true
2024-06-26 17:10:25 +08:00
yuxianghui
9bdcf0dd92 Merge branch 'feature/调拨单优化' into feature/调拨单优化1 2024-06-26 17:08:39 +08:00
yuxianghui
bcb60425b2 1、完成 内部调拨单优化项 需求;2、解决 不同序列号调拨单选择同一个货位可以确认成功 bug;3、收货入库时扫描录入Rfid方法添加日志 2024-06-26 17:07:09 +08:00
jinling.yang
22643368fa Merge branch 'feature/修复工单完成报错库存问题' into develop 2024-06-26 16:41:23 +08:00
jinling.yang
aeb100923f Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修复工单完成报错库存问题 2024-06-26 16:41:05 +08:00
杨金灵
53c6d6015e Accept Merge Request #1101: (feature/修复工单完成报错库存问题 -> develop)
Merge Request: 修复制造订单生成时没有采购单

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1101?initial=true
2024-06-26 16:40:40 +08:00
jinling.yang
131e9329de Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-06-26 16:37:05 +08:00
jinling.yang
dbd5c488f8 修复制造订单生成时没有采购单 2024-06-26 16:36:51 +08:00
马广威
f8ba414229 Accept Merge Request #1100: (feature/sf物流方面缺陷与优化 -> develop)
Merge Request: sf物流优化

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1100?initial=true
2024-06-26 16:34:52 +08:00
mgw
7fd3647afb sf物流优化 2024-06-26 16:34:04 +08:00
马广威
f5be9c6e65 Accept Merge Request #1099: (feature/制造订单列表页及详情页优化需求 -> develop)
Merge Request: 制造订单列表页及详情页优化需求

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1099?initial=true
2024-06-26 14:13:06 +08:00
mgw
c275a39a15 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造订单列表页及详情页优化需求 2024-06-26 14:11:45 +08:00
mgw
d07ab53aeb 制造订单列表页及详情页优化需求 2024-06-26 14:10:57 +08:00
jinling.yang
55accb714a Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-06-26 11:25:47 +08:00
jinling.yang
5bd3eddfd5 Merge branch 'feature/修复编程单下发ftp路径' into develop 2024-06-26 11:24:58 +08:00
杨金灵
c8bcd4d0f5 Accept Merge Request #1098: (feature/修复编程单下发ftp路径 -> develop)
Merge Request: 修复编程单下发ftp路径

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1098?initial=true
2024-06-26 11:24:40 +08:00
jinling.yang
2cbe5ed394 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修复编程单下发ftp路径 2024-06-26 11:11:26 +08:00
jinling.yang
1f1cb17a40 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-06-26 11:11:08 +08:00
jinling.yang
2ff935f68d 修复编程单下发ftp路径 2024-06-26 11:10:54 +08:00
杨金灵
098745ec50 Accept Merge Request #1097: (feature/修复编程单下发ftp路径 -> develop)
Merge Request: 修复编程单下发ftp路径

Created By: @杨金灵
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1097?initial=true
2024-06-26 10:21:25 +08:00
jinling.yang
94175f2039 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-06-26 10:17:27 +08:00
jinling.yang
1940116a35 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修复编程单下发ftp路径 2024-06-26 10:17:14 +08:00
jinling.yang
f4eb378bea 修复制造订单:无工单时,工单page需隐藏 2024-06-26 10:17:00 +08:00
jinling.yang
dcbb60b088 修复编程单下发ftp路径:去掉注释 2024-06-25 18:11:45 +08:00
jinling.yang
88ef9c106d 修复编程单下发ftp路径 2024-06-25 17:54:08 +08:00
马广威
0f7f12008f Accept Merge Request #1096: (feature/【计划】模块的【排程单】页面优化需求 -> develop)
Merge Request: 处理"打印的二维码信息与界面的二维码信息不一致"等

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1096?initial=true
2024-06-25 16:51:47 +08:00
mgw
f44836705b 放出程序下载按钮 2024-06-25 16:50:09 +08:00
mgw
35ac51bc10 取消默认分组展示 2024-06-25 14:22:51 +08:00
mgw
eb2851391b 处理"打印的二维码信息与界面的二维码信息不一致" 2024-06-25 12:06:28 +08:00
jinling.yang
86f67556ce Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-06-25 11:07:41 +08:00
禹翔辉
e437875a92 Accept Merge Request #1095: (release/release_1.8 -> develop)
Merge Request: 功能刀具、工件状态优化

Created By: @禹翔辉
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @禹翔辉
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1095
2024-06-25 09:53:14 +08:00
马广威
9e56aeda67 Accept Merge Request #1093: (release/release_1.8 -> master)
Merge Request: 功能刀具、工件状态优化

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1093?initial=true
2024-06-24 21:38:15 +08:00
jinling.yang
b4535e88c9 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-06-24 17:31:08 +08:00
jinling.yang
be94cd0d54 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-06-24 17:30:03 +08:00
jinling.yang
65e209fe2a Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-06-24 17:20:18 +08:00
jinling.yang
27ba002b51 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-06-24 16:54:28 +08:00
jinling.yang
2cd83c87e2 Merge branch 'feature/优化重新下发程序' into develop 2024-06-24 16:52:48 +08:00
jinling.yang
ba87d07af7 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-06-24 16:52:24 +08:00
34 changed files with 521 additions and 404 deletions

View File

@@ -527,3 +527,7 @@ div:has(.o_required_modifier) > label::before {
.o_form_view .o_group .o_wrap_label .o_form_label { .o_form_view .o_group .o_wrap_label .o_form_label {
white-space: nowrap; white-space: nowrap;
} }
// 修复表格内容覆盖表头bug
.o_list_renderer .o_list_table tbody th {
position: unset;
}

View File

@@ -301,51 +301,25 @@ def unlink(self):
# This is used to restrict the access right to unlink a record # This is used to restrict the access right to unlink a record
current_model_id = self.env['ir.model'].sudo().search( current_model_id = self.env['ir.model'].sudo().search(
[('model', '=', self._name)]).id [('model', '=', self._name)]).id
# access_right_rec = self.env['access.right'].sudo().search_read(
# [('model_id', '=', current_model_id)], ['model_id', 'is_delete',
# 'groups_id'])
# if access_right_rec and not self.env.is_admin():
# for rec in access_right_rec:
# group_name = self.env['ir.model.data'].sudo().search([
# ('model', '=', 'res.groups'),
# ('res_id', '=', rec['groups_id'][0])
# ]).name
# module_name = self.env['ir.model.data'].sudo().search([
# ('model', '=', 'res.groups'),
# ('res_id', '=', rec['groups_id'][0])
# ]).module
# group = module_name + "." + group_name
# if self.env.user.has_group(group):
# if rec['is_delete']:
# raise UserError(_('You are restricted from performing this'
# ' operation. Please contact the'
# ' administrator.'))
# 检查 'access.right' 模型是否存在于环境中
if 'access.right' in self.env:
# current_model_id = self.env['ir.model'].sudo().search([('model', '=', self._name)]).id
access_right_rec = self.env['access.right'].sudo().search_read( access_right_rec = self.env['access.right'].sudo().search_read(
[('model_id', '=', current_model_id)], ['model_id', 'is_delete', 'groups_id'] [('model_id', '=', current_model_id)], ['model_id', 'is_delete',
) 'groups_id'])
if access_right_rec and not self.env.is_admin(): if access_right_rec and not self.env.is_admin():
for rec in access_right_rec: for rec in access_right_rec:
group_data = self.env['ir.model.data'].sudo().search_read( group_name = self.env['ir.model.data'].sudo().search([
[('model', '=', 'res.groups'), ('res_id', '=', rec['groups_id'][0])], ('model', '=', 'res.groups'),
['name', 'module'] ('res_id', '=', rec['groups_id'][0])
) ]).name
module_name = self.env['ir.model.data'].sudo().search([
if group_data: ('model', '=', 'res.groups'),
group_name = group_data[0]['name'] ('res_id', '=', rec['groups_id'][0])
module_name = group_data[0]['module'] ]).module
group_xml_id = f"{module_name}.{group_name}" group = module_name + "." + group_name
if self.env.user.has_group(group):
if self.env.user.has_group(group_xml_id) and rec['is_delete']: if rec['is_delete']:
raise UserError( raise UserError(_('You are restricted from performing this'
_('You are restricted from performing this operation. Please contact the administrator.')) ' operation. Please contact the'
else: ' administrator.'))
# 如果 'access.right' 模型不存在,可以在这里定义备选逻辑
pass
return True return True

View File

@@ -11,8 +11,8 @@ access_sf_machine_control_system,sf_machine_control_system,model_sf_machine_cont
access_sf_machine_control_system_admin,sf_machine_control_system_admin,model_sf_machine_control_system,base.group_system,1,1,1,0 access_sf_machine_control_system_admin,sf_machine_control_system_admin,model_sf_machine_control_system,base.group_system,1,1,1,0
access_sf_production_process_group_sale_director,sf_production_process_group_sale_director,model_sf_production_process,sf_base.group_sale_director,1,0,0,0 access_sf_production_process_group_sale_director,sf_production_process_group_sale_director,model_sf_production_process,sf_base.group_sale_director,1,0,0,0
access_sf_production_process_group_sale_salemanager,sf_production_process_group_sale_salemanager,model_sf_production_process,sf_base.group_sale_salemanager,1,0,0,0 access_sf_production_process_group_sale_salemanager,sf_production_process_group_sale_salemanager,model_sf_production_process,sf_base.group_sale_salemanager,1,0,0,0
access_res_partner_category_group_sale_salemanager,res_partner_category_group_sale_salemanager,base.model_res_partner_category,sf_base.group_sale_salemanager,1,0,1,0 access_res_partner_category_group_sale_salemanager,res_partner_category_group_sale_salemanager,base.model_res_partner_category,sf_base.group_sale_salemanager,1,1,1,0
access_res_partner_category_group_sale_director,res_partner_category_group_sale_director,base.model_res_partner_category,sf_base.group_sale_director,1,0,1,0 access_res_partner_category_group_sale_director,res_partner_category_group_sale_director,base.model_res_partner_category,sf_base.group_sale_director,1,1,1,0
access_sf_production_process,sf_production_process,model_sf_production_process,base.group_user,1,1,1,0 access_sf_production_process,sf_production_process,model_sf_production_process,base.group_user,1,1,1,0
access_sf_production_process_admin,sf_production_process_admin,model_sf_production_process,base.group_system,1,1,1,0 access_sf_production_process_admin,sf_production_process_admin,model_sf_production_process,base.group_system,1,1,1,0
access_sf_production_materials,sf_production_materials,model_sf_production_materials,base.group_user,1,1,1,0 access_sf_production_materials,sf_production_materials,model_sf_production_materials,base.group_user,1,1,1,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
11 access_sf_machine_control_system_admin sf_machine_control_system_admin model_sf_machine_control_system base.group_system 1 1 1 0
12 access_sf_production_process_group_sale_director sf_production_process_group_sale_director model_sf_production_process sf_base.group_sale_director 1 0 0 0
13 access_sf_production_process_group_sale_salemanager sf_production_process_group_sale_salemanager model_sf_production_process sf_base.group_sale_salemanager 1 0 0 0
14 access_res_partner_category_group_sale_salemanager res_partner_category_group_sale_salemanager base.model_res_partner_category sf_base.group_sale_salemanager 1 0 1 1 0
15 access_res_partner_category_group_sale_director res_partner_category_group_sale_director base.model_res_partner_category sf_base.group_sale_director 1 0 1 1 0
16 access_sf_production_process sf_production_process model_sf_production_process base.group_user 1 1 1 0
17 access_sf_production_process_admin sf_production_process_admin model_sf_production_process base.group_system 1 1 1 0
18 access_sf_production_materials sf_production_materials model_sf_production_materials base.group_user 1 1 1 0

View File

@@ -21,6 +21,7 @@ class Http(models.AbstractModel):
def _auth_method_sf_token(cls): def _auth_method_sf_token(cls):
# 从headers.environ中获取对方传过来的token,timestamp,加密的校验字符串 # 从headers.environ中获取对方传过来的token,timestamp,加密的校验字符串
datas = request.httprequest.headers.environ datas = request.httprequest.headers.environ
_logger.info('datas:%s' % datas)
if 'HTTP_TOKEN' in datas: if 'HTTP_TOKEN' in datas:
_logger.info('token:%s' % datas['HTTP_TOKEN']) _logger.info('token:%s' % datas['HTTP_TOKEN'])
# 查询密钥 # 查询密钥

View File

@@ -5,7 +5,7 @@ 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 from odoo import api, fields, models, _
from odoo.exceptions import ValidationError from odoo.exceptions import ValidationError
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
@@ -161,15 +161,25 @@ class JdEclp(models.Model):
url2 = config['bfm_url'] + '/api/get/jd/no' url2 = config['bfm_url'] + '/api/get/jd/no'
response = requests.post(url2, json=json2, data=None) response = requests.post(url2, json=json2, data=None)
# _logger.info('调用成功2', response.json()['result']['wbNo']) # _logger.info('调用成功2', response.json()['result']['wbNo'])
self.carrier_tracking_ref = response.json()['result']['wbNo'] self.carrier_tracking_ref = response.json()['result'].get('wbNo')
if not self.carrier_tracking_ref:
raise ValidationError('物流下单未成功,请联系管理员')
self.is_bill = True self.is_bill = True
self.logistics_status = '1' self.logistics_status = '1'
# # 京东物流下单后,销售订单状态改为待收货 notification = {
# self.env['sale.order'].search([('name', '=', self.origin)]).write({'scheduled_status': 'to receive'}) 'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'title': _('成功'),
'type': 'success',
'message': '物流下单成功',
'sticky': False,
'next': {'type': 'ir.actions.client', 'tag': 'reload'}
}
}
# else: return notification
# raise UserError("选择京东物流才能下单呦")
def get_bill(self): def get_bill(self):
""" """

View File

@@ -32,7 +32,7 @@
<field name="is_bill" invisible="True"/> <field name="is_bill" invisible="True"/>
<field name="logistics_status" invisible="True"/> <field name="logistics_status" invisible="True"/>
<field name="logistics_way" invisible="True"/> <field name="logistics_way" invisible="True"/>
<button string="京东物流下单" name="create_order" type="object" confirm="是否确认物流下单" class="btn-primary" <button string="物流下单" name="create_order" type="object" confirm="是否确认物流下单" class="btn-primary"
attrs="{'invisible': ['|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('is_bill', '=', True), ('logistics_way', '=', '自提')]}"/> attrs="{'invisible': ['|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('is_bill', '=', True), ('logistics_way', '=', '自提')]}"/>
<button string="获取物流面单" name="get_bill" type="object" confirm="是否获取物流面单" class="btn-primary" <button string="获取物流面单" name="get_bill" type="object" confirm="是否获取物流面单" class="btn-primary"
attrs="{'invisible': ['|', '|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('logistics_status', '=', '2'), ('is_bill', '=', False), ('logistics_way', '=', '自提')]}"/> attrs="{'invisible': ['|', '|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('logistics_status', '=', '2'), ('is_bill', '=', False), ('logistics_way', '=', '自提')]}"/>
@@ -45,16 +45,26 @@
<field name="model">stock.picking</field> <field name="model">stock.picking</field>
<field name="inherit_id" ref="delivery.view_picking_withcarrier_out_form"/> <field name="inherit_id" ref="delivery.view_picking_withcarrier_out_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="location_id" position="after"> <field name="location_id" position="after">
<field name="logistics_status" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/> <field name="logistics_status" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
<field name="logistics_way" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/> <field name="logistics_way" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
</field> </field>
</field>
</record>
<xpath expr="//group//field[@name='carrier_id']" position="after"> <record id="tracking_only_view" model="ir.ui.view">
<!-- <field name="senderNickName" domain="[('self.name', 'like', '%OUT%')]"/> --> <field name="name">tracking only</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//notebook//page[@name='operations']" position="after">
<page string="发货信息" name="tracking">
<group>
<group>
<field name="senderNickName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/> <field name="senderNickName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
<field name="expressItemName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/> <field name="expressItemName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
<field name="grossWeight" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
<field name="grossVolume" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
<field name="deliveryType" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/> <field name="deliveryType" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
<field name="receiverName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/> <field name="receiverName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
<field name="receiverMobile" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/> <field name="receiverMobile" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
@@ -64,23 +74,21 @@
<field name="receiverTownName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/> <field name="receiverTownName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
<field name="receiverCompany" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/> <field name="receiverCompany" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
<field name="remark" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/> <field name="remark" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
<field name="grossWeight" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
<field name="grossVolume" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
<field name="pickupBeginTime" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/> <field name="pickupBeginTime" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
<field name="bill_show" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/> </group>
<group>
<field name="logistics_status"/> <field name="logistics_status"/>
</xpath> <field name="carrier_id"/>
<xpath expr="//group//field[@name='group_id']" position="after"> <field name="carrier_tracking_ref"/>
<field name="bill_show" attrs="{'invisible': [('check_out', '!=', 'OUT')]}" string='面单下载'/>
<field name="bill_show" widget="pdf_viewer" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/> <field name="bill_show" widget="pdf_viewer" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
</group>
</group>
</page>
</xpath> </xpath>
<!-- <xpath expr="//group[@name='other_infos']" position="after"> -->
<!-- <div> -->
<!-- <button string="京东物流下单" name="create_order" type="object" confirm="是否确认物流下单" class="btn-primary"/> -->
<!-- </div> -->
<!-- <div> -->
<!-- <button string="获取物流面单" name="get_bill" type="object" confirm="是否获取物流面单" class="btn-primary"/> -->
<!-- </div> -->
<!-- </xpath> -->
</field> </field>
</record> </record>
</odoo> </odoo>

View File

@@ -88,7 +88,7 @@
</div> </div>
<field name="model_volume" string="体积[mm³]"/> <field name="model_volume" string="体积[mm³]"/>
<field name="product_model_type_id" string="模型类型"/> <field name="product_model_type_id" string="模型类型"/>
<field name="model_processing_panel" placeholder="例如R,U" string="加工面板"/> <field name="model_processing_panel" placeholder="例如R,U" string="加工面板" readonly="1"/>
<field name="model_machining_precision"/> <field name="model_machining_precision"/>
<field name="model_process_parameters_ids" string="表面工艺参数" <field name="model_process_parameters_ids" string="表面工艺参数"
widget="many2many_tags" widget="many2many_tags"

View File

@@ -27,6 +27,7 @@
</xpath> </xpath>
<xpath expr="//field[@name='production_id']" position="before"> <xpath expr="//field[@name='production_id']" position="before">
<field name="product_tmpl_name"/> <field name="product_tmpl_name"/>
<field name="rfid_code"/>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@@ -5,7 +5,7 @@
<field name="model">mrp.workorder</field> <field name="model">mrp.workorder</field>
<field name="inherit_id" ref="sf_manufacturing.view_mrp_production_workorder_tray_form_inherit_sf"/> <field name="inherit_id" ref="sf_manufacturing.view_mrp_production_workorder_tray_form_inherit_sf"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<!-- <xpath expr="//header" position="inside">--> <!-- <xpath expr="//header" position="inside">&ndash;&gt;-->
<!-- <button string="程序下载" name="cnc_file_download" type="object" class="oe_highlight" attrs='{"invisible": ["|",--> <!-- <button string="程序下载" name="cnc_file_download" type="object" class="oe_highlight" attrs='{"invisible": ["|",-->
<!-- ("user_permissions","=",False),("routing_type","!=","CNC加工")]}'/>--> <!-- ("user_permissions","=",False),("routing_type","!=","CNC加工")]}'/>-->
<!-- </xpath>--> <!-- </xpath>-->
@@ -17,15 +17,15 @@
</group> </group>
<div> <div>
<div> <div>
<field name="button_compensation_state" attrs='{"invisible": ["|", <!-- <field name="button_compensation_state" attrs='{"invisible": ["|",-->
("state","!=","progress"),("user_permissions","=",False)]}'/> <!-- ("state","!=","progress"),("user_permissions","=",False)]}'/>-->
<!-- <span>&#32;</span>--> <!-- <span>&#32;</span>-->
<button name="button_send_program_again" type="object" string="重新下发NC程序" <!-- <button name="button_send_program_again" type="object" string="重新下发NC程序"-->
class="btn-primary" <!-- class="btn-primary"-->
confirm="是否确认重新下发NC程序" <!-- confirm="是否确认重新下发NC程序"-->
groups="sf_base.group_sf_order_user,sf_base.group_sf_equipment_user" <!-- groups="sf_base.group_sf_order_user,sf_base.group_sf_equipment_user"-->
attrs="{'invisible': ['|', '|', '|',('routing_type','!=','装夹预调'),('state','in',['done', 'cancel', <!-- attrs="{'invisible': ['|', '|', '|',('routing_type','!=','装夹预调'),('state','in',['done', 'cancel',-->
'progress']),('processing_drawing','=',False),('is_send_program_again','=',True)]}"/> <!-- 'progress']),('processing_drawing','=',False),('is_send_program_again','=',True)]}"/>-->
<!-- <button string="一键补偿" name="compensation" type="object" confirm="是否确认下发补偿"--> <!-- <button string="一键补偿" name="compensation" type="object" confirm="是否确认下发补偿"-->
<!-- class="btn-primary" attrs='{"invisible": ["|",--> <!-- class="btn-primary" attrs='{"invisible": ["|",-->
<!-- ("state","!=","progress"),("user_permissions","=",False)]}'/>--> <!-- ("state","!=","progress"),("user_permissions","=",False)]}'/>-->

View File

@@ -19,7 +19,7 @@
<!-- attrs='{"invisible": ["|",("state","!=","progress"), --> <!-- attrs='{"invisible": ["|",("state","!=","progress"), -->
<!-- ("user_permissions","!=",True)]}'/> --> <!-- ("user_permissions","!=",True)]}'/> -->
<!-- <button string="下发" name="up" type="object" class="btn-primary" confirm="是否确认下发此程序" context="{'default_cnc_ids': cnc_ids}"/> --> <!-- <button string="下发" name="up" type="object" class="btn-primary" confirm="是否确认下发此程序" context="{'default_cnc_ids': cnc_ids}"/> -->
<button string="下发" name="up" type="object" class="btn-primary" confirm="是否确认下发此程序" <!-- <button string="下发" name="up" type="object" class="btn-primary" confirm="是否确认下发此程序"-->
context="{'default_sf_cnc_processing_id': id}" attrs='{"invisible": ["|",("state","!=","progress"), context="{'default_sf_cnc_processing_id': id}" attrs='{"invisible": ["|",("state","!=","progress"),
("user_permissions","!=",True)]}'/> ("user_permissions","!=",True)]}'/>
<!-- <button string="下发" name="up" type="object" class="btn-primary" confirm="是否确认下发此程序"--> <!-- <button string="下发" name="up" type="object" class="btn-primary" confirm="是否确认下发此程序"-->

View File

@@ -14,7 +14,7 @@
<!-- <field name="program_ids" domain="[('workorder_id', '=', workorder_id)]"/>--> <!-- <field name="program_ids" domain="[('workorder_id', '=', workorder_id)]"/>-->
</group> </group>
<footer> <footer>
<button string="合并下发" name="confirm_up" type="object" class="btn-primary" confirm="是否确认合并下发"/> <!-- <button string="合并下发" name="confirm_up" type="object" class="btn-primary" confirm="是否确认合并下发"/>-->
<button string="取消" class="btn-secondary" special="cancel"/> <button string="取消" class="btn-secondary" special="cancel"/>
</footer> </footer>
</form> </form>

View File

@@ -162,7 +162,8 @@ class Manufacturing_Connect(http.Controller):
routing_type = ret['CraftId'] routing_type = ret['CraftId']
equipment_id = ret["DeviceId"] equipment_id = ret["DeviceId"]
workorder = request.env['mrp.workorder'].sudo().search( workorder = request.env['mrp.workorder'].sudo().search(
[('production_id', '=', production_id), ('routing_type', '=', routing_type)], limit=1) [('production_id', '=', production_id), ('routing_type', '=', routing_type),
('rfid_code', '!=', False)], limit=1)
if not workorder: if not workorder:
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '该工单不存在'} res = {'Succeed': False, 'ErrorCode': 202, 'Error': '该工单不存在'}
return json.JSONEncoder().encode(res) return json.JSONEncoder().encode(res)
@@ -203,12 +204,14 @@ class Manufacturing_Connect(http.Controller):
res = {'Succeed': True, 'Datas': ['工单已结束']} res = {'Succeed': True, 'Datas': ['工单已结束']}
datas = request.httprequest.data datas = request.httprequest.data
ret = json.loads(datas) ret = json.loads(datas)
logging.info('button_Work_End:%s' % ret)
request.env['center_control.interface.log'].sudo().create( request.env['center_control.interface.log'].sudo().create(
{'content': ret, 'name': 'AutoDeviceApi/FeedBackEnd'}) {'content': ret, 'name': 'AutoDeviceApi/FeedBackEnd'})
production_id = ret['BillId'] production_id = ret['BillId']
routing_type = ret['CraftId'] routing_type = ret['CraftId']
workorder = request.env['mrp.workorder'].sudo().search( workorder = request.env['mrp.workorder'].sudo().search(
[('production_id', '=', production_id), ('routing_type', '=', routing_type)], limit=1) [('production_id', '=', production_id), ('routing_type', '=', routing_type),
('rfid_code', '!=', False)], limit=1)
if not workorder: if not workorder:
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '该工单不存在'} res = {'Succeed': False, 'ErrorCode': 202, 'Error': '该工单不存在'}
return json.JSONEncoder().encode(res) return json.JSONEncoder().encode(res)
@@ -222,14 +225,14 @@ class Manufacturing_Connect(http.Controller):
# workorder.sudo().production_id.process_state = '待解除装夹' # workorder.sudo().production_id.process_state = '待解除装夹'
# 根据工单的实际结束时间修改排程单的结束时间、状态,同时修改销售订单的状态 # 根据工单的实际结束时间修改排程单的结束时间、状态,同时修改销售订单的状态
if workorder.date_finished: # if workorder.date_finished:
request.env['sf.production.plan'].sudo().search([('production_id', '=', production_id)]).write( # request.env['sf.production.plan'].sudo().search([('production_id', '=', production_id)]).write(
{'actual_end_time': workorder.date_finished, # {'actual_end_time': workorder.date_finished,
'state': 'finished'}) # 'state': 'finished'})
production_obj = request.env['mrp.production'].sudo().search([('name', '=', production_id)]) # production_obj = request.env['mrp.production'].sudo().search([('name', '=', production_id)])
if production_obj: # if production_obj:
production_obj.sudo().work_order_state = '已完成' # production_obj.sudo().work_order_state = '已完成'
production_obj.write({'state': 'completed'}) # production_obj.write({'state': 'done'})
# request.env['sale.order'].sudo().search( # request.env['sale.order'].sudo().search(
# [('name', '=', production_obj.origin)]).write({'schedule_status': 'to deliver'}) # [('name', '=', production_obj.origin)]).write({'schedule_status': 'to deliver'})
@@ -317,15 +320,15 @@ class Manufacturing_Connect(http.Controller):
[('rfid_code', '=', ret['RfidCode']), ('routing_type', '=', 'CNC加工')]) [('rfid_code', '=', ret['RfidCode']), ('routing_type', '=', 'CNC加工')])
if workorder: if workorder:
for item in workorder.cmm_ids: for item in workorder.cmm_ids:
if item.program_date is not False: if item.program_create_date is not False:
program_date = item.program_date.strftime("%Y-%m-%d %H:%M:%S") program_create_date = item.program_create_date.strftime("%Y-%m-%d %H:%M:%S")
program_date_str = request.env['sf.sync.common'].sudo().get_add_time(program_date) program_date_str = request.env['sf.sync.common'].sudo().get_add_time(program_create_date)
res['Datas'].append({ res['Datas'].append({
'CraftId': workorder.id, 'CraftId': workorder.id,
'CraftKey': workorder.name, 'CraftKey': workorder.name,
'ProgramDate': '' if not item.program_date else program_date_str, 'ProgramDate': '' if not item.program_create_date else program_date_str,
'ProgramPath': item.program_path, 'ProgramPath': item.program_path,
'PostProcessing': item.post_processing_name, 'PostProcessing': item.program_name,
}) })
else: else:
res = {'Succeed': False, 'ErrorCode': 203, 'Error': '暂无工单及对应的CNC程序数据'} res = {'Succeed': False, 'ErrorCode': 203, 'Error': '暂无工单及对应的CNC程序数据'}
@@ -468,10 +471,14 @@ class Manufacturing_Connect(http.Controller):
workorder = request.env['mrp.workorder'].sudo().search(domain, order='id asc') workorder = request.env['mrp.workorder'].sudo().search(domain, order='id asc')
if workorder: if workorder:
for order in workorder: for order in workorder:
if order.production_id.production_line_state == '待上产线': if order.production_line_state == '待上产线':
logging.info( logging.info(
'制造订单产线状态:%s' % order.production_id.production_line_state) '单产线状态:%s' % order.production_line_state)
order.production_id.write({'production_line_state': '已上产线'}) panel_workorder = request.env['mrp.workorder'].sudo().search(
[('rfid_code', '=', rfid_code),
('processing_panel', '=', order.processing_panel)])
if panel_workorder:
panel_workorder.write({'production_line_state': '已上产线'})
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search( workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(
[ [
('rfid_code', '=', rfid_code), ('type', '=', '上产线'), ('rfid_code', '=', rfid_code), ('type', '=', '上产线'),
@@ -525,10 +532,14 @@ class Manufacturing_Connect(http.Controller):
workorder = request.env['mrp.workorder'].sudo().search(domain, order='id asc') workorder = request.env['mrp.workorder'].sudo().search(domain, order='id asc')
if workorder: if workorder:
for order in workorder: for order in workorder:
if order.production_id.production_line_state == '已上产线': if order.production_line_state == '已上产线':
logging.info( logging.info(
'制造订单产线状态:%s' % order.production_id.production_line_state) '单产线状态:%s' % order.production_line_state)
order.production_id.write({'production_line_state': '已下产线'}) panel_workorder = request.env['mrp.workorder'].sudo().search(
[('rfid_code', '=', rfid_code),
('processing_panel', '=', order.processing_panel)])
if panel_workorder:
panel_workorder.write({'production_line_state': '已下产线'})
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search( workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(
[ [
('rfid_code', '=', rfid_code), ('type', '=', '下产线'), ('rfid_code', '=', rfid_code), ('type', '=', '下产线'),

View File

@@ -30,13 +30,10 @@ class MrpProduction(models.Model):
# ('completed', '已完工') # ('completed', '已完工')
# ]) # ])
state = fields.Selection([ state = fields.Selection([
('draft', 'Draft'), ('draft', '草稿'),
('confirmed', 'Confirmed'), ('confirmed', '待排程'),
('progress', '排程'), ('pending_cam', '加工'),
('pending_cam', '待装夹'), ('progress', '加工中'),
('pending_processing', '待加工'),
('pending_era_cam', '待解除装夹'),
('completed', '已完工'),
('to_close', 'To Close'), ('to_close', 'To Close'),
('done', 'Done'), ('done', 'Done'),
('cancel', 'Cancelled')], string='State', ('cancel', 'Cancelled')], string='State',
@@ -53,13 +50,14 @@ class MrpProduction(models.Model):
active = fields.Boolean(string='已归档', default=True) active = fields.Boolean(string='已归档', default=True)
programming_no = fields.Char('编程单号') programming_no = fields.Char('编程单号')
work_state = fields.Char('业务状态') work_state = fields.Char('业务状态')
programming_state = fields.Char('编程状态', tracking=True) programming_state = fields.Selection(
[('编程中', '编程中'), ('已编程', '已编程')], string='编程状态', tracking=True)
glb_file = fields.Binary("glb模型文件") glb_file = fields.Binary("glb模型文件")
production_line_id = fields.Many2one('sf.production.line', string='生产线', tracking=True) production_line_id = fields.Many2one('sf.production.line', string='生产线', tracking=True)
plan_start_processing_time = fields.Datetime('计划开始加工时间') plan_start_processing_time = fields.Datetime('计划开始加工时间')
production_line_state = fields.Selection( # production_line_state = fields.Selection(
[('待上产线', '待上产线'), ('已上产线', '已上产线'), ('已下产线', '已下产线')], # [('待上产线', '待上产线'), ('已上产线', '已上产线'), ('已下产线', '已下产线')],
string='上/下产线', default='待上产线', tracking=True) # string='上/下产线', default='待上产线', tracking=True)
# 工序状态 # 工序状态
# Todo 研究下用法 # Todo 研究下用法
process_state = fields.Selection([ process_state = fields.Selection([
@@ -81,7 +79,7 @@ class MrpProduction(models.Model):
@api.depends( @api.depends(
'move_raw_ids.state', 'move_raw_ids.quantity_done', 'move_finished_ids.state', 'move_raw_ids.state', 'move_raw_ids.quantity_done', 'move_finished_ids.state',
'workorder_ids.state', 'product_qty', 'qty_producing', 'schedule_state', 'process_state') 'workorder_ids.state', 'product_qty', 'qty_producing', 'schedule_state')
def _compute_state(self): def _compute_state(self):
for production in self: for production in self:
if not production.state or not production.product_uom_id: if not production.state or not production.product_uom_id:
@@ -109,22 +107,19 @@ class MrpProduction(models.Model):
production.state = 'progress' production.state = 'progress'
elif any(not float_is_zero(move.quantity_done, elif any(not float_is_zero(move.quantity_done,
precision_rounding=move.product_uom.rounding or move.product_id.uom_id.rounding) precision_rounding=move.product_uom.rounding or move.product_id.uom_id.rounding)
for move in production.move_raw_ids): for move in production.move_raw_ids if move.product_id):
production.state = 'progress' production.state = 'progress'
# 新添加的状态逻辑 # # 新添加的状态逻辑
if production.state == 'progress' and production.schedule_state == '已排' and production.process_state == '待装夹': if (
# production.state = 'pending_processing' production.state == 'to_close' or production.state == 'progress') and production.schedule_state == '未排':
production.state = 'confirmed'
elif production.state == 'to_close' and production.schedule_state == '已排':
production.state = 'pending_cam'
if production.state == 'progress':
if all(wo_state not in ('progress', 'done') for wo_state in production.workorder_ids.mapped('state')):
production.state = 'pending_cam' production.state = 'pending_cam'
if production.state == 'progress' and production.schedule_state == '已排' and production.process_state == '待加工':
# if production.state == 'pending_cam' and production.process_state == '待加工':
production.state = 'pending_processing'
elif production.state == 'progress' and production.process_state == '待解除装夹':
production.state = 'pending_era_cam'
elif production.state == 'progress' and production.process_state == '已完工':
production.state = 'completed'
elif production.state == 'progress' and production.work_order_state == '已完成':
production.state = 'completed'
def action_check(self): def action_check(self):
""" """
@@ -293,14 +288,6 @@ class MrpProduction(models.Model):
# 其他规则限制: 默认只分配给工作中心状态为非故障的工作中心; # 其他规则限制: 默认只分配给工作中心状态为非故障的工作中心;
def _create_workorder3(self, item): def _create_workorder3(self, item):
# 根据product_id对self进行分组
grouped_product_ids = {k: list(g) for k, g in groupby(self, key=lambda x: x.product_id.id)}
# 初始化一个字典来存储每个product_id对应的生产订单名称列表
product_id_to_production_names = {}
# 对于每个product_id获取其所有生产订单的名称
for product_id, productions in grouped_product_ids.items():
# 为同一个product_id创建一个生产订单名称列表
product_id_to_production_names[product_id] = [production.name for production in productions]
for production in self: for production in self:
if not production.bom_id or not production.product_id: if not production.bom_id or not production.product_id:
continue continue
@@ -347,6 +334,7 @@ class MrpProduction(models.Model):
# 表面工艺工序 # 表面工艺工序
# 获取表面工艺id # 获取表面工艺id
if production.product_id.model_process_parameters_ids: if production.product_id.model_process_parameters_ids:
logging.info('model_process_parameters_ids:%s' % production.product_id.model_process_parameters_ids)
surface_technics_arr = [] surface_technics_arr = []
# 工序id # 工序id
route_workcenter_arr = [] route_workcenter_arr = []
@@ -361,6 +349,7 @@ class MrpProduction(models.Model):
# 用filter刷选表面工艺id'是否存在工艺类别对象里 # 用filter刷选表面工艺id'是否存在工艺类别对象里
if production_process_category: if production_process_category:
for p in production_process_category: for p in production_process_category:
logging.info('production_process_category:%s' % p.name)
production_process = p.production_process_ids.filtered( production_process = p.production_process_ids.filtered(
lambda pp: pp.id in surface_technics_arr) lambda pp: pp.id in surface_technics_arr)
if production_process: if production_process:
@@ -414,7 +403,7 @@ class MrpProduction(models.Model):
else: else:
if m == len(consecutive_workorders) - 1 and m != 0: if m == len(consecutive_workorders) - 1 and m != 0:
self.env['stock.picking'].create_outcontract_picking(consecutive_workorders, self.env['stock.picking'].create_outcontract_picking(consecutive_workorders,
production_item) production)
if sorted_workorders[i] in consecutive_workorders: if sorted_workorders[i] in consecutive_workorders:
is_pick = True is_pick = True
consecutive_workorders = [] consecutive_workorders = []
@@ -422,21 +411,21 @@ class MrpProduction(models.Model):
# 当前面的连续工序生成对应的外协出入库单再生成当前工序的外协出入库单 # 当前面的连续工序生成对应的外协出入库单再生成当前工序的外协出入库单
if is_pick is False: if is_pick is False:
self.env['stock.picking'].create_outcontract_picking(sorted_workorders[i], self.env['stock.picking'].create_outcontract_picking(sorted_workorders[i],
production_item) production)
if m == len(consecutive_workorders) - 1 and m != 0: if m == len(consecutive_workorders) - 1 and m != 0:
self.env['stock.picking'].create_outcontract_picking(consecutive_workorders, self.env['stock.picking'].create_outcontract_picking(consecutive_workorders,
production_item) production)
if sorted_workorders[i] in consecutive_workorders: if sorted_workorders[i] in consecutive_workorders:
is_pick = True is_pick = True
consecutive_workorders = [] consecutive_workorders = []
m = 0 m = 0
if m == len(consecutive_workorders) - 1 and m != 0: if m == len(consecutive_workorders) - 1 and m != 0:
self.env['stock.picking'].create_outcontract_picking(consecutive_workorders, production_item) self.env['stock.picking'].create_outcontract_picking(consecutive_workorders, production)
if is_pick is False and m == 0: if is_pick is False and m == 0:
if len(sorted_workorders) == 1: if len(sorted_workorders) == 1:
self.env['stock.picking'].create_outcontract_picking(sorted_workorders, production_item) self.env['stock.picking'].create_outcontract_picking(sorted_workorders, production)
else: else:
self.env['stock.picking'].create_outcontract_picking(sorted_workorders[i], production_item) self.env['stock.picking'].create_outcontract_picking(sorted_workorders[i], production)
for workorder in production.workorder_ids: for workorder in production.workorder_ids:
workorder.duration_expected = workorder._get_duration_expected() workorder.duration_expected = workorder._get_duration_expected()
@@ -641,9 +630,10 @@ class MrpProduction(models.Model):
}) })
for production in self: for production in self:
logging.info('qty_produced:%s' % production.qty_produced)
production.write({ production.write({
'date_finished': fields.Datetime.now(), 'date_finished': fields.Datetime.now(),
'product_qty': production.qty_produced, 'product_qty': production.product_qty if production.qty_produced < 1.0 else production.qty_produced,
'priority': '0', 'priority': '0',
'is_locked': True, 'is_locked': True,
'state': 'done', 'state': 'done',
@@ -669,6 +659,7 @@ class MrpProduction(models.Model):
if any(mo.show_allocation for mo in self): if any(mo.show_allocation for mo in self):
action = self.action_view_reception_report() action = self.action_view_reception_report()
return action return action
logging.info('last-product_qty:%s' % production.product_qty)
return True return True
context = self.env.context.copy() context = self.env.context.copy()
context = {k: v for k, v in context.items() if not k.startswith('default_')} context = {k: v for k, v in context.items() if not k.startswith('default_')}

View File

@@ -19,7 +19,7 @@ from odoo.addons.sf_mrs_connect.models.ftp_operate import FtpController
class ResMrpWorkOrder(models.Model): class ResMrpWorkOrder(models.Model):
_inherit = 'mrp.workorder' _inherit = 'mrp.workorder'
_order = 'sequence asc,create_date desc' _order = 'id'
product_tmpl_name = fields.Char('坯料产品名称', related='production_bom_id.bom_line_ids.product_id.name') product_tmpl_name = fields.Char('坯料产品名称', related='production_bom_id.bom_line_ids.product_id.name')
@@ -136,11 +136,6 @@ class ResMrpWorkOrder(models.Model):
supplier_id = fields.Many2one('res.partner', string='外协供应商') supplier_id = fields.Many2one('res.partner', string='外协供应商')
equipment_id = fields.Many2one('maintenance.equipment', string='加工设备', tracking=True) equipment_id = fields.Many2one('maintenance.equipment', string='加工设备', tracking=True)
is_ok = fields.Boolean(string='是否合格')
# 加工人
processing_user_id = fields.Many2one('res.users', string='加工人')
# 检测人
inspection_user_id = fields.Many2one('res.users', string='检测人')
# 保存名称 # 保存名称
save_name = fields.Char(string='检测文件保存名称', compute='_compute_save_name') save_name = fields.Char(string='检测文件保存名称', compute='_compute_save_name')
# 获取数据状态 # 获取数据状态
@@ -198,8 +193,9 @@ class ResMrpWorkOrder(models.Model):
production_line_id = fields.Many2one('sf.production.line', related='production_id.production_line_id', production_line_id = fields.Many2one('sf.production.line', related='production_id.production_line_id',
string='生产线', store=True, tracking=True) string='生产线', store=True, tracking=True)
production_line_state = fields.Selection(related='production_id.production_line_state', production_line_state = fields.Selection(
string='/下产线', store=True, tracking=True) [('待上产线', '待上产线'), ('已上产线', '上产线'), ('已下产线', '已下产线')],
string='上/下产线', default='待上产线', tracking=True)
detection_report = fields.Binary('检测报告', readonly=True) detection_report = fields.Binary('检测报告', readonly=True)
is_remanufacture = fields.Boolean(string='重新生成制造订单', default=False) is_remanufacture = fields.Boolean(string='重新生成制造订单', default=False)
is_fetchcnc = fields.Boolean(string='重新获取NC程序', default=False) is_fetchcnc = fields.Boolean(string='重新获取NC程序', default=False)
@@ -207,7 +203,8 @@ class ResMrpWorkOrder(models.Model):
[("programming", "编程"), ("clamping", "返工"), ("cutter", "刀具"), ("operate computer", "操机"), [("programming", "编程"), ("clamping", "返工"), ("cutter", "刀具"), ("operate computer", "操机"),
("technology", "工艺"), ("customer redrawing", "客户改图"), ("other", "其他"), ], string="原因", tracking=True) ("technology", "工艺"), ("customer redrawing", "客户改图"), ("other", "其他"), ], string="原因", tracking=True)
detailed_reason = fields.Text('详细原因') detailed_reason = fields.Text('详细原因')
is_send_program_again = fields.Boolean(string='是否重新下发NC程序', default=False)
# is_send_program_again = fields.Boolean(string='是否重新下发NC程序', default=False)
@api.onchange('rfid_code') @api.onchange('rfid_code')
def _onchange(self): def _onchange(self):
@@ -234,16 +231,6 @@ class ResMrpWorkOrder(models.Model):
ids = [t[0] for t in self.env.cr.fetchall()] ids = [t[0] for t in self.env.cr.fetchall()]
return [('id', 'in', ids)] return [('id', 'in', ids)]
@api.onchange('is_ok')
def _onchange_inspection_user_id(self):
"""
检测is_ok(是否合格)被修改的话就将当前用户赋值给inspection_user_id
"""
if not self.inspection_user_id:
self.inspection_user_id = self.env.user.id
else:
self.inspection_user_id = False
@api.onchange('functional_fixture_id') @api.onchange('functional_fixture_id')
def _onchange_functional_fixture_id(self): def _onchange_functional_fixture_id(self):
if self.functional_fixture_id: if self.functional_fixture_id:
@@ -876,10 +863,9 @@ class ResMrpWorkOrder(models.Model):
('location_dest_id', '=', self.env['stock.location'].search( ('location_dest_id', '=', self.env['stock.location'].search(
[('barcode', 'ilike', 'VL-SPOC')]).id), [('barcode', 'ilike', 'VL-SPOC')]).id),
('origin', '=', self.production_id.name)]) ('origin', '=', self.production_id.name)])
purchase = self.env['purchase.order'].search([('origin', '=', self.production_id.name)]) if move_out:
if purchase and move_out:
move_out.write({'state': 'assigned'}) move_out.write({'state': 'assigned'})
self.env['stock.move.line'].create(move_out.get_move_line(purchase, self)) self.env['stock.move.line'].create(move_out.get_move_line(self.production_id, self))
# move_out._action_assign() # move_out._action_assign()
if self.state == 'waiting' or self.state == 'ready' or self.state == 'progress': if self.state == 'waiting' or self.state == 'ready' or self.state == 'progress':
@@ -1021,22 +1007,24 @@ class ResMrpWorkOrder(models.Model):
if workorder.processing_panel == record.processing_panel: if workorder.processing_panel == record.processing_panel:
rfid_code = workorder.rfid_code rfid_code = workorder.rfid_code
workorder.write({'rfid_code_old': rfid_code, workorder.write({'rfid_code_old': rfid_code,
'rfid_code': ''}) 'rfid_code': False})
workorder.rfid_code_old = rfid_code workorder.rfid_code_old = rfid_code
workorder.rfid_code = '' workorder.rfid_code = False
if is_production_id is True and record.routing_type in ['解除装夹', '表面工艺']: if is_production_id is True and record.routing_type in ['解除装夹', '表面工艺']:
logging.info('product_qty:%s' % record.production_id.product_qty)
for move_raw_id in record.production_id.move_raw_ids: for move_raw_id in record.production_id.move_raw_ids:
move_raw_id.quantity_done = move_raw_id.product_uom_qty move_raw_id.quantity_done = move_raw_id.product_uom_qty
record.process_state = '已完工' record.process_state = '已完工'
record.production_id.process_state = '已完工' record.production_id.process_state = '已完工'
if record.routing_type in ['表面工艺']: if record.routing_type in ['解除装夹', '表面工艺']:
raw_move = self.env['stock.move'].sudo().search( raw_move = self.env['stock.move'].sudo().search(
[('origin', '=', record.production_id.name), ('procure_method', '=', 'make_to_order'), [('origin', '=', record.production_id.name),
('procure_method', 'in', ['make_to_order', 'make_to_stock']),
('state', '!=', 'done')]) ('state', '!=', 'done')])
if raw_move: if raw_move:
raw_move.write({'state': 'done'}) raw_move.write({'state': 'done'})
record.production_id.button_mark_done1() record.production_id.button_mark_done1()
# self.production_id.state = 'done' # record.production_id.state = 'done'
# 将FTP的检测报告文件下载到临时目录 # 将FTP的检测报告文件下载到临时目录
def download_reportfile_tmp(self, workorder, reportpath): def download_reportfile_tmp(self, workorder, reportpath):
@@ -1079,31 +1067,30 @@ class ResMrpWorkOrder(models.Model):
return True return True
# 重新下发nc程序 # 重新下发nc程序
def button_send_program_again(self): # def button_send_program_again(self):
try: # try:
res = {'programming_no': self.production_id.programming_no} # res = {'programming_no': self.production_id.programming_no}
configsettings = self.env['res.config.settings'].get_values() # configsettings = self.env['res.config.settings'].get_values()
config_header = Common.get_headers(self, configsettings['token'], configsettings['sf_secret_key']) # config_header = Common.get_headers(self, configsettings['token'], configsettings['sf_secret_key'])
url = '/api/intelligent_programming/reset_state_again' # url = '/api/intelligent_programming/reset_state_again'
config_url = configsettings['sf_url'] + url # config_url = configsettings['sf_url'] + url
r = requests.post(config_url, json=res, data=None, headers=config_header) # r = requests.post(config_url, json=res, data=None, headers=config_header)
r = r.json() # r = r.json()
result = json.loads(r['result']) # result = json.loads(r['result'])
if result['status'] == 1: # if result['status'] == 1:
productions = self.env['mrp.production'].search( # productions = self.env['mrp.production'].search(
[('programming_no', '=', self.production_id.programming_no), ('programming_state', '=', '已编程')]) # [('programming_no', '=', self.production_id.programming_no), ('programming_state', '=', '已编程')])
if productions: # if productions:
workorder = productions.workorder_ids.filtered( # workorder = productions.workorder_ids.filtered(
lambda ap: ap.routing_type in ['装夹预调', 'CNC加工'] and ap.state not in ['done', 'cancel', # lambda ap: ap.routing_type in ['装夹预调', 'CNC加工'] and ap.state not in ['done', 'cancel',
'progress']) # 'progress'])
if workorder: # if workorder:
workorder.write({'is_send_program_again': True}) # productions.write({'work_state': '编程中', 'programming_state': '编程中'})
productions.write({'work_state': '编程中', 'programming_state': '编程中'}) # else:
else: # raise UserError(result['message'])
raise UserError(result['message']) # except Exception as e:
except Exception as e: # logging.info('button_send_program_again error:%s' % e)
logging.info('button_send_program_again error:%s' % e) # raise UserError("重新下发nc程序失败,请联系管理员")
raise UserError("重新下发nc程序失败,请联系管理员")
class CNCprocessing(models.Model): class CNCprocessing(models.Model):
@@ -1215,11 +1202,13 @@ class CNCprocessing(models.Model):
# 将FTP的多面的程序单文件下载到临时目录 # 将FTP的多面的程序单文件下载到临时目录
def download_file_tmp(self, production_no, processing_panel): def download_file_tmp(self, production_no, processing_panel):
remotepath = os.path.join('/NC', production_no, 'return', processing_panel) remotepath = os.path.join('/home/ftp/ftp_root/NC', production_no, 'return', processing_panel)
serverdir = os.path.join('/tmp', production_no, 'return', processing_panel) serverdir = os.path.join('/tmp', production_no, 'return', processing_panel)
ftp_resconfig = self.env['res.config.settings'].get_values() ftp_resconfig = self.env['res.config.settings'].get_values()
ftp = FtpController(str(ftp_resconfig['ftp_host']), int(ftp_resconfig['ftp_port']), ftp_resconfig['ftp_user'], ftp = FtpController(str(ftp_resconfig['ftp_host']), int(ftp_resconfig['ftp_port']), ftp_resconfig['ftp_user'],
ftp_resconfig['ftp_password']) ftp_resconfig['ftp_password'])
if not ftp.file_exists_1(remotepath):
logging.info('目录不存在:%s' % remotepath)
download_state = ftp.download_program_file(remotepath, serverdir) download_state = ftp.download_program_file(remotepath, serverdir)
logging.info('download_state:%s' % download_state) logging.info('download_state:%s' % download_state)
return download_state return download_state
@@ -1265,6 +1254,7 @@ class SfWorkOrderBarcodes(models.Model):
_inherit = ["mrp.workorder", "barcodes.barcode_events_mixin"] _inherit = ["mrp.workorder", "barcodes.barcode_events_mixin"]
def on_barcode_scanned(self, barcode): def on_barcode_scanned(self, barcode):
logging.info('Rfid:%s' % barcode)
workorder = self.env['mrp.workorder'].browse(self.ids) workorder = self.env['mrp.workorder'].browse(self.ids)
# workorder_preset = self.env['mrp.workorder'].search( # workorder_preset = self.env['mrp.workorder'].search(
# [('routing_type', '=', '装夹预调'), ('rfid_code', '=', barcode)]) # [('routing_type', '=', '装夹预调'), ('rfid_code', '=', barcode)])
@@ -1308,7 +1298,7 @@ class SfWorkOrderBarcodes(models.Model):
self.process_state = '待检测' self.process_state = '待检测'
self.date_start = datetime.now() self.date_start = datetime.now()
else: else:
raise UserError('托盘信息不存在') raise UserError('没有找到Rfid为【%s】的托盘信息!!!' % barcode)
# stock_move_line = self.env['stock.move.line'].search([('lot_name', '=', barcode)]) # stock_move_line = self.env['stock.move.line'].search([('lot_name', '=', barcode)])
# if stock_move_line.product_id.categ_type == '夹具': # if stock_move_line.product_id.categ_type == '夹具':
# workorder.write({ # workorder.write({

View File

@@ -616,7 +616,7 @@ class ResProductMo(models.Model):
item['model_width'] + model_type.embryo_tolerance) * ( item['model_width'] + model_type.embryo_tolerance) * (
item['model_height'] + model_type.embryo_tolerance), item['model_height'] + model_type.embryo_tolerance),
'product_model_type_id': model_type.id, 'product_model_type_id': model_type.id,
'model_processing_panel': 'R', # 'model_processing_panel': 'R',
'model_machining_precision': item['model_machining_precision'], 'model_machining_precision': item['model_machining_precision'],
'model_code': item['barcode'], 'model_code': item['barcode'],
'length': item['model_long'], 'length': item['model_long'],
@@ -634,6 +634,7 @@ class ResProductMo(models.Model):
'model_process_parameters_ids': [(6, 0, [])] if not item.get( 'model_process_parameters_ids': [(6, 0, [])] if not item.get(
'process_parameters_code') else self.get_process_parameters_id(item['process_parameters_code']), 'process_parameters_code') else self.get_process_parameters_id(item['process_parameters_code']),
'model_remark': item['remark'], 'model_remark': item['remark'],
'single_manufacturing': True,
'default_code': '%s-%s' % (order_number, i), 'default_code': '%s-%s' % (order_number, i),
'manual_quotation': item['manual_quotation'] or False, 'manual_quotation': item['manual_quotation'] or False,
'part_number': item.get('part_number') or '', 'part_number': item.get('part_number') or '',

View File

@@ -204,40 +204,18 @@ class StockRule(models.Model):
productions = self.env['mrp.production'].with_user(SUPERUSER_ID).sudo().with_company(company_id).create( productions = self.env['mrp.production'].with_user(SUPERUSER_ID).sudo().with_company(company_id).create(
productions_values) productions_values)
# self.env['stock.move'].sudo().create(productions._get_moves_raw_values()) self.env['stock.move'].sudo().create(productions._get_moves_raw_values())
self.env['stock.move'].sudo().create(productions._get_moves_finished_values())
productions.filtered(lambda p: (not p.orderpoint_id and p.move_raw_ids) or \
(
p.move_dest_ids.procure_method != 'make_to_order' and not
p.move_raw_ids and not p.workorder_ids)).action_confirm()
''' '''
创建工单 创建工单
''' '''
# productions._create_workorder() # productions._create_workorder()
# #
grouped_product_ids = {k: list(g) for k, g in groupby(productions, key=lambda x: x.product_id.id)} self.env['stock.move'].sudo().create(productions._get_moves_finished_values())
# 初始化一个字典来存储每个product_id对应的生产订单名称列表 productions.filtered(lambda p: (not p.orderpoint_id and p.move_raw_ids) or \
product_id_to_production_names = {} (
# 对于每个product_id获取其所有生产订单的名称 p.move_dest_ids.procure_method != 'make_to_order' and not
for product_id, productions in grouped_product_ids.items(): p.move_raw_ids and not p.workorder_ids)).action_confirm()
# 为同一个product_id创建一个生产订单名称列表
product_id_to_production_names[product_id] = [production.name for production in productions]
for production_item in productions:
if production_item.product_id.id in product_id_to_production_names:
# # 同一个产品多个制造订单对应一个编程单和模型库
# # 只调用一次fetchCNC并将所有生产订单的名称作为字符串传递
if not production_item.programming_no:
production_programming = self.env['mrp.production'].search(
[('product_id.id', '=', production_item.product_id.id),
('origin', '=', production_item.origin)],
limit=1, order='id asc')
if not production_programming.programming_no:
production_item.fetchCNC(
', '.join(product_id_to_production_names[production_item.product_id.id]))
else:
production_item.write({'programming_no': production_programming.programming_no,
'programming_state': '编程中'})
for production in productions: for production in productions:
''' '''
创建制造订单时生成序列号 创建制造订单时生成序列号
@@ -283,6 +261,29 @@ class StockRule(models.Model):
'product_id': production.product_id.id, 'product_id': production.product_id.id,
'state': 'draft', 'state': 'draft',
}) })
all_production = productions
grouped_product_ids = {k: list(g) for k, g in groupby(all_production, key=lambda x: x.product_id.id)}
# 初始化一个字典来存储每个product_id对应的生产订单名称列表
product_id_to_production_names = {}
# 对于每个product_id获取其所有生产订单的名称
for product_id, all_production in grouped_product_ids.items():
# 为同一个product_id创建一个生产订单名称列表
product_id_to_production_names[product_id] = [production.name for production in all_production]
for production_item in productions:
if production_item.product_id.id in product_id_to_production_names:
# # 同一个产品多个制造订单对应一个编程单和模型库
# # 只调用一次fetchCNC并将所有生产订单的名称作为字符串传递
if not production_item.programming_no:
production_programming = self.env['mrp.production'].search(
[('product_id.id', '=', production_item.product_id.id),
('origin', '=', production_item.origin)],
limit=1, order='id asc')
if not production_programming.programming_no:
production_item.fetchCNC(
', '.join(product_id_to_production_names[production_item.product_id.id]))
else:
production_item.write({'programming_no': production_programming.programming_no,
'programming_state': '编程中'})
return True return True
@@ -486,10 +487,10 @@ class StockPicking(models.Model):
('location_dest_id', '=', self.env['stock.location'].search( ('location_dest_id', '=', self.env['stock.location'].search(
[('barcode', 'ilike', 'VL-SPOC')]).id), [('barcode', 'ilike', 'VL-SPOC')]).id),
('origin', '=', self.origin)]) ('origin', '=', self.origin)])
if self.id == move_out.picking_id.id: # if self.id == move_out.picking_id.id:
if move_out.move_line_ids.workorder_id.state not in ['progress']: # if move_out.move_line_ids.workorder_id.state not in ['progress']:
raise UserError( # raise UserError(
_('该出库单里源单据内的单号为%s的工单还未开始,不能进行验证操作!' % move_out.move_line_ids.workorder_id.name)) # _('该出库单里源单据内的单号为%s的工单还未开始,不能进行验证操作!' % move_out.move_line_ids.workorder_id.name))
# 入库单验证 # 入库单验证
move_in = self.env['stock.move'].search( move_in = self.env['stock.move'].search(
[('location_dest_id', '=', self.env['stock.location'].search( [('location_dest_id', '=', self.env['stock.location'].search(
@@ -505,18 +506,17 @@ class StockPicking(models.Model):
res = super().button_validate() res = super().button_validate()
if res is True: if res is True:
if self.id == move_out.picking_id.id: if self.id == move_out.picking_id.id:
if move_out.move_line_ids.workorder_id.state == 'progress': # if move_out.move_line_ids.workorder_id.state == 'progress':
move_in = self.env['stock.move'].search( move_in = self.env['stock.move'].search(
[('location_dest_id', '=', self.env['stock.location'].search( [('location_dest_id', '=', self.env['stock.location'].search(
[('barcode', 'ilike', 'WH-PREPRODUCTION')]).id), [('barcode', 'ilike', 'WH-PREPRODUCTION')]).id),
('location_id', '=', self.env['stock.location'].search( ('location_id', '=', self.env['stock.location'].search(
[('barcode', 'ilike', 'VL-SPOC')]).id), [('barcode', 'ilike', 'VL-SPOC')]).id),
('origin', '=', self.origin)]) ('origin', '=', self.origin)])
# purchase = self.env['purchase.order'].search([('origin', '=', self.origin)]) production = self.env['mrp.production'].search([('name', '=', self.origin)])
if move_in: if move_in:
move_in.write({'state': 'assigned'}) move_in.write({'state': 'assigned'})
purchase = self.env['purchase.order'].search([('origin', '=', self.origin)]) self.env['stock.move.line'].create(move_in.get_move_line(production, None))
self.env['stock.move.line'].create(move_in.get_move_line(purchase, None))
return res return res
@@ -598,7 +598,7 @@ class ReStockMove(models.Model):
'state': 'confirmed', 'state': 'confirmed',
} }
def get_move_line(self, purchase, sorted_workorders): def get_move_line(self, production_id, sorted_workorders):
return { return {
'move_id': self.id, 'move_id': self.id,
'product_id': self.product_id.id, 'product_id': self.product_id.id,
@@ -607,7 +607,7 @@ class ReStockMove(models.Model):
'location_dest_id': self.picking_id.location_dest_id.id, 'location_dest_id': self.picking_id.location_dest_id.id,
'picking_id': self.picking_id.id, 'picking_id': self.picking_id.id,
'reserved_uom_qty': 1.0, 'reserved_uom_qty': 1.0,
'lot_id': purchase.picking_ids.move_line_ids.lot_id.id, 'lot_id': production_id.move_line_raw_ids.lot_id.id,
'company_id': self.company_id.id, 'company_id': self.company_id.id,
# 'workorder_id': '' if not sorted_workorders else sorted_workorders.id, # 'workorder_id': '' if not sorted_workorders else sorted_workorders.id,
# 'production_id': '' if not sorted_workorders else sorted_workorders.production_id.id, # 'production_id': '' if not sorted_workorders else sorted_workorders.production_id.id,

View File

@@ -65,10 +65,9 @@
<!-- <attribute name="statusbar_visible">draft,confirmed,progress,pending_processing,completed,done --> <!-- <attribute name="statusbar_visible">draft,confirmed,progress,pending_processing,completed,done -->
<!-- </attribute> --> <!-- </attribute> -->
<attribute name="statusbar_visible"> <attribute name="statusbar_visible">
progress,pending_cam,pending_processing,pending_era_cam,completed,done confirmed,pending_cam,progress,done
</attribute> </attribute>
</xpath> </xpath>
<xpath expr="//sheet//group//group[2]//label" position="before"> <xpath expr="//sheet//group//group[2]//label" position="before">
<!-- <field name="process_state"/> --> <!-- <field name="process_state"/> -->
<field name="state"/> <field name="state"/>
@@ -76,18 +75,19 @@
</xpath> </xpath>
<xpath expr="//sheet//group//group//div[3]" position="after"> <xpath expr="//sheet//group//group//div[3]" position="after">
<field name="manual_quotation" readonly="1"/>
<field name="programming_no" readonly="1"/> <field name="programming_no" readonly="1"/>
<field name="programming_state" readonly="1" decoration-success="programming_state == '已编程'"
decoration-warning="programming_state =='编程中'"/>
<field name="work_state" invisible="1"/> <field name="work_state" invisible="1"/>
<field name="schedule_state" invisible='1'/> <field name="schedule_state" invisible='1'/>
<field name="manual_quotation" readonly="1"/>
<field name="programming_state" readonly="1"/>
</xpath> </xpath>
<xpath expr="//field[@name='user_id']" position="before"> <xpath expr="//field[@name='user_id']" position="before">
<field name="plan_start_processing_time" readonly="1"/> <field name="plan_start_processing_time" readonly="1"/>
</xpath> </xpath>
<xpath expr="//field[@name='user_id']" position="after"> <xpath expr="//field[@name='user_id']" position="after">
<field name="production_line_id" readonly="1"/> <field name="production_line_id" readonly="1"/>
<field name="production_line_state" readonly="1"/> <!-- <field name="production_line_state" readonly="1"/>-->
<field name="part_number" string="成品的零件图号"/> <field name="part_number" string="成品的零件图号"/>
<field name="part_drawing"/> <field name="part_drawing"/>
</xpath> </xpath>
@@ -255,7 +255,9 @@
</xpath> </xpath>
<xpath expr="//sheet//notebook//page[@name='operations']" position="attributes"> <xpath expr="//sheet//notebook//page[@name='operations']" position="attributes">
<attribute name="attrs">{'invisible': [('schedule_state', '=', '未排')]}</attribute> <attribute name="attrs">{'invisible': ['|',('schedule_state', '=', '未排'),('workorder_ids', '=',
[])]}
</attribute>
</xpath> </xpath>
</field> </field>
</record> </record>
@@ -280,9 +282,11 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//tree//button[@name='button_start']" position="replace"> <xpath expr="//tree//button[@name='button_start']" position="replace">
<field name="routing_type" invisible="True"/> <field name="routing_type" invisible="True"/>
<button name="button_start" type="object" string="开始" class="btn-success" <button name="button_start" type="object" string="开始" class="btn-success" confirm="是否确认开始?"
attrs="{'invisible': ['|', '|', '|','|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), ('is_user_working', '!=', False), ('routing_type', '=', 'CNC加工')]}" attrs="{'invisible': ['|', '|', '|','|', ('production_state','in', ('draft', 'done', 'cancel')),
groups="sf_base.group_sf_mrp_user" confirm="是否确认开始?"/> ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), ('is_user_working', '!=',
False), ('routing_type', '=', 'CNC加工')]}"
groups="sf_base.group_sf_mrp_user"/>
</xpath> </xpath>
<xpath expr="//tree//button[@name='button_pending']" position="replace"> <xpath expr="//tree//button[@name='button_pending']" position="replace">
<button name="button_pending" type="object" string="Pause" class="btn-warning" <button name="button_pending" type="object" string="Pause" class="btn-warning"

View File

@@ -91,7 +91,7 @@
<!-- <field name="target">fullscreen</field>--> <!-- <field name="target">fullscreen</field>-->
<field name="target">current</field> <field name="target">current</field>
<field name="domain">[('state', '!=', 'cancel'),('schedule_state', '=', '已排')]</field> <field name="domain">[('state', '!=', 'cancel'),('schedule_state', '=', '已排')]</field>
<field name="context">{'search_default_workcenter_id': active_id}</field> <field name="context">{'search_default_product': 1, 'search_default_workcenter_id': active_id}</field>
<field name="help" type="html"> <field name="help" type="html">
<p class="o_view_nocontent_workorder"> <p class="o_view_nocontent_workorder">
没有工单要做! 没有工单要做!
@@ -124,7 +124,7 @@
<field name='user_permissions' invisible="1"/> <field name='user_permissions' invisible="1"/>
<field name='name' invisible="1"/> <field name='name' invisible="1"/>
<field name='is_delivery' invisible="1"/> <field name='is_delivery' invisible="1"/>
<field name='is_send_program_again' invisible="1"/> <!-- <field name='is_send_program_again' invisible="1"/>-->
<!-- 工单form页面的开始停工按钮等 --> <!-- 工单form页面的开始停工按钮等 -->
<!-- <button name="button_start" type="object" string="开始" class="btn-success" --> <!-- <button name="button_start" type="object" string="开始" class="btn-success" -->
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'not in', ('pending_processing', 'pending_cam', 'pending_era_cam')), ('state','!=','ready'), ('routing_type', 'not in', ('装夹预调', 'CNC加工', '解除装夹'))]}" --> <!-- attrs="{'invisible': ['|', '|', ('production_state', 'not in', ('pending_processing', 'pending_cam', 'pending_era_cam')), ('state','!=','ready'), ('routing_type', 'not in', ('装夹预调', 'CNC加工', '解除装夹'))]}" -->
@@ -136,7 +136,7 @@
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'not in', ('pending_processing', 'pending_cam', 'pending_era_cam')), ('state','!=','progress'), ('routing_type', 'not in', ('装夹预调', 'CNC加工', '解除装夹'))]}" --> <!-- attrs="{'invisible': ['|', '|', ('production_state', 'not in', ('pending_processing', 'pending_cam', 'pending_era_cam')), ('state','!=','progress'), ('routing_type', 'not in', ('装夹预调', 'CNC加工', '解除装夹'))]}" -->
<!-- groups="sf_base.group_sf_mrp_user" confirm="是否确认完工"/> --> <!-- groups="sf_base.group_sf_mrp_user" confirm="是否确认完工"/> -->
<button name="button_start" type="object" string="开始" class="btn-success" <button name="button_start" type="object" string="开始" class="btn-success" confirm="是否确认开始"
attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), ('is_user_working', '!=', False)]}"/> attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), ('is_user_working', '!=', False)]}"/>
<button name="button_pending" type="object" string="暂停" class="btn-warning" <button name="button_pending" type="object" string="暂停" class="btn-warning"
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/> attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
@@ -160,11 +160,11 @@
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked'),('state','=','done')]}"/> --> <!-- attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked'),('state','=','done')]}"/> -->
<button name="button_workpiece_delivery" type="object" string="工件配送" class="btn-primary" <button name="button_workpiece_delivery" type="object" string="工件配送" class="btn-primary"
attrs="{'invisible': ['|','|',('routing_type','!=','装夹预调'),('is_delivery','=',True),('state','!=','done')]}"/> attrs="{'invisible': ['|','|',('routing_type','!=','装夹预调'),('is_delivery','=',True),('state','!=','done')]}"/>
<button name="button_send_program_again" type="object" string="重新下发NC程序" class="btn-primary" <!-- <button name="button_send_program_again" type="object" string="重新下发NC程序" class="btn-primary"-->
confirm="是否确认重新下发NC程序" <!-- confirm="是否确认重新下发NC程序"-->
groups="sf_base.group_sf_order_user,sf_base.group_sf_equipment_user" <!-- groups="sf_base.group_sf_order_user,sf_base.group_sf_equipment_user"-->
attrs="{'invisible': ['|', '|', '|',('routing_type','!=','装夹预调'),('state','in',['done', 'cancel', <!-- attrs="{'invisible': ['|', '|', '|',('routing_type','!=','装夹预调'),('state','in',['done', 'cancel',-->
'progress']),('cnc_worksheet','=',False),('is_send_program_again','=',True)]}"/> <!-- 'progress']),('cnc_worksheet','=',False),('is_send_program_again','=',True)]}"/>-->
</xpath> </xpath>
<xpath expr="//page[1]" position="before"> <xpath expr="//page[1]" position="before">
<page string="开料要求" attrs='{"invisible": [("routing_type","!=","切割")]}'> <page string="开料要求" attrs='{"invisible": [("routing_type","!=","切割")]}'>
@@ -183,8 +183,11 @@
</page> </page>
</xpath> </xpath>
<xpath expr="//label[1]" position="before"> <xpath expr="//label[1]" position="before">
<field name='routing_type'/> <field name='routing_type' readonly="1"/>
<field name='process_state' attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/> <field name='process_state' attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
<field name="rfid_code" force_save="1" readonly="1" cache="True"
attrs="{'invisible': [('rfid_code_old', '!=', False)]}"/>
<field name="rfid_code_old" readonly="1" attrs="{'invisible': [('rfid_code_old', '=', False)]}"/>
</xpath> </xpath>
<xpath expr="//label[1]" position="attributes"> <xpath expr="//label[1]" position="attributes">
<attribute name="string">计划加工时间</attribute> <attribute name="string">计划加工时间</attribute>
@@ -227,9 +230,6 @@
<!-- attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/> --> <!-- attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/> -->
<!-- <field name="functional_fixture_type_id" --> <!-- <field name="functional_fixture_type_id" -->
<!-- attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/> --> <!-- attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/> -->
<field name="rfid_code" force_save="1" readonly="1" cache="True"
attrs="{'invisible': [('rfid_code_old', '!=', False)]}"/>
<field name="rfid_code_old" readonly="1" attrs="{'invisible': [('rfid_code_old', '=', False)]}"/>
</group> </group>
<!-- <group>--> <!-- <group>-->
<!-- <div>--> <!-- <div>-->
@@ -242,23 +242,6 @@
<!-- <field name="processing_panel" readonly="1" attrs="{'invisible': [('routing_type', 'in', ('获取CNC加工程序','装夹','解除装夹',--> <!-- <field name="processing_panel" readonly="1" attrs="{'invisible': [('routing_type', 'in', ('获取CNC加工程序','装夹','解除装夹',-->
<!-- '前置三元定位检测','后置三元质量检测','解除装夹'))]}"/>--> <!-- '前置三元定位检测','后置三元质量检测','解除装夹'))]}"/>-->
</field> </field>
<xpath expr="//page[1]" position="before">
<page string="获取CNC加工程序" attrs='{"invisible": [("routing_type","!=","获取CNC加工程序")]}'>
<group>
<field name="programming_no" readonly="1"
attrs='{"invisible": [("programming_no","=",False)]}'/>
<field name="programming_state" readonly="1"
attrs='{"invisible": [("programming_no","=",False)]}'/>
</group>
<!-- <group>-->
<!-- <div class="col-12 col-lg-6 o_setting_box" style="white-space: nowrap">-->
<!-- <button type="object" class="oe_highlight" name="fetchCNC" string="获取CNC程序代码"-->
<!-- />-->
<!-- </div>-->
<!-- </group>-->
</page>
</xpath>
<!-- <page string="Components" name="components">--> <!-- <page string="Components" name="components">-->
<xpath expr="//page[1]" position="before"> <xpath expr="//page[1]" position="before">
<!-- <page string="装夹托盘" attrs='{"invisible": [("routing_type","!=","装夹")]}'>--> <!-- <page string="装夹托盘" attrs='{"invisible": [("routing_type","!=","装夹")]}'>-->
@@ -483,7 +466,10 @@
<field name="production_line_id" readonly="1"/> <field name="production_line_id" readonly="1"/>
<field name="task_delivery_time" readonly="1"/> <field name="task_delivery_time" readonly="1"/>
<field name="task_completion_time" readonly="1"/> <field name="task_completion_time" readonly="1"/>
<field name="status" readonly="1"/> <field name="status" readonly="1" widget="badge"
decoration-success="status == '已配送'"
decoration-warning="status == '待下发'"
decoration-danger="status == '待配送'"/>
</tree> </tree>
</field> </field>
</page> </page>
@@ -575,9 +561,6 @@
</div> </div>
</xpath> </xpath>
<xpath expr="//form//sheet//group//group//div[3]" position="after"> <xpath expr="//form//sheet//group//group//div[3]" position="after">
<field name="is_ok" attrs='{"invisible": [("routing_type","=","装夹预调")]}'/>
<field name="processing_user_id" attrs='{"invisible": [("routing_type","=","装夹预调")]}'/>
<field name="inspection_user_id" attrs='{"invisible": [("routing_type","=","装夹预调")]}'/>
<field name="save_name" widget="CopyClipboardChar" <field name="save_name" widget="CopyClipboardChar"
attrs="{'invisible':[('routing_type','!=','装夹预调')]}"/> attrs="{'invisible':[('routing_type','!=','装夹预调')]}"/>
<label for="material_length" string="物料尺寸"/> <label for="material_length" string="物料尺寸"/>
@@ -592,9 +575,6 @@
<field name="material_height" class="o_address_zip"/> <field name="material_height" class="o_address_zip"/>
</div> </div>
<field name="part_number" string="成品的零件图号"/> <field name="part_number" string="成品的零件图号"/>
<field name="rfid_code" force_save="1" readonly="1" cache="True"
attrs="{'invisible': [('rfid_code_old', '!=', False)]}"/>
<field name="rfid_code_old" readonly="1" attrs="{'invisible': [('rfid_code_old', '=', False)]}"/>
</xpath> </xpath>
</field> </field>
</record> </record>
@@ -729,7 +709,7 @@
</search> </search>
</field> </field>
</record> </record>
<record id="sf_workpiece_delivery_act" model="ir.actions.act_window"> <record id="sf_workpiece_delivery_act" model="ir.actions.act_window">
<field name="name">工件配送</field> <field name="name">工件配送</field>
<field name="res_model">sf.workpiece.delivery</field> <field name="res_model">sf.workpiece.delivery</field>

View File

@@ -28,9 +28,10 @@ class Sf_Mrs_Connect(http.Controller):
request.env.ref("base.user_admin")).search( request.env.ref("base.user_admin")).search(
[('programming_no', '=', ret['programming_no'])]) [('programming_no', '=', ret['programming_no'])])
if productions: if productions:
# 拉取所有加工面的程序文件 # # 拉取所有加工面的程序文件
for r in ret['processing_panel'].split(','): for r in ret['processing_panel'].split(','):
program_path_tmp_r = os.path.join('/tmp', ret['folder_name'], 'return', r) program_path_tmp_r = os.path.join('/tmp', ret['folder_name'], 'return', r)
if os.path.exists(program_path_tmp_r):
files_r = os.listdir(program_path_tmp_r) files_r = os.listdir(program_path_tmp_r)
if files_r: if files_r:
for file_name in files_r: for file_name in files_r:
@@ -39,26 +40,54 @@ class Sf_Mrs_Connect(http.Controller):
download_state = request.env['sf.cnc.processing'].with_user( download_state = request.env['sf.cnc.processing'].with_user(
request.env.ref("base.user_admin")).download_file_tmp( request.env.ref("base.user_admin")).download_file_tmp(
ret['folder_name'], r) ret['folder_name'], r)
if download_state == 0: if download_state is False:
res['status'] = -2 res['status'] = -2
res['message'] = '制造订单号为%s的CNC程序文件从FTP拉取失败' % (cnc_production.name) res['message'] = '编程单号为%s的CNC程序文件从FTP拉取失败' % (ret['programming_no'])
return json.JSONEncoder().encode(res) return json.JSONEncoder().encode(res)
for production in productions: for production in productions:
if not production.workorder_ids: if not production.workorder_ids:
production.product_id.model_processing_panel = ret['processing_panel'] production.product_id.model_processing_panel = ret['processing_panel']
production._create_workorder(ret) production._create_workorder(ret)
else: # else:
# for panel in ret['processing_panel'].split(','):
# # 查询状态为进行中且工序类型为CNC加工的工单
# cnc_workorder = production.workorder_ids.filtered(
# lambda ac: ac.routing_type == 'CNC加工' and ac.state not in ['progress', 'done',
# 'cancel'] and ac.processing_panel == panel)
# if cnc_workorder:
# if cnc_workorder.cnc_ids:
# cnc_workorder.cmm_ids.sudo().unlink()
# cnc_workorder.cnc_ids.sudo().unlink()
# request.env['sf.cam.work.order.program.knife.plan'].sudo().unlink_cam_plan(
# production)
# # program_path_tmp_panel = os.path.join('C://Users//43484//Desktop//fsdownload//test',
# # panel)
# program_path_tmp_panel = os.path.join('/tmp', ret['folder_name'], 'return', panel)
# logging.info('program_path_tmp_panel:%s' % program_path_tmp_panel)
# files_panel = os.listdir(program_path_tmp_panel)
# if files_panel:
# for file in files_panel:
# file_extension = os.path.splitext(file)[1]
# logging.info('file_extension:%s' % file_extension)
# if file_extension.lower() == '.pdf':
# panel_file_path = os.path.join(program_path_tmp_panel, file)
# logging.info('panel_file_path:%s' % panel_file_path)
# cnc_workorder.write(
# {'cnc_ids': cnc_workorder.cnc_ids.sudo()._json_cnc_processing(panel, ret),
# 'cmm_ids': cnc_workorder.cmm_ids.sudo()._json_cmm_program(panel, ret),
# 'cnc_worksheet': base64.b64encode(open(panel_file_path, 'rb').read())})
# pre_workorder = production.workorder_ids.filtered(
# lambda ap: ap.routing_type == '装夹预调' and ap.state not in ['done',
# 'cancel'] and ap.processing_panel == panel)
# if pre_workorder:
# pre_workorder.write(
# {'processing_drawing': base64.b64encode(open(panel_file_path, 'rb').read())})
for panel in ret['processing_panel'].split(','): for panel in ret['processing_panel'].split(','):
# 查询状态为进行中且工序类型为CNC加工的工单 # 查询状态为进行中且工序类型为CNC加工的工单
cnc_workorder = production.workorder_ids.filtered( cnc_workorder = productions.workorder_ids.filtered(
lambda ac: ac.routing_type == 'CNC加工' and ac.state not in ['progress', 'done', lambda ac: ac.routing_type == 'CNC加工' and ac.state not in ['progress', 'done',
'cancel'] and ac.processing_panel == panel) 'cancel'] and ac.processing_panel == panel)
if cnc_workorder: if cnc_workorder:
if cnc_workorder.cnc_ids:
cnc_workorder.cmm_ids.sudo().unlink()
cnc_workorder.cnc_ids.sudo().unlink()
request.env['sf.cam.work.order.program.knife.plan'].sudo().unlink_cam_plan(
production)
# program_path_tmp_panel = os.path.join('C://Users//43484//Desktop//fsdownload//test', # program_path_tmp_panel = os.path.join('C://Users//43484//Desktop//fsdownload//test',
# panel) # panel)
program_path_tmp_panel = os.path.join('/tmp', ret['folder_name'], 'return', panel) program_path_tmp_panel = os.path.join('/tmp', ret['folder_name'], 'return', panel)
@@ -71,18 +100,13 @@ class Sf_Mrs_Connect(http.Controller):
if file_extension.lower() == '.pdf': if file_extension.lower() == '.pdf':
panel_file_path = os.path.join(program_path_tmp_panel, file) panel_file_path = os.path.join(program_path_tmp_panel, file)
logging.info('panel_file_path:%s' % panel_file_path) logging.info('panel_file_path:%s' % panel_file_path)
cnc_workorder.write( cnc_workorder.write({'cnc_worksheet': base64.b64encode(open(panel_file_path, 'rb').read())})
{'is_send_program_again': False, pre_workorder = productions.workorder_ids.filtered(
'cnc_ids': cnc_workorder.cnc_ids.sudo()._json_cnc_processing(panel, ret),
'cmm_ids': cnc_workorder.cmm_ids.sudo()._json_cmm_program(panel, ret),
'cnc_worksheet': base64.b64encode(open(panel_file_path, 'rb').read())})
pre_workorder = production.workorder_ids.filtered(
lambda ap: ap.routing_type == '装夹预调' and ap.state not in ['done', lambda ap: ap.routing_type == '装夹预调' and ap.state not in ['done',
'cancel'] and ap.processing_panel == panel) 'cancel'] and ap.processing_panel == panel)
if pre_workorder: if pre_workorder:
pre_workorder.write( pre_workorder.write(
{'is_send_program_again': False, {'processing_drawing': base64.b64encode(open(panel_file_path, 'rb').read())})
'processing_drawing': base64.b64encode(open(panel_file_path, 'rb').read())})
productions.write({'programming_state': '已编程', 'work_state': '已编程'}) productions.write({'programming_state': '已编程', 'work_state': '已编程'})
cnc_program_ids = [item.id for item in productions] cnc_program_ids = [item.id for item in productions]
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search( workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(

View File

@@ -21,6 +21,23 @@ class FtpController():
except Exception: except Exception:
logging.info("ftp连接失败") logging.info("ftp连接失败")
def file_exists_1(self, path):
# 检查文件是否存在于FTP服务器上
try:
logging.info("path:%s" % path)
logging.info("dirname:%s" % os.path.dirname(path))
directories = os.path.normpath(path).split(os.path.sep)
# 切换到上级目录
for directory in directories:
if directory:
# 检查目录是否存在
if (directory in ['NC']) or (directory not in ['home', 'ftp', 'ftp_root', 'NC']):
self.ftp.cwd(directory)
return os.path.basename(path)
except Exception as e:
logging.error(f"Error checking file: {e}")
return False
def file_exists(self, path): def file_exists(self, path):
# 检查文件是否存在于FTP服务器上 # 检查文件是否存在于FTP服务器上
try: try:
@@ -32,8 +49,25 @@ class FtpController():
logging.error(f"Error checking file: {e}") logging.error(f"Error checking file: {e}")
return False return False
# 下载目录下的pdf文件(程序单)
def download_program_file(self, target_dir, serverdir):
if not os.path.exists(serverdir):
os.makedirs(serverdir)
try:
logging.info('FTP目录:%s' % target_dir)
logging.info("进入FTP目录 ")
remotenames = self.ftp.nlst()
logging.info('FTP目录文件:%s' % remotenames)
for file in remotenames:
server = os.path.join(serverdir, file)
if file.find(".pdf") != -1:
self.download_file(server, file)
return True
except:
return False
finally:
self.ftp.quit()
logging.info("ftp已关闭")
# # 检测字符串的编码 # # 检测字符串的编码
# def detect_encoding(self, s): # def detect_encoding(self, s):

View File

@@ -37,7 +37,7 @@ class sf_production_plan(models.Model):
_order = 'state_order asc, write_date desc' _order = 'state_order asc, write_date desc'
name = fields.Char(string='制造订单') name = fields.Char(string='制造订单')
active = fields.Boolean(string='已归档', default=True) # active = fields.Boolean(string='已归档', default=True)
# selected = fields.Boolean(default=False) # selected = fields.Boolean(default=False)
# order_number = fields.Char(string='订单号') # order_number = fields.Char(string='订单号')
order_deadline = fields.Datetime(string='订单交期') order_deadline = fields.Datetime(string='订单交期')
@@ -101,17 +101,17 @@ class sf_production_plan(models.Model):
# return super(sf_production_plan, self.with_context(active_test=False))._search( # return super(sf_production_plan, self.with_context(active_test=False))._search(
# args, offset, limit, order, count, access_rights_uid) # args, offset, limit, order, count, access_rights_uid)
def archive(self): # def archive(self):
""" # """
归档 # 归档
""" # """
self.write({'active': False}) # self.write({'active': False})
#
def unarchive(self): # def unarchive(self):
""" # """
取消归档 # 取消归档
""" # """
self.write({'active': True}) # self.write({'active': True})
@api.model @api.model
def get_import_templates(self): def get_import_templates(self):

View File

@@ -63,7 +63,7 @@
</div> </div>
<group> <group>
<group string="基本信息"> <group string="基本信息">
<field name="active" invisible="1"/> <!-- <field name="active" invisible="1"/> -->
<field name="production_id" widget="many2one_button"/> <field name="production_id" widget="many2one_button"/>
<field name="product_id"/> <field name="product_id"/>
<field name="origin"/> <field name="origin"/>
@@ -217,11 +217,11 @@
</li> </li>
<li> <li>
<strong>订单交期:</strong> <strong>订单交期:</strong>
<t t-out="order_deadline"/> <t t-out="order_deadline.format('L LTS')"/>
</li> </li>
<li> <li>
<strong>产品名称:</strong> <strong>产品名称:</strong>
<t t-out="product_id"/> <t t-out="product_id[1]"/>
</li> </li>
<li> <li>
<strong>数量:</strong> <strong>数量:</strong>
@@ -268,7 +268,8 @@
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
<field name="res_model">sf.production.plan</field> <field name="res_model">sf.production.plan</field>
<field name="view_mode">tree,gantt,form</field> <field name="view_mode">tree,gantt,form</field>
<field name="context">{'search_default_group_by_state': 1, 'search_default_draft': 1, 'display_complete': True}</field> <!-- <field name="context">{'search_default_group_by_state': 1, 'search_default_draft': 1, 'display_complete': True}</field> -->
<field name="context">{'search_default_draft': 1, 'display_complete': True}</field>
</record> </record>
<menuitem <menuitem

View File

@@ -114488,10 +114488,21 @@ msgid "径跳精度(mm)"
msgstr "" msgstr ""
#. module: sf_manufacturing #. module: sf_manufacturing
#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__progress #: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__draft
msgid "待排程" msgid "待排程"
msgstr "待排程" msgstr "待排程"
#. module: sf_manufacturing
#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__process_state__待加工
#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__confirmed
msgid "待加工"
msgstr "待加工"
#. module: sf_manufacturing
#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__progress
msgid "待排程"
msgstr "加工中"
#. module: sf_base #. module: sf_base
#: model:ir.model.fields,field_description:sf_base.field_sf_cutting_tool_model__jump_accuracy #: model:ir.model.fields,field_description:sf_base.field_sf_cutting_tool_model__jump_accuracy
msgid "径跳精度(um)" msgid "径跳精度(um)"

View File

@@ -171,6 +171,11 @@ class ProductTemplate(models.Model):
class RePurchaseOrder(models.Model): class RePurchaseOrder(models.Model):
_inherit = 'purchase.order' _inherit = 'purchase.order'
mrp_production_count = fields.Integer(
"Count of MO Source",
compute='_compute_mrp_production_count',
groups='mrp.group_mrp_user,sf_base.group_purchase,sf_base.group_purchase_director')
remark = fields.Text('备注') remark = fields.Text('备注')
user_id = fields.Many2one( user_id = fields.Many2one(
'res.users', string='买家', index=True, tracking=True, 'res.users', string='买家', index=True, tracking=True,

View File

@@ -54,7 +54,7 @@
<record model="ir.rule" id="sale_order_rule_my"> <record model="ir.rule" id="sale_order_rule_my">
<field name="name">销售经理查看自己的订单</field> <field name="name">销售经理查看自己的订单</field>
<field name="model_id" ref="model_sale_order"/> <field name="model_id" ref="model_sale_order"/>
<field name="domain_force">['|',('user_id','=',user.id),('create_uid', '=',user.id)]</field> <field name="domain_force">['|','|',('user_id','=',user.id),('user_id', '=', False),('create_uid', '=',user.id)]</field>
<field name="groups" eval="[(4, ref('sf_base.group_sale_salemanager'))]"/> <field name="groups" eval="[(4, ref('sf_base.group_sale_salemanager'))]"/>
<field name="perm_read" eval="1"/> <field name="perm_read" eval="1"/>
<field name="perm_write" eval="1"/> <field name="perm_write" eval="1"/>
@@ -74,7 +74,7 @@
<record model="ir.rule" id="inventory_purchase_order_rule_my"> <record model="ir.rule" id="inventory_purchase_order_rule_my">
<field name="name">采购岗查看自己的订单</field> <field name="name">采购岗查看自己的订单</field>
<field name="model_id" ref="purchase.model_purchase_order"/> <field name="model_id" ref="purchase.model_purchase_order"/>
<field name="domain_force">['|',('user_id','=',user.id),('create_uid', '=',user.id)]</field> <field name="domain_force">['|','|',('user_id','=',user.id),('user_id', '=', False),('create_uid', '=',user.id)]</field>
<field name="groups" eval="[(4, ref('sf_base.group_purchase'))]"/> <field name="groups" eval="[(4, ref('sf_base.group_purchase'))]"/>
<field name="perm_read" eval="1"/> <field name="perm_read" eval="1"/>
<field name="perm_write" eval="0"/> <field name="perm_write" eval="0"/>

View File

@@ -79,6 +79,13 @@
<xpath expr="//form/header/button[@name='button_done']" position="attributes"> <xpath expr="//form/header/button[@name='button_done']" position="attributes">
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute> <attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
</xpath> </xpath>
<xpath expr="//form/sheet/div[@name='button_box']/button[@name='action_view_mrp_productions']"
position="attributes">
<attribute name="groups">mrp.group_mrp_user,sf_base.group_purchase,sf_base.group_purchase_director
</attribute>
</xpath>
<xpath expr="//field[@name='order_line']" position="attributes"> <xpath expr="//field[@name='order_line']" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['purchase'])]} <attribute name="attrs">{'readonly': [('state', 'in', ['purchase'])]}
</attribute> </attribute>

View File

@@ -944,13 +944,11 @@ class FunctionalToolDismantle(models.Model):
functional_tool_assembly = self.functional_tool_id.functional_tool_name_id functional_tool_assembly = self.functional_tool_id.functional_tool_name_id
if self.scrap_boolean: if self.scrap_boolean:
# 刀柄报废 入库到Scrap # 刀柄报废 入库到Scrap
lot.create_stock_quant(location, location_dest_scrap_ids[-1], functional_tool_assembly.id, code, lot.create_stock_quant(location, location_dest_scrap_ids[-1], False, code, False, False)
functional_tool_assembly, functional_tool_assembly.tool_groups_id)
lot.tool_material_status = '报废' lot.tool_material_status = '报废'
else: else:
# 刀柄不报废 入库到刀具房 # 刀柄不报废 入库到刀具房
lot.create_stock_quant(location, location_dest, functional_tool_assembly.id, code, lot.create_stock_quant(location, location_dest, False, code, False, False)
functional_tool_assembly, functional_tool_assembly.tool_groups_id)
lot.tool_material_status = '可用' lot.tool_material_status = '可用'
# ==============功能刀具[报废]拆解================ # ==============功能刀具[报废]拆解================

View File

@@ -3,6 +3,7 @@ import requests
import logging import logging
from odoo import models, api, fields from odoo import models, api, fields
from odoo.exceptions import ValidationError from odoo.exceptions import ValidationError
from datetime import datetime, timedelta
from odoo.addons.sf_base.commons.common import Common from odoo.addons.sf_base.commons.common import Common
@@ -101,7 +102,7 @@ class SfMaintenanceEquipment(models.Model):
tool_install_time = {'Nomal': '正常', 'Warning': '报警'} tool_install_time = {'Nomal': '正常', 'Warning': '报警'}
equipment_tool_id.write({ equipment_tool_id.write({
'functional_tool_name_id': functional_tool_id.id, 'functional_tool_name_id': functional_tool_id.id,
'tool_install_time': time 'tool_install_time': time - timedelta(hours=8)
}) })
if functional_tool_id.current_location != '机内刀库': if functional_tool_id.current_location != '机内刀库':
# 对功能刀具进行移动到生产线 # 对功能刀具进行移动到生产线

View File

@@ -25,7 +25,8 @@ class ToolMaterial(models.Model):
have_been_used_num = fields.Integer('在用数量', compute='_compute_number', store=True) have_been_used_num = fields.Integer('在用数量', compute='_compute_number', store=True)
scrap_num = fields.Integer('报废数量', compute='_compute_number', store=True) scrap_num = fields.Integer('报废数量', compute='_compute_number', store=True)
barcode_ids = fields.One2many('stock.lot', 'tool_material_search_id', string='序列号', readonly=True) barcode_ids = fields.One2many('stock.lot', 'tool_material_search_id', string='序列号', readonly=True,
domain=[('tool_material_status', '!=', '未入库')])
@api.depends('product_id.stock_quant_ids.quantity') @api.depends('product_id.stock_quant_ids.quantity')
def _compute_number(self): def _compute_number(self):
@@ -46,8 +47,6 @@ class ToolMaterial(models.Model):
record.scrap_num = scrap_num record.scrap_num = scrap_num
record.number = usable_num + have_been_used_num + scrap_num record.number = usable_num + have_been_used_num + scrap_num
@api.model @api.model
def _read_group_cutting_tool_material_id(self, categories, domain, order): def _read_group_cutting_tool_material_id(self, categories, domain, order):
cutting_tool_material_id = categories._search([], order=order, access_rights_uid=SUPERUSER_ID) cutting_tool_material_id = categories._search([], order=order, access_rights_uid=SUPERUSER_ID)

View File

@@ -63,6 +63,7 @@
<field name="name"/> <field name="name"/>
<field name="rfid"/> <field name="rfid"/>
<field name="product_qty"/> <field name="product_qty"/>
<field name="create_date" string="入库日期"/>
<field name="tool_material_status"/> <field name="tool_material_status"/>
<!-- <button name="enroll_tool_material_stock" string="序列号注册" type="object" class="btn-primary"/>--> <!-- <button name="enroll_tool_material_stock" string="序列号注册" type="object" class="btn-primary"/>-->
</tree> </tree>

View File

@@ -557,8 +557,10 @@ class SfStockMoveLine(models.Model):
_name = 'stock.move.line' _name = 'stock.move.line'
_inherit = ['stock.move.line', 'printing.utils'] _inherit = ['stock.move.line', 'printing.utils']
stock_lot_name = fields.Char('序列号名称', related='lot_id.name')
current_location_id = fields.Many2one( current_location_id = fields.Many2one(
'sf.shelf.location', string='当前货位', compute='_compute_current_location_id', store=True) 'sf.shelf.location', string='当前货位', compute='_compute_current_location_id', store=True, readonly=False,
domain="[('product_id', '=', product_id),'|',('product_sn_id.name', '=', stock_lot_name),('product_sn_ids.lot_id.name','=',stock_lot_name)]")
# location_dest_id = fields.Many2one('stock.location', string='目标库位') # location_dest_id = fields.Many2one('stock.location', string='目标库位')
location_dest_id_product_type = fields.Many2many(related='location_dest_id.product_type') location_dest_id_product_type = fields.Many2many(related='location_dest_id.product_type')
location_dest_id_value = fields.Integer(compute='_compute_location_dest_id_value', store=True) location_dest_id_value = fields.Integer(compute='_compute_location_dest_id_value', store=True)
@@ -622,6 +624,11 @@ class SfStockMoveLine(models.Model):
if not qr_code_data: if not qr_code_data:
raise UserError("没有找到二维码数据。") raise UserError("没有找到二维码数据。")
lot_name = self.lot_name lot_name = self.lot_name
# 增加"当为坯料时,只打印序列号的前面部分"
if self.lot_name: # 确保 lot_name 存在
if self.product_id.categ_id.name == '坯料':
lot_name = lot_name.split('[', 1)[0]
# host = "192.168.50.110" # 可以根据实际情况修改 # host = "192.168.50.110" # 可以根据实际情况修改
# port = 9100 # 可以根据实际情况修改 # port = 9100 # 可以根据实际情况修改
@@ -851,7 +858,9 @@ class SfStockMoveLine(models.Model):
def compute_destination_location_id(self): def compute_destination_location_id(self):
for record in self: for record in self:
obj = self.env['sf.shelf.location'].search([('name', '=', obj = self.env['sf.shelf.location'].search([('name', '=',
self.destination_location_id.name)]) record.destination_location_id.name)])
if obj and obj.product_id and obj.product_id != record.product_id:
raise ValidationError('目标货位【%s】已被【%s】产品占用!' % (obj.code, obj.product_id))
if record.lot_id: if record.lot_id:
if record.product_id.tracking == 'serial': if record.product_id.tracking == 'serial':
shelf_location_obj = self.env['sf.shelf.location'].search( shelf_location_obj = self.env['sf.shelf.location'].search(
@@ -864,7 +873,7 @@ class SfStockMoveLine(models.Model):
if obj: if obj:
obj.product_sn_id = record.lot_id.id obj.product_sn_id = record.lot_id.id
elif record.product_id.tracking == 'lot': elif record.product_id.tracking == 'lot':
self.put_shelf_location(record) record.put_shelf_location(record)
if not obj.product_id: if not obj.product_id:
obj.product_id = record.product_id.id obj.product_id = record.product_id.id
else: else:
@@ -975,15 +984,26 @@ class SfStockPicking(models.Model):
# 调用入库方法进行入库刀货位 # 调用入库方法进行入库刀货位
line.compute_destination_location_id() line.compute_destination_location_id()
else: else:
# 对除刀柄之外的刀具物料进行 目标货位必填校验 # 对除刀柄之外的刀具物料入库到刀具房进行 目标货位必填校验
if self.location_dest_id.name == '刀具房' and line.product_id.cutting_tool_material_id.name not in ( if self.location_dest_id.name == '刀具房' and line.product_id.cutting_tool_material_id.name not in (
'刀柄', False): '刀柄', False):
raise ValidationError('请选择【%s】产品的目标货位!' % line.product_id.name) raise ValidationError('请选择【%s】产品的目标货位!' % line.product_id.name)
if line.current_location_id: if line.current_location_id:
# 对货位的批次产品进行出货
line.put_shelf_location(line)
if line.current_location_id:
# 按序列号管理的产品
if line.current_location_id.product_sn_id: if line.current_location_id.product_sn_id:
line.current_location_id.product_sn_id = False line.current_location_id.product_sn_id = False
# line.current_location_id.location_status = '空闲' # line.current_location_id.location_status = '空闲'
line.current_location_id.product_num = 0 line.current_location_id.product_num = 0
line.current_location_id.product_id = False
else:
# 对除刀柄之外的刀具物料从刀具房出库进行 当前货位必填校验
if self.location_id.name == '刀具房' and line.product_id.cutting_tool_material_id.name not in (
'刀柄', False):
raise ValidationError('请选择【%s】产品的当前货位!' % line.product_id.name)
# 对入库作业的刀柄和托盘进行Rfid绑定校验 # 对入库作业的刀柄和托盘进行Rfid绑定校验
for move in self.move_ids: for move in self.move_ids:
@@ -1110,6 +1130,7 @@ class CustomStockMove(models.Model):
采购入库扫码绑定Rfid码 采购入库扫码绑定Rfid码
""" """
for record in self: for record in self:
logging.info('Rfid%s' % barcode)
if record: if record:
lot = self.env['stock.lot'].sudo().search([('rfid', '=', barcode)]) lot = self.env['stock.lot'].sudo().search([('rfid', '=', barcode)])
if lot: if lot:
@@ -1121,7 +1142,9 @@ class CustomStockMove(models.Model):
'该Rfid【%s】已经被序列号为【%s】的【%s】物料所占用!' % (barcode, lot.name, material)) '该Rfid【%s】已经被序列号为【%s】的【%s】物料所占用!' % (barcode, lot.name, material))
if '刀柄' in (record.product_id.cutting_tool_material_id.name or '') or '托盘' in ( if '刀柄' in (record.product_id.cutting_tool_material_id.name or '') or '托盘' in (
record.product_id.fixture_material_id.name or ''): record.product_id.fixture_material_id.name or ''):
logging.info('开始录入Rfid:%s' % record.move_line_nosuggest_ids)
for move_line_nosuggest_id in record.move_line_nosuggest_ids: for move_line_nosuggest_id in record.move_line_nosuggest_ids:
logging.info('录入的记录%s , Rfid:%s' % (move_line_nosuggest_id, move_line_nosuggest_id.rfid))
if move_line_nosuggest_id.rfid: if move_line_nosuggest_id.rfid:
if move_line_nosuggest_id.rfid == barcode: if move_line_nosuggest_id.rfid == barcode:
if record.product_id.cutting_tool_material_id.name: if record.product_id.cutting_tool_material_id.name:
@@ -1130,7 +1153,9 @@ class CustomStockMove(models.Model):
raise ValidationError('该托盘的Rfid已经录入请勿重复录入') raise ValidationError('该托盘的Rfid已经录入请勿重复录入')
else: else:
line_id = int(re.sub(r"\D", "", str(move_line_nosuggest_id.id))) line_id = int(re.sub(r"\D", "", str(move_line_nosuggest_id.id)))
self.env['stock.move.line'].sudo().search([('id', '=', line_id)]).write({'rfid': barcode}) res = self.env['stock.move.line'].sudo().search([('id', '=', line_id)]).write(
{'rfid': barcode})
logging.info('Rfid是否录入:%s' % res)
move_line_nosuggest_id.rfid = barcode move_line_nosuggest_id.rfid = barcode
break break
else: else:
@@ -1184,6 +1209,12 @@ class CustomStockMove(models.Model):
# todo 待控制 # todo 待控制
if not lot_name: if not lot_name:
raise ValidationError("请先分配序列号") raise ValidationError("请先分配序列号")
# 增加"当为坯料时,只打印序列号的前面部分"
if record.lot_name: # 确保 lot_name 存在
if record.product_id.categ_id.name == '坯料':
lot_name = lot_name.split('[', 1)[0]
# host = "192.168.50.110" # 可以根据实际情况修改 # host = "192.168.50.110" # 可以根据实际情况修改
# port = 9100 # 可以根据实际情况修改 # port = 9100 # 可以根据实际情况修改

View File

@@ -7,7 +7,9 @@
<field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree"/> <field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='location_id'][2]" position="after"> <xpath expr="//field[@name='location_id'][2]" position="after">
<field name="current_location_id" force_save="1"/> <field name="stock_lot_name" invisible="1"/>
<field name="current_location_id" force_save="1"
options="{'no_create': True,'no_create_edit':True}"/>
</xpath> </xpath>
<xpath expr="//field[@name='location_dest_id'][2]" position="after"> <xpath expr="//field[@name='location_dest_id'][2]" position="after">
<field name="current_product_id" invisible="1"/> <field name="current_product_id" invisible="1"/>
@@ -55,6 +57,7 @@
<field name="inherit_id" ref="stock.view_move_line_form"/> <field name="inherit_id" ref="stock.view_move_line_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//form//sheet//group//group//field[@name='location_id']" position="after"> <xpath expr="//form//sheet//group//group//field[@name='location_id']" position="after">
<field name="stock_lot_name" invisible="1"/>
<field name="current_location_id" options="{'no_create': False}" force_save="1"/> <field name="current_location_id" options="{'no_create': False}" force_save="1"/>
</xpath> </xpath>
<xpath expr="//form//sheet//group//group//field[@name='location_dest_id']" position="after"> <xpath expr="//form//sheet//group//group//field[@name='location_dest_id']" position="after">

View File

@@ -592,8 +592,23 @@ var GanttRow = Widget.extend({
}); });
pill.decorations = pillDecorations; pill.decorations = pillDecorations;
// let isDelay = false
// if(pill.state != 'processing' && pill.state != 'finished') { // 判断待加工
// isDelay = pill.order_deadline.isBefore(new Date())
// }
pill.exState = ''
if (self.colorField){ if (self.colorField){
pill._color = self._getColor(pill[self.colorField]); // console.log(self.colorField, self, pill, '颜色')
// pill._color = self._getColor(pill[self.colorField]);
// 设置pill背景颜色2 修改时间2024年6月25日17:09:43
let isDelay = false
if(pill.state != 'processing' && pill.state != 'finished') { // 判断待加工
isDelay = pill.order_deadline.isBefore(new Date())
}
if(isDelay) {
pill.disableDragdrop = true
}
pill._color = self._getColor2(isDelay ? 'delay' : pill.state);
} }
if (self.progressField) { if (self.progressField) {
@@ -613,6 +628,13 @@ var GanttRow = Widget.extend({
} }
return 0; return 0;
}, },
_getColor2 (state) {
return {
'finished': 'ccc',
'delay': 9,
'processing': 13 // 绿色
}[state]
},
/** /**
* Get context to evaluate decoration * Get context to evaluate decoration
* *
@@ -867,10 +889,11 @@ var GanttRow = Widget.extend({
if ($pill.hasClass('ui-draggable-dragging')) { if ($pill.hasClass('ui-draggable-dragging')) {
return; return;
} }
var self = this; var self = this;
var pill = _.findWhere(this.pills, { id: $pill.data('id') }); var pill = _.findWhere(this.pills, { id: $pill.data('id') });
if(pill.state == 'finished'){ // 已完成状态不能拖拽
return;
}
// DRAGGABLE // DRAGGABLE
if (this.options.canEdit && !pill.disableStartResize && !pill.disableStopResize && !this.isGroup) { if (this.options.canEdit && !pill.disableStartResize && !pill.disableStopResize && !this.isGroup) {

View File

@@ -754,3 +754,7 @@
left: -0.5 * $o-connector-creator-bullet-diameter; left: -0.5 * $o-connector-creator-bullet-diameter;
} }
} }
.o_gantt_view .o_gantt_row_nogroup .o_gantt_pill.o_gantt_color_ccc {
background-color: #ccc;
}