Compare commits

..

150 Commits

Author SHA1 Message Date
liaodanlong
196b427867 状态计算 2025-01-06 13:39:21 +08:00
liaodanlong
b6f3382e5d 状态计算 2025-01-06 13:34:57 +08:00
liaodanlong
f2ee382205 状态计算 2025-01-06 13:33:02 +08:00
liaodanlong
081880b4bb 状态计算 2025-01-06 13:20:10 +08:00
yuxianghui
bc475441a2 1、去除工单开始按钮的二次确认;2、优化托盘入库后夹具物料查询中的状态还是未入库的问题 2025-01-06 13:11:22 +08:00
liaodanlong
a7c3a604a6 Merge remote-tracking branch 'origin/release/release_2.7' into release/release_2.7 2025-01-06 13:03:30 +08:00
liaodanlong
0bd65b5da8 状态计算 2025-01-06 13:03:15 +08:00
guanhuan
63d9b4bf39 Merge branch 'refs/heads/develop' into release/release_2.7 2025-01-06 12:51:14 +08:00
管欢
2619953be1 Accept Merge Request #1710: (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/1710
2025-01-06 12:49:14 +08:00
guanhuan
9f1514bd14 修复销售单号和追溯参考为空问题 2025-01-06 11:44:33 +08:00
liaodanlong
403e64a957 表面工艺外协关联采购单查询条件修改 2025-01-06 11:09:22 +08:00
mgw
aaded331cd 解除装夹方法增加前置判断 2025-01-06 10:11:44 +08:00
mgw
f68453a0c6 Merge branch 'release/release_2.7' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into release/release_2.7 2025-01-03 15:26:20 +08:00
mgw
5cff411aaf r环境审批问题 2025-01-03 15:25:47 +08:00
guanhuan
ef5a3decd4 Merge remote-tracking branch 'origin/release/release_2.7' into release/release_2.7 2025-01-03 15:17:26 +08:00
guanhuan
ce1860b283 Merge branch 'refs/heads/develop' into release/release_2.7 2025-01-03 15:16:57 +08:00
mgw
b3f56754cd 修改翻译 2025-01-03 15:09:03 +08:00
管欢
202db10cea Accept Merge Request #1709: (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/1709
2025-01-03 15:06:29 +08:00
guanhuan
6b61df9d50 工序外协发料通知跳转 2025-01-03 15:04:22 +08:00
guanhuan
1cac579a1f Merge remote-tracking branch 'origin/develop' into release/release_2.7 2025-01-03 12:59:19 +08:00
管欢
53ca78a6a3 Accept Merge Request #1708: (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/1708
2025-01-03 12:54:37 +08:00
mgw
0d28df0415 适配多层审批 2025-01-03 12:52:27 +08:00
guanhuan
d182641d81 外购订单采购单提醒 2025-01-03 12:52:24 +08:00
马广威
7789c901b2 Accept Merge Request #1707: (feature/制造功能优化 -> develop)
Merge Request: 调整状态字段名称

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1707?initial=true
2025-01-03 11:43:55 +08:00
mgw
aa4b73e406 调整状态字段名称 2025-01-03 11:43:27 +08:00
马广威
1ca8ebe3cc Accept Merge Request #1706: (feature/制造功能优化 -> develop)
Merge Request: Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1706?initial=true
2025-01-03 11:33:28 +08:00
mgw
c34cdd595d Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化 2025-01-03 11:32:48 +08:00
mgw
1936b512c2 调整多层审批需求 2025-01-03 11:32:24 +08:00
胡尧
3c470093d3 Merge branch 'develop' into release/release_2.7 2025-01-03 10:24:24 +08:00
管欢
b483097907 Accept Merge Request #1705: (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/1705?initial=true
2025-01-03 10:21:33 +08:00
guanhuan
c6aeff2006 待质检提醒 2025-01-03 10:17:33 +08:00
胡尧
170309b3c0 修改依赖 2025-01-03 10:01:52 +08:00
管欢
d4537fe73d Accept Merge Request #1704: (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/1704
2025-01-02 14:24:53 +08:00
guanhuan
eaaa13fb9a 待质检提醒 2025-01-02 14:21:18 +08:00
guanhuan
f92bd8263c 待质检提醒 2025-01-02 14:20:31 +08:00
廖丹龙
5f3957864a Accept Merge Request #1703: (feature/part_number -> 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/1703
2025-01-02 13:43:03 +08:00
liaodanlong
f884963abc 工艺确认重置表面工艺工单的关联采购单为草稿 2025-01-02 13:34:09 +08:00
廖丹龙
1e17ac07a9 Accept Merge Request #1702: (feature/part_number -> 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/1702
2025-01-02 12:52:02 +08:00
liaodanlong
2f3e12e3af 表面工艺采购单确认订单限制,自动化产线加工路线逻辑矫正 2025-01-02 12:50:39 +08:00
liaodanlong
0ce51a4a66 添加人工线下加工工单排序 2025-01-02 12:49:46 +08:00
liaodanlong
a1bf997d51 采购岗与采购总监岗位添加工单操作权限 2025-01-02 12:49:05 +08:00
马广威
e6c125cae6 Accept Merge Request #1701: (feature/制造功能优化 -> develop)
Merge Request: Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1701?initial=true
2025-01-02 11:34:28 +08:00
mgw
ac968b0d6e Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化 2025-01-02 10:59:27 +08:00
mgw
81bebf836d sf-采购-询价单状态流转多余按钮影响现有按钮功能 2025-01-02 10:59:03 +08:00
黄焱
d47d3f1638 Accept Merge Request #1700: (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/1700?initial=true
2025-01-02 10:31:33 +08:00
hy
614447d56e 解开屏蔽的方法 2025-01-02 10:28:40 +08:00
廖丹龙
bf13edc1be Accept Merge Request #1699: (feature/part_number -> 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/1699
2025-01-02 09:08:27 +08:00
liaodanlong
e99b8692ea Merge branch 'refs/heads/develop' into feature/part_number 2025-01-02 09:06:41 +08:00
liaodanlong
701decb38f 表面工艺采购单确认订单进行限制 2024-12-31 17:08:38 +08:00
管欢
3c61726fd3 Accept Merge Request #1698: (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/1698?initial=true
2024-12-31 16:42:34 +08:00
guanhuan
247bebbd75 询价单审批 2024-12-31 16:39:09 +08:00
胡尧
c3ceda2ba9 Accept Merge Request #1697: (feature/sale_order_route_pick -> develop)
Merge Request: 特殊表面工艺外协采购单发起人修改为供应商的采购员

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1697?initial=true
2024-12-31 16:01:03 +08:00
胡尧
281f3c67c3 特殊表面工艺外协采购单发起人修改为供应商的采购员 2024-12-31 16:00:24 +08:00
禹翔辉
641a669f46 Accept Merge Request #1696: (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/1696
2024-12-31 15:53:53 +08:00
yuxianghui
94b1c7d258 关闭报废入口 2024-12-31 15:50:51 +08:00
廖丹龙
b06b690ae9 Accept Merge Request #1695: (feature/part_number -> 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/1695
2024-12-31 14:05:55 +08:00
liaodanlong
37476bcc88 回退代码 2024-12-31 14:03:15 +08:00
管欢
af7eeb55f1 Accept Merge Request #1694: (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/1694
2024-12-31 13:32:34 +08:00
guanhuan
39ed32f3e9 修复成品调拨出库订单的状态没变 2024-12-31 13:08:00 +08:00
廖丹龙
79ec60bd6b Accept Merge Request #1693: (feature/part_number -> develop)
Merge Request: sf-制造-外协工单-调拨单已取消问题

Created By: @廖丹龙
Reviewed By: @胡尧
Approved By: @胡尧 
Accepted By: @廖丹龙
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1693
2024-12-31 12:55:17 +08:00
liaodanlong
4b7308fdcd sf-制造-外协工单-调拨单已取消问题 2024-12-31 12:54:16 +08:00
胡尧
198f1145d7 Accept Merge Request #1692: (feature/sale_order_route_pick -> develop)
Merge Request: 修改退回工艺设计后再确认,采购单编程草稿状态

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1692?initial=true
2024-12-31 11:40:03 +08:00
胡尧
64eb66c334 修改退回工艺设计后再确认,采购单编程草稿状态 2024-12-31 11:39:36 +08:00
禹翔辉
cff21a4bcc Accept Merge Request #1691: (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/1691?initial=true
2024-12-31 11:35:30 +08:00
yuxianghui
2373f33315 采购单源单据为入库单时,自动计算对应参考销售订单的值 2024-12-31 11:34:21 +08:00
禹翔辉
d6e2e554a8 Accept Merge Request #1690: (feature/采购单链接销售单 -> develop)
Merge Request: 采购订单的关联销售订单字段从销售模块搬迁到制造模块,并新增一个many2many类型字段,且对字段的自动计算方法进行优化。

Created By: @禹翔辉
Reviewed By: @胡尧
Approved By: @胡尧 
Accepted By: @禹翔辉
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1690
2024-12-31 10:58:54 +08:00
yuxianghui
6c45a0bf4a Merge branch 'feature/入库单优化' into feature/采购单链接销售单 2024-12-31 10:57:09 +08:00
yuxianghui
4902fc5d9a 1、采购订单的关联销售订单字段从销售模块搬迁到制造模块,并新增一个many2many类型字段,且对字段的自动计算方法进行优化。 2024-12-31 10:56:07 +08:00
黄焱
9e5dbc0104 Accept Merge Request #1688: (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/1688?initial=true
2024-12-31 10:00:18 +08:00
管欢
c57918736d Accept Merge Request #1689: (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/1689
2024-12-31 10:00:01 +08:00
guanhuan
78a456849c 修复成品调拨出库订单的状态没变 2024-12-31 09:55:16 +08:00
hy
1816f1a497 修复表格对不齐问题 2024-12-31 09:45:56 +08:00
禹翔辉
da815c8ea1 Accept Merge Request #1686: (feature/入库单优化 -> develop)
Merge Request: 1、采购订单form页买家改名为采购员;2、优化成品入库单的的坯料委外加工链接;

Created By: @禹翔辉
Reviewed By: @胡尧
Approved By: @胡尧 
Accepted By: @禹翔辉
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1686
2024-12-31 08:57:15 +08:00
yuxianghui
32e3c2f79f 采购订单源文档字段名称改为源单据 2024-12-31 08:56:41 +08:00
胡尧
c478b72e04 Accept Merge Request #1687: (feature/sale_order_route_pick -> develop)
Merge Request: 创建成品时从模板上获取供应商价格

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1687?initial=true
2024-12-31 08:54:23 +08:00
胡尧
78b0529809 创建成品时从模板上获取供应商价格 2024-12-31 08:54:02 +08:00
yuxianghui
17ffac63cb Merge branch 'feature/夹具查询优化_2' into feature/入库单优化 2024-12-31 08:48:50 +08:00
yuxianghui
acee32cc39 1、采购订单form页买家改名为采购员;2、优化成品入库单的的坯料委外加工链接; 2024-12-31 08:47:44 +08:00
马广威
b36cf745c2 Accept Merge Request #1685: (feature/制造功能优化 -> develop)
Merge Request: 添加提交审批的通知消息

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1685?initial=true
2024-12-30 21:38:17 +08:00
mgw
a24279f6e6 添加提交审批的通知消息 2024-12-30 21:37:10 +08:00
马广威
68b89999a9 Accept Merge Request #1684: (feature/制造功能优化 -> develop)
Merge Request: 修改展示名称

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1684?initial=true
2024-12-30 20:29:57 +08:00
mgw
7c38c7f643 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化 2024-12-30 20:28:49 +08:00
mgw
4937c3a812 修改展示名称 2024-12-30 20:27:57 +08:00
马广威
05469c71b8 Accept Merge Request #1683: (feature/制造功能优化 -> develop)
Merge Request: 修改展示名称

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1683?initial=true
2024-12-30 19:25:14 +08:00
mgw
210eea3b0b 修改展示名称 2024-12-30 19:24:45 +08:00
马广威
f58d1058f7 Accept Merge Request #1682: (feature/制造功能优化 -> develop)
Merge Request: Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1682?initial=true
2024-12-30 18:00:08 +08:00
mgw
0622d7525f Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化 2024-12-30 17:59:36 +08:00
mgw
7556c09ac2 增加活动项 2024-12-30 17:59:11 +08:00
禹翔辉
5344e97b7e Accept Merge Request #1681: (feature/夹具查询优化_2 -> develop)
Merge Request: Merge branch 'feature/成品调拨单优化_1' into feature/夹具查询优化_2

Created By: @禹翔辉
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @禹翔辉
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1681?initial=true
2024-12-30 17:33:58 +08:00
yuxianghui
1b10b7bb53 Merge branch 'feature/成品调拨单优化_1' into feature/夹具查询优化_2 2024-12-30 17:32:28 +08:00
yuxianghui
9ab164f0fe 1 2024-12-30 17:31:22 +08:00
马广威
3b07b26303 Accept Merge Request #1680: (feature/制造功能优化 -> develop)
Merge Request: Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1680?initial=true
2024-12-30 17:28:41 +08:00
管欢
29a32be8d2 Accept Merge Request #1679: (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/1679
2024-12-30 17:28:15 +08:00
mgw
3620412a13 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化 2024-12-30 17:27:46 +08:00
mgw
5e72e3d1dd 审批明细问题 2024-12-30 17:27:00 +08:00
guanhuan
4137b304f3 消息提醒 2024-12-30 17:25:32 +08:00
马广威
caac651ab4 Accept Merge Request #1678: (feature/制造功能优化 -> develop)
Merge Request: Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1678?initial=true
2024-12-30 17:12:01 +08:00
mgw
30e496442f Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化 2024-12-30 17:11:31 +08:00
mgw
c28c00a47b 调整description 2024-12-30 17:11:08 +08:00
禹翔辉
4f4fdeecb5 Accept Merge Request #1677: (feature/成品调拨单优化_1 -> develop)
Merge Request: 1、询价单的确认按钮权限添加;2、成品调拨单添加对应的坯料采购单和坯料外协单跳转链接

Created By: @禹翔辉
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @禹翔辉
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1677?initial=true
2024-12-30 17:07:07 +08:00
yuxianghui
8742f9b98b Merge branch 'feature/成品调拨单优化' into feature/成品调拨单优化_1 2024-12-30 17:05:45 +08:00
yuxianghui
d7ce69f474 1、询价单的确认按钮权限添加;2、成品调拨单添加对应的坯料采购单和坯料外协单跳转链接 2024-12-30 17:04:59 +08:00
胡尧
cf46cff7e5 Accept Merge Request #1676: (feature/sale_order_route_pick -> develop)
Merge Request: 屏蔽前端代码

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1676?initial=true
2024-12-30 16:33:41 +08:00
胡尧
c124e2962c 屏蔽前端代码 2024-12-30 16:32:36 +08:00
管欢
f4312c4d4e Accept Merge Request #1675: (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/1675
2024-12-30 16:20:37 +08:00
guanhuan
5928456ffe 提示优化 2024-12-30 16:19:17 +08:00
马广威
305ea9dff7 Accept Merge Request #1674: (feature/制造功能优化 -> develop)
Merge Request: Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1674?initial=true
2024-12-30 16:04:59 +08:00
mgw
bdfc393099 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化 2024-12-30 16:04:10 +08:00
mgw
1e1bd63acf 调整提示语句格式 2024-12-30 16:03:46 +08:00
马广威
fa20bb6eb5 Accept Merge Request #1673: (feature/制造功能优化 -> develop)
Merge Request: sf-询价单-新增状态及修改未审批的提示语句

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1673?initial=true
2024-12-30 15:51:19 +08:00
mgw
c82db7159d sf-询价单-新增状态及修改未审批的提示语句 2024-12-30 15:50:25 +08:00
廖丹龙
89d6752012 Accept Merge Request #1672: (feature/part_number -> 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/1672
2024-12-30 15:40:36 +08:00
liaodanlong
3060b35ab2 销售订单交付状态修改 2024-12-30 15:38:43 +08:00
廖丹龙
17ad976a32 Accept Merge Request #1671: (feature/part_number -> develop)
Merge Request: sf-工序外协调拨单-外协出库单多生成了一张外协出库调拨单

Created By: @廖丹龙
Reviewed By: @胡尧
Approved By: @胡尧 
Accepted By: @廖丹龙
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1671
2024-12-30 15:28:57 +08:00
liaodanlong
9f3b351544 sf-工序外协调拨单-外协出库单多生成了一张外协出库调拨单 2024-12-30 15:25:20 +08:00
黄焱
5dc7dc8e0a Accept Merge Request #1670: (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/1670?initial=true
2024-12-30 14:40:22 +08:00
hy
f1868168af 修复会计列表表头少了列bug 2024-12-30 14:38:45 +08:00
guanhuan
f084b5d765 提示优化 2024-12-30 14:12:54 +08:00
guanhuan
854c3ceef2 提示优化 2024-12-30 13:51:31 +08:00
管欢
4269ce58db Accept Merge Request #1668: (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/1668?initial=true
2024-12-30 11:37:04 +08:00
guanhuan
3555be86c6 提示优化 2024-12-30 11:35:08 +08:00
廖丹龙
764472111f Accept Merge Request #1667: (feature/part_number -> 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/1667?initial=true
2024-12-30 10:31:05 +08:00
liaodanlong
ce4fc8b8ab 批量调拨 2024-12-30 10:29:29 +08:00
马广威
67f4917491 Accept Merge Request #1666: (feature/制造功能优化 -> develop)
Merge Request: Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1666?initial=true
2024-12-30 10:02:51 +08:00
mgw
ad885f1e39 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化 2024-12-30 10:02:09 +08:00
mgw
993d720c40 sf-采购询价单【上传合同】按钮展示条件修改 2024-12-30 10:01:43 +08:00
禹翔辉
da75a8cd35 Accept Merge Request #1665: (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/1665
2024-12-30 09:59:32 +08:00
yuxianghui
b35f842915 调整托盘解绑修改顺序 2024-12-30 09:57:36 +08:00
guanhuan
4e7993d035 追溯参考号 2024-12-30 09:56:49 +08:00
禹翔辉
946f02003e Accept Merge Request #1664: (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/1664?initial=true
2024-12-30 09:54:58 +08:00
yuxianghui
435315a166 Merge branch 'feature/夹具物料查询优化' into feature/夹具物料查询优化_1 2024-12-30 09:53:49 +08:00
yuxianghui
676f8eb7eb 添加点击工单的解绑托盘按钮时,修改对应托盘状态为空闲 2024-12-30 09:52:32 +08:00
管欢
6e9f66506a Accept Merge Request #1663: (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/1663
2024-12-30 09:48:30 +08:00
guanhuan
f3e08f5ccc 新增零件名称,零件图号 2024-12-30 09:43:20 +08:00
廖丹龙
c9d7d70d3c Accept Merge Request #1662: (feature/part_number -> 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/1662?initial=true
2024-12-30 09:41:08 +08:00
liaodanlong
ee6e457bbd 委外加工采购单与制造订单进行关联 2024-12-30 09:38:51 +08:00
guanhuan
ab5b4c477f 新增零件名称,零件图号 2024-12-30 09:33:00 +08:00
mgw
9330be3753 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化 2024-12-30 08:57:49 +08:00
mgw
a3a2c96d00 添加紧急采购字段 2024-12-30 08:57:05 +08:00
禹翔辉
31187755b9 Accept Merge Request #1661: (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/1661
2024-12-30 08:42:16 +08:00
yuxianghui
178f538997 Merge branch 'feature/销售、采购页面优化' into feature/夹具物料查询优化 2024-12-30 08:34:58 +08:00
马广威
304f6ad5ba Accept Merge Request #1659: (feature/part_number -> develop)
Merge Request: 销售订单交付状态修改

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1659?initial=true
2024-12-28 14:55:55 +08:00
liaodanlong
8b40714dad 销售订单交付状态修改 2024-12-28 14:55:17 +08:00
马广威
cb8e415e60 Accept Merge Request #1658: (feature/part_number -> 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/1658
2024-12-28 14:30:47 +08:00
liaodanlong
889049b107 表面工艺确认回退再重新确认调拨单报错问题 2024-12-28 14:28:34 +08:00
廖丹龙
610028c5f4 Accept Merge Request #1657: (feature/part_number -> develop)
Merge Request: sorted_workorders变量过滤

Created By: @廖丹龙
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @廖丹龙
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1657
2024-12-28 09:13:42 +08:00
liaodanlong
abfac28094 sorted_workorders变量过滤 2024-12-28 09:12:27 +08:00
廖丹龙
24d8d37e0a Accept Merge Request #1656: (feature/part_number -> develop)
Merge Request: sorted_workorders变量定义

Created By: @廖丹龙
Reviewed By: @马广威
Approved By: @马广威 
Accepted By: @廖丹龙
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1656?initial=true
2024-12-28 09:08:20 +08:00
liaodanlong
6780d4e758 sorted_workorders变量定义 2024-12-28 09:07:02 +08:00
yuxianghui
675fb54d37 夹具物料查询优化 2024-12-27 17:28:24 +08:00
43 changed files with 738 additions and 461 deletions

View File

@@ -139,6 +139,7 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', {
owl.onMounted(() => {
this.activeElement = this.uiService.activeElement;
this.setRequired()
this.listherHeaderBodyNum()
})
return this._super(...arguments);
},
@@ -165,6 +166,26 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', {
} catch (e) {
console.log(e)
}
},
listherHeaderBodyNum() {
const dom = this.tableRef.el
try {
const thead = $(dom).children('thead')
const tbody = $(dom).children('tbody')
const thead_tr = thead.children().eq(0)
const tbody_tr = tbody.children().eq(0)
const thead_th_num = thead_tr.children().length
const tbody_tr_num = tbody_tr.children().length
const num = thead_th_num - tbody_tr_num
if(num == -1) {
tbody.children('tr').each(function () {
$(this).children('td').eq(0).remove()
})
}
} catch (e) {
console.log(e)
}
}
})

View File

@@ -20,7 +20,7 @@
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['purchase', 'base_tier_validation', 'documents'],
'depends': ['purchase', 'purchase_tier_validation', 'documents', 'purchase_request', 'account', 'purchase_order_approved'],
# always loaded
'data': [
@@ -33,4 +33,10 @@
'demo': [
'demo/demo.xml',
],
'assets': {
'web.assets_backend': [
'jikimo_purchase_tier_validation/static/src/js/ir_model_extend.js',
],
},
}

View File

@@ -8,6 +8,7 @@ _logger = logging.getLogger(__name__)
class jikimo_purchase_tier_validation(models.Model):
_name = 'purchase.order'
_inherit = ['purchase.order', 'tier.validation']
_description = "采购订单"
_tier_validation_buttons_xpath = "/form/header/button[@id='draft_confirm'][1]"
@@ -21,7 +22,11 @@ class jikimo_purchase_tier_validation(models.Model):
def button_confirm(self):
for record in self:
if record.need_validation and record.validation_status != 'validated':
raise ValidationError(_('请先完成审批!'))
raise ValidationError(_('此操作需要至少对一条记录进行审批。\n请发起审批申请。'))
if record.state in ['to approve']:
raise ValidationError(_('请先完成审批。'))
if record.state == 'approved':
record.state = 'purchase'
return super().button_confirm()
# def button_confirm(self):
@@ -63,7 +68,48 @@ class jikimo_purchase_tier_validation(models.Model):
if error_messages:
raise ValidationError('\n'.join(error_messages))
return super(jikimo_purchase_tier_validation, self).request_validation()
# 添加通知消息
if hasattr(record, 'message_post'):
current_user = self.env.user.name
record.message_post(
body=f"<strong>{current_user}</strong> 提交审批",
message_type='notification',
subtype_xmlid='mail.mt_note'
)
res = super(jikimo_purchase_tier_validation, self).request_validation()
self.state = 'to approve'
return res
def restart_validation(self):
res = super(jikimo_purchase_tier_validation, self).restart_validation()
self.state = 'draft'
return res
def _validate_tier(self, tiers=False):
res = super(jikimo_purchase_tier_validation, self)._validate_tier(tiers)
tier_reviews = tiers or self.review_ids
# 检查是否所有审批都已通过
all_approved = all(
tier_review.status == 'approved'
for tier_review in tier_reviews
)
if all_approved and tier_reviews: # 确保有审批记录
self.state = 'approved'
return res
def _rejected_tier(self, tiers=False):
res = super(jikimo_purchase_tier_validation, self)._rejected_tier(tiers)
self.state = 'draft'
return res
@api.model
def _get_under_validation_exceptions(self):
res = super(jikimo_purchase_tier_validation, self)._get_under_validation_exceptions()
res.append("state")
return res
# 上传合同文件
def upload_contract_file(self):
@@ -152,3 +198,18 @@ class jikimo_purchase_tier_validation(models.Model):
'sticky': False,
}
}
class jikimo_purchase_request(models.Model):
_inherit = 'purchase.request'
_description = "采购申请"
class jikimo_account_payment(models.Model):
_inherit = 'account.payment'
_description = "付款单"
class jikimo_account_move(models.Model):
_inherit = 'account.move'
_description = "发票账单"

View File

@@ -0,0 +1,14 @@
/** @odoo-module **/
import {registerPatch} from "@mail/model/model_core";
registerPatch({
name: "ir.model.review",
fields: {
availableWebViews: {
compute() {
return ["list", "form", "activity"];
},
},
},
});

View File

@@ -1,13 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<record model="ir.ui.view" id="tier_validation_view_approved_purchase_order_form_inherit">
<field name="name">tier_validation_view_approved_purchase_order_form_inherit</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase_order_approved.purchase_order_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='button_release']" position="replace">
</xpath>
</field>
</record>
<record model="ir.ui.view" id="tier_validation_view_purchase_order_form_inherit">
<field name="name">tier_validation_view_purchase_order_form_inherit</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<xpath expr="//header/button[@name='button_approve']" position="replace">
</xpath>
<xpath expr="//header/button[@name='button_cancel']" position="replace">
</xpath>
<xpath expr="//header/field[@name='state']" position="replace">
<field name="state" widget="statusbar" statusbar_visible="draft,sent,to approve, approved, purchase" readonly="1"/>
</xpath>
<xpath expr="//header/button[last()]" position="after">
<button name="button_cancel" states="draft,to approve,sent,purchase" string="取消" type="object" data-hotkey="x" />
@@ -16,7 +32,7 @@
<xpath expr="//header/button[@name='action_rfq_send'][1]" position="before">
<field name="validation_status" invisible="1"/>
<field name="is_upload_contract_file" invisible="1"/>
<button name="upload_contract_file" string="上传合同" type="object" class="oe_highlight" attrs="{'invisible': ['|', ('validation_status', '!=', 'no'), ('is_upload_contract_file', '=', True)]}"/>
<button name="upload_contract_file" string="上传合同" type="object" class="oe_highlight" attrs="{'invisible': ['|', '|', ('validation_status', '!=', 'no'), ('is_upload_contract_file', '=', True), ('state', 'not in', ['draft', 'sent'])]}"/>]}"/>
<button name="delete_contract_file" string="删除合同" type="object" class="oe_highlight" attrs="{'invisible': ['|', ('validation_status', '!=', 'no'), ('is_upload_contract_file', '=', False)]}"/>
</xpath>
<xpath expr="//notebook/page[1]" position="before">

View File

@@ -1 +1,2 @@
from . import upload_file_wizard
from . import upload_file_wizard
from . import comment_wizard

View File

@@ -0,0 +1,15 @@
from odoo import models, fields
class CommentWizard(models.TransientModel):
_inherit = "comment.wizard"
def add_comment(self):
rec = self.env[self.res_model].browse(self.res_id)
self.review_ids = rec.review_ids
result = super(CommentWizard, self).add_comment()
return result

View File

@@ -23,4 +23,4 @@ class ProductTemplate(models.Model):
self.is_bfm = product_template_id.is_bfm
self.is_manual_processing = product_template_id.is_manual_processing
# 复制 seller_ids
self.seller_ids = [(0, 0, {'partner_id': seller.partner_id.id, 'delay': 1.0}) for seller in product_template_id.seller_ids]
self.seller_ids = [(0, 0, {'partner_id': seller.partner_id.id, 'delay': 1.0, 'price': seller.price}) for seller in product_template_id.seller_ids]

View File

@@ -8,7 +8,7 @@
'sequence': 120,
'summary': 'Control the quality of your products',
'website': 'https://www.odoo.com/app/quality',
'depends': ['quality'],
'depends': ['quality', 'sf_manufacturing'],
'description': """
Quality Control
===============

View File

@@ -159,6 +159,34 @@ class QualityCheck(models.Model):
is_lot_tested_fractionally = fields.Boolean(related='point_id.is_lot_tested_fractionally')
testing_percentage_within_lot = fields.Float(related="point_id.testing_percentage_within_lot")
product_tracking = fields.Selection(related='product_id.tracking')
quality_check_type = fields.Selection([
('采购入库检', '采购入库检'),
('客供料入库检', '客供料入库检'),
('退货入库检', '退货入库检'),
('生产入库检', '生产入库检'),
('外协入库检', '外协入库检'),
('成品发货检', '成品发货检'),
('工序外协发货检', '工序外协发货检'),
('委外坯料发货检', '委外坯料发货检')], string='类型', compute='_compute_quality_check_type', store=True)
@api.depends('picking_id')
def _compute_quality_check_type(self):
for check in self:
if check.picking_id:
picking_type = check.picking_id.picking_type_id.sequence_code
type_mapping = {
'IN': '采购入库检',
'DL': '客供料入库检',
'RET': '退货入库检',
'SFP': '生产入库检',
'OCIN': '外协入库检',
'OUT': '成品发货检',
'OCOUT': '工序外协发货检',
'RES': '委外坯料发货检',
}
check.quality_check_type = type_mapping.get(picking_type, False)
else:
check.quality_check_type = False
@api.depends('measure_success')
def _compute_warning_message(self):
@@ -301,6 +329,19 @@ class QualityAlert(models.Model):
_inherit = "quality.alert"
title = fields.Char('Title')
part_number = fields.Char(string='零件图号', compute='_compute_part_info', store=True)
part_name = fields.Char(string='零件名称', compute='_compute_part_info', store=True)
@api.depends('product_id', 'picking_id')
def _compute_part_info(self):
for alert in self:
if alert.product_tmpl_id.categ_id.name == '成品':
alert.part_number = alert.product_id.part_number
alert.part_name = alert.product_id.part_name
elif alert.product_id.categ_id.name == '坯料':
if alert.picking_id.move_ids_without_package:
alert.part_number = alert.picking_id.move_ids_without_package[0].part_number
alert.part_name = alert.picking_id.move_ids_without_package[0].part_name
def action_see_check(self):
return {

View File

@@ -90,6 +90,8 @@
<field name="lot_id" context="{'default_product_id': product_id}"
groups="stock.group_production_lot"/>
<field name="picking_id"/>
<field name="part_name"/>
<field name="part_number"/>
</group>
<group>
<field name="team_id"/>
@@ -150,6 +152,10 @@
<field name="date_assign" position="after">
<field name="company_id" groups="base.main_company"/>
</field>
<field name="product_tmpl_id" position="after">
<field name="part_name" optional="show"/>
<field name="part_number" optional="show"/>
</field>
</field>
</record>
@@ -260,6 +266,8 @@
<field name="company_id" invisible="1"/>
<field name="product_id" attrs="{'invisible' : [('measure_on', '=', 'operation')]}"/>
<field name="measure_on" attrs="{'readonly': [('point_id', '!=', False)]}"/>
<field name="part_name"/>
<field name="part_number"/>
<field name="show_lot_text" invisible="1"/>
<field name="move_line_id" invisible="1"/>
<field name="product_tracking" invisible="1"/>
@@ -448,6 +456,10 @@
<filter string="Control Point" name="groupby_point_id" context="{'group_by': 'point_id'}"/>
<filter string="Team" name="groupby_team_id" context="{'group_by': 'team_id'}"/>
</group>
<searchpanel>
<field name="quality_check_type" icon="fa-filter" enable_counters="1"/>
<field name="quality_state" icon="fa-filter" enable_counters="1"/>
</searchpanel>
</search>
</field>
</record>
@@ -507,6 +519,7 @@
<field name="name">Quality Checks</field>
<field name="res_model">quality.check</field>
<field name="view_mode">tree,kanban,form,pivot,graph</field>
<field name="context">{'is_web_request': True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No quality check found

View File

@@ -25,7 +25,7 @@
# 只有它被屏蔽了
# 'views/SfWorkOrderBarcodes.xml',
'views/WorkCenterBarcodes.xml',
'views/Stock_picking_Barcodes.xml',
# 'views/Stock_picking_Barcodes.xml',
'views/machine_monitor.xml',
'views/machine_info_present.xml',
'views/delivery_record.xml',

View File

@@ -0,0 +1,21 @@
#. module: sf_manufacturing
#. odoo-python
#: code:addons/sf_manufacturing/models/mrp_production.py:0
#, python-format
msgid "You must enter a serial number for %s"
msgstr "您必须为%s输入一个序列号。"
#. module: sf_manufacturing
#. odoo-python
#: code:addons/sf_manufacturing/models/mrp_production.py:0
#, python-format
msgid "You must enter a serial number for each line of %s"
msgstr "您必须为以下各%s行输入序列号"
#. module: sf_manufacturing
#. odoo-python
#: code:addons/sf_manufacturing/models/mrp_production.py:0
#, python-format
msgid "You have %s incomplete supplies: %s"
msgstr "您有%s补给未完成: %s"

View File

@@ -790,6 +790,7 @@ class MrpProduction(models.Model):
groupby(production_all, key=lambda x: x.product_id.id)}
for product_id, pd in grouped_product_ids.items():
product_id_to_production_names[product_id] = [p.name for p in pd]
sorted_workorders = None
for production in production_all:
proc_workorders = []
process_parameter_workorder = self.env['mrp.workorder'].search(
@@ -801,46 +802,9 @@ class MrpProduction(models.Model):
workorder._get_surface_technics_purchase_ids().write({'state': 'cancel'})
workorder.move_subcontract_workorder_ids.write({'state': 'cancel'})
workorder.move_subcontract_workorder_ids.picking_id.write({'state': 'cancel'})
consecutive_workorders = []
sorted_workorders = sorted(process_parameter_workorder, key=lambda w: w.sequence)
# for i, workorder in enumerate(sorted_workorders):
# # 检查当前工作订单和下一个工作订单是否连续,并且供应商相同
# if i == 0:
# consecutive_workorders.append(workorder)
# elif workorder.sequence == sorted_workorders[
# i - 1].sequence + 1 and workorder.supplier_id.id == sorted_workorders[i - 1].supplier_id.id:
# consecutive_workorders.append(workorder)
# else:
# # 处理连续组,如果它不为空
# if consecutive_workorders:
# proc_workorders.append(consecutive_workorders)
# # 创建外协出入库单和采购订单
# # self.env['stock.picking'].create_outcontract_picking(consecutive_workorders, production, sorted_workorders)
# # self.env['purchase.order'].get_purchase_order(consecutive_workorders, production,
# # product_id_to_production_names)
# if i < len(sorted_workorders) - 1:
# # 重置连续组,并添加当前工作订单
# consecutive_workorders = [workorder]
# else:
# # 判断最后一笔:
# if workorder.sequence == sorted_workorders[
# i - 1].sequence and workorder.supplier_id.id == sorted_workorders[
# i - 1].supplier_id.id:
# consecutive_workorders = [workorder]
# else:
# proc_workorders.append([workorder])
# # 立即创建外协出入库单和采购订单
# # self.env['stock.picking'].create_outcontract_picking(workorder, production)
# # self.env['purchase.order'].get_purchase_order(workorder, production,
# # product_id_to_production_names)
# consecutive_workorders = []
#
# # 处理最后一个组,即使它可能只有一个工作订单
# if consecutive_workorders:
# proc_workorders.append(consecutive_workorders)
# self.env['stock.picking'].create_outcontract_picking(consecutive_workorders, production)
# self.env['purchase.order'].get_purchase_order(consecutive_workorders, production,
# product_id_to_production_names)
if not sorted_workorders:
return
for workorders in reversed(sorted_workorders):
self.env['stock.picking'].create_outcontract_picking(workorders, production, sorted_workorders)
self.env['purchase.order'].get_purchase_order(workorders, production, product_id_to_production_names)
@@ -977,6 +941,8 @@ class MrpProduction(models.Model):
and item.process_parameters_id == work.surface_technics_parameters_id) or
(item.route_id.name == work.name and item.panel
and item.panel == work.processing_panel))
if work.name == '人工线下加工':
td_ids = technology_design_ids.filtered(lambda item: (item.route_id.name in work.name))
if td_ids:
work.sequence = td_ids[0].sequence
cancel_work_ids = workorder_ids.filtered(lambda item: item.state in ('已取消', 'cancel'))
@@ -1578,18 +1544,12 @@ class MrpProduction(models.Model):
first_order = self.env['mrp.production'].search(
[('origin', '=', order.origin), ('product_id', '=', order.product_id.id)], limit=1, order='id asc')
order.picking_ids = self.env['stock.picking'].search([
('group_id', '!=', False), ('state', '!=', 'cancel'),
'|', # 表示“或”的开始
('group_id', '=', order.procurement_group_id.id),
('related_group_ids', '=', order.procurement_group_id.id)
('group_id', '=', first_order.procurement_group_id.id), ('group_id', '!=', False),
])
order.delivery_count = len(first_order.picking_ids)
else:
order.picking_ids = self.env['stock.picking'].search([
('group_id', '!=', False),('state', '!=', 'cancel'),
'|', # 表示“或”的开始
('group_id', '=', order.procurement_group_id.id),
('related_group_ids', '=', order.procurement_group_id.id)
('group_id', '=', order.procurement_group_id.id), ('group_id', '!=', False),
])
order.delivery_count = len(order.picking_ids)
@@ -1621,6 +1581,26 @@ class MrpProduction(models.Model):
})
return action
def _subcontract_sanity_check(self):
for production in self:
if production.product_tracking != 'none' and not self.lot_producing_id:
raise UserError(_('You must enter a serial number for %s') % production.product_id.name)
for sml in production.move_raw_ids.move_line_ids:
if sml.tracking != 'none' and not sml.lot_id:
picking_ids = production.picking_ids.filtered(
lambda p: p.state not in ['done', 'cancel'])
picking_num = len(picking_ids)
picking_info = ', '.join(
['%s:%s' % (picking.picking_type_id.name, picking.name) for picking in picking_ids]
)
if picking_info:
raise UserError(_('You have %s incomplete supplies: %s') % (
picking_num, picking_info))
else:
raise UserError(
_('You must enter a serial number for each line of %s') % sml.product_id.display_name)
return True
class sf_detection_result(models.Model):
_name = 'sf.detection.result'

View File

@@ -17,6 +17,7 @@ from odoo.exceptions import UserError, ValidationError
from odoo.addons.sf_mrs_connect.models.ftp_operate import FtpController
class ResMrpWorkOrder(models.Model):
_inherit = 'mrp.workorder'
_order = 'sequence asc'
@@ -129,7 +130,7 @@ class ResMrpWorkOrder(models.Model):
Y10_axis = fields.Float(default=0)
Z10_axis = fields.Float(default=0)
X_deviation_angle = fields.Integer(string="X轴偏差度", default=0)
test_results = fields.Selection([("合格", "合格"), ("返工", "返工"), ("报废", "报废")], default='合格',
test_results = fields.Selection([("合格", "合格"), ("返工", "返工")], default='合格',
string="检测结果", tracking=True)
cnc_ids = fields.One2many("sf.cnc.processing", 'workorder_id', string="CNC加工程序")
cmm_ids = fields.One2many("sf.cmm.program", 'workorder_id', string="CMM程序")
@@ -330,7 +331,7 @@ class ResMrpWorkOrder(models.Model):
return result
def _get_surface_technics_purchase_ids(self):
domain = [('origin', '=', self.production_id.name), ('purchase_type', '=', 'consignment')]
domain = [('origin', 'like', '%' + self.production_id.name + '%'), ('purchase_type', '=', 'consignment')]
purchase_orders = self.env['purchase.order'].search(domain)
purchase_orders_id = self.env['purchase.order']
for po in purchase_orders:
@@ -1035,49 +1036,6 @@ class ResMrpWorkOrder(models.Model):
'production_id.tool_state', 'production_id.schedule_state', 'sequence',
'production_id.programming_state')
def _compute_state(self):
# super()._compute_state()
# for workorder in self:
# if workorder.sequence != 1:
# previous_workorder = self.env['mrp.workorder'].search(
# [('production_id', '=', workorder.production_id.id),
# ('sequence', '=', workorder.sequence - 1)])
# if workorder.state == 'pending':
# if all([wo.state in ('done', 'cancel') for wo in workorder.blocked_by_workorder_ids]):
# if workorder.production_id.reservation_state == 'assigned' and workorder.production_id.schedule_state == '已排':
# if ((workorder.sequence == 1 and not workorder.blocked_by_workorder_ids)
# or (workorder.blocked_by_workorder_ids.state in ('done', 'cancel')
# and workorder.blocked_by_workorder_ids.test_results not in ['报废', '返工'])
# or (previous_workorder.state in ('done', 'cancel')
# and not workorder.blocked_by_workorder_ids
# and previous_workorder.test_results not in ['报废', '返工'])
# ):
# workorder.state = 'ready'
# continue
# if workorder.production_id.schedule_state == '未排' and workorder.state in ('waiting', 'ready'):
# if workorder.sequence != 1:
# workorder.state = 'pending'
# continue
# if workorder.state not in ('waiting', 'ready'):
# continue
# if workorder.state in (
# 'waiting') and workorder.sequence == 1 and workorder.production_id.schedule_state == '已排':
# workorder.state = 'ready'
# continue
# if not all([wo.state in ('done', 'cancel') for wo in workorder.blocked_by_workorder_ids]):
# workorder.state = 'pending'
# if workorder.state in ['waiting']:
# if previous_workorder.state == 'waiting':
# workorder.state = 'pending'
# if workorder.sequence == 1 and workorder.state == 'pending':
# workorder.state = 'waiting'
# continue
# if workorder.production_id.reservation_state not in ('waiting', 'confirmed', 'assigned'):
# continue
# if workorder.production_id.reservation_state == 'assigned' and workorder.state == 'waiting' and workorder.production_id.schedule_state == '已排':
# workorder.state = 'ready'
# elif workorder.production_id.reservation_state != 'assigned' and workorder.state == 'ready':
# workorder.state = 'waiting'
for workorder in self:
# 如果工单的工序没有进行排序则跳出循环
if workorder.production_id.workorder_ids.filtered(lambda wk: wk.sequence == 0):
@@ -1111,7 +1069,7 @@ class ResMrpWorkOrder(models.Model):
continue
else:
workorder.state = 'ready'
continue
continue
# ================= 如果制造订单刀具状态为[无效刀、缺刀] 或者 制造订单状态为[返工]==========================
if (workorder.production_id.tool_state in ['1', '2'] or workorder.production_id.state == 'rework'
or workorder.production_id.schedule_state != '已排'
@@ -1134,86 +1092,12 @@ class ResMrpWorkOrder(models.Model):
if workorder.is_subcontract is False:
workorder.state = 'ready'
else:
# production_programming = self.env['mrp.production'].search(
# [('origin', '=', self.production_id.origin)], order='name asc')
# production_no_remanufacture = production_programming.filtered(
# lambda a: a.is_remanufacture is False)
# production_list = [production.name for production in production_programming]
# purchase_orders = self.env['purchase.order'].search(
# [('origin', 'ilike', ','.join(production_list))])
# for line in purchase_orders.order_line:
# if (
# line.product_id.server_product_process_parameters_id == workorder.surface_technics_parameters_id
# and line.product_qty == len(production_no_remanufacture)):
# if all(pur_order.state == 'purchase' for pur_order in purchase_orders):
# workorder.state = 'ready'
# else:
# workorder.state = 'waiting'
purchase_orders_id = self._get_surface_technics_purchase_ids()
if purchase_orders_id:
workorder.state = 'ready' if purchase_orders_id.state == 'purchase' else 'waiting'
else:
workorder.state = 'waiting'
# re_work = self.env['mrp.workorder'].search([('production_id', '=', workorder.production_id.id),
# ('processing_panel', '=', workorder.processing_panel),
# ('is_rework', '=', True), ('state', 'in', ['done', 'rework'])])
# cnc_workorder = self.env['mrp.workorder'].search(
# [('production_id', '=', workorder.production_id.id),
# ('processing_panel', '=', workorder.processing_panel),
# ('routing_type', '=', 'CNC加工'), ('state', 'in', ['done', 'rework']),
# ('test_results', '=', '返工')])
# cnc_workorder_pending = self.env['mrp.workorder'].search(
# [('production_id', '=', workorder.production_id.id),
# ('processing_panel', '=', workorder.processing_panel),
# ('routing_type', '=', 'CNC加工'), ('state', 'in', ['pending'])])
# unclamp_workorder = self.env['mrp.workorder'].search(
# [('production_id', '=', workorder.production_id.id),
# ('sequence', '=', workorder.sequence - 1),
# ('state', 'in', ['done'])])
# if workorder.state not in ['cancel', 'progress', 'rework']:
# if workorder.production_id.state == 'rework':
# if workorder.routing_type == '装夹预调':
# # # 有返工工单
# # if re_work:
# # 新工单
# if workorder.is_rework is False:
# if (workorder.production_id.programming_state == '已编程'
# and workorder.production_id.is_rework is False):
# if re_work or cnc_workorder:
# workorder.state = 'ready'
# else:
# if workorder.production_id.is_rework is True:
# if re_work or cnc_workorder:
# workorder.state = 'waiting'
#
# elif workorder.routing_type == 'CNC加工':
# pre_workorder = self.env['mrp.workorder'].search(
# [('production_id', '=', workorder.production_id.id),
# ('processing_panel', '=', workorder.processing_panel),
# ('routing_type', '=', '装夹预调'), ('state', '=', 'done')])
# if pre_workorder:
# if re_work:
# workorder.state = 'waiting'
# elif workorder.routing_type == '解除装夹':
# if cnc_workorder:
# if not cnc_workorder_pending or unclamp_workorder.test_results == '报废':
# workorder.state = 'waiting'
# # else:
# # if workorder.production_id.is_rework is True:
# # workorder.state = 'waiting'
# elif workorder.production_id.state == 'progress':
# if (workorder.routing_type == '装夹预调' and workorder.production_id.programming_state == '已编程'
# and workorder.is_rework is False and workorder.state not in ['done', 'rework', 'cancel']):
# if workorder.production_id.is_rework is False:
# if re_work or cnc_workorder or unclamp_workorder:
# workorder.state = 'ready'
# # if (re_work or cnc_workorder) and workorder.production_id.is_rework is False:
# # workorder.state = 'ready'
# elif workorder.production_id.state == 'scrap':
# if workorder.routing_type == '解除装夹' and unclamp_workorder.test_results == '报废':
# workorder.state = 'waiting'
# 重写工单开始按钮方法
def button_start(self):
# 判断工单状态是否为等待组件
@@ -1456,6 +1340,9 @@ class ResMrpWorkOrder(models.Model):
# 解绑托盘
def unbind_tray(self):
for item in self:
self.env['stock.lot'].sudo().search([('rfid', '=', item.rfid_code)]).write(
{'tool_material_status': '可用'})
self.production_id.workorder_ids.write({
'rfid_code': False,
'tray_serial_number': False,

View File

@@ -10,28 +10,93 @@ from odoo.tools import OrderedSet
# _get_surface_technics_purchase_ids
class PurchaseOrder(models.Model):
_inherit = 'purchase.order'
production_count = fields.Integer(
"关联制造订单",
compute='_compute_workorder_count',
)
def action_view_production(self):
origins = [order.name for order in self.picking_ids]
production_id = self.env['mrp.production'].search([('origin', 'in', origins)])
if not production_id:
return
action = {
'res_model': 'mrp.production',
'type': 'ir.actions.act_window',
}
if len(production_id) == 1:
action.update({
'view_mode': 'form',
'res_id': production_id.id,
})
else:
action.update({
'name': _("制造订单列表"),
'domain': [('id', 'in', production_id.ids)],
'view_mode': 'tree,form',
})
return action
def _compute_workorder_count(self):
for purchase in self:
origins = [order.name for order in purchase.picking_ids]
production_id = self.env['mrp.production'].search([('origin', 'in', origins)])
purchase.production_count = len(production_id)
def button_confirm(self):
super().button_confirm()
workorders = self.env['mrp.workorder'].search([('purchase_id', '=', self.id)])
workorders = self.env['mrp.workorder'].search([('purchase_id', '=', self.id), ('state', '!=', 'cancel')])
for workorder in workorders:
if workorder.routing_type == '表面工艺' and workorder.is_subcontract is True:
if workorder.routing_type == '表面工艺' and workorder.is_subcontract is True:
move_out = workorder.move_subcontract_workorder_ids[1]
# move_out = self.env['stock.move'].search(
# [('location_id', '=', self.env['stock.location'].search(
# [('barcode', 'ilike', 'WH-PREPRODUCTION')]).id),
# ('location_dest_id', '=', self.env['stock.location'].search(
# [('barcode', 'ilike', 'VL-SPOC')]).id),
# ('origin', '=', self.production_id.name), ('state', 'not in', ['cancel', 'done'])])
for mo in move_out:
if mo.state != 'done':
mo.write({'state': 'assigned', 'production_id': False})
if not mo.move_line_ids:
self.env['stock.move.line'].create(mo.get_move_line(workorder.production_id, workorder))
return True
origin_sale_id = fields.Many2one('sale.order', string='销售订单号', store=True, compute='_compute_origin_sale_id')
origin_sale_ids = fields.Many2many('sale.order', string='销售订单号(多个)', store=True,
compute='_compute_origin_sale_id')
@api.depends('origin')
def _compute_origin_sale_id(self):
for purchase in self:
if not purchase.origin:
continue
elif 'MO' in purchase.origin:
mp_name_list = [name.strip() for name in purchase['origin'].split(',')]
os_ids = list({mp_id.sale_order_id.id for mp_id in self.env['mrp.production'].sudo().search([
('name', 'in', mp_name_list)])})
if len(os_ids) == 1:
purchase.origin_sale_id = os_ids[0]
elif len(os_ids) >= 2:
purchase.origin_sale_ids = os_ids
elif 'S' in purchase.origin:
os_name_list = [name.strip() for name in purchase['origin'].split(',')]
os_ids = self.env['sale.order'].sudo().search([('name', 'in', os_name_list)])
if len(os_ids) == 1:
purchase.origin_sale_id = os_ids.id
elif len(os_ids) >= 2:
purchase.origin_sale_ids = os_ids.ids
elif 'IN' in purchase.origin:
sp_name_list = [name.strip() for name in purchase['origin'].split(',')]
os_ids = list({sp_id.sale_order_id.id for sp_id in self.env['stock.picking'].sudo().search([
('name', 'in', sp_name_list)])})
if len(os_ids) == 1:
purchase.origin_sale_id = os_ids[0]
elif len(os_ids) >= 2:
purchase.origin_sale_ids = os_ids
class PurchaseOrderLine(models.Model):
_inherit = 'purchase.order.line'
part_number = fields.Char('零件图号', related='product_id.part_number', readonly=True)
related_product = fields.Many2one('product.product',compute='_compute_related_product', string='关联产品',help='经此产品工艺加工成的成品')
related_product = fields.Many2one('product.product', compute='_compute_related_product', string='关联产品',
help='经此产品工艺加工成的成品')
@api.depends('order_id.origin')
def _compute_related_product(self):
for record in self:
@@ -40,4 +105,3 @@ class PurchaseOrderLine(models.Model):
record.related_product = production_id.product_id if production_id else False
else:
record.related_product = False

View File

@@ -148,61 +148,8 @@ class SaleOrder(models.Model):
self.env.ref("base.user_admin")).bom_create(product, bom_type, 'product')
product_bom_purchase.with_user(self.env.ref("base.user_admin")).bom_create_line_has(
purchase_embryo)
result = super(SaleOrder, self).action_confirm()
self.merge_picking()
return result
return super(SaleOrder, self).action_confirm()
def merge_picking(self):
"""
合并多个stock.picking为一个新的stock.picking。
:param picking_ids: 需要合并的stock.picking记录ID列表
:return: 合并后的新的stock.picking对象
"""
picking_idss = self.env['stock.picking'].search([('retrospect_ref', 'ilike','%'+ self.name +'%')])
for pick in picking_idss:
print('qfwowio',pick)
picking_ids = self.env['stock.picking'].search([('retrospect_ref', '=', self.default_code)])
if not picking_ids:
return
# 获取需要合并的 stock.picking 记录
# 创建一个新的 stock.picking 作为合并结果
group = self.env['procurement.group'].create({
'name': self.name,
'partner_id': self.partner_id.id,
})
new_picking = self.env['stock.picking'].create({
'partner_id': picking_ids[0].partner_id.id,
'location_id': picking_ids[0].location_id.id,
'location_dest_id': picking_ids[0].location_dest_id.id,
'move_ids': False,
'sale_id': self.id,
'picking_type_id': picking_ids[0].picking_type_id.id,
'origin': '合并自: ' + ','.join([p.origin for p in picking_ids]),
'retrospect_ref':self.default_code,
'person_of_delivery':picking_ids[0].person_of_delivery,
'telephone_of_delivery': picking_ids[0].telephone_of_delivery,
'address_of_delivery': picking_ids[0].address_of_delivery,
'group_id':picking_ids[0].group_id.id
})
# 合并所有 move_lines
for picking in picking_ids:
for move in picking.move_ids:
# 复制 move_lines 到新的 picking
new_move_vals = move.copy_data()[0]
new_move_vals['picking_id']=new_picking.id
self.env['stock.move'].create(new_move_vals)
for pick in picking_idss:
print('qfwowio',pick)
# 处理合并后的配送单状态
new_picking.action_confirm() # 确认新的配送单
for pick in picking_idss:
print('qfwowio',pick)
new_picking.action_assign() # 分配新的配送单
# 删除原有的配送单
picking_ids.write({'state': 'cancel'}) # 将原配送单状态更改为取消
return new_picking
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
part_number = fields.Char('零件图号', related='product_id.part_number', readonly=True)

View File

@@ -36,7 +36,6 @@ class sf_technology_design(models.Model):
return workorders_values_str
def write(self, vals):
print('qwfojkqwfkio')
return super(sf_technology_design, self).write(vals)
def unlink_technology_design(self):
self.active = False

View File

@@ -587,53 +587,35 @@ class StockPicking(models.Model):
telephone_of_delivery = fields.Char('电话号码', compute='_compute_move_ids', store=True)
address_of_delivery = fields.Char('联系地址', compute='_compute_move_ids', store=True)
retrospect_ref = fields.Char('平台订单号', compute='_compute_move_ids', store=True)
sale_name = fields.Char('销售订单', compute='_compute_move_ids', store=True)
retrospect_ref = fields.Char('追溯参考', compute='_compute_move_ids', store=True)
sale_order_id = fields.Many2one('sale.order', '销售单号', compute='_compute_move_ids', store=True)
picking_type_sequence_code = fields.Char(related='picking_type_id.sequence_code')
related_group_ids = fields.Many2many(
'procurement.group', string='关联捕获组',
readonly=True, compute='_compute_related_group_ids', store=True)
@api.depends('origin')
def _compute_related_group_ids(self):
for record in self:
if not record.origin:
continue
names = record.origin.split(',')
related_group_ids = self.env['procurement.group'].search([('name', 'in', names)])
record.related_group_ids = [(6, 0, related_group_ids.ids)]
@api.depends('move_ids', 'move_ids.product_id')
def _compute_move_ids(self):
for item in self:
if item.move_ids:
if item.picking_type_id.sequence_code == 'DL':
sale_name = item.move_ids[0].product_id.with_context(lang='zh_CN').name.split('-')[1]
item.sale_name=sale_name
if 'S' in sale_name:
sale_id = self.env['sale.order'].sudo().search([('name', '=', sale_name)])
item.person_of_delivery = sale_id.person_of_delivery
item.telephone_of_delivery = sale_id.telephone_of_delivery
item.address_of_delivery = sale_id.address_of_delivery
product_id = item.move_ids[0].product_id
if product_id:
sale_info = None
if product_id.categ_id.type == '坯料' and product_id.name.startswith('R-S'):
parts = product_id.name.split('-')
if len(parts) >= 3:
sale_name = parts[1]
sale_info = self.env['sale.order'].sudo().search(
[('name', '=', sale_name)])
else:
raise ValidationError('坯料名称格式错误,正确格式为[R-S???-?]')
move_ids = []
for move_id in item.move_ids:
move_ids.append(move_id.product_id.id)
boms = self.env['mrp.bom'].sudo().search([('bom_line_ids.product_id', 'in', move_ids)])
if boms:
codes_list = []
for bom in boms:
if bom.product_tmpl_id.default_code:
code_list = bom.product_tmpl_id.default_code.split('-')
if len(code_list) >= 4:
code = '-'.join(code_list[:4])
if code not in codes_list:
codes_list.append(code)
else:
raise ValidationError('坯料成品的内部参考值格式错误')
item.retrospect_ref = ','.join(codes_list)
elif item.picking_type_id.sequence_code in ['INT', 'PC']:
pass
sale_order_line = self.env['sale.order.line'].sudo().search(
[('product_id', '=', product_id.id)])
if sale_order_line:
sale_info = sale_order_line[0].order_id
if sale_info:
item.sale_order_id = sale_info.id
item.retrospect_ref = sale_info.order_code
if item.picking_type_id.sequence_code == 'DL':
item.person_of_delivery = sale_info.person_of_delivery
item.telephone_of_delivery = sale_info.telephone_of_delivery
item.address_of_delivery = sale_info.address_of_delivery
# 设置外协出入单的名称
def _get_name_Res(self, rescode):
@@ -669,52 +651,66 @@ class StockPicking(models.Model):
if move_out:
workorder = move_out.subcontract_workorder_id
workorder.button_start()
if self.location_id.name == '成品存货区' and self.location_dest_id.name == '客户':
sale_id = self.env['sale.order'].sudo().search(
[('name', '=', self.origin)])
stock_picking_list = self.env['stock.picking'].sudo().search(
[('id', 'in', sale_id.picking_ids.ids)])
stock_picking = stock_picking_list.filtered(lambda p: p.state not in ("done", "cancel"))
if sale_id and not stock_picking:
sale_id.write({'state': 'delivered'})
return res
# 创建 外协出库入单
def create_outcontract_picking(self, workorders, item, sorted_workorders):
for workorder in workorders:
if workorder.move_subcontract_workorder_ids:
workorder.move_subcontract_workorder_ids.write({'state': 'waiting'})
workorder.move_subcontract_workorder_ids.picking_id.write({'state': 'waiting'})
workorder.move_subcontract_workorder_ids.write({'state': 'cancel'})
workorder.move_subcontract_workorder_ids.picking_id.write({'state': 'cancel'})
# 创建一个新的补货组
procurement_group_id = self.env['procurement.group'].create({
'name': workorder.name,
'partner_id': self.partner_id.id,
})
move_dest_id = False
# 如果当前工单是是制造订单的最后一个工艺外协工单
if workorder == next((workorder for workorder in reversed(sorted_workorders) if workorder.is_subcontract),
None):
move_dest_id = item.move_raw_ids[0].id
else:
# 创建一个新的补货组
procurement_group_id = self.env['procurement.group'].create({
'name': workorder.name,
'partner_id': self.partner_id.id,
})
move_dest_id = False
# 如果当前工单是是制造订单的最后一个工艺外协工单
if workorder == next((workorder for workorder in reversed(item.workorder_ids) if workorder.is_subcontract), None):
move_dest_id = item.move_raw_ids[0].id
else:
# 从sorted_workorders中找到上一工单的move
if len(sorted_workorders) > 1:
move_dest_id = sorted_workorders[sorted_workorders.index(workorder)+1].move_subcontract_workorder_ids[1].id
new_picking = True
outcontract_picking_type_in = self.env.ref(
'sf_manufacturing.outcontract_picking_in').id,
outcontract_picking_type_out = self.env.ref(
'sf_manufacturing.outcontract_picking_out').id,
moves_in = self.env['stock.move'].sudo().create(
self.env['stock.move']._get_stock_move_values_Res(item, outcontract_picking_type_in,
procurement_group_id.id, move_dest_id))
picking_in = self.create(
moves_in._get_new_picking_values_Res(item, workorder, 'WH/OCIN/'))
# pick_ids.append(picking_in.id)
moves_in.write(
{'picking_id': picking_in.id, 'state': 'waiting'})
moves_in._assign_picking_post_process(new=new_picking)
moves_out = self.env['stock.move'].sudo().create(
self.env['stock.move']._get_stock_move_values_Res(item, outcontract_picking_type_out,
procurement_group_id.id, moves_in.id))
workorder.write({'move_subcontract_workorder_ids': [(6, 0, [moves_in.id, moves_out.id])]})
picking_out = self.create(
moves_out._get_new_picking_values_Res(item, workorder, 'WH/OCOUT/'))
# pick_ids.append(picking_out.id)
moves_out.write(
{'picking_id': picking_out.id, 'state': 'waiting'})
moves_out._assign_picking_post_process(new=new_picking)
# 从sorted_workorders中找到上一工单的move
if len(sorted_workorders) > 1:
move_dest_id = \
sorted_workorders[sorted_workorders.index(workorder) + 1].move_subcontract_workorder_ids[1].id
new_picking = True
outcontract_picking_type_in = self.env.ref(
'sf_manufacturing.outcontract_picking_in').id,
outcontract_picking_type_out = self.env.ref(
'sf_manufacturing.outcontract_picking_out').id,
context = dict(self.env.context)
context.update({
'default_production_id': item.id, # 添加额外信息到 context 中
})
moves_in = self.env['stock.move'].sudo().with_context(context).create(
self.env['stock.move']._get_stock_move_values_Res(item, outcontract_picking_type_in,
procurement_group_id.id, move_dest_id))
picking_in = self.create(
moves_in._get_new_picking_values_Res(item, workorder, 'WH/OCIN/'))
# pick_ids.append(picking_in.id)
moves_in.write(
{'picking_id': picking_in.id, 'state': 'waiting'})
moves_in._assign_picking_post_process(new=new_picking)
# self.env.context.get('default_production_id')
moves_out = self.env['stock.move'].sudo().with_context(context).create(
self.env['stock.move']._get_stock_move_values_Res(item, outcontract_picking_type_out,
procurement_group_id.id, moves_in.id))
workorder.write({'move_subcontract_workorder_ids': [(6, 0, [moves_in.id, moves_out.id])]})
picking_out = self.create(
moves_out._get_new_picking_values_Res(item, workorder, 'WH/OCOUT/'))
# pick_ids.append(picking_out.id)
moves_out.write(
{'picking_id': picking_out.id, 'state': 'waiting'})
moves_out._assign_picking_post_process(new=new_picking)
@api.depends('move_type', 'immediate_transfer', 'move_ids.state', 'move_ids.picking_id')
def _compute_state(self):
@@ -738,6 +734,34 @@ class ReStockMove(models.Model):
materiel_length = fields.Float(string='物料长度', digits=(16, 4))
materiel_width = fields.Float(string='物料宽度', digits=(16, 4))
materiel_height = fields.Float(string='物料高度', digits=(16, 4))
part_number = fields.Char(string='零件图号', compute='_compute_part_info', store=True)
part_name = fields.Char(string='零件名称', compute='_compute_part_info', store=True)
@api.depends('product_id')
def _compute_part_info(self):
for move in self:
if move.product_id.categ_id.type == '成品':
move.part_number = move.product_id.part_number
move.part_name = move.product_id.part_name
elif move.product_id.categ_id.type == '坯料':
if move.origin:
origin = move.origin.split(',')[0] if ',' in move.origin else move.origin
mrp_productio_info = self.env['mrp.production'].sudo().search(
[('name', '=', origin)])
if mrp_productio_info:
move.part_number = mrp_productio_info.part_number
move.part_name = mrp_productio_info.part_name
else:
purchase_order_info = self.env['purchase.order'].sudo().search(
[('name', '=', origin)])
if purchase_order_info:
mrp_production_ids = purchase_order_info._get_mrp_productions().ids
if mrp_production_ids:
mrp_productio_info = self.env['mrp.production'].sudo().search(
[('id', '=', mrp_production_ids[0])])
if mrp_productio_info:
move.part_number = mrp_productio_info.part_number
move.part_name = mrp_productio_info.part_name
def _get_stock_move_values_Res(self, item, picking_type_id, group_id, move_dest_ids=False):
route_id = self.env.ref('sf_manufacturing.route_surface_technology_outsourcing').id
@@ -754,6 +778,7 @@ class ReStockMove(models.Model):
'origin': item.name,
'group_id': group_id,
'move_dest_ids': [(6, 0, [move_dest_ids])] if move_dest_ids else False,
# 'production_id': item.id,
# 'route_ids': False if not route else [(4, route.id)],
'date_deadline': datetime.now(),
'picking_type_id': picking_type_id,

View File

@@ -183,4 +183,7 @@ access_sf_manual_product_model_type_routing_sort_manager,sf_manual_product_model
access_sf_manual_product_model_type_routing_sort_group_plan_dispatch,sf_manual_product_model_type_routing_sort_group_plan_dispatch,model_sf_manual_product_model_type_routing_sort,sf_base.group_plan_dispatch,1,0,0,0
access_sf_detection_result_manager,sf_detection_result_manager,model_sf_detection_result,,1,1,1,1
access_mrp_workorder_batch_replan_wizard_group_plan_dispatch,mrp_workorder_batch_replan_wizard_group_plan_dispatch,model_mrp_workorder_batch_replan_wizard,sf_base.group_plan_dispatch,1,1,1,0
access_mrp_workorder_batch_replan_wizard_group_plan_dispatch,mrp_workorder_batch_replan_wizard_group_plan_dispatch,model_mrp_workorder_batch_replan_wizard,sf_base.group_plan_dispatch,1,1,1,0
access_mrp_workorder_group_purchase_director,mrp_workorder,model_mrp_workorder,sf_base.group_purchase_director,1,1,0,0
access_mrp_workorder_group_purchase,mrp_workorder,model_mrp_workorder,sf_base.group_purchase,1,1,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
183
184
185
186
187
188
189

View File

@@ -10,6 +10,25 @@
<field name="related_product" optional="show"/>
<field name="part_number" optional="show"/>
</xpath>
<xpath expr="//sheet//div[@class='oe_button_box']" position="inside">
<button class="oe_stat_button" name="action_view_production" type="object" icon="fa-wrench"
attrs="{'invisible': [('production_count', '=', 0)]}"
>
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="production_count"/>
</span>
<span class="o_stat_text">制造订单</span>
</div>
</button>
</xpath>
<!-- 添加销售订单号字段-->
<xpath expr="//sheet/group/group[2]/div[@name='date_approve']" position="after">
<field name="origin_sale_id" readonly="1" string="参考销售订单"
attrs="{'invisible': [('origin_sale_id' , '=', False)]}"/>
<field name="origin_sale_ids" readonly="1" string="参考销售订单" widget="many2many_tags"
attrs="{'invisible': [('origin_sale_ids' , '=', [])]}"/>
</xpath>
</field>
</record>
</data>

View File

@@ -17,6 +17,12 @@
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='backorder_id']" position="after">
<field name="retrospect_ref"/>
</xpath>
<xpath expr="//field[@name='origin']" position="after">
<field name="sale_order_id"/>
</xpath>
<xpath expr="//field[@name='user_id']" position="after">
<field name="picking_type_sequence_code" invisible="1"/>
<field name="retrospect_ref"
@@ -26,6 +32,10 @@
attrs="{'invisible':[('picking_type_sequence_code','!=','DL')]}"/>
<field name="address_of_delivery" attrs="{'invisible':[('picking_type_sequence_code','!=','DL')]}"/>
</xpath>
<xpath expr="//field[@name='product_id']" position="after">
<field name="part_number" optional="show"/>
<field name="part_name" optional="show"/>
</xpath>
</field>
</record>
@@ -34,8 +44,10 @@
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.vpicktree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='origin']" position="before">
<field name="sale_order_id" string="销售单号"/>
</xpath>
<xpath expr="//field[@name='origin']" position="after">
<field name="sale_name"/>
<field name="retrospect_ref"/>
</xpath>
</field>
@@ -46,8 +58,13 @@
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_internal_search"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="replace">
<field name="name"/>
<field name="retrospect_ref"/>
<field name="sale_order_id" string="销售单号"/>
</xpath>
<xpath expr="//filter[@name='picking_type']" position="after">
<filter string="追溯参考" name="retrospect_ref" domain="[]"
<filter string="追溯参考" name="retrospect" domain="[]"
context="{'group_by': 'retrospect_ref'}"/>
</xpath>
</field>

View File

@@ -25,38 +25,6 @@ class ProductionTechnologyReAdjustWizard(models.TransientModel):
# 该制造订单的其他同一销售订单的制造订单的工艺设计处理
if production_item != self.production_id:
self.env['sf.technology.design'].sudo().unified_procedure_multiple_work_orders(technology_designs, production_item)
# for td_other in production_item.technology_design_ids:
# # if td_other.is_auto is False:
# # td_del = technology_designs.filtered(lambda tdo: tdo.route_id.id == td_other.route_id.id)
# # if not td_del or td_del.active is False:
# # td_other.write({'active': False})
# for td_main in technology_designs:
# route_other = production_item.technology_design_ids.filtered(
# lambda td: td.route_id.id == td_main.route_id.id)
# if not route_other and td_main.active is True:
# production_item.write({'technology_design_ids': [(0, 0, {
# 'route_id': td_main.route_id.id,
# 'process_parameters_id': False if td_main.process_parameters_id is False else
# self.env[
# 'sf.production.process.parameter'].search(
# [('id', '=', td_main.process_parameters_id.id)]).id,
# 'sequence': td_main.sequence,
# 'is_auto': td_main.is_auto})]})
# else:
# for ro in route_other:
# domain = [('production_id', '=', self.production_id.id),
# ('active', 'in', [True, False]),
# ('route_id', '=', ro.route_id.id)]
# if ro.route_id.routing_type == '表面工艺':
# domain += [('process_parameters_id', '=', ro.process_parameters_id.id)]
# elif ro.route_id.routing_tag == 'special' and ro.is_auto is False:
# # display_name = ro.route_id.display_name
# domain += [('id', '=', ro.id)]
# elif ro.panel is not False:
# domain += [('panel', '=', ro.panel)]
# td_upd = self.env['sf.technology.design'].sudo().search(domain)
# if td_upd:
# ro.write({'sequence': td_upd.sequence, 'active': td_upd.active})
special_design = self.env['sf.technology.design'].sudo().search(
[('routing_tag', '=', 'special'), ('production_id', '=', production_item.id),
('is_auto', '=', False), ('active', 'in', [True, False])])
@@ -71,23 +39,6 @@ class ProductionTechnologyReAdjustWizard(models.TransientModel):
else:
domain += [('technology_design_id', '=', special.id), ('state', '!=', 'cancel')]
workorder = self.env['mrp.workorder'].search(domain)
# previous_workorder = self.env['mrp.workorder'].search(
# [('sequence', '=', workorder.sequence - 1), ('routing_type', '=', '表面工艺'),
# ('production_id', '=', workorder.production_id.id)])
# if previous_workorder:
# if previous_workorder.supplier_id != workorder.supplier_id:
# is_cancel = True
# else:
# is_cancel = True
# if workorder.state != 'cancel' and is_cancel is True:
# workorder.write({'state': 'cancel'})
# workorder.picking_ids.write({'state': 'cancel'})
# workorder.picking_ids.move_ids.write({'state': 'cancel'})
# purchase_order = self.env['purchase.order'].search(
# [('origin', '=', workorder.production_id.name)])
# for line in purchase_order.order_line:
# if line.product_id.server_product_process_parameters_id == workorder.surface_technics_parameters_id:
# purchase_order.write({'state': 'cancel'})
else:
workorder = self.env['mrp.workorder'].search(
[('technology_design_id', '=', special.id), ('production_id', '=', special.production_id.id), ('state', '!=', 'cancel')])

View File

@@ -27,36 +27,7 @@ class ProductionTechnologyWizard(models.TransientModel):
if production != self.production_id:
self.env['sf.technology.design'].sudo().unified_procedure_multiple_work_orders(technology_designs,
production)
# for td_other in production.technology_design_ids:
# if td_other.is_auto is False:
# td_del = technology_designs.filtered(lambda tdo: tdo.route_id.id == td_other.route_id.id)
# if not td_del or td_del.active is False:
# td_other.write({'active': False})
# for td_main in technology_designs:
# route_other = production.technology_design_ids.filtered(
# lambda td: td.route_id.id == td_main.route_id.id)
# if not route_other and td_main.active is True:
# production.write({'technology_design_ids': [(0, 0, {
# 'route_id': td_main.route_id.id,
# 'process_parameters_id': False if td_main.process_parameters_id is False else self.env[
# 'sf.production.process.parameter'].search(
# [('id', '=', td_main.process_parameters_id.id)]).id,
# 'sequence': td_main.sequence})]})
# else:
# for ro in route_other:
# domain = [('production_id', '=', self.production_id.id),
# ('active', 'in', [True, False]),
# ('route_id', '=', ro.route_id.id)]
# if ro.route_id.routing_type == '表面工艺':
# domain += [('process_parameters_id', '=', ro.process_parameters_id.id)]
# elif ro.route_id.routing_tag == 'special' and ro.is_auto is False:
# # display_name = ro.route_id.display_name
# domain += [('id', '=', ro.id)]
# elif ro.panel is not False:
# domain += [('panel', '=', ro.panel)]
# td_upd = self.env['sf.technology.design'].sudo().search(domain)
# if td_upd:
# ro.write({'sequence': td_upd.sequence, 'active': td_upd.active})
# 特殊表面工艺
special_design = self.env['sf.technology.design'].sudo().search(
[('routing_tag', '=', 'special'), ('production_id', '=', production.id),
('is_auto', '=', False), ('active', 'in', [True, False])])

View File

@@ -207,8 +207,9 @@ class WorkpieceDeliveryWizard(models.TransientModel):
workorder.production_line_id.id != self.production_ids[0].production_line_id.id):
raise UserError(f'该rfid对应的制造订单号为{workorder.production_id.name}的目的生产线不一致')
# 调用打印成品条码方法
workorder.print_method()
if workorder.routing_type == '解除装夹':
# 调用打印成品条码方法
workorder.print_method()
# 将对象添加到对应的同模型且是多对多类型里
self.production_ids |= workorder.production_id

View File

@@ -12,7 +12,7 @@
'category': 'sf',
'website': 'https://www.sf.jikimo.com',
'depends': ['sale', 'purchase', 'sf_plan', 'jikimo_message_notify', 'stock', 'sf_quality', 'mrp',
'sf_manufacturing','product'],
'sf_manufacturing', 'product', 'quality'],
'data': [
'data/bussiness_node.xml',
'data/cron_data.xml',
@@ -20,6 +20,7 @@
'security/ir.model.access.csv',
'views/mrp_workorder_views.xml',
'views/purchase_order_view.xml',
'views/stock_picking_view.xml',
],
'test': [
],

View File

@@ -150,5 +150,10 @@
<field name="name">采购单已逾期提醒</field>
<field name="model">purchase.order</field>
</record>
<record id="bussiness_quality_check" model="jikimo.message.bussiness.node">
<field name="name">待质检提醒</field>
<field name="model">product.product</field>
</record>
</data>
</odoo>

View File

@@ -389,5 +389,17 @@
事项:[共有{{num}}个采购订单已逾期]({{url}})
</field>
</record>
<record id="template_quality_check" model="jikimo.message.template">
<field name="name">待质检提醒</field>
<field name="model_id" ref="product.model_product_product"/>
<field name="model">product.product</field>
<field name="bussiness_node_id" ref="bussiness_quality_check"/>
<field name="msgtype">markdown</field>
<field name="urgency">normal</field>
<field name="content">### 待质检提醒:
单号:产品[{{name}}]({{url}})
事项:有{{num}}个质检单需要处理。</field>
</record>
</data>
</odoo>

View File

@@ -13,3 +13,4 @@ from . import sf_message_maintenance_logs
from . import sf_message_mrp_production_wizard
from . import sf_message_mrp_production_adjust_wizard
from . import sf_message_product
from . import sf_message_quality_check

View File

@@ -63,8 +63,9 @@ class SFMessageMrpProduction(models.Model):
[('origin', 'in', mrp_production_names), ('state', '=', 'assigned')])
if stock_picking_num >= 1:
url = self.env['ir.config_parameter'].sudo().get_param('web.base.url')
action_id = self.env.ref('stock.action_picking_tree_ready').id
url_with_id = f"{url}/web#view_type=list&action={action_id}"
action_id = self.env.ref('sf_message.action_picking_outsourced_tree_ready').id
menu_id = self.env.ref('stock.menu_stock_root').id
url_with_id = f"{url}/web#view_type=list&action={action_id}&menu_id={menu_id}"
content = content.replace('{{name}}', mrp_production.product_id.name).replace('{{url}}',
url_with_id).replace(
'{{num}}', str(stock_picking_num))

View File

@@ -3,7 +3,7 @@ from odoo import models, fields, api, _
from urllib.parse import urlencode
class SFMessagePlan(models.Model):
class SFMessageProduct(models.Model):
_name = 'product.product'
_inherit = ['product.product', 'jikimo.message.dispatch']
@@ -28,7 +28,19 @@ class SFMessagePlan(models.Model):
'{{number}}', str(production_num)).replace(
'{{request_url}}', url)
contents.append(content)
return contents
if message_queue_id.message_template_id.name == '待质检提醒':
content = message_queue_id.message_template_id.content
product_product = self.env['product.product'].sudo().search([('id', '=', int(message_queue_id.res_id))])
quality_check_num = self.env['quality.check'].sudo().search_count(
[('product_id', '=', product_product.id), ('quality_state', '=', 'none')])
if quality_check_num >= 1:
url = self.env['ir.config_parameter'].sudo().get_param('web.base.url')
action_id = self.env.ref('quality_control.quality_check_action_report').id
url_with_id = f"{url}/web#view_type=list&action={action_id}"
content = content.replace('{{name}}', product_product.name).replace('{{url}}', url_with_id).replace(
'{{num}}', str(quality_check_num))
contents.append(content)
return contents, message_queue_ids
def get_request_url(self):
url = self.env['ir.config_parameter'].sudo().get_param('web.base.url')

View File

@@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
import logging
from odoo import models, fields, api, _
class SFMessageQualityCheck(models.Model):
_name = 'quality.check'
_inherit = ['quality.check', 'jikimo.message.dispatch']
@api.model_create_multi
def create(self, vals_list):
result = super().create(vals_list)
try:
# 判断是否为web页面创建请求
is_web_request = self.env.context.get('is_web_request', False)
if not is_web_request:
for obj in result:
jikimo_message_queue = self.get_message_queue(obj.product_id.id)
if not jikimo_message_queue:
obj.product_id.add_queue('待质检提醒')
except Exception as e:
logging.info('add_queue待质检提醒 error:%s' % e)
return result
def get_message_queue(self, res_id):
business_node_id = self.env.ref('sf_message.bussiness_quality_check').id
message_template = self.env["jikimo.message.template"].sudo().search([
("name", "=", '待质检提醒'),
("bussiness_node_id", "=", business_node_id)
], limit=1)
jikimo_message_queue = self.env['jikimo.message.queue'].sudo().search(
[('res_id', '=', res_id), ("message_status", "in", ("pending", "sent")),
('message_template_id', '=', message_template.id)])
return jikimo_message_queue

View File

@@ -32,7 +32,7 @@ class SFMessageSale(models.Model):
for purchase_order_id in purchase_order_ids:
if purchase_order_id.purchase_type == 'outsourcing':
purchase_order_id.add_queue('委外加工采购单提醒')
if purchase_order_id.purchase_type == 'standard':
if purchase_order_id.purchase_type == 'outside':
purchase_order_id.add_queue('外购订单采购单提醒')
except Exception as e:
logging.info('add_queue error:%s' % e)

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_picking_internal_search_sf" model="ir.ui.view">
<field name="name">stock.picking.search</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_internal_search"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='activities_exception']" position="before">
<filter name="outsourced" string="外协出库" domain="[('picking_type_id.name', '=', '外协出库')]"
invisible="1"/>
<separator/>
</xpath>
</field>
</record>
<record id="action_picking_outsourced_tree_ready" model="ir.actions.act_window">
<field name="name">待办</field>
<field name="res_model">stock.picking</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">tree,kanban,form,calendar</field>
<field name="domain"></field>
<field name="context">{'search_default_outsourced': 1,'contact_display': 'partner_address',
'search_default_available': 1}
</field>
<field name="search_view_id" ref="stock.view_picking_internal_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
没有仓库调拨。 让我们创建一个!
</p>
<p>
移动允许您将产品从一个位置移动到另外一个位置。
</p>
</field>
</record>
</odoo>

View File

@@ -2023,6 +2023,11 @@ msgstr "<span class=\"o_stat_text\">损失</span>"
msgid "<span class=\"o_stat_text\">Maintenance</span>"
msgstr ""
#. module: sf_manufacturing
#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__confirmed
msgid "待排程"
msgstr "待排程"
#. module: mrp
#: model_terms:ir.ui.view,arch_db:mrp.product_product_form_view_bom_button
#: model_terms:ir.ui.view,arch_db:mrp.product_template_form_view_bom_button

View File

@@ -25,7 +25,7 @@ class SfQualityCncTest(models.Model):
('pass', '合格'),
('fail', '不合格')], string='判定结果')
number = fields.Integer('数量', default=1)
test_results = fields.Selection([("合格", "合格"), ("返工", "返工"), ("报废", "报废")], string="检测结果")
test_results = fields.Selection([("合格", "合格"), ("返工", "返工")], string="检测结果")
reason = fields.Selection(
[("programming", "编程"), ("cutter", "刀具"), ("clamping", "装夹"), ("operate computer", "操机"),
("technology", "工艺"), ("customer redrawing", "客户改图")], string="原因")

View File

@@ -285,13 +285,14 @@ class RePurchaseOrder(models.Model):
[('standard', '标准采购'), ('consignment', '工序外协'), ('outsourcing', '委外加工'), ('outside', '外购订单')],
string='采购类型', default='standard', store=True, compute='_compute_purchase_type')
origin_sale_id = fields.Many2one('sale.order', string='销售订单号', compute='_compute_origin_sale_id')
# 合同编号
contract_number = fields.Char(string='合同编号', size=20)
# 合同概况
contract_summary = fields.Text(string='合同概况')
# 选择是否为紧急采购
urgent_purchase = fields.Selection([('no', ''), ('yes', '')], string='紧急采购', default='no')
@api.depends('origin')
def _compute_purchase_type(self):
for purchase in self:
@@ -308,21 +309,6 @@ class RePurchaseOrder(models.Model):
purchase.purchase_type = 'outsourcing'
break
@api.depends('order_line.move_dest_ids.group_id.mrp_production_ids',
'order_line.move_ids.move_dest_ids.group_id.mrp_production_ids', 'origin')
def _compute_origin_sale_id(self):
for purchase in self:
productions_ids = purchase._get_mrp_productions()
if productions_ids:
if productions_ids[0].sale_order_id:
purchase.origin_sale_id = productions_ids[0].sale_order_id.id
continue
order_id = self.env['sale.order'].sudo().search([('name', '=', purchase.origin)])
if order_id:
purchase.origin_sale_id = order_id.id
continue
purchase.origin_sale_id = False
delivery_warning = fields.Selection([('normal', '正常'), ('warning', '预警'), ('overdue', '已逾期')],
string='交期状态', default='normal',
tracking=True)
@@ -361,6 +347,7 @@ class RePurchaseOrder(models.Model):
purchase_order = pp._get_surface_technics_purchase_ids()
if purchase_order:
purchase_order.write({'state': 'draft'})
pp.purchase_id = [(6, 0, [purchase_order.id])]
else:
server_template = self.env['product.template'].search(
[('server_product_process_parameters_id', '=', pp.surface_technics_parameters_id.id),
@@ -370,12 +357,16 @@ class RePurchaseOrder(models.Model):
'product_qty': 1,
'product_uom': server_template.uom_id.id
}))
# 获取服务商品最后一个供应商的采购员
purchase_user_id = server_template.seller_ids[-1].partner_id.purchase_user_id
purchase_order = self.env['purchase.order'].sudo().create({
'partner_id': server_template.seller_ids[0].partner_id.id,
'origin': production.name,
'state': 'draft',
'purchase_type': 'consignment',
'order_line': server_product_process})
'order_line': server_product_process,
'user_id': purchase_user_id.id
})
pp.purchase_id = [(6, 0, [purchase_order.id])]
# self.env.cr.commit()
@@ -405,6 +396,23 @@ class RePurchaseOrder(models.Model):
production = self.env['mrp.production'].search([('name', '=', production_name)])
for workorder in production.workorder_ids.filtered(
lambda wd: wd.routing_type == '表面工艺' and wd.state == 'waiting' and line.product_id.server_product_process_parameters_id == wd.surface_technics_parameters_id):
work_ids = workorder.production_id.workorder_ids.filtered(
lambda wk: wk.state not in ['done', 'rework', 'cancel'])
min_sequence_wk = min(work_ids, key=lambda wk: wk.sequence)
artificial_offline = (
workorder.production_id.production_type == '人工线下加工' and workorder.production_id.schedule_state != '已排')
auto_production = (
workorder.production_id.production_type == '自动化产线加工' and workorder.production_id.programming_state != '已编程')
if workorder.sequence == min_sequence_wk.sequence:
if artificial_offline or auto_production:
raise UserError('等待组件')
else:
sorted_work_ids = work_ids.sorted(key=lambda w: w.sequence)
previous_workorder = self.env['mrp.workorder'].search([('sequence', '<', workorder.sequence),
('production_id', '=', workorder.production_id.id),
('state', '=', 'done')], order='sequence desc', limit=1)
if not previous_workorder:
raise UserError('等待组件')
workorder.state = 'ready'
return result
@@ -437,6 +445,7 @@ class PurchaseOrderLine(models.Model):
part_name = fields.Char('零件名称', related='product_id.part_name', readonly=True)
# part_number = fields.Char('零件图号',related='product_id.part_number', readonly=True)
class ResPartnerToSale(models.Model):
_inherit = 'res.partner'

View File

@@ -9,12 +9,16 @@
<xpath expr="//header/button[@name='action_view_picking']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//header/button[@name='button_confirm']" position="replace">
</xpath>
<xpath expr="//header/button[@name='button_confirm']" position="replace">
</xpath>
<xpath expr="//header/button[@name='action_rfq_send'][1]" position="before">
<button name="button_confirm" type="object" states="sent" string="Confirm Order"
context="{'validate_analytic': True}" class="oe_highlight" id="bid_confirm"
data-hotkey="v"/>
<button name="button_confirm" type="object" states="draft" context="{'validate_analytic': True}"
string="Confirm Order" id="draft_confirm"/>
<button name="button_confirm" type="object" string="确认订单"
context="{'validate_analytic': True}" class="oe_highlight" id="draft_confirm"
groups="sf_base.group_purchase,sf_base.group_purchase_director"
attrs="{'invisible': [('state', 'in', ['purchase', 'done', 'cancel'])]}"
/>
<button name="action_view_picking"
string="接收产品" class="oe_highlight" type="object"
attrs="{'invisible': ['|', '|' , ('is_shipped', '=', True), ('state','not in', ('purchase','done')), ('incoming_picking_count', '=', 0)]}"
@@ -25,11 +29,11 @@
<xpath expr="//header/button[@name='button_cancel'][2]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//header/button[@name='button_confirm'][3]" position="attributes">
<attribute name="invisible">1</attribute>
<xpath expr="//field[@name='user_id']" position="attributes">
<attribute name="string">采购员</attribute>
</xpath>
<xpath expr="//header/button[@name='button_confirm'][4]" position="attributes">
<attribute name="invisible">1</attribute>
<xpath expr="//field[@name='origin']" position="attributes">
<attribute name="string">源单据</attribute>
</xpath>
<field name="partner_id" position="replace">
@@ -38,13 +42,6 @@
<field name="currency_id" position="after">
<field name="remark" attrs="{'readonly': [('state', 'in', ['purchase'])]}" string="订单备注"/>
</field>
<xpath expr="//form/header/button[@name='button_confirm'][2]" position="replace">
<button name="button_confirm" type="object" context="{'validate_analytic': True}"
string="确认订单" id="draft_confirm"
groups="sf_base.group_purchase,sf_base.group_purchase_director"
attrs="{'invisible': [('state', 'in', ['purchase', 'cancel'])]}"
/>
</xpath>
<xpath expr="//form/header/button[@name='action_rfq_send'][1]" position="replace">
<button name="action_rfq_send" states="draft" string="通过Email发送采购单" type="object"
context="{'send_rfq':True}" class="oe_highlight" data-hotkey="g"
@@ -81,10 +78,6 @@
<xpath expr="//form/header/button[@name='action_create_invoice'][2]" position="attributes">
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
</xpath>
<xpath expr="//form/header/button[@name='button_confirm']" position="attributes">
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
<!-- <button name="action_create_invoice" string="创建账单" type="object" class="oe_highlight" context="{'create_bill':True}" attrs="{'invisible': ['|', ('state', 'not in', ('purchase', 'done')), ('invoice_status', 'in', ('no', 'invoiced'))]}" data-hotkey="w" groups="sf_base.group_purchase,sf_base.group_purchase_director"/> -->
</xpath>
<!-- <xpath expr="//form/header/button[@name='action_create_invoice[2]']" position="attributes">-->
<!-- <attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>-->
<!-- </xpath>-->
@@ -181,6 +174,7 @@
<field name="partner_id" position="after">
<field name="purchase_type" string="采购类型" readonly="1"/>
<field name="picking_type_id" string="作业类型" domain="[('code','=','incoming'), '|', ('warehouse_id', '=', False), ('warehouse_id.company_id', '=', company_id)]" options="{'no_create': True}" groups="stock.group_stock_multi_locations"/>
<field name="urgent_purchase"/>
<label for="date_planned" string="最近交货日期"/>
<div name="date_planned_div" class="o_row">
<field name="date_planned" attrs="{'readonly': [('state', 'not in', ('draft', 'sent', 'to approve', 'purchase'))]}"/>
@@ -196,11 +190,6 @@
<field name="partner_ref" string="合同名称"/>
<field name="contract_number"/>
</xpath>
<!-- 添加销售订单号字段-->
<xpath expr="//sheet/group/group[2]/div[@name='date_approve']" position="after">
<!-- <field name="origin_sale_id" readonly="1" attrs="{'invisible': [('origin_sale_id', '=', False)]}" string="参考销售订单"/> -->
<field name="origin_sale_id" readonly="1" string="参考销售订单"/>
</xpath>
<xpath expr="//sheet/group/group[2]/field[@name='effective_date']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
@@ -235,6 +224,9 @@
<xpath expr="//field[@name='user_id']" position="attributes">
<attribute name="string">采购员</attribute>
</xpath>
<xpath expr="//field[@name='origin']" position="attributes">
<attribute name="string">源单据</attribute>
</xpath>
<xpath expr="//field[@name='activity_ids']" position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
@@ -292,6 +284,9 @@
<xpath expr="//field[@name='user_id']" position="attributes">
<attribute name="string">采购员</attribute>
</xpath>
<xpath expr="//field[@name='origin']" position="attributes">
<attribute name="string">源单据</attribute>
</xpath>
<xpath expr="//field[@name='user_id']" position="after">
<field name="delivery_warning" optional="show"/>
<field name="date_planned" string="最近交货日期" optional="show" widget="date"/>

View File

@@ -13,6 +13,74 @@ _logger = logging.getLogger(__name__)
class StockPicking(models.Model):
_inherit = 'stock.picking'
pro_purchase_count = fields.Integer('坯料采购单数量', compute='_compute_pro_purchase_count', store=True)
@api.depends('name')
def _compute_pro_purchase_count(self):
for sp in self:
if sp:
po_ids = self.env['purchase.order'].sudo().search([
('origin', 'like', sp.name), ('purchase_type', '=', 'standard')])
if po_ids:
sp.pro_purchase_count = len(po_ids)
def pro_purchase_order(self):
"""
坯料采购
"""
po_ids = self.env['purchase.order'].sudo().search([
('origin', 'like', self.name), ('purchase_type', '=', 'standard')])
action = {
'res_model': 'purchase.order',
'type': 'ir.actions.act_window',
}
if len(po_ids) == 1:
action.update({
'view_mode': 'form',
'res_id': po_ids.id,
})
else:
action.update({
'name': _("采购订单列表"),
'domain': [('id', 'in', po_ids.ids)],
'view_mode': 'tree,form',
})
return action
pro_out_purchase_count = fields.Integer('坯料委外单数量', compute='_compute_pro_out_purchase_count', store=True)
@api.depends('name')
def _compute_pro_out_purchase_count(self):
for sp in self:
if sp:
po_ids = self.env['purchase.order'].sudo().search([
('origin', 'like', sp.name), ('purchase_type', '=', 'outsourcing')])
if po_ids:
sp.pro_out_purchase_count = len(po_ids)
def pro_out_purchase_order(self):
"""
坯料委外
"""
po_ids = self.env['purchase.order'].sudo().search([
('origin', 'like', self.name), ('purchase_type', '=', 'outsourcing')])
action = {
'res_model': 'purchase.order',
'type': 'ir.actions.act_window',
}
if len(po_ids) == 1:
action.update({
'view_mode': 'form',
'res_id': po_ids.id,
})
else:
action.update({
'name': _("委外订单列表"),
'domain': [('id', 'in', po_ids.ids)],
'view_mode': 'tree,form',
})
return action
# 重写验证下发发货到bfm
def button_validate(self):
info = super(StockPicking, self).button_validate()

View File

@@ -1,6 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
</data>
<data>
<record id="add_check_out_view_picking_form" model="ir.ui.view">
<field name="name">添加坯料采购单链接</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//form//sheet//div[@name='button_box']//button[@name='action_picking_move_tree']" position="before">
<button class="oe_stat_button" name="pro_purchase_order" type="object" icon="fa-credit-card"
attrs="{'invisible': [('pro_purchase_count', '=', 0)]}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="pro_purchase_count"/></span>
<span class="o_stat_text">坯料采购</span>
</div>
</button>
<button class="oe_stat_button" name="pro_out_purchase_order" type="object" icon="fa-credit-card"
attrs="{'invisible': [('pro_out_purchase_count', '=', 0)]}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="pro_out_purchase_count"/></span>
<span class="o_stat_text">坯料委外</span>
</div>
</button>
</xpath>
</field>
</record>
</data>
</odoo>

View File

@@ -21,7 +21,7 @@ class FixtureMaterialSearch(models.Model):
image = fields.Binary('图片', related='product_id.image_1920')
number = fields.Integer('总数量', compute='_compute_number')
usable_num = fields.Integer('可用数量', compute='_compute_number')
have_been_used_num = fields.Integer('用数量', compute='_compute_number')
have_been_used_num = fields.Integer('用数量', compute='_compute_number')
scrap_num = fields.Integer('报废数量', compute='_compute_number')
barcode_ids = fields.One2many('stock.lot', 'fixture_material_search_id', string='序列号', readonly=True)

View File

@@ -126,16 +126,16 @@ class StockLot(models.Model):
tool_material_search_id = fields.Many2one('sf.tool.material.search', string='刀具物料搜索')
fixture_material_search_id = fields.Many2one('sf.fixture.material.search', string='夹具物料搜索')
tool_material_status = fields.Selection(
[('未入库', '未入库'), ('可用', '可用'), ('在用', '空闲'), ('报废', '报废')], string='状态',
[('未入库', '未入库'), ('可用', '空闲'), ('在用', '占用'), ('报废', '报废')], string='状态',
compute='_compute_tool_material_status', store=True)
@api.depends('quant_ids')
def _compute_tool_material_status(self):
for record in self:
if record:
if record.product_id.categ_id.name in ['刀具', '夹具']:
if record.product_id.categ_id.name in ['刀具']:
if record.quant_ids:
if record.quant_ids[-1].location_id.name in ['刀具房', '夹具房']:
if record.quant_ids[-1].location_id.name in ['刀具房']:
record.tool_material_status = '可用'
elif record.quant_ids[-1].location_id.name == '刀具组装位置':
record.tool_material_status = '在用'

View File

@@ -943,6 +943,8 @@ class SfStockPicking(models.Model):
for record in self:
if record.state != 'assigned':
continue
for move in record.move_ids:
move.action_show_details()
record.action_set_quantities_to_reservation()
record.button_validate()
@@ -1122,7 +1124,7 @@ class SfPickingType(models.Model):
if not self.env.user.has_group('base.group_system'):
action['context']['create'] = False
if self.sequence_code in ['DL', 'INT', 'PC']:
action['context']['search_default_retrospect_ref'] = 1
action['context']['search_default_retrospect'] = 1
return action