Compare commits

..

130 Commits

Author SHA1 Message Date
黄焱
80f259651c Accept Merge Request #1986: (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/1986?initial=true
2025-04-02 09:05:31 +08:00
hyyy
1c57ee0be1 修复没加引号字段 2025-04-02 09:04:38 +08:00
黄焱
c732bbad62 Accept Merge Request #1984: (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/1984?initial=true
2025-04-02 08:54:03 +08:00
马广威
5285fcd066 Accept Merge Request #1985: (feature/制造功能优化 -> develop)
Merge Request: 零件名称调为可写

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1985?initial=true
2025-04-02 08:50:06 +08:00
mgw
d318d8cb32 零件名称调为可写 2025-04-02 08:49:24 +08:00
hyyy
5b9dc05653 还原代码 2025-04-02 08:48:27 +08:00
hyyy
a513592b21 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/前端样式修改 2025-04-02 08:36:23 +08:00
胡尧
e686ea9469 Accept Merge Request #1983: (feature/commercially_launched -> develop)
Merge Request: Merge branch 'develop' into feature/commercially_launched

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1983
2025-04-01 20:45:15 +08:00
胡尧
651918c51c Merge branch 'develop' into feature/commercially_launched 2025-04-01 20:42:36 +08:00
胡尧
7b13dfcc0e Accept Merge Request #1982: (feature/tool_standard_library_process -> 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/1982
2025-04-01 20:32:39 +08:00
liaodanlong
60e139d5e0 采购申请添加字段的翻译 2025-04-01 16:59:40 +08:00
胡尧
8d5ea0ae19 去掉采购申请不同补货组不能合并的检查 2025-04-01 11:07:08 +08:00
胡尧
d7597359ba 处理多个表面工艺,确认供货路线报错的问题 2025-03-31 16:50:50 +08:00
胡尧
f8309bfaba Merge branch 'develop' into feature/commercially_launched 2025-03-31 16:07:11 +08:00
胡尧
7ed756f922 修改报错翻译 2025-03-31 16:06:50 +08:00
禹翔辉
e837b84a50 Accept Merge Request #1981: (feature/调拨验证方法优化 -> 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/1981
2025-03-31 15:57:51 +08:00
yuxianghui
e7cb100ab1 1、优化调拨单验证方法;2、隐藏请购明细列表视图字段 2025-03-31 15:55:37 +08:00
mgw
d00c9dd38c Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-31 13:02:30 +08:00
胡尧
1d857be16a 修改获取编程文件根目录 2025-03-31 09:28:30 +08:00
马广威
5914e4ca6e Accept Merge Request #1980: (feature/制造功能优化 -> develop)
Merge Request: 调整字段显隐

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1980?initial=true
2025-03-31 09:12:35 +08:00
mgw
d96970fb96 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化 2025-03-31 09:11:44 +08:00
mgw
0af9064fce 调整字段显隐 2025-03-31 09:11:21 +08:00
胡尧
21148ae74b 屏蔽sf获取编程文件的逻辑 2025-03-31 09:06:36 +08:00
胡尧
1a3590b6b6 屏蔽物流下单的按钮 2025-03-30 15:03:18 +08:00
胡尧
b55c6c1fe7 修改前置三元检测文件根目录 2025-03-30 11:16:40 +08:00
mgw
8c61dcac29 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-28 14:25:58 +08:00
马广威
41d4e9785f Accept Merge Request #1979: (feature/制造功能优化 -> develop)
Merge Request: 调整页脚布局

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1979?initial=true
2025-03-28 14:24:14 +08:00
mgw
5bf86930e9 调整页脚布局 2025-03-28 14:23:41 +08:00
mgw
7ad9885377 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-28 14:05:29 +08:00
mgw
71433c18b7 Merge branch 'feature/commercially_launched' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-28 14:03:21 +08:00
马广威
4b60ad307b Accept Merge Request #1978: (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/1978?initial=true
2025-03-28 14:02:11 +08:00
mgw
1a5c8e5f56 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化 2025-03-28 14:01:17 +08:00
mgw
8b1e12eb9f 质检报告优化 2025-03-28 14:00:55 +08:00
胡尧
dbf2257a88 Merge branch 'feature/commercially_launched' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-28 13:37:37 +08:00
胡尧
f34c01d1b0 解决表面工艺外协调拨单验证报错的问题 2025-03-28 13:37:29 +08:00
廖丹龙
9c73062593 Accept Merge Request #1977: (feature/tool_standard_library_process -> 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/1977?initial=true
2025-03-28 10:10:56 +08:00
liaodanlong
878fef18df 产品加工面部代码还原 2025-03-28 10:03:41 +08:00
liaodanlong
8348c4fc48 Merge branch 'refs/heads/develop' into feature/commercially_launched 2025-03-27 16:42:22 +08:00
廖丹龙
8643fb2385 Accept Merge Request #1976: (feature/tool_standard_library_process -> 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/1976
2025-03-27 16:41:19 +08:00
liaodanlong
77744e75d7 子制造订单零件图号零件名称问题 2025-03-27 16:38:57 +08:00
胡尧
4cbcf08da8 销售单默认筛选供货方式待确认 2025-03-27 16:10:07 +08:00
mgw
af2a589679 添加翻译文件 2025-03-27 15:59:39 +08:00
胡尧
4b6f04aa9d 修改字段显示位置 2025-03-27 15:51:16 +08:00
廖丹龙
4634d43012 Accept Merge Request #1975: (feature/tool_standard_library_process -> 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/1975
2025-03-27 15:23:00 +08:00
liaodanlong
dd6e8b6707 调试信息 2025-03-27 15:21:15 +08:00
mgw
55337815c7 修改dashboard当日完成数据计算逻辑 2025-03-27 10:42:20 +08:00
廖丹龙
0ccb7cb3d1 Accept Merge Request #1974: (feature/tool_standard_library_process -> 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/1974
2025-03-26 17:24:40 +08:00
liaodanlong
d2155b17b4 Merge branch 'refs/heads/develop' into feature/tool_standard_library_process
# Conflicts:
#	sf_manufacturing/models/product_template.py
2025-03-26 17:01:13 +08:00
liaodanlong
11a5217430 子制造订单零件图号与零件名称获取方式修改 2025-03-26 16:57:47 +08:00
管欢
855e0eb1c2 Accept Merge Request #1973: (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/1973
2025-03-26 14:50:07 +08:00
mgw
6312bb988a Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-25 15:04:15 +08:00
mgw
fe9548a0d1 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-25 14:08:06 +08:00
胡尧
0347eb48e4 销售订单行增加交期字段,销售订单列表默认值修改为供货方式待确认 2025-03-25 13:48:17 +08:00
mgw
0aae15cbce Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-25 13:32:55 +08:00
mgw
5a7d70fb6b Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-25 13:27:51 +08:00
mgw
8ea8bf1f48 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-25 10:40:48 +08:00
liaodanlong
df78019226 Merge remote-tracking branch 'origin/feature/commercially_launched' into feature/commercially_launched 2025-03-25 10:39:22 +08:00
liaodanlong
6ad945b720 产品加工面板空值处理 2025-03-25 10:39:02 +08:00
mgw
3285d4da57 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-25 10:35:00 +08:00
liaodanlong
60539462a0 报错处理 2025-03-25 10:02:39 +08:00
liaodanlong
81b425ae0c 调拨单零件图号零件名称处理 2025-03-24 17:28:16 +08:00
liaodanlong
33fabc068a 报错处理 2025-03-24 16:06:11 +08:00
liaodanlong
db4dd33709 报错处理 2025-03-24 15:54:59 +08:00
liaodanlong
4acb0fa0ba Merge branch 'refs/heads/develop' into feature/commercially_launched 2025-03-24 15:39:26 +08:00
胡尧
c5ad94c5f3 Merge branch 'develop' into feature/commercially_launched 2025-03-24 14:56:16 +08:00
胡尧
43c6686240 Merge branch 'develop' into feature/commercially_launched 2025-03-24 14:29:47 +08:00
mgw
5c35eae859 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-24 14:03:21 +08:00
mgw
fde28bed8a Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-24 13:54:14 +08:00
mgw
16ae845ad9 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-24 13:41:39 +08:00
胡尧
e10648ad07 Merge branch 'develop' into feature/commercially_launched 2025-03-24 11:13:48 +08:00
mgw
d2b02bb6f7 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-24 11:03:07 +08:00
胡尧
0e1c44c3ac Merge branch 'develop' into feature/commercially_launched 2025-03-24 09:56:19 +08:00
胡尧
5ffbe4c6fc Merge branch 'feature/commercially_launched' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-24 09:00:22 +08:00
胡尧
5ae167c133 去掉取消自动加工原因 2025-03-24 09:00:16 +08:00
mgw
0702e1dd51 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-21 18:26:58 +08:00
mgw
e861897527 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-21 18:18:29 +08:00
胡尧
3bb909c2ee Merge branch 'develop' into feature/commercially_launched 2025-03-21 15:39:56 +08:00
胡尧
da19b86bf5 Merge branch 'develop' into feature/commercially_launched 2025-03-21 15:29:49 +08:00
胡尧
dc318769af Merge branch 'develop' into feature/commercially_launched 2025-03-21 15:13:28 +08:00
mgw
311b95bca5 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-21 13:18:22 +08:00
胡尧
80118b61c2 Merge branch 'develop' into feature/commercially_launched 2025-03-21 11:24:02 +08:00
mgw
94d0c14e1f Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-20 16:23:01 +08:00
mgw
3f6f9bb709 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-20 15:44:11 +08:00
mgw
49a1ec353a Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-20 08:49:47 +08:00
mgw
b89cfb899b Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-19 15:44:21 +08:00
胡尧
0ff0cc5fbd Merge branch 'develop' into feature/commercially_launched 2025-03-19 15:41:51 +08:00
mgw
37173968fd Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-19 13:18:42 +08:00
mgw
470482b7e2 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-19 13:06:52 +08:00
mgw
5b51cc3de4 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-19 12:55:23 +08:00
mgw
9e939467e5 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-19 11:35:27 +08:00
mgw
b05492615f Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-19 11:23:49 +08:00
mgw
32ed0e9693 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-19 11:18:28 +08:00
mgw
623ebe3ec3 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-19 11:09:16 +08:00
mgw
da06688571 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-19 11:02:40 +08:00
mgw
c01451336d Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-19 10:24:26 +08:00
mgw
2db5068e85 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-19 10:06:52 +08:00
mgw
c955953335 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-18 16:51:19 +08:00
mgw
9220c4b7c4 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-18 16:42:51 +08:00
mgw
70b21c607e Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-18 16:31:48 +08:00
胡尧
4fe7300ec0 Merge branch 'develop' into feature/commercially_launched 2025-03-18 15:56:19 +08:00
mgw
282458c945 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-18 13:45:19 +08:00
胡尧
f6e87493d3 Merge branch 'develop' into feature/commercially_launched 2025-03-18 11:28:23 +08:00
mgw
e141f0af2c Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-18 10:41:01 +08:00
mgw
4618c83b2f Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-18 09:45:00 +08:00
mgw
e89400f04e Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched 2025-03-18 09:18:47 +08:00
胡尧
051f8128e9 Merge branch 'develop' into feature/commercially_launched 2025-03-17 15:05:47 +08:00
胡尧
8f61f258b1 解决冲突 2025-03-14 16:08:37 +08:00
胡尧
a864845d2b 解决销售订单form中,tree内显示模型的问题 2025-03-14 16:06:33 +08:00
胡尧
a6a2e53111 Merge branch 'develop' into feature/commercially_launched 2025-03-14 13:52:18 +08:00
胡尧
a11329eaf8 Merge branch 'develop' into feature/commercially_launched 2025-03-13 14:51:21 +08:00
胡尧
d571b77915 修改工单新模型显示 2025-03-13 14:50:26 +08:00
胡尧
24897f07f8 获取编程单,不传递模型参数 2025-03-13 13:58:13 +08:00
胡尧
53779b89a7 Merge branch 'develop' into feature/commercially_launched 2025-03-13 13:06:26 +08:00
胡尧
a1a94867f0 Merge branch 'develop' into feature/commercially_launched 2025-03-13 11:34:17 +08:00
胡尧
0a666f568d 解决待发货获取不到模型名字的问题 2025-03-13 10:52:14 +08:00
胡尧
ad8ec770b6 Merge branch 'develop' into feature/commercially_launched 2025-03-13 09:17:33 +08:00
胡尧
3cc3c48ab3 Merge branch 'develop' into feature/commercially_launched 2025-03-13 08:47:59 +08:00
胡尧
f5da36a82c 修改销售订单模型显示 2025-03-12 17:26:19 +08:00
胡尧
da489555b0 去掉多余的字段 2025-03-12 17:17:21 +08:00
胡尧
29337bfceb 调整模型显示 2025-03-12 17:05:29 +08:00
hyyy
ef0d05a29d Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/前端样式修改 2025-03-11 13:29:19 +08:00
胡尧
b8bec37e15 Merge branch 'develop' into feature/commercially_launched 2025-03-11 09:06:43 +08:00
胡尧
dedc820b50 Merge branch 'develop' into feature/commercially_launched 2025-03-10 16:31:35 +08:00
胡尧
2ccedc95f2 Merge branch 'feature/mrp_bug_fixed' into feature/commercially_launched 2025-03-06 16:24:36 +08:00
胡尧
b276f616e5 成品供应商默认取模板中最后一个 2025-03-06 14:03:31 +08:00
胡尧
cb645aa1b9 增加自动化产线的零件供货路线初始化为自动化产线加工 2025-03-06 13:59:14 +08:00
胡尧
2409dab8b0 增加非自动化原因 2025-03-05 14:27:41 +08:00
胡尧
e8fc38e6ed Merge branch 'develop' into feature/commercially_launched 2025-03-04 09:32:07 +08:00
胡尧
52e585e637 解决冲突 2025-02-20 13:51:24 +08:00
胡尧
05dac9fb0c 调整模型上传的流程 2025-02-20 13:36:05 +08:00
39 changed files with 17770 additions and 93 deletions

View File

@@ -1,6 +1,6 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_request
# * jikimo_purchase_request
#
# Translators:
# Jeffery Chen Fan <jeffery9@gmail.com>, 2016
@@ -614,7 +614,7 @@ msgstr "手动开票"
#. module: purchase_request
#: model:ir.model.fields,field_description:purchase_request.field_purchase_request_line_make_purchase_order__sync_data_planned
msgid "Match existing PO lines by Scheduled Date"
msgstr ""
msgstr "仅匹配计划日期相同的采购订单行"
#. module: purchase_request
#: model:ir.model.fields,field_description:purchase_request.field_purchase_request__message_has_error
@@ -862,7 +862,7 @@ msgstr "采购申请 %s 已完成"
#: code:addons/purchase_request/wizard/purchase_request_line_make_purchase_order.py:0
#, python-format
msgid "Purchase Request %s is not approved or in progress"
msgstr "采购申请 %s 未获批准或进行中"
msgstr "采购申请 %s 状态非已批准或进行中"
#. module: purchase_request
#: model:ir.model,name:purchase_request.model_purchase_request_allocation

View File

@@ -2,7 +2,7 @@
<record id="view_purchase_request_form_sf" model="ir.ui.view">
<field name="name">purchase.request.sf.form</field>
<field name="model">purchase.request</field>
<field name="inherit_id" ref="purchase_request.view_purchase_request_form" />
<field name="inherit_id" ref="purchase_request.view_purchase_request_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='button_draft']" position="attributes">
<attribute name="string">重置草稿</attribute>
@@ -21,19 +21,20 @@
<record id="view_purchase_request_line_tree_sf" model="ir.ui.view">
<field name="name">purchase.request.line.sf.tree</field>
<field name="model">purchase.request.line</field>
<field name="inherit_id" ref="purchase_request.purchase_request_line_tree" />
<field name="inherit_id" ref="purchase_request.purchase_request_line_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='requested_by']" position="replace">
<field name="supply_method"/>
</xpath>
<xpath expr="//field[@name='assigned_to']" position="replace">
<xpath expr="//field[@name='assigned_to']" position="attributes">
<attribute name="invisible">True</attribute>
</xpath>
<xpath expr="//field[@name='name']" position="attributes">
<attribute name="invisible">True</attribute>
</xpath>
<xpath expr="//field[@name='supplier_id']" position="after">
<field name="requested_by" widget="many2one_avatar_user"/>
<field name="assigned_to" widget="many2one_avatar_user"/>
<field name="assigned_to" widget="many2one_avatar_user" invisible="1"/>
</xpath>
<xpath expr="//field[@name='purchased_qty']" position="attributes">
<attribute name="string">采购数量</attribute>
@@ -44,7 +45,7 @@
<xpath expr="//field[@name='product_id']" position="after">
<field name="related_product"/>
<field name="part_number"/>
<field name="part_name"/>
<field name="part_name" invisible="1"/>
</xpath>
</field>
</record>
@@ -52,7 +53,7 @@
<record id="view_purchase_request_line_search_sf" model="ir.ui.view">
<field name="name">purchase.request.line.sf.search</field>
<field name="model">purchase.request.line</field>
<field name="inherit_id" ref="purchase_request.purchase_request_line_search" />
<field name="inherit_id" ref="purchase_request.purchase_request_line_search"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_id']" position="after">
<field name="supply_method"/>

View File

@@ -86,7 +86,21 @@ class PurchaseRequestLineMakePurchaseOrder(models.TransientModel):
"context": False,
"type": "ir.actions.act_window",
}
def _check_valid_request_line(self, request_line_ids):
for line in self.env["purchase.request.line"].browse(request_line_ids):
if line.request_id.state not in ["approved", "in_progress"]:
raise UserError(
_("采购申请 %s 未审批或未进行中")
% line.request_id.name
)
super(PurchaseRequestLineMakePurchaseOrder, self)._check_valid_request_line(request_line_ids)
@api.model
def check_group(self, request_lines):
# 去掉合并必须同一采购组的限制
pass
class PurchaseRequestLineMakePurchaseOrderItem(models.TransientModel):
_inherit = "purchase.request.line.make.purchase.order.item"

File diff suppressed because it is too large Load Diff

View File

@@ -9,5 +9,6 @@ class MrpBom(models.Model):
# 成品的供应商从模板中获取
if product_type == 'product':
bom_id.subcontractor_id = product.product_tmpl_id.seller_ids.partner_id.id
if product.product_tmpl_id.seller_ids:
bom_id.subcontractor_id = product.product_tmpl_id.seller_ids[-1].partner_id.id
return bom_id

View File

@@ -130,7 +130,7 @@ class QualityPoint(models.Model):
class QualityCheck(models.Model):
_inherit = "quality.check"
part_name = fields.Char('零件名称', related='product_id.part_name')
part_name = fields.Char('零件名称', related='product_id.part_name', readonly=False, store=True)
part_number = fields.Char('零件图号', related='product_id.part_number', readonly=False, store=True)
material_name = fields.Char('材料名称', compute='_compute_material_name')
@@ -206,7 +206,15 @@ class QualityCheck(models.Model):
('NG', 'NG')
], string='出厂检验报告结果', default='OK')
measure_operator = fields.Many2one('res.users', string='操机员')
quality_manager = fields.Many2one('res.users', string='质检员')
quality_manager = fields.Many2one('res.users', string='质检员', compute='_compute_quality_manager', store=True)
@api.depends('measure_line_ids')
def _compute_quality_manager(self):
for record in self:
if record.measure_line_ids:
record.quality_manager = record.env.user.id
else:
record.quality_manager = False
# 流水号(从1开始最大99)
serial_number = fields.Integer('流水号', default=1, readonly=True)
@@ -336,7 +344,6 @@ class QualityCheck(models.Model):
# 7. 更新其他信息
self.serial_number += 1
self.quality_manager = self.env.user.id
if self.publish_status == 'canceled' and self.picking_id.state == 'done':
self.upload_factory_report()

View File

@@ -5,7 +5,7 @@
<field name="model">quality.check.measure.line</field>
<field name="arch" type="xml">
<tree editable="bottom" class="measureTable">
<field name="sequence" class="measureTableSequence"/>
<!-- <field name="sequence" class="measureTableSequence"/> -->
<!-- <field name="column_nums"/> -->
<field name="measure_item"/>
<field name="measure_value1" attrs="{ 'column_invisible': [('parent.column_nums', '&lt;', 1)] }"/>

View File

@@ -271,9 +271,9 @@
<field name="part_number" attrs="{'invisible': [('categ_type', '!=', '成品')], 'readonly': [('publish_status', '=', 'published')]}"/>
<field name="material_name" attrs="{'invisible': [('categ_type', '!=', '成品')]}"/>
<field name="total_qty" attrs="{'invisible': ['|', ('measure_on', '!=', 'product'), ('is_out_check', '=', False)]}"/>
<field name="check_qty" attrs="{'invisible': [('measure_on', '!=', 'product')], 'readonly': [('publish_status', '=', 'published')]}"/>
<field name="check_qty" attrs="{'invisible': ['|', ('measure_on', '!=', 'product'), ('is_out_check', '=', False)], 'readonly': [('publish_status', '=', 'published')]}"/>
<!-- <field name="categ_type"/> -->
<field name="report_number_id"/>
<field name="report_number_id" attrs="{'invisible': ['|', ('measure_on', '!=', 'product'), ('is_out_check', '=', False)]}"/>
<field name="column_nums" invisible="1"/>
<field name="publish_status" invisible="1"/>
<field name="show_lot_text" invisible="1"/>
@@ -320,7 +320,7 @@
<field name="team_id"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="user_id" string="Control Person" invisible="1"/>
<field name="measure_operator" string="操机员" attrs="{'readonly': [('publish_status', '=', 'published')]}"/>
<field name="measure_operator" string="操机员" attrs="{'invisible': ['|', ('measure_on', '!=', 'product'), ('is_out_check', '=', False)], 'readonly': [('publish_status', '=', 'published')]}"/>
</group>
</group>

View File

@@ -65,7 +65,7 @@
<field name="lot_id" position="after">
<field name="workorder_id" invisible="1"/>
<field name="production_id" invisible="1"/>
<field name="finished_lot_id" attrs="{'invisible': [('finished_lot_id', '=', False)]}" groups="stock.group_production_lot"/>
<!-- <field name="finished_lot_id" attrs="{'invisible': [('finished_lot_id', '=', False)]}" groups="stock.group_production_lot"/> -->
</field>
<xpath expr="//field[@name='lot_id']" position="after">
<field name="lot_id" attrs="{'invisible': [('workorder_id', '=', False)]}" groups="stock.group_production_lot" string="Component Lot/Serial"/>

View File

@@ -32,6 +32,7 @@ class FixtureModel(models.Model):
multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型")
brand_id = fields.Many2one('sf.machine.brand', string="品牌")
model_file = fields.Binary(string="图片")
glb_url = fields.Char(string="图片")
status = fields.Boolean('状态')
active = fields.Boolean('有效', default=False)

View File

@@ -158,6 +158,8 @@
<!-- <field name="upload_model_file" widget="many2many_binary"/>-->
<field name="model_file" widget="Viewer3D" string="模型" readonly="1" force_save="1"
attrs="{'invisible': [('model_file', '=', False)]}"/>
<field name="glb_url" widget="Viewer3D" string="模型" readonly="1" force_save="1"
attrs="{'invisible': [('glb_url', '=', False)]}"/>
</group>
</group>
<notebook>

View File

@@ -29,7 +29,7 @@ class Sf_Bf_Connect(http.Controller):
bfm_process_order_list = json.loads(kw['bfm_process_order_list'])
order_id = request.env['sale.order'].with_user(request.env.ref("base.user_admin")).sale_order_create(
company_id, kw['delivery_name'], kw['delivery_telephone'], kw['delivery_address'],
kw['delivery_end_date'], kw['payments_way'], kw['pay_way'])
kw['delivery_end_date'], kw['payments_way'], kw['pay_way'], model_display_version=kw.get('model_display_version'))
i = 1
# 给sale_order的default_code字段赋值
aa = request.env['sale.order'].sudo().search([('name', '=', order_id.name)])

View File

@@ -32,7 +32,7 @@
<field name="is_bill" invisible="True"/>
<field name="logistics_status" invisible="True"/>
<field name="logistics_way" invisible="True"/>
<button string="物流下单" name="create_order" type="object" confirm="是否确认物流下单" class="btn-primary"
<!-- <button string="物流下单" name="create_order" type="object" confirm="是否确认物流下单" class="btn-primary" -->
attrs="{'invisible': ['|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('is_bill', '=', True), ('logistics_way', '=', '自提')]}"/>
<button string="获取物流面单" name="get_bill" type="object" confirm="是否获取物流面单" class="btn-primary"
attrs="{'invisible': ['|', '|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('logistics_status', '=', '2'), ('is_bill', '=', False), ('logistics_way', '=', '自提')]}"/>

View File

@@ -44,7 +44,7 @@ class ResProductTemplate(models.Model):
else:
return self.env.ref('sf_dlm.product_uom_cubic_millimeter')
# model_file = fields.Binary('模型文件')
model_file = fields.Binary('模型文件')
# 胚料的库存路线设置
# def _get_routes(self, route_type):

View File

@@ -16,15 +16,21 @@
<field name='categ_id' class="custom_required" attrs="{'readonly': [('id', '!=', False)]}"/>
<field name='is_bfm' invisible="1"/>
<field name='categ_type' invisible="1"/>
<field name='glb_url' invisible="1"/>
<field name='part_name' attrs="{'invisible': [('categ_type', '!=', '成品')]}"/>
<field name='part_number' attrs="{'invisible': [('categ_type', '!=', '成品')]}"/>
<field name='manual_quotation' attrs="{'invisible':[('upload_model_file', '=', [])]}"/>
<field name='manual_quotation' attrs="{'invisible':[('glb_url', '=', False)]}"/>
<field name="is_customer_provided" attrs="{'invisible': [('categ_type', 'not in', ['成品', '坯料'])], 'readonly': True}" />
<field name="upload_model_file"
widget="many2many_binary"
attrs="{'invisible': ['|', '|',('categ_type', '!=', '成品'),('categ_type', '=', False),('is_bfm','=', True)]}"/>
<field name="model_name" invisible="1"/>
<field name="upload_model_file" widget="many2many_binary" attrs="{'invisible': [('upload_model_file', '=', False)]}"/>
<field name="model_url"
widget="binary_download"
filename_field="model_name"
attrs="{'invisible': ['|', '|',('categ_type', '!=', '成品'),('categ_type', '=', False),('model_url', '=', False)]}"/>
<field name="model_file" widget="Viewer3D" string="模型" readonly="1" force_save="1"
attrs="{'invisible': ['|','|', ('categ_type', '!=', '成品'),('categ_type', '=', False),('model_file', '=', False)]}"/>
<field name="glb_url" widget="Viewer3D" string="模型" readonly="1" force_save="1"
attrs="{'invisible': ['|','|', ('categ_type', '!=', '成品'),('categ_type', '=', False),('glb_url', '=', False)]}"/>
<field name='cutting_tool_type' invisible="1"/>
<field name="fixture_material_type" invisible="1"/>
<field name="embryo_model_type_id" string="模型类型" options="{'no_create': True}"
@@ -68,6 +74,7 @@
</field>
<xpath expr="//field[@name='uom_id']" position="before">
<field name="is_manual_processing" attrs="{'invisible': [('categ_type', 'not in', ['成品', '坯料'])], 'readonly': True}" />
<field name="auto_machining" attrs="{'invisible': [('categ_type', 'not in', ['成品', '坯料'])], 'readonly': True}" />
</xpath>
<xpath expr="//label[@for='volume']" position="before">
<label for="length" string="尺寸"

View File

@@ -567,7 +567,7 @@ class Sf_Dashboard_Connect(http.Controller):
"""
res = {'status': 1, 'message': '成功', 'data': {}}
# plan_obj = request.env['sf.production.plan'].sudo()
plan_obj = request.env['mrp.production'].sudo()
plan_obj = request.env['mrp.workorder'].sudo().search([('routing_type', '=', 'CNC加工')])
line_list = ast.literal_eval(kw['line_list'])
begin_time_str = kw['begin_time'].strip('"')
end_time_str = kw['end_time'].strip('"')
@@ -618,7 +618,7 @@ class Sf_Dashboard_Connect(http.Controller):
start_time, end_time = time_interval
orders = plan_obj.search([
('production_line_id.name', '=', line),
('production_id.production_line_id.name', '=', line),
('state', 'in', ['done']),
(date_field_name, '>=', start_time.strftime('%Y-%m-%d %H:%M:%S')),
(date_field_name, '<=', end_time.strftime('%Y-%m-%d %H:%M:%S')) # 包括结束时间
@@ -638,18 +638,18 @@ class Sf_Dashboard_Connect(http.Controller):
for date in date_list:
next_day = date + timedelta(days=1)
orders = plan_obj.search([('production_line_id.name', '=', line), ('state', 'in', ['done']),
orders = plan_obj.search([('production_id.production_line_id.name', '=', line), ('state', 'in', ['done']),
(date_field_name, '>=', date.strftime('%Y-%m-%d 00:00:00')),
(date_field_name, '<', next_day.strftime('%Y-%m-%d 00:00:00'))
])
rework_orders = plan_obj.search(
[('production_line_id.name', '=', line), ('state', 'in', ['rework']),
[('production_id.production_line_id.name', '=', line), ('state', 'in', ['rework']),
(date_field_name, '>=', date.strftime('%Y-%m-%d 00:00:00')),
(date_field_name, '<', next_day.strftime('%Y-%m-%d 00:00:00'))
])
not_passed_orders = plan_obj.search(
[('production_line_id.name', '=', line), ('state', 'in', ['scrap', 'cancel']),
[('production_id.production_line_id.name', '=', line), ('state', 'in', ['scrap', 'cancel']),
(date_field_name, '>=', date.strftime('%Y-%m-%d 00:00:00')),
(date_field_name, '<', next_day.strftime('%Y-%m-%d 00:00:00'))
])
@@ -942,7 +942,7 @@ class Sf_Dashboard_Connect(http.Controller):
# machine_list = ast.literal_eval(kw['machine_list'])
# for item in machine_list:
# machine_data = equipment_obj.search([('code', '=', item)])
for log in maintenance_logs_obj.search([]):
for log in maintenance_logs_obj.search([], order='id desc', limit=30):
res['data'].append({
'name': log.name,
'alarm_time': log.alarm_time.strftime('%Y-%m-%d %H:%M:%S'),

View File

@@ -27,7 +27,8 @@ class JikimoSaleRoutePicking(Sf_Bf_Connect):
bfm_process_order_list = json.loads(kw['bfm_process_order_list'])
order_id = request.env['sale.order'].with_user(request.env.ref("base.user_admin")).sale_order_create(
company_id, kw['delivery_name'], kw['delivery_telephone'], kw['delivery_address'],
kw['delivery_end_date'], kw['payments_way'], kw['pay_way'], kw['order_number'], state='draft')
kw['delivery_end_date'], kw['payments_way'], kw['pay_way'], kw['order_number'], state='draft',
model_display_version=kw.get('model_display_version'))
i = 1
# 给sale_order的default_code字段赋值
# aa = request.env['sale.order'].sudo().search([('name', '=', order_id.name)])

View File

@@ -5,6 +5,8 @@ import logging
import json
import os
import re
import traceback
import requests
from itertools import groupby
from collections import defaultdict, namedtuple
@@ -25,6 +27,7 @@ class MrpProduction(models.Model):
maintenance_count = fields.Integer(compute='_compute_maintenance_count', string="Number of maintenance requests")
request_ids = fields.One2many('maintenance.request', 'production_id')
model_file = fields.Binary('模型文件', related='product_id.model_file')
glb_url = fields.Char('模型文件', related='product_id.glb_url')
schedule_state = fields.Selection([('未排', '未排'), ('已排', '已排'), ('已完成', '已完成')],
string='排程状态', default='未排')
work_order_state = fields.Selection([('未排', '未排'), ('已排', '已排'), ('已完成', '已完成')],
@@ -256,14 +259,46 @@ class MrpProduction(models.Model):
], string='工序状态', default='待装夹')
# 零件图号
part_number = fields.Char('零件图号', related='product_id.part_number', readonly=True)
part_number = fields.Char('零件图号', compute='_compute_part_info', store=True)
# 上传零件图纸
part_drawing = fields.Binary('零件图纸', related='product_id.machining_drawings', readonly=True)
quality_standard = fields.Binary('质检标准', related='product_id.quality_standard', readonly=True)
part_name = fields.Char(string='零件名称', related='product_id.part_name', readonly=True)
part_name = fields.Char(string='零件名称', compute='_compute_part_info', store=True)
@api.depends('product_id')
def _compute_part_info(self):
try:
for production_id in self:
if production_id.product_id.categ_id.type == '成品':
production_id.part_number = production_id.product_id.part_number
production_id.part_name = production_id.product_id.part_name
elif production_id.product_id.categ_id.type == '坯料':
product_name = ''
match = re.search(r'(S\d{5}-\d)', production_id.product_id.name)
# 如果匹配成功,提取结果
if match:
product_name = match.group(0)
if production_id.sale_order_id:
sale_order = production_id.sale_order_id
else:
sale_order_name = ''
match = re.search(r'(S\d+)', production_id.product_id.name)
if match:
sale_order_name = match.group(0)
sale_order = self.env['sale.order'].sudo().search(
[('name', '=', sale_order_name)])
logging.info("product_name is :%s" % product_name)
filtered_order_line = sale_order.order_line.filtered(
lambda production: re.search(f'{product_name}$', production.product_id.name)
)
if filtered_order_line:
production_id.part_number = filtered_order_line.part_number
production_id.part_name = filtered_order_line.part_name
except Exception as e:
traceback_error = traceback.format_exc()
logging.error("制造订单零件图号 零件名称获取失败:%s" % traceback_error)
# 判断制造的产品类型
production_product_type = fields.Selection([
@@ -720,14 +755,16 @@ class MrpProduction(models.Model):
'model_order_no': cnc.product_id.default_code,
'user': cnc.env.user.name,
'programme_way': programme_way,
'model_file': '' if not cnc.product_id.model_file else base64.b64encode(
cnc.product_id.model_file).decode('utf-8'),
# 'model_file': '' if not cnc.product_id.model_file else base64.b64encode(
# cnc.product_id.model_file).decode('utf-8'),
# 'glb_url': cnc.product_id.glb_url,
'part_name': cnc.product_id.part_name,
'part_number': cnc.product_id.part_number,
'machining_drawings': base64.b64encode(cnc.product_id.machining_drawings).decode(
'utf-8') if cnc.product_id.machining_drawings else '',
'machining_drawings_name': cnc.product_id.machining_drawings_name,
'machining_drawings_mimetype': cnc.product_id.machining_drawings_mimetype,
# 'model_id': cnc.product_id.model_id,
}
# 打印出除了 model_file 之外的所有键值对
for key, value in res.items():

View File

@@ -289,6 +289,7 @@ class ResMrpWorkOrder(models.Model):
cmm_ids = fields.One2many("sf.cmm.program", 'workorder_id', string="CMM程序")
tray_code = fields.Char(string="托盘编码")
glb_file = fields.Binary("glb模型文件", related='production_id.model_file')
glb_url = fields.Char("glb模型文件", related='production_id.glb_url')
is_subcontract = fields.Boolean(string='是否外协')
surface_technics_parameters_id = fields.Many2one('sf.production.process.parameter', string="表面工艺可选参数")
@@ -735,7 +736,8 @@ class ResMrpWorkOrder(models.Model):
local_filename = self.save_name + '.xls'
local_file_path = os.path.join(local_dir_path, local_filename)
logging.info('local_file_path:%s' % local_file_path)
remote_path = '/home/ftp/ftp_root/ThreeTest/XT/Before/' + local_filename
# remote_path = '/home/ftp/ftp_root/ThreeTest/XT/Before/' + local_filename
remote_path = '/ThreeTest/XT/Before/' + local_filename
logging.info('remote_path:%s' % remote_path)
is_get_detection_file = self.env['ir.config_parameter'].sudo().get_param('is_get_detection_file')
if not is_get_detection_file:
@@ -1532,7 +1534,7 @@ class ResMrpWorkOrder(models.Model):
# workorder.rfid_code_old = rfid_code
# workorder.rfid_code = False
logging.info('workorder.rfid_code:%s' % workorder.rfid_code)
# if is_production_id is True and record.routing_type in ['解除装夹', '表面工艺', '切割']:
if is_production_id is True:
logging.info('product_qty:%s' % record.production_id.product_qty)
for move_raw_id in record.production_id.move_raw_ids:
@@ -1547,6 +1549,17 @@ class ResMrpWorkOrder(models.Model):
# if raw_move:
# raw_move.write({'state': 'done'})
if record.production_id.state != 'rework':
# 如果工单包含了外协工序,需要预留数量
if self.move_raw_ids.move_orig_ids.subcontract_workorder_id:
location_id = self.move_raw_ids.location_id
quant = self.move_raw_ids.lot_ids.quant_ids.filtered(lambda q: q.location_id.id == location_id.id)
if quant.reserved_quantity == 0:
self.env['stock.quant']._update_reserved_quantity(
self.move_raw_ids.product_id,
location_id,
quant.quantity,
lot_id=quant.lot_id,
)
record.production_id.button_mark_done1()
# record.production_id.state = 'done'
@@ -1850,7 +1863,7 @@ class CNCprocessing(models.Model):
# 将FTP的多面的程序单文件下载到临时目录
def download_file_tmp(self, production_no, processing_panel):
remotepath = os.path.join('/home/ftp/ftp_root/NC', production_no, 'return', processing_panel)
remotepath = os.path.join('/', production_no, 'return', processing_panel)
serverdir = os.path.join('/tmp', production_no, 'return', processing_panel)
ftp_resconfig = self.env['res.config.settings'].get_values()
ftp = FtpController(str(ftp_resconfig['ftp_host']), int(ftp_resconfig['ftp_port']), ftp_resconfig['ftp_user'],

View File

@@ -30,6 +30,7 @@ class ResProductMo(models.Model):
model_width = fields.Float('模型宽(mm)', digits=(16, 3))
model_height = fields.Float('模型高(mm)', digits=(16, 3))
model_volume = fields.Float('模型体积(m³)')
model_area = fields.Float('模型表面积(m²)')
model_machining_precision = fields.Selection(selection=_get_machining_precision, string='加工精度')
model_processing_panel = fields.Char('模型加工面板')
model_remark = fields.Char('模型备注说明')
@@ -777,11 +778,40 @@ class ResProductMo(models.Model):
manual_quotation = fields.Boolean('人工编程', default=False, readonly=True)
machining_drawings = fields.Binary('2D加工图纸', readonly=True)
quality_standard = fields.Binary('质检标准', readonly=True)
part_name = fields.Char(string='零件名称', readonly=True)
part_number = fields.Char(string='零件图号', readonly=True)
part_name = fields.Char(string='零件名称', compute='_compute_related_product', readonly=True, store=True)
part_number = fields.Char(string='零件图号', compute='_compute_related_product', readonly=True, store=True)
machining_drawings_name = fields.Char(string='零件图号名称', readonly=True)
machining_drawings_mimetype = fields.Char(string='零件图号类型', readonly=True)
model_url = fields.Char('模型文件地址')
glb_url = fields.Char('glb文件地址')
area = fields.Float('表面积(m²)')
auto_machining = fields.Boolean('自动化加工(模型识别)', default=False)
model_id = fields.Char('模型id')
@api.depends('name')
def _compute_related_product(self):
for record in self:
if record.categ_id.name == '坯料':
product_name = ''
match = re.search(r'(S\d{5}-\d)', record.name)
# 如果匹配成功,提取结果
if match:
product_name = match.group(0)
sale_order_name = ''
match_sale = re.search(r'S(\d+)', record.name)
if match_sale:
sale_order_name = match_sale.group(0)
sale_order = self.env['sale.order'].sudo().search(
[('name', '=', sale_order_name)])
if sale_order:
filtered_order_line = sale_order.order_line.filtered(
lambda order_line: re.search(f'{product_name}$', order_line.product_id.name)
)
record.part_number = filtered_order_line.product_id.part_number if filtered_order_line else None
record.part_name = filtered_order_line.product_id.part_name if filtered_order_line else None
@api.constrains('tool_length')
def _check_tool_length_size(self):
if self.tool_length > 1000000:
@@ -852,7 +882,7 @@ class ResProductMo(models.Model):
copy_product_id = product_id.with_user(self.env.ref("base.user_admin")).copy()
copy_product_id.product_tmpl_id.active = True
model_type = self.env['sf.model.type'].search([], limit=1)
attachment = self.attachment_create(item['model_name'], item['model_data'])
# attachment = self.attachment_create(item['model_name'], item['model_data'])
# 获取坯料冗余配置
if not item.get('embryo_redundancy'):
embryo_redundancy_id = model_type.embryo_tolerance_id
@@ -875,10 +905,14 @@ class ResProductMo(models.Model):
'length': item['model_long'],
'width': item['model_width'],
'height': item['model_height'],
'volume': item['model_long'] * item['model_width'] * item['model_height'],
'model_file': '' if not item['model_file'] else base64.b64decode(item['model_file']),
'model_name': attachment.name if attachment else None,
'upload_model_file': [(6, 0, [attachment.id])] if attachment else None,
'volume': item['model_volume'],
'area': item['model_area'],
# 'model_file': '' if not item['model_file'] else base64.b64decode(item['model_file']),
'model_url': item['model_url'],
'glb_url': item['glb_url'],
'model_name': item['model_name'],
'auto_machining': item['auto_machining'],
# 'upload_model_file': [(6, 0, [attachment.id])] if attachment else None,
'list_price': item['price'],
'materials_id': self.env['sf.production.materials'].search(
[('materials_no', '=', item['texture_code'])]).id,
@@ -898,6 +932,7 @@ class ResProductMo(models.Model):
'part_name': item.get('part_name') or '',
'machining_drawings_name': item.get('machining_drawings_name') or '',
'machining_drawings_mimetype': item.get('machining_drawings_mimetype') or '',
'model_id': item['model_id'],
}
tax_id = self.env['account.tax'].sudo().search(
[('type_tax_use', '=', 'sale'), ('amount', '=', item.get('tax')), ('price_include', '=', 'True')])
@@ -980,15 +1015,14 @@ class ResProductMo(models.Model):
vals = {
'name': '%s-%s-%s [%s %s-%s * %s * %s]' % ('R',
order_id.name, i, materials_id.name, materials_type_id.name,
item['model_long'] + embryo_redundancy_id.long,
item['model_width'] + embryo_redundancy_id.width,
item['model_height'] + embryo_redundancy_id.height),
'length': item['model_long'] + embryo_redundancy_id.long,
'width': item['model_width'] + embryo_redundancy_id.width,
'height': item['model_height'] + embryo_redundancy_id.height,
'volume': (item['model_long'] + embryo_redundancy_id.long) * (
item['model_width'] + embryo_redundancy_id.width) * (
item['model_height'] + embryo_redundancy_id.height),
self.format_float(item['model_long'] + embryo_redundancy_id.long),
self.format_float(item['model_width'] + embryo_redundancy_id.width),
self.format_float(item['model_height'] + embryo_redundancy_id.height)),
'length': self.format_float(item['model_long'] + embryo_redundancy_id.long),
'width': self.format_float(item['model_width'] + embryo_redundancy_id.width),
'height': self.format_float(item['model_height'] + embryo_redundancy_id.height),
'volume': self.format_float(item['blank_volume']),
'area': self.format_float(item['blank_area']),
'embryo_model_type_id': model_type.id,
'list_price': item['price'],
'materials_id': materials_id.id,
@@ -1081,6 +1115,9 @@ class ResProductMo(models.Model):
base64_data = base64.b64encode(image_data)
return base64_data
# 增加产品表面积
class ResProductFixture(models.Model):
_inherit = 'product.template'
@@ -1093,6 +1130,7 @@ class ResProductFixture(models.Model):
fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name')
multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型")
model_file = fields.Binary(string="3D模型图")
glb_url = fields.Char(string="3D模型图")
# 夹具物料基本参数
diameter = fields.Float('直径(mm)', digits=(16, 2))

View File

@@ -59,7 +59,7 @@ class QuickEasyOrder(models.Model):
product_id = self.env.ref('jikimo_sale_multiple_supply_methods.product_template_default').sudo().with_context(active_test=False).product_variant_id
# user_id = request.env.ref('base.user_admin').sudo()
order_id = self.env['sale.order'].sale_order_create(company_id, 'XXXXX', 'XXXXX', 'XXXXX',
str(datetime.now()), '现结', '支付宝', state='draft')
str(datetime.now()), '现结', '支付宝', state='draft', model_display_version='v2')
order_id.default_code = obj.name
i = 1
for item in res['bfm_process_order_list']:

View File

@@ -1,5 +1,7 @@
import logging
import json
import re
from odoo import models, fields, api, _
from odoo.exceptions import UserError
@@ -23,6 +25,9 @@ class SaleOrder(models.Model):
def confirm_to_supply_method(self):
self.state = 'supply method'
for line in self.order_line:
if line.product_id.auto_machining:
line.supply_method = 'automation'
def action_confirm(self):
if self._get_forbidden_state_confirm() & set(self.mapped('state')):
@@ -57,18 +62,25 @@ class SaleOrder(models.Model):
order_id = self
product = line.product_id
# 拼接方法需要的item结构
# 拼接方法需要的item结构,成品的模型数据信息就是坯料的数据信息
item = {
'texture_code': product.materials_id.materials_no,
'texture_type_code': product.materials_type_id.materials_no,
'model_long': product.length,
'model_width': product.width,
'model_height': product.height,
'blank_volume': product.model_volume,
'blank_area': product.model_area,
'price': product.list_price,
'embryo_redundancy_id': line.embryo_redundancy_id,
}
product_name = ''
match = re.search(r'(S\d{5}-\d)', product.name)
# 如果匹配成功,提取结果
if match:
product_name = match.group(0)
# 获取成品名结尾-n的n
product_seria = int(product.name.split('-')[-1])
product_seria = int(product_name.split('-')[-1])
# 成品供货方式为采购则不生成bom
if line.supply_method != 'purchase':
bom_data = self.env['mrp.bom'].with_user(self.env.ref("base.user_admin")).get_bom(product)
@@ -151,7 +163,7 @@ class SaleOrder(models.Model):
'purchase',
product_seria,
product)
if purchase_embryo == -3:
if purchase_embryo and purchase_embryo == -3:
raise UserError('该订单模型的材料型号暂未设置获取方式和供应商,请先配置再进行分配')
else:
# 产品配置bom
@@ -198,3 +210,14 @@ class SaleOrderLine(models.Model):
if vals['supply_method'] == 'purchase' and line.is_incoming_material:
raise UserError('当前(%s)产品为客供料,不能选择外购' % ','.join(line.mapped('product_id.name')))
return super(SaleOrderLine, self).write(vals)
cancel_auto_machining = fields.Boolean('是否取消自动化加工', compute='_compute_cancel_auto_machining', store=True)
cancel_auto_machining_reason = fields.Char('更改供货原因')
@api.depends('product_id', 'supply_method')
def _compute_cancel_auto_machining(self):
for line in self:
line.cancel_auto_machining = True if line.product_id.auto_machining \
and line.supply_method != 'automation' else False

View File

@@ -355,9 +355,9 @@ class StockRule(models.Model):
)
for p in production_process:
logging.info('production_process:%s' % p.name)
process_parameter = production_item.product_id.model_process_parameters_ids.filtered(
process_parameters = production_item.product_id.model_process_parameters_ids.filtered(
lambda pm: pm.process_id.id == p.id)
if process_parameter:
for process_parameter in process_parameters:
i += 1
route_production_process = self.env[
'mrp.routing.workcenter'].search(
@@ -688,7 +688,8 @@ class StockPicking(models.Model):
# 如果当前工单是是制造订单的最后一个工艺外协工单
if workorder == next((workorder for workorder in reversed(sorted_workorders) if workorder.is_subcontract),
None):
move_dest_id = item.move_raw_ids[0].id
if item.move_raw_ids:
move_dest_id = item.move_raw_ids[0].id
else:
# 从sorted_workorders中找到上一工单的move
if len(sorted_workorders) > 1:
@@ -724,6 +725,7 @@ class StockPicking(models.Model):
moves_out._action_confirm()
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):
super(StockPicking, self)._compute_state()
@@ -799,7 +801,7 @@ class ReStockMove(models.Model):
continue
logging.info('制造订单的调拨单 %s', move.origin)
production_id = self.env['mrp.production'].sudo().search(
[('name', '=', move.origin)], limit=1)
[('name', '=', move.origin.split(',')[0] if move.origin else '')], limit=1)
if not production_id:
continue
product_name = ''
@@ -847,6 +849,7 @@ class ReStockMove(models.Model):
# 'route_ids': False if not route else [(4, route.id)],
'date_deadline': datetime.now(),
'picking_type_id': picking_type_id,
# 'is_subcontract': True,
}
return move_values
@@ -1116,6 +1119,13 @@ class ReStockMove(models.Model):
if self.state != 'assigned':
self.state = 'assigned'
return self.action_show_details()
def _prepare_move_line_vals(self, quantity=None, reserved_quant=None):
res = super(ReStockMove, self)._prepare_move_line_vals(quantity, reserved_quant)
if self.subcontract_workorder_id:
if self.subcontract_workorder_id.production_id.move_raw_ids.move_line_ids:
res['lot_id'] = self.subcontract_workorder_id.production_id.move_raw_ids.move_line_ids[0].lot_id.id
return res
class ReStockQuant(models.Model):

View File

@@ -450,7 +450,9 @@
</button>
</div>
<field name="product_id" position="after">
<field name="model_file" string="产品模型" readonly="1" widget="Viewer3D"/>
<field name="model_file" string="产品模型" readonly="1" widget="Viewer3D" attrs="{'invisible': [('model_file', '=', False)]}"/>
<field name="glb_url" widget="Viewer3D" string="模型" readonly="1" force_save="1"
attrs="{'invisible': [('glb_url', '=', False)]}"/>
</field>
</field>
</record>

View File

@@ -251,7 +251,8 @@
<field name="date_planned_finished" invisible="1"/>
<field name="duration" widget="mrp_timer"
invisible="1" sum="real duration"/>
<field name="glb_file" readonly="1" widget="Viewer3D" string="加工模型"/>
<field name="glb_file" readonly="1" widget="Viewer3D" string="加工模型" attrs="{'invisible': [('glb_file', '=', False)]}"/>
<field name="glb_url" readonly="1" widget="Viewer3D" string="加工模型" attrs="{'invisible': [('glb_url', '=', False)]}"/>
<field name="manual_quotation" readonly="1"
attrs="{'invisible': [('routing_type', 'not in', ['CNC加工', '人工线下加工'])]}"/>
<field name="processing_panel" readonly="1"

View File

@@ -18,9 +18,13 @@
<xpath expr="//page/field[@name='order_line']/tree/field[@name='remark']" position="before">
<field name="supply_method" attrs="{'invisible': [('state', '=', 'draft')], 'required': [('state', '=', 'supply method')]}" />
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='model_glb_file']" position="before">
<xpath expr="//field[@name='order_line']/tree/field[@name='product_template_id']" position="after">
<field name="part_number" optional="show" class="section_and_note_text"/>
</xpath>
</xpath>
<!-- <xpath expr="//field[@name='order_line']/tree/field[@name='remark']" position="before"> -->
<!-- <field name="cancel_auto_machining" invisible="1"/> -->
<!-- <field name="cancel_auto_machining_reason" optional="show" attrs="{'required': [('cancel_auto_machining', '=', True),('state', 'not in', ['draft', 'sent'])]}"/> -->
<!-- </xpath> -->
<!-- <xpath expr="//header/button[@name='action_cancel']" position="attributes"> -->
<!-- <attribute name="attrs">{'invisible': [('state', '!=', 'draft')]}</attribute> -->
@@ -67,7 +71,7 @@
<record id="sale.action_quotations_with_onboarding" model="ir.actions.act_window">
<field name="search_view_id" ref="jikimo_sale_order_view_search_inherit_quotation_supply_method"/>
<field name="context">{'search_default_draft': 1}</field>
<field name="context">{'search_default_supply_method': 1}</field>
</record>
<record id="action_quotations_supply_method" model="ir.actions.act_window">

View File

@@ -191,7 +191,8 @@ class SFMessageWork(models.Model):
def write(self, vals):
res = super(SFMessageWork, self).write(vals)
if ('leave_id' in vals and vals['leave_id'] is False or 'date_planned_start' in vals and vals['date_planned_start'] is False) \
and self.schedule_state != '未排':
self.add_queue('计划数据异常跟踪')
for record in self:
if ('leave_id' in vals and vals['leave_id'] is False or 'date_planned_start' in vals and vals['date_planned_start'] is False) \
and record.schedule_state != '未排':
record.add_queue('计划数据异常跟踪')
return res

View File

@@ -48,11 +48,11 @@
<div class="col-6">
<p>售后服务: <span t-field="o.company_id.phone"/></p>
<p>公司名称: <span t-field="o.company_id.name"/></p>
<p>公司网址: <span t-field="o.company_id.website"/></p>
<p>公司邮箱: <span t-field="o.company_id.email"/></p>
<p>加工工厂: <span t-field="o.company_id.factory_name"/></p>
</div>
<div class="col-6">
<p>加工工厂: <span t-field="o.company_id.factory_name"/></p>
<p>公司网址: <span t-field="o.company_id.website"/></p>
<p>公司邮箱: <span t-field="o.company_id.email"/></p>
</div>
</div>
<!-- <div style="border-top: 2px solid black;"></div> -->
@@ -68,7 +68,7 @@
<t t-call="sf_quality.report_quality_header"/>
<div class="page" style="min-height: 800px; position: relative; padding-bottom: 150px;">
<div class="page" style="min-height: 800px; position: relative; padding-bottom: 250px;">
<table class="table table-sm o_main_table mt-4" style="border: 1px solid black;">
<tr>

View File

@@ -26,6 +26,7 @@ class QualityCheck(models.Model):
string='生产线')
equipment_id = fields.Many2one(related='workorder_id.equipment_id', string='加工设备')
model_file = fields.Binary(related='workorder_id.glb_file', string='加工模型')
glb_url = fields.Char(related='workorder_id.glb_url', string='加工模型')
detection_report = fields.Binary(related='workorder_id.detection_report', readonly=True, string='检测报告')
test_results = fields.Selection([("合格", "合格"), ("返工", "返工")], string="检测结果",

View File

@@ -12,6 +12,7 @@ class SfQualityCncTest(models.Model):
production_id = fields.Many2one(related='workorder_id.production_id', string='制造订单')
product_id = fields.Many2one(related='workorder_id.product_id', string='产品')
model_file = fields.Binary(related='workorder_id.glb_file', string='加工模型')
glb_url = fields.Char(related='workorder_id.glb_url', string='加工模型')
processing_panel = fields.Char(related='workorder_id.processing_panel', string='加工面')
equipment_id = fields.Many2one(related='workorder_id.equipment_id', string='加工设备')
production_line_id = fields.Many2one(related='workorder_id.production_line_id',

View File

@@ -13,6 +13,8 @@
<field name="equipment_id" attrs="{'invisible': [('production_id', '=', False)]}"/>
<field name="model_file" widget="Viewer3D" string="模型" readonly="1" force_save="1"
attrs="{'invisible': ['|',('model_file', '=', False), ('production_id', '=', False)]}"/>
<field name="glb_url" widget="Viewer3D" string="模型" readonly="1" force_save="1"
attrs="{'invisible': ['|',('glb_url', '=', False), ('production_id', '=', False)]}"/>
</xpath>
<xpath expr="//field[@name='partner_id']" position="after">
<field name="processing_panel" attrs="{'invisible': [('production_id', '=', False)]}"/>

View File

@@ -87,7 +87,8 @@
<field name="product_id"/>
<field name="production_line_id"/>
<field name="equipment_id"/>
<field name="model_file" widget="Viewer3D"/>
<field name="model_file" widget="Viewer3D" attrs="{'invisible': [('model_file', '=', False)]}"/>
<field name="glb_url" widget="Viewer3D" attrs="{'invisible': [('glb_url', '=', False)]}"/>
</group>
<group>
<field name="part_name"/>

View File

@@ -314,7 +314,7 @@ class QuickEasyOrder(models.Model):
company_id = self.env.ref('base.main_company').sudo()
# user_id = request.env.ref('base.user_admin').sudo()
order_id = self.env['sale.order'].sale_order_create(company_id, 'XXXXX', 'XXXXX', 'XXXXX',
str(datetime.now()), '现结', '支付宝')
str(datetime.now()), '现结', '支付宝', 'v2')
i = 1
# 给sale_order的default_code字段赋值
aa = self.env['sale.order'].sudo().search([('name', '=', order_id.name)])

View File

@@ -237,7 +237,7 @@ class QuickEasyOrder(models.Model):
company_id = self.env.ref('base.main_company').sudo()
# user_id = request.env.ref('base.user_admin').sudo()
order_id = self.env['sale.order'].sale_order_create(company_id, 'XXXXX', 'XXXXX', 'XXXXX',
str(datetime.now()), '现结', '支付宝')
str(datetime.now()), '现结', '支付宝', 'v2')
i = 1
# 给sale_order的default_code字段赋值
aa = self.env['sale.order'].sudo().search([('name', '=', order_id.name)])

View File

@@ -61,9 +61,12 @@ class ReSaleOrder(models.Model):
order_code = fields.Char('平台订单号', readonly=True)
model_display_version = fields.Char('模型展示版本', default="v1")
# 业务平台分配工厂后在智能工厂先创建销售订单
def sale_order_create(self, company_id, delivery_name, delivery_telephone, delivery_address,
deadline_of_delivery, payments_way, pay_way, order_number, state='sale'):
deadline_of_delivery, payments_way, pay_way, order_number, state='sale',
model_display_version='v1'):
now_time = datetime.datetime.now()
partner = self.get_customer()
data = {
@@ -80,6 +83,7 @@ class ReSaleOrder(models.Model):
'payments_way': payments_way,
'pay_way': pay_way,
'order_code': order_number,
'model_display_version': model_display_version,
}
if deadline_of_delivery:
# deadline_of_delivery字段存在为false字符串情况
@@ -138,11 +142,15 @@ class ReSaleOrder(models.Model):
product.materials_id.name),
'price_unit': product.list_price,
'product_uom_qty': item['number'],
'model_glb_file': base64.b64decode(item['model_file']) if item['model_file'] else None,
# 'model_glb_file': base64.b64decode(item['model_file']) if item['model_file'] else None,
'model_url': item['model_url'],
'glb_url': item['glb_url'],
'remark': item.get('remark'),
'embryo_redundancy_id': item.get('embryo_redundancy_id'),
'is_incoming_material': True if item.get('embryo_redundancy_id') else False,
'manual_quotation': item.get('manual_quotation')
'manual_quotation': item.get('manual_quotation'),
'model_id': item['model_id'],
'delivery_end_date': item['delivery_end_date'],
}
return self.env['sale.order.line'].with_context(skip_procurement=True).create(vals)
@@ -245,6 +253,7 @@ class ResaleOrderLine(models.Model):
# part_number = fields.Char('零件图号', related='product_id.part_number', readonly=True)
part_name = fields.Char('零件名称', related='product_id.part_name', readonly=True)
model_glb_file = fields.Binary('模型的glb文件', compute='_compute_model_glb_file', store=True)
glb_url = fields.Char('glb文件地址', compute='_compute_model_glb_file', store=True)
# product_template_id = fields.Many2one(
# string="产品",
# comodel_name='product.template',
@@ -261,6 +270,10 @@ class ResaleOrderLine(models.Model):
is_incoming_material = fields.Boolean('客供料', compute='_compute_is_incoming_material', store=True)
embryo_redundancy_id = fields.Many2one('sf.embryo.redundancy', '坯料冗余')
manual_quotation = fields.Boolean('人工编程', default=False)
model_url = fields.Char('模型文件地址')
model_id = fields.Char('模型id')
delivery_end_date = fields.Date('交货截止日期')
@api.depends('embryo_redundancy_id')
def _compute_is_incoming_material(self):
@@ -273,6 +286,8 @@ class ResaleOrderLine(models.Model):
if line.product_template_id:
if not line.model_glb_file:
line.model_glb_file = line.product_id.product_tmpl_id.model_file
if not line.glb_url:
line.glb_url = line.product_id.product_tmpl_id.glb_url
if not line.price_unit:
line.price_unit = line.product_id.product_tmpl_id.list_price

View File

@@ -50,9 +50,13 @@
<group>
<field name="customer_id" context="{'is_customer': True }"
options="{'no_create': True}" required="1"/>
<field name="upload_model_file" widget="many2many_binary"/>
<field name="upload_model_file" widget="many2many_binary" attrs="{'invisible': [('upload_model_file', '=', False)]}"/>
<!-- <field name="model_url" widget="binary_download" filename_field="model_name" readonly="1" string="模型文件"
attrs="{'invisible': [('model_url', '=', False)]}"/> -->
<field name="model_file" widget="Viewer3D" string="模型" readonly="1" force_save="1"
attrs="{'invisible': [('model_file', '=', False)]}"/>
<!-- <field name="glb_url" widget="Viewer3D" string="模型" readonly="1" force_save="1"
attrs="{'invisible': [('glb_url', '=', False)]}"/> -->
<label for="model_length" string="尺寸(mm)"
attrs='{"invisible": [("model_file","=",False)]}'/>
<div class="test_model"

View File

@@ -98,12 +98,15 @@
<field name="deadline_of_delivery" readonly="0"/>
<field name="payments_way" invisible="1"/>
<field name="pay_way" invisible="1"/>
<field name="model_display_version" invisible="1"/>
<!-- <field name="schedule_status" readonly="1"/> -->
</field>
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="before">
<field name="model_glb_file" widget="Viewer3D" optional="show"
string="模型文件" attrs="{'readonly': [('state', 'in', ['draft'])], 'isInList': True}"/>
<field name="part_name" optional="hide"/>
string="模型文件" readonly="1" attrs="{'column_invisible': [('parent.model_display_version', '!=', 'v1')], 'isInList': True}"/>
<field name="glb_url" widget="Viewer3D" optional="show"
string="模型文件" readonly="1" attrs="{'column_invisible': [('parent.model_display_version', '!=', 'v2')], 'isInList': True}"/>
<field name="part_name" optional="show"/>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='price_subtotal']" position="after">
<field name="remark"/>
@@ -133,6 +136,10 @@
<xpath expr="//field[@name='order_line']/tree/field[@name='product_uom']" position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='remark']" position="before">
<field name="delivery_end_date" optional="hide"/>
</xpath>
<field name="user_id" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
</field>

View File

@@ -88,13 +88,23 @@ class StockPicking(models.Model):
self.send_to_bfm()
return info
def _action_done(self):
"""处理创建欠单时,新单据验证序列号无法使用问题"""
todo_moves = self.move_ids.filtered(
lambda self: self.state in ['draft', 'waiting', 'partially_available', 'assigned', 'confirmed'])
res = super(StockPicking, self)._action_done()
todo_move = todo_moves.filtered(lambda mv: mv.quantity_done == 0)
if todo_move:
todo_move.move_line_nosuggest_ids.write({'qty_done': 1})
return res
def deal_move_ids(self, send_move_ids, send_move_line_ids):
move_ids = [] # 本次发货单
move_line_ids = [] # 本次发货单行
if send_move_ids:
for item in send_move_ids:
val = {
'name': item.product_id.upload_model_file.display_name,
'name': item.product_id.upload_model_file.display_name if item.product_id.upload_model_file else item.product_id.model_name,
'quantity_done': item.quantity_done,
'date': date_utils.json_default(item.date) if item.date else None,
'description_picking': item.description_picking,

View File

@@ -27,7 +27,10 @@ export class StepViewer extends Component {
formatUrl() {
var url = '';
if (this.props.value) {
if (this.props.value.slice(-1) == 'b' && !isNaN(this.props.value.split(' ')[0])) {
if (this.props.value.startsWith('http')) {
// 从url读取文件内容
url = this.props.value;
} else if (this.props.value.slice(-1) == 'b' && !isNaN(this.props.value.split(' ')[0])) {
var url_props = {
base_url: session['web.base.url'],
model: this.props.record.resModel,
@@ -37,21 +40,19 @@ export class StepViewer extends Component {
url = url_props['base_url'].replace('http://', 'https://') + '/web/content/' + url_props['model'] + '/' + url_props['id'] + '/' + url_props['field'] + '?download=true';
// url = 'http://localhost:8069'+'/web/content/'+url_props['model']+'/'+url_props['id']+'/'+url_props['field']+'?download=true'
// console.log('url111111', url)
return url;
} else {
url = "data:model/gltf-binary;base64," + this.props.value;
// console.log('url2', url)
return url;
// localStorage.setItem('url',url)
// let new_url = localStorage.getItem(('url'))
// var oViewer = document.getElementsByTagName('model-viewer')[0];
// return new_url
// url = "web_widget_model_viewer/static/src/images/not_model.png";
}
} else {
// var oImg = document.getElementsByClassName('test')[0]
// console.log(oImg)
}
}
return url;
}
}