Compare commits
428 Commits
feature/sf
...
feature/还原
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbf86a69e3 | ||
|
|
f3ec784383 | ||
|
|
032b13b2ad | ||
|
|
e33ca7cd33 | ||
|
|
3a7a6e480a | ||
|
|
51b67c0dcd | ||
|
|
8124818bad | ||
|
|
3a62d4406f | ||
|
|
8b8b30602b | ||
|
|
7a5fcd79d8 | ||
|
|
93fe4d8c62 | ||
|
|
cdeec93e76 | ||
|
|
1a2d9592d1 | ||
|
|
71a64c36ca | ||
|
|
5f026e3b1e | ||
|
|
d50f8716b5 | ||
|
|
6cd2637983 | ||
|
|
ab91ce01d4 | ||
|
|
8f1897c4ff | ||
|
|
1e2c80c38f | ||
|
|
db8ad0f425 | ||
|
|
eedce8338b | ||
|
|
b132cb8713 | ||
|
|
66d6fe8f0a | ||
|
|
97e57f9b3c | ||
|
|
57cfa56081 | ||
|
|
1d464dd00e | ||
|
|
fdc38afcbd | ||
|
|
2e9dc3d006 | ||
|
|
c54a8308c6 | ||
|
|
1934708d78 | ||
|
|
e7bfff491b | ||
|
|
97e36c249b | ||
|
|
6d93d5ef87 | ||
|
|
e8a0b3da93 | ||
|
|
e9acd98ccc | ||
|
|
535d69f4d9 | ||
|
|
603a59b6d7 | ||
|
|
ca2f30fdbd | ||
|
|
4c92c08f84 | ||
|
|
2fd8483a52 | ||
|
|
71bdd6334f | ||
|
|
194f6f52dc | ||
|
|
93ce482d40 | ||
|
|
96c5c3dcf5 | ||
|
|
6bcf7ec53a | ||
|
|
a7d760bc5e | ||
|
|
e196b6b1e3 | ||
|
|
9cb9872a5e | ||
|
|
58d4b3813b | ||
|
|
34d0e989d6 | ||
|
|
c52af21477 | ||
|
|
149d6778f5 | ||
|
|
98c9f3098b | ||
|
|
ff904ad68c | ||
|
|
932f82ac6c | ||
|
|
bbb5ddb177 | ||
|
|
7cbbf58309 | ||
|
|
8edee62d3a | ||
|
|
ce67b7985b | ||
|
|
ef47597cf9 | ||
|
|
9e8d5aaf6a | ||
|
|
363463e31d | ||
|
|
8ff635e901 | ||
|
|
c65e13a83e | ||
|
|
8721bc2de1 | ||
|
|
ec344cc918 | ||
|
|
905df2b79e | ||
|
|
e73fb5791a | ||
|
|
6738a855bb | ||
|
|
3c82020e5e | ||
|
|
422074fcec | ||
|
|
897f5b76f0 | ||
|
|
ee565d3796 | ||
|
|
912b50246a | ||
|
|
df2ba048f4 | ||
|
|
ef2f7d3ecb | ||
|
|
2391c08485 | ||
|
|
85ac3d7a3e | ||
|
|
b96723d9a5 | ||
|
|
19b9db66d3 | ||
|
|
8371875d62 | ||
|
|
a3f6fdda2a | ||
|
|
4a10335379 | ||
|
|
1132acfa40 | ||
|
|
7138dab1b5 | ||
|
|
6bf3df0ef4 | ||
|
|
55594c119f | ||
|
|
0a3bd37224 | ||
|
|
60abdfb372 | ||
|
|
facdf5712a | ||
|
|
94df139110 | ||
|
|
e4f6bc4632 | ||
|
|
6f0dbe3625 | ||
|
|
c00cd5a00a | ||
|
|
b487b6fc40 | ||
|
|
8489a67e64 | ||
|
|
f8426ae4c3 | ||
|
|
c4021d02ce | ||
|
|
bd01ad7bbf | ||
|
|
9650f45ba2 | ||
|
|
cfed77d1a5 | ||
|
|
94c795a68f | ||
|
|
2fba2ad488 | ||
|
|
31260e8921 | ||
|
|
4d04b37582 | ||
|
|
eec27b26f7 | ||
|
|
e300ca1822 | ||
|
|
c8a3bee099 | ||
|
|
35c051e730 | ||
|
|
950ec3a1e1 | ||
|
|
1c1a038156 | ||
|
|
640bf79dc8 | ||
|
|
1ccc32cbcb | ||
|
|
f8d8d885bb | ||
|
|
7c8c869172 | ||
|
|
8d5a4ed4c8 | ||
|
|
981872b0b1 | ||
|
|
d8a74c17f0 | ||
|
|
fe6d207099 | ||
|
|
206043a1a0 | ||
|
|
6a2a465569 | ||
|
|
1767ada489 | ||
|
|
d7f85967c9 | ||
|
|
1a95f5e4ac | ||
|
|
abd7364658 | ||
|
|
26ec1c9f6e | ||
|
|
490aa3fe04 | ||
|
|
924a28e957 | ||
|
|
e58ceb3ac8 | ||
|
|
61c3b16a69 | ||
|
|
70109c0965 | ||
|
|
74b4fd1367 | ||
|
|
c206dc3097 | ||
|
|
4c1c8e7683 | ||
|
|
0d8d54c05b | ||
|
|
71147eb7f9 | ||
|
|
c753df768d | ||
|
|
45df8f5bc2 | ||
|
|
29a55f3ff8 | ||
|
|
94c0b00c2d | ||
|
|
32473d302f | ||
|
|
2cf4958f46 | ||
|
|
893aa2111c | ||
|
|
6cf26e8029 | ||
|
|
e796bbe990 | ||
|
|
c2d2d16948 | ||
|
|
c3ba11bed4 | ||
|
|
37815d603a | ||
|
|
ca0b59e95b | ||
|
|
7c478ec4fd | ||
|
|
5b1d347fd4 | ||
|
|
e738d40b75 | ||
|
|
685eced709 | ||
|
|
ffc40c70d2 | ||
|
|
cc3ee289d3 | ||
|
|
487b452519 | ||
|
|
4a62af7545 | ||
|
|
07be7c3074 | ||
|
|
ddad1e9114 | ||
|
|
2c1a101c24 | ||
|
|
ab1af72727 | ||
|
|
bc186a9723 | ||
|
|
de04d452b3 | ||
|
|
66b808dfc9 | ||
|
|
ad36b37f27 | ||
|
|
e403f2f8e6 | ||
|
|
24b850a508 | ||
|
|
4d8b463cb3 | ||
|
|
9fef877d12 | ||
|
|
c323d9995e | ||
|
|
4f83c5f29a | ||
|
|
ed5f47cc31 | ||
|
|
66bb55a823 | ||
|
|
5926d71d27 | ||
|
|
c78ea6fbe5 | ||
|
|
96df8f971c | ||
|
|
35511effae | ||
|
|
54912f15b9 | ||
|
|
e8a13f1721 | ||
|
|
1532293918 | ||
|
|
030ef14633 | ||
|
|
bf8b45609c | ||
|
|
964618d365 | ||
|
|
06eeb1ed1f | ||
|
|
deb732dc5e | ||
|
|
5737d7b0bc | ||
|
|
5fd0beab95 | ||
|
|
858c163cbe | ||
|
|
fee3572f38 | ||
|
|
f2862af565 | ||
|
|
c1c3639611 | ||
|
|
41017412cd | ||
|
|
e552502fd1 | ||
|
|
61da25a031 | ||
|
|
aafafd682d | ||
|
|
98ed831a85 | ||
|
|
e9be2e9c43 | ||
|
|
b73a449b01 | ||
|
|
45d04e1a05 | ||
|
|
fc17063507 | ||
|
|
b3fbbeb85c | ||
|
|
97d760cd56 | ||
|
|
9d911a5c2b | ||
|
|
9bb3b88fd6 | ||
|
|
baaeac10eb | ||
|
|
2510f5fbf3 | ||
|
|
f77691251e | ||
|
|
5292826c72 | ||
|
|
6fed64ba2a | ||
|
|
8e5f5cf0d1 | ||
|
|
b4b5207aea | ||
|
|
ca61537e21 | ||
|
|
83da8f58e2 | ||
|
|
a36c30b5c1 | ||
|
|
ae6ec7183e | ||
|
|
cc58425f50 | ||
|
|
dda3aad95d | ||
|
|
d6dcb6bf55 | ||
|
|
4b672f3c23 | ||
|
|
423d5cec8e | ||
|
|
e6bb5db0e1 | ||
|
|
f0e66c6d90 | ||
|
|
8a1dfe14e6 | ||
|
|
5113de7e97 | ||
|
|
e06002e05a | ||
|
|
8b7b52ee2c | ||
|
|
6738f38131 | ||
|
|
ab115ab71c | ||
|
|
6ec6094c5e | ||
|
|
321c40d31d | ||
|
|
890b73e108 | ||
|
|
247b3e4444 | ||
|
|
7391b1324d | ||
|
|
d53e664881 | ||
|
|
b49b5890a0 | ||
|
|
690543e2d4 | ||
|
|
f296e1ba1a | ||
|
|
31f07c5156 | ||
|
|
63d6ce6da8 | ||
|
|
580f95f338 | ||
|
|
326181fa81 | ||
|
|
6fc735063a | ||
|
|
499261f62e | ||
|
|
6912160232 | ||
|
|
04e63dcc59 | ||
|
|
7ceaadb9c4 | ||
|
|
fdf1b786fe | ||
|
|
1da7a0195d | ||
|
|
b093b11ec2 | ||
|
|
718b1f9edf | ||
|
|
5bdd3982ae | ||
|
|
a606cbfc6d | ||
|
|
1a5fcf09e1 | ||
|
|
d2899fe38e | ||
|
|
24e75f8895 | ||
|
|
5bc5766507 | ||
|
|
49f021ed7a | ||
|
|
94031e68ad | ||
|
|
182348f427 | ||
|
|
c885f3ce8c | ||
|
|
e5b0960e3a | ||
|
|
dd5d4e7748 | ||
|
|
369980d655 | ||
|
|
2096d05cdb | ||
|
|
fbab054324 | ||
|
|
e3ff9e9fde | ||
|
|
c3ee544ca6 | ||
|
|
08581c8bc4 | ||
|
|
49cbf2fde2 | ||
|
|
2f2522c99e | ||
|
|
fefa14a47b | ||
|
|
329d7b6464 | ||
|
|
f36c2ac096 | ||
|
|
9c6367c053 | ||
|
|
076866e9b7 | ||
|
|
3a64a2106a | ||
|
|
ead39c9649 | ||
|
|
25d1a99239 | ||
|
|
9a318d45f3 | ||
|
|
41a9aa86a7 | ||
|
|
2322758e50 | ||
|
|
d216478679 | ||
|
|
b487ee127a | ||
|
|
2a964bc30e | ||
|
|
d0132dbc3a | ||
|
|
acccb4b6f9 | ||
|
|
48f75ad600 | ||
|
|
daeae46820 | ||
|
|
77535fa70e | ||
|
|
913780bc2b | ||
|
|
f566fc1c08 | ||
|
|
a97ce9b0a7 | ||
|
|
d0e18fbd44 | ||
|
|
3845041f7f | ||
|
|
f313a171cb | ||
|
|
93731a4777 | ||
|
|
dba17d5c7a | ||
|
|
2a984ba2c0 | ||
|
|
dbfd75b139 | ||
|
|
db1dc18c28 | ||
|
|
523f7a0942 | ||
|
|
16b3df87c9 | ||
|
|
8d952aa046 | ||
|
|
e3e253fab8 | ||
|
|
fe96004111 | ||
|
|
8483be5d2d | ||
|
|
b6964e29bc | ||
|
|
56d1a98c53 | ||
|
|
01f0902937 | ||
|
|
6335c03cef | ||
|
|
4f898dd8ce | ||
|
|
d012066428 | ||
|
|
4c57bbe791 | ||
|
|
b8d590de6d | ||
|
|
82a31c6f31 | ||
|
|
30a7f762c2 | ||
|
|
3a1acb0f5a | ||
|
|
c0b759aa9d | ||
|
|
7f5ac4ef90 | ||
|
|
f1c835800e | ||
|
|
77852900a3 | ||
|
|
b2a9088354 | ||
|
|
3be0d1ffad | ||
|
|
686c049e52 | ||
|
|
780dbd5dda | ||
|
|
53ad002f3b | ||
|
|
36270477d5 | ||
|
|
a45ee59a76 | ||
|
|
d2782446b0 | ||
|
|
eb835ae5c8 | ||
|
|
401103f17b | ||
|
|
e592d49983 | ||
|
|
de0cb1ebbc | ||
|
|
8e91aec7f1 | ||
|
|
0b7dc6d09a | ||
|
|
108cb96ca5 | ||
|
|
03efa01a85 | ||
|
|
ba19175472 | ||
|
|
aa9464face | ||
|
|
0c788df2f2 | ||
|
|
cbc9264b2c | ||
|
|
82ce347ca4 | ||
|
|
d13071272a | ||
|
|
74523c710f | ||
|
|
fc35ef687b | ||
|
|
a71d960e2d | ||
|
|
0cbf01b9ec | ||
|
|
869b389420 | ||
|
|
d429a8b4b8 | ||
|
|
deccb6e3cd | ||
|
|
2a9c5276ab | ||
|
|
db0c83bd2b | ||
|
|
f81ee155e7 | ||
|
|
76368398ba | ||
|
|
8e5fc5eb61 | ||
|
|
a0804758f5 | ||
|
|
4634393f6c | ||
|
|
5ffe2ce0e2 | ||
|
|
911f464aca | ||
|
|
9f30a029c5 | ||
|
|
5b9fcb2e53 | ||
|
|
46807003e1 | ||
|
|
593944cac2 | ||
|
|
018b51e1e5 | ||
|
|
a29dbca0e4 | ||
|
|
47a408d034 | ||
|
|
d14120dfa2 | ||
|
|
b88c6a53ab | ||
|
|
e3d58c2a9e | ||
|
|
04261036a5 | ||
|
|
0eaed68b82 | ||
|
|
ccb53a61de | ||
|
|
4a01132b91 | ||
|
|
9fffcd4f04 | ||
|
|
ce86a66e92 | ||
|
|
65dd8372dd | ||
|
|
39f97131a2 | ||
|
|
7b471be4cf | ||
|
|
802bd4285c | ||
|
|
e7de773f28 | ||
|
|
4098dda5b8 | ||
|
|
2c67f7a286 | ||
|
|
a953ca189e | ||
|
|
0a09c54690 | ||
|
|
076c4a2bcb | ||
|
|
0e2cbf06ca | ||
|
|
575c856f27 | ||
|
|
103b00a635 | ||
|
|
38c77e7fbb | ||
|
|
272ab8daa0 | ||
|
|
acff814e9b | ||
|
|
1bc3f756fe | ||
|
|
99ea796f2e | ||
|
|
4ef82ee7cf | ||
|
|
4bed65d1df | ||
|
|
2b9e768793 | ||
|
|
f4a878ced9 | ||
|
|
093724a277 | ||
|
|
8346f40b79 | ||
|
|
a9ba65ec17 | ||
|
|
8f29696b64 | ||
|
|
2d32419a7d | ||
|
|
2c636c5e64 | ||
|
|
270338868b | ||
|
|
845d606b36 | ||
|
|
919a200750 | ||
|
|
ad11f2ea63 | ||
|
|
a414f7cd25 | ||
|
|
2a8558f5a2 | ||
|
|
13555d91e2 | ||
|
|
5ccc186bd1 | ||
|
|
27259fb8f7 | ||
|
|
b733c4168f | ||
|
|
1e243e4500 | ||
|
|
ef2e84e411 | ||
|
|
4f644b1e25 | ||
|
|
a5cb2dc93b | ||
|
|
749473f9dc | ||
|
|
dc8aecba93 | ||
|
|
587e2a4e3e | ||
|
|
d83255cc67 | ||
|
|
14edbd85f4 | ||
|
|
e7df6c14b1 | ||
|
|
e2c13a8194 | ||
|
|
9acdcc0429 | ||
|
|
c04e138d6b | ||
|
|
296efcc395 |
@@ -10,7 +10,7 @@
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['web'],
|
||||
'depends': ['web', 'purchase'],
|
||||
'data': [
|
||||
|
||||
],
|
||||
@@ -22,11 +22,21 @@
|
||||
],
|
||||
'web.assets_backend': [
|
||||
'jikimo_frontend/static/src/fields/custom_many2many_checkboxes/*',
|
||||
'jikimo_frontend/static/src/fields/Many2OneRadioField/*',
|
||||
'jikimo_frontend/static/src/scss/custom_style.scss',
|
||||
# 'jikimo_frontend/static/src/views/list_nums/list_nbCols.js',
|
||||
'jikimo_frontend/static/src/views/list_nums/list_nums.xml',
|
||||
'jikimo_frontend/static/src/views/list_nums/list_nums2.xml',
|
||||
'jikimo_frontend/static/src/views/list_nums/list_nums3.xml',
|
||||
'jikimo_frontend/static/src/js/custom_form_status_indicator.js',
|
||||
'jikimo_frontend/static/src/js/custom_image_temp.js',
|
||||
'jikimo_frontend/static/src/scss/rowno_in_tree.scss',
|
||||
# 'jikimo_frontend/static/src/views/list_nums/list_render.xml',
|
||||
# 'jikimo_frontend/static/src/list/list_up_down_button.xml',
|
||||
# 'jikimo_frontend/static/src/list/custom_import.js',
|
||||
# 'jikimo_frontend/static/src/list/custom_width.js',
|
||||
'jikimo_frontend/static/src/views/list_nums/extent_purchase.xml',
|
||||
|
||||
],
|
||||
|
||||
},
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
.many2one_radio_field {
|
||||
display: inline-block;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { RadioField } from "@web/views/fields/radio/radio_field"; // 导入单选按钮组件
|
||||
import { registry } from "@web/core/registry";
|
||||
|
||||
export class Many2OneRadioField extends RadioField {
|
||||
// 你可以重写或者添加一些方法和属性
|
||||
// 例如,你可以重写setup方法来添加一些事件监听器或者初始化一些变量
|
||||
setup() {
|
||||
super.setup(); // 调用父类的setup方法
|
||||
// 你自己的代码
|
||||
}
|
||||
|
||||
onImageClick(event) {
|
||||
// 放大图片逻辑
|
||||
// 获取图片元素
|
||||
const img = event.target;
|
||||
const close = img.nextSibling;
|
||||
// 实现放大图片逻辑
|
||||
// 比如使用 CSS 放大
|
||||
img.parentElement.classList.add('zoomed');
|
||||
close.classList.add('img_close');
|
||||
}
|
||||
|
||||
onCloseClick(event) {
|
||||
const close = event.target;
|
||||
const img = close.previousSibling;
|
||||
img.parentElement.classList.remove('zoomed');
|
||||
close.classList.remove('img_close');
|
||||
}
|
||||
|
||||
get items() {
|
||||
return Many2OneRadioField.getItems(this.props.name, this.props.record);
|
||||
}
|
||||
|
||||
static getItems(fieldName, record) {
|
||||
switch (record.fields[fieldName].type) {
|
||||
case "selection":
|
||||
return record.fields[fieldName].selection;
|
||||
case "many2one": {
|
||||
const value = record.preloadedData[fieldName] || [];
|
||||
return value.map((item) => [item.id, item.display_name, item.image]);
|
||||
}
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Many2OneRadioField.template = "jikimo_frontend.Many2OneRadioField";
|
||||
// MyCustomWidget.supportedTypes = ['many2many'];
|
||||
|
||||
registry.category("fields").add("many2one_radio", Many2OneRadioField);
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<t t-name="jikimo_frontend.Many2OneRadioField" owl="1">
|
||||
<div
|
||||
role="radiogroup"
|
||||
t-attf-class="o_{{ props.orientation }}"
|
||||
t-att-aria-label="string"
|
||||
>
|
||||
<t t-foreach="items" t-as="item" t-key="item[0]">
|
||||
<div class="form-check o_radio_item many2one_radio_field" aria-atomic="true">
|
||||
<input
|
||||
type="radio"
|
||||
class="form-check-input o_radio_input"
|
||||
t-att-checked="item[0] === value"
|
||||
t-att-disabled="props.readonly"
|
||||
t-att-name="id"
|
||||
t-att-data-value="item[0]"
|
||||
t-att-data-index="item_index"
|
||||
t-att-id="`${id}_${item[0]}`"
|
||||
t-on-change="() => this.onChange(item)"
|
||||
/>
|
||||
<label class="form-check-label o_form_label" t-att-for="`${id}_${item[0]}`" t-esc="item[1]" />
|
||||
<div t-on-dblclick="onImageClick">
|
||||
<t>
|
||||
<img t-att-src="item[2]" width="50" height="50"/>
|
||||
<div class="close" t-on-click="onCloseClick">×</div>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
@@ -15,23 +15,24 @@ export class MyCustomWidget extends Many2ManyCheckboxesField {
|
||||
// 放大图片逻辑
|
||||
// 获取图片元素
|
||||
const img = event.target;
|
||||
const close = img.nextSibling
|
||||
const close = img.nextSibling;
|
||||
|
||||
// 实现放大图片逻辑
|
||||
// 比如使用 CSS 放大
|
||||
img.parentElement.classList.add('zoomed');
|
||||
close.classList.add('img_close')
|
||||
close.classList.add('img_close');
|
||||
}
|
||||
|
||||
onCloseClick(event) {
|
||||
const close = event.target;
|
||||
const img = close.previousSibling
|
||||
img.parentElement.classList.remove('zoomed')
|
||||
close.classList.remove('img_close')
|
||||
const img = close.previousSibling;
|
||||
img.parentElement.classList.remove('zoomed');
|
||||
close.classList.remove('img_close');
|
||||
}
|
||||
}
|
||||
|
||||
MyCustomWidget.template = "jikimo_frontend.MyCustomWidget"
|
||||
MyCustomWidget.template = "jikimo_frontend.MyCustomWidget";
|
||||
// MyCustomWidget.supportedTypes = ['many2many'];
|
||||
|
||||
registry.category("fields").add("custom_many2many_checkboxes", MyCustomWidget);
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
/** @odoo-module */
|
||||
|
||||
import {patch} from '@web/core/utils/patch';
|
||||
// import { Dialog } from "@web/core/dialog/dialog";
|
||||
import {_t} from "@web/core/l10n/translation";
|
||||
import {FormStatusIndicator} from "@web/views/form/form_status_indicator/form_status_indicator";
|
||||
|
||||
var Dialog = require('web.Dialog');
|
||||
// var {patch} = require("web.utils") 这句话也行
|
||||
|
||||
patch(FormStatusIndicator.prototype, 'jikimo_frontend.FormStatusIndicator', {
|
||||
// 你可以重写或者添加一些方法和属性
|
||||
async _onDiscardChanges() {
|
||||
// var self = this;
|
||||
Dialog.confirm(this, _t("Are you sure you want to discard changes?"), {
|
||||
title: _t("Discard Changes"),
|
||||
|
||||
// confirm_callback: function () {
|
||||
// self.model.discardChanges(self.handle);
|
||||
// },
|
||||
});
|
||||
},
|
||||
|
||||
async discard() {
|
||||
// if (window.confirm("Are you sure you want to discard changes?")) {
|
||||
// await this.props.discard();
|
||||
// }
|
||||
// const result = await this._confirmDiscardChange();
|
||||
await this._confirmDiscardChange();
|
||||
await this.props.discard();
|
||||
},
|
||||
|
||||
_confirmDiscardChange(){
|
||||
var self = this;
|
||||
var def = new Promise(function (resolve, reject) {
|
||||
var message = _t("请确认是否要舍弃之前的更改?");
|
||||
var dialog = Dialog.confirm(self, message, {
|
||||
title: _t("Warning"),
|
||||
confirm_callback: resolve.bind(self, true),
|
||||
cancel_callback: reject,
|
||||
});
|
||||
dialog.on('closed', self, reject);
|
||||
});
|
||||
return def;
|
||||
},
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
$(function (){
|
||||
document.addEventListener('click', function () {
|
||||
const dom = $('.o_form_status_indicator_buttons ')
|
||||
if(dom) {
|
||||
const dom1 = dom.children().eq(0)
|
||||
const dom2 = dom.children().eq(1)
|
||||
if(!dom1.text()) {
|
||||
dom1.append('保存')
|
||||
dom2.append('取消')
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
32
jikimo_frontend/static/src/js/custom_image.js
Normal file
32
jikimo_frontend/static/src/js/custom_image.js
Normal file
@@ -0,0 +1,32 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
|
||||
import {patch} from '@web/core/utils/patch';
|
||||
import { url } from "@web/core/utils/urls";
|
||||
import { ImageField, imageCacheKey } from '@web/views/fields/image/image_field';
|
||||
|
||||
patch(ImageField.prototype, 'jikimo_frontend/static/src/js/custom_image.js', {
|
||||
// 你可以重写或者添加一些方法和属性
|
||||
getUrl(previewFieldName) {
|
||||
console.log('666666666666666666666666666666666')
|
||||
if (this.state.isValid && this.props.value) {
|
||||
if (1) {
|
||||
if (!this.rawCacheKey) {
|
||||
this.rawCacheKey = this.props.record.data.__last_update;
|
||||
}
|
||||
return url("/web/image", {
|
||||
model: this.props.record.resModel,
|
||||
id: this.props.record.resId,
|
||||
field: previewFieldName,
|
||||
unique: imageCacheKey(this.rawCacheKey),
|
||||
});
|
||||
} else {
|
||||
// Use magic-word technique for detecting image type
|
||||
const magic = fileTypeMagicWordMap[this.props.value[0]] || "png";
|
||||
return `data:image/${magic};base64,${this.props.value}`;
|
||||
}
|
||||
}
|
||||
return placeholder;
|
||||
}
|
||||
}
|
||||
);
|
||||
36
jikimo_frontend/static/src/js/custom_image_temp.js
Normal file
36
jikimo_frontend/static/src/js/custom_image_temp.js
Normal file
@@ -0,0 +1,36 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
import { url } from "@web/core/utils/urls";
|
||||
import { ImageField, imageCacheKey } from '@web/views/fields/image/image_field';
|
||||
|
||||
export class CustomImageField extends ImageField {
|
||||
setup() {
|
||||
super.setup();
|
||||
// this.dialog = useService("dialog");
|
||||
}
|
||||
|
||||
getUrl(previewFieldName) {
|
||||
console.log('8888888888886666666666666666666')
|
||||
if (this.state.isValid && this.props.value) {
|
||||
if (1) {
|
||||
if (!this.rawCacheKey) {
|
||||
this.rawCacheKey = this.props.record.data.__last_update;
|
||||
}
|
||||
return url("/web/image", {
|
||||
model: this.props.record.resModel,
|
||||
id: this.props.record.resId,
|
||||
field: previewFieldName,
|
||||
unique: imageCacheKey(this.rawCacheKey),
|
||||
});
|
||||
} else {
|
||||
// Use magic-word technique for detecting image type
|
||||
const magic = fileTypeMagicWordMap[this.props.value[0]] || "png";
|
||||
return `data:image/${magic};base64,${this.props.value}`;
|
||||
}
|
||||
}
|
||||
return placeholder;
|
||||
}
|
||||
}
|
||||
|
||||
registry.category("fields").add("custom_image", CustomImageField);
|
||||
95
jikimo_frontend/static/src/list/custom_width.js
Normal file
95
jikimo_frontend/static/src/list/custom_width.js
Normal file
@@ -0,0 +1,95 @@
|
||||
/** @odoo-module */
|
||||
|
||||
import {patch} from '@web/core/utils/patch';
|
||||
import {ListRenderer} from "@web/views/list/list_renderer";
|
||||
|
||||
// var {patch} = require("web.utils") 这句话也行
|
||||
|
||||
patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', {
|
||||
// 你可以重写或者添加一些方法和属性
|
||||
// The following code manipulates the DOM directly to avoid having to wait for a
|
||||
// render + patch which would occur on the next frame and cause flickering.
|
||||
freezeColumnWidths() {
|
||||
// console.log('ccccccccccccccccccccccccccc')
|
||||
if (!this.keepColumnWidths) {
|
||||
this.columnWidths = null;
|
||||
}
|
||||
|
||||
const table = this.tableRef.el;
|
||||
const headers = [...table.querySelectorAll("thead th:not(.o_list_actions_header)")];
|
||||
const column_num = headers.length;
|
||||
|
||||
if (!this.columnWidths || !this.columnWidths.length) {
|
||||
// no column widths to restore
|
||||
// Set table layout auto and remove inline style to make sure that css
|
||||
// rules apply (e.g. fixed width of record selector)
|
||||
table.style.tableLayout = "auto";
|
||||
headers.forEach((th) => {
|
||||
th.style.width = null;
|
||||
th.style.maxWidth = null;
|
||||
});
|
||||
|
||||
this.setDefaultColumnWidths(column_num);
|
||||
|
||||
// Squeeze the table by applying a max-width on largest columns to
|
||||
// ensure that it doesn't overflow
|
||||
this.columnWidths = this.computeColumnWidthsFromContent();
|
||||
table.style.tableLayout = "fixed";
|
||||
}
|
||||
headers.forEach((th, index) => {
|
||||
if (!th.style.width) {
|
||||
th.style.width = `${Math.floor(this.columnWidths[index])}px`;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
setDefaultColumnWidths(column_num) {
|
||||
// const bbb = this.state.columns[0].name
|
||||
const widths = this.state.columns.map((col) =>
|
||||
this.calculateColumnWidth(col));
|
||||
// const sumOfRelativeWidths = (widths
|
||||
// .filter(({ type }) => type === "relative")
|
||||
// .reduce((sum, { value }) => sum + value, 0));
|
||||
|
||||
// 获取数组的最后一项
|
||||
const lastItem = widths[widths.length - 1];
|
||||
|
||||
// 复制最后一项
|
||||
const newItem = { ...lastItem };
|
||||
|
||||
// 将新的对象添加到数组的末尾
|
||||
widths.push(newItem);
|
||||
|
||||
// 判断销售的sequence
|
||||
// if (this.state.columns[0].name === "sequence") {
|
||||
// widths[1] = { type: "relative", value: 0.1 };
|
||||
// }
|
||||
|
||||
// 判断 this.state.columns 是否存在且长度大于零
|
||||
if (this.state.columns && this.state.columns.length > 0
|
||||
&& this.state.columns[0].name === "sequence") {
|
||||
widths[1] = { type: "relative", value: 0.1 };
|
||||
}
|
||||
|
||||
|
||||
// 1 because nth-child selectors are 1-indexed,
|
||||
// 2 when the first column contains
|
||||
// the checkboxes to select records.
|
||||
const columnOffset = this.hasSelectors ? 2 : 1;
|
||||
widths.forEach(({ type, value }, width) => {
|
||||
const headerEl = this.tableRef.el.querySelector(
|
||||
`th:nth-child(${width + columnOffset})`);
|
||||
if (type === "absolute") {
|
||||
if (this.isEmpty) {
|
||||
headerEl.style.width = value;
|
||||
} else {
|
||||
headerEl.style.minWidth = value;
|
||||
}
|
||||
} else if (type === "relative" && this.isEmpty) {
|
||||
headerEl.style.width = `${((value / column_num) * 100
|
||||
).toFixed(2)}%`;
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
);
|
||||
20
jikimo_frontend/static/src/list/list_up_down_button.xml
Normal file
20
jikimo_frontend/static/src/list/list_up_down_button.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates>
|
||||
<t t-name="list_up_down_button" t-inherit="web.ListView.Buttons" t-inherit-mode="extension" owl="1">
|
||||
<xpath expr="//t[@t-if='nbTotal and !nbSelected and activeActions.exportXlsx and isExportEnable and !env.isSmall']" position="before">
|
||||
<!-- 新增的导入文件按钮 -->
|
||||
<!-- <button type="button" class="btn btn-secondary fa fa-upload o_list_import_file" data-tooltip="导入文件" aria-label="Import File" title="" t-on-click="onDirectImportData"/> -->
|
||||
<!-- <button type="button" class="btn btn-secondary fa fa-upload o_list_import_file" data-tooltip="导入文件" aria-label="Import File" title="" t-on-click="onDirectImportData"/> -->
|
||||
<!-- <button type="button" class="btn btn-secondary fa fa-download o_list_export_xlsx" data-tooltip="导出全部" aria-label="导出全部" t-on-click="onDirectExportData"/> -->
|
||||
<button type="button" class="btn btn-secondary o_list_export_xlsx" data-tooltip="导出全部" aria-label="导出全部" t-on-click="onDirectExportData">导出全部</button>
|
||||
<!-- <button type="button" t-component="base_import.ImportRecords" class="btn btn-secondary o_list_export_xlsx" data-tooltip="导入数据" aria-label="导入数据" t-on-click="importRecords">导入数据</button> -->
|
||||
<!-- <button type="button" class="btn btn-secondary o_list_export_xlsx" data-tooltip="导入数据" aria-label="导入数据" t-on-click="importRecords">导入数据</button> -->
|
||||
<!-- <t t-component="base_import.ImportRecords"> -->
|
||||
<!-- <button t-on-click="importRecords" type="button" class="btn btn-secondary o_list_export_xlsx" data-tooltip="导入数据" aria-label="导入数据">导入数据</button> -->
|
||||
<!-- </t> -->
|
||||
|
||||
</xpath>
|
||||
<xpath expr="//t[@t-if='nbTotal and !nbSelected and activeActions.exportXlsx and isExportEnable and !env.isSmall']" position="replace">
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
@@ -8,9 +8,16 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
div:has(.o_required_modifier) > label::before {
|
||||
content: '*' !important;
|
||||
color: red !important;
|
||||
padding: 0 4px !important;
|
||||
vertical-align: top !important;
|
||||
font-size: 1.5rem !important;
|
||||
}
|
||||
|
||||
.my-image div {
|
||||
|
||||
width: 110px !important;
|
||||
height: 110px !important;
|
||||
}
|
||||
@@ -128,7 +135,7 @@ td.o_required_modifier {
|
||||
.text-truncate {
|
||||
overflow: unset !important;
|
||||
text-overflow: unset !important;
|
||||
white-space: unset !important;
|
||||
white-space: nowrap!important;
|
||||
}
|
||||
|
||||
.o_list_renderer .o_list_table tbody > tr > td:not(.o_list_record_selector):not(.o_handle_cell):not(.o_list_button):not(.o_list_record_remove) {
|
||||
@@ -198,8 +205,8 @@ div[class="o_content o_component_with_search_panel"] img[name="equipment_image"]
|
||||
|
||||
div[class="o_content o_component_with_search_panel"] .o_kanban_card_content button {
|
||||
position: absolute;
|
||||
top: -52px;
|
||||
left: 3rem;
|
||||
//top: -52px;
|
||||
//left: -55px;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
@@ -246,16 +253,16 @@ div[class="o_content o_component_with_search_panel"] .show_state span {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .row {
|
||||
position: absolute;
|
||||
top: 55px;
|
||||
right: 43.5%;
|
||||
}
|
||||
//div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .row {
|
||||
// position: absolute;
|
||||
// top: 55px;
|
||||
// right: 43.5%;
|
||||
//}
|
||||
//------------------------------------------
|
||||
|
||||
.test_model > .o_form_label {
|
||||
margin-left: 4px !important;
|
||||
line-height: 0 !important;
|
||||
//line-height: 0 !important;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1200px) {
|
||||
@@ -263,10 +270,10 @@ div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .
|
||||
right: 52%;
|
||||
}
|
||||
|
||||
div[class="o_content o_component_with_search_panel"] .o_kanban_card_content button {
|
||||
|
||||
left: -4.4rem;
|
||||
}
|
||||
//div[class="o_content o_component_with_search_panel"] .o_kanban_card_content button {
|
||||
//
|
||||
// left: -95px;
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
@@ -311,27 +318,86 @@ div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .
|
||||
.o_horizontal_separator {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.o_field_widget input[class='o_input'] {
|
||||
text-align: center
|
||||
}
|
||||
//
|
||||
//.o_field_widget input[class='o_input'] {
|
||||
//text-align: center
|
||||
//}
|
||||
|
||||
div:has(.o_required_modifier) > label::before {
|
||||
position: absolute;
|
||||
left: -3px;
|
||||
}
|
||||
|
||||
.o_form_view .o_form_label {
|
||||
position: relative;
|
||||
width: 9rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
padding-left: 1rem;
|
||||
//.o_form_view .o_form_label {
|
||||
// position: relative;
|
||||
// width: 9rem;
|
||||
// overflow: hidden;
|
||||
// text-overflow: ellipsis;
|
||||
// white-space: nowrap;
|
||||
// padding-left: 1rem;
|
||||
//}
|
||||
//
|
||||
//.o_form_view .o_form_label:hover {
|
||||
// white-space: normal;
|
||||
// overflow: visible;
|
||||
//}
|
||||
|
||||
.o_form_view {
|
||||
.o_form_sheet_bg .o_form_sheet {
|
||||
//max-width: none !important;
|
||||
width: auto !important;
|
||||
max-width: 98% !important;
|
||||
}
|
||||
.o_FormRenderer_chatterContainer {
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
|
||||
.o_form_view .o_form_label:hover {
|
||||
white-space: normal;
|
||||
overflow: visible;
|
||||
|
||||
// 2023-11-16 hy 新增
|
||||
.o_kanban_card_content .btn-group {
|
||||
position: unset;
|
||||
}
|
||||
|
||||
.o_kanban_card_content .btn-group button{
|
||||
top: 100px;
|
||||
left: 168px;
|
||||
}
|
||||
|
||||
|
||||
.o_kanban_primary_right {
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
left: 168px;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
.row {
|
||||
width: 50%;
|
||||
margin: 0;
|
||||
>div {
|
||||
padding: 0;
|
||||
width: unset;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.o_stock_kanban .o_kanban_card_content {
|
||||
.row {
|
||||
align-items: center;
|
||||
|
||||
.o_kanban_primary_left, .o_kanban_primary_right {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.o_kanban_primary_right {
|
||||
position: unset;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 机床换刀申请表格宽度设置
|
||||
.o_list_table_ungrouped {
|
||||
min-width: 1089px;
|
||||
}
|
||||
4
jikimo_frontend/static/src/scss/rowno_in_tree.scss
Normal file
4
jikimo_frontend/static/src/scss/rowno_in_tree.scss
Normal file
@@ -0,0 +1,4 @@
|
||||
.row_no {
|
||||
width: 3.2% !important;
|
||||
vertical-align: middle;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<templates>
|
||||
<t t-name="purchase.PurchaseListView" t-inherit="web.ListRenderer" t-inherit-mode="primary" owl="1">
|
||||
<xpath expr="//div[hasclass('o_list_renderer')]" position="before">
|
||||
<PurchaseDashBoard />
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
@@ -8,4 +8,4 @@ patch(ListRenderer.prototype, '/jikimo_frontend/static/src/views/list_nums/list_
|
||||
const nbCols = this._super(...arguments);
|
||||
return nbCols + 1;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<t t-name="og.web.ListRenderer" t-inherit="web.ListRenderer" t-inherit-mode="extension">
|
||||
<xpath expr="//table/thead/tr/th[@t-if='hasSelectors']" position="before">
|
||||
<th><i class="fa fa-list-ol"/></th>
|
||||
<th class="row_no"><i class="fa fa-list-ol"/></th>
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
|
||||
47
jikimo_frontend/static/src/views/list_nums/list_render.xml
Normal file
47
jikimo_frontend/static/src/views/list_nums/list_render.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<template>
|
||||
<t
|
||||
t-name="rowno_in_tree.ListRenderer"
|
||||
t-inherit="web.ListRenderer"
|
||||
t-inherit-mode="extension"
|
||||
owl="1"
|
||||
|
||||
>
|
||||
<xpath expr="//table/thead/tr/th[@t-if='hasSelectors']" position="before">
|
||||
<th class="row_no"><i class="fa fa-list-ol"/></th>
|
||||
</xpath>
|
||||
<xpath expr="//div/table/tfoot/tr/td" position="before">
|
||||
<td />
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
<t
|
||||
t-name="rowno_in_tree.add_number"
|
||||
t-inherit="web.ListRenderer.Rows"
|
||||
t-inherit-mode="extension"
|
||||
owl="1"
|
||||
>
|
||||
<xpath expr="//t[@t-foreach='list.records']" position="before">
|
||||
<t t-set="RowNumber" t-value="1" />
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//t[@t-call='{{ constructor.recordRowTemplate }}']"
|
||||
position="after"
|
||||
>
|
||||
<t t-set="RowNumber" t-value="RowNumber+1" />
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
<t
|
||||
t-name="rowno_in_tree.ListRenderer.RecordRowNumber"
|
||||
t-inherit="web.ListRenderer.RecordRow"
|
||||
t-inherit-mode="extension"
|
||||
owl="1"
|
||||
>
|
||||
<xpath expr="//td[@class='o_list_record_selector']" position="before">
|
||||
<td tabindex="-1">
|
||||
<span t-esc="RowNumber" />
|
||||
</td>
|
||||
</xpath>
|
||||
</t>
|
||||
</template>
|
||||
@@ -23,7 +23,7 @@ html .o_web_client > .o_action_manager > .o_action {
|
||||
}
|
||||
|
||||
.o_form_view {
|
||||
background-color: unset !important;
|
||||
//background-color: unset !important;
|
||||
min-height: unset !important;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@
|
||||
<xpath expr="//field[@name='state']" position="after">
|
||||
<field name="production_state" invisible="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//button[@name='action_open_wizard']" position="after">
|
||||
<button name="open_tablet_view" type="object" icon="fa-tablet" title="Open Tablet View" context="{'from_production_order': True}" attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'cancel', 'done')), ('state', '=', 'done')]}"/>
|
||||
</xpath>
|
||||
<!-- <xpath expr="//button[@name='action_open_wizard']" position="after">-->
|
||||
<!-- <button name="open_tablet_view" type="object" icon="fa-tablet" title="Open Tablet View" context="{'from_production_order': True}" attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'cancel', 'done')), ('state', '=', 'done')]}"/>-->
|
||||
<!-- </xpath>-->
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@ csv_internal_sep = ,
|
||||
data_dir = /var/lib/odoo
|
||||
db_host = 172.17.0.2
|
||||
db_maxconn = 64
|
||||
db_name = sf_cs_dev937
|
||||
db_name = sf_t2cs_003
|
||||
db_password = sf
|
||||
db_port = 5432
|
||||
db_sslmode = prefer
|
||||
db_template = template0
|
||||
db_user = sf
|
||||
dbfilter =
|
||||
demo = {}
|
||||
without_demo = all
|
||||
email_from = False
|
||||
from_filter = False
|
||||
geoip_database = /usr/share/GeoIP/GeoLite2-City.mmdb
|
||||
@@ -56,7 +56,6 @@ test_tags = None
|
||||
;transient_age_limit = 1.0
|
||||
;translate_modules = ['all']
|
||||
unaccent = False
|
||||
upgrade_path =
|
||||
without_demo = False
|
||||
upgrade_path =
|
||||
workers = 0
|
||||
|
||||
|
||||
@@ -7,10 +7,15 @@
|
||||
<field name="model">quality.point</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_button_box" name="button_box"/>
|
||||
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
|
||||
<h2><field name="name" readonly="1"/></h2>
|
||||
<widget name="web_ribbon" title="Archived" bg_color="bg-danger"
|
||||
attrs="{'invisible': [('active', '=', True)]}"/>
|
||||
<h2>
|
||||
<field name="name" readonly="1"/>
|
||||
</h2>
|
||||
<group>
|
||||
<group>
|
||||
<field name="active" invisible="1"/>
|
||||
@@ -33,13 +38,14 @@
|
||||
<field name="note" placeholder="Describe the quality check to do..."/>
|
||||
</page>
|
||||
<page string="Notes" name="Notes">
|
||||
<field name="reason" string="Note" placeholder="Describe why you need to perform this quality check..."/>
|
||||
<field name="reason" string="Note"
|
||||
placeholder="Describe why you need to perform this quality check..."/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids"/>
|
||||
<field name="message_ids"/>
|
||||
<field name="message_follower_ids"/>
|
||||
<field name="message_ids"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
@@ -85,17 +91,18 @@
|
||||
<filter name="filter_date_close" date="date_close"/>
|
||||
<separator/>
|
||||
<filter string="Late Activities" name="activities_overdue"
|
||||
domain="[('my_activity_date_deadline', '<', context_today().strftime('%Y-%m-%d'))]"
|
||||
help="Show all records which has next action date is before today"/>
|
||||
domain="[('my_activity_date_deadline', '<', context_today().strftime('%Y-%m-%d'))]"
|
||||
help="Show all records which has next action date is before today"/>
|
||||
<filter string="Today Activities" name="activities_today"
|
||||
domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
|
||||
domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
|
||||
<filter string="Future Activities" name="activities_upcoming_all"
|
||||
domain="[('my_activity_date_deadline', '>', context_today().strftime('%Y-%m-%d'))]"/>
|
||||
domain="[('my_activity_date_deadline', '>', context_today().strftime('%Y-%m-%d'))]"/>
|
||||
<group expand="0" string="Group By">
|
||||
<filter string="Stage" name="groupby_stage" domain="[]" context="{'group_by': 'stage_id'}"/>
|
||||
<filter string="Responsible" name="groupby_user" domain="[]" context="{'group_by': 'user_id'}"/>
|
||||
<filter string="Root Cause" name="groupby_reason" domain="[]" context="{'group_by': 'reason_id'}"/>
|
||||
<filter string="Creation Date" name="groupby_createmonth" domain="[]" context="{'group_by': 'create_date'}"/>
|
||||
<filter string="Creation Date" name="groupby_createmonth" domain="[]"
|
||||
context="{'group_by': 'create_date'}"/>
|
||||
<filter string="Quality Team" name="groupby_team_id" domain="[]" context="{'group_by': 'team_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
@@ -122,4 +129,4 @@
|
||||
</record>
|
||||
|
||||
<!-- js stuff -->
|
||||
</odoo>
|
||||
</odoo>
|
||||
|
||||
@@ -602,6 +602,7 @@
|
||||
<field name="model">quality.alert.team</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header></header>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<label for="name" string="Team Name"/>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['account', 'base', 'mrp_workorder', 'sale'],
|
||||
'depends': ['base', 'mrp_workorder', 'sale', 'purchase', 'sales_team'],
|
||||
'data': [
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
@@ -19,8 +19,9 @@
|
||||
'views/fixture_view.xml',
|
||||
'views/functional_fixture_view.xml',
|
||||
'views/menu_view.xml',
|
||||
"views/tool_views.xml",
|
||||
"views/tool_menu.xml",
|
||||
'views/tool_views.xml',
|
||||
'views/tool_basic_param.xml',
|
||||
'views/tool_menu.xml',
|
||||
'views/menu_fixture_view.xml',
|
||||
|
||||
],
|
||||
|
||||
@@ -1 +1 @@
|
||||
from. import common
|
||||
from . import common
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import models
|
||||
import time
|
||||
import hashlib
|
||||
from odoo import models
|
||||
|
||||
|
||||
class Common(models.Model):
|
||||
_name = 'sf.sync.common'
|
||||
_description = u'公用类'
|
||||
|
||||
def get_headers(self,token, secret_key):
|
||||
def get_headers(self, token, secret_key):
|
||||
'''
|
||||
获取requests中的heardes参数
|
||||
'''
|
||||
@@ -19,5 +19,3 @@ class Common(models.Model):
|
||||
'TIMESTAMP': str(timestamp),
|
||||
'checkstr': check_sf_str}
|
||||
return headers
|
||||
|
||||
|
||||
|
||||
@@ -3,9 +3,4 @@ from . import common
|
||||
from . import tool_base_new
|
||||
from . import fixture
|
||||
from . import functional_fixture
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
from . import tool_other_features
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
import requests
|
||||
import json
|
||||
import requests
|
||||
from odoo import fields, models, api
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.addons.sf_base.commons.common import Common
|
||||
@@ -9,6 +9,14 @@ from odoo.addons.sf_base.commons.common import Common
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SpindleTaperType(models.Model):
|
||||
_name = 'spindle.taper.type'
|
||||
_description = '主轴锥孔型号'
|
||||
|
||||
name = fields.Char('名称')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
class MachineBrandTags(models.Model):
|
||||
_name = 'sf.machine.brand.tags'
|
||||
_description = '标签'
|
||||
@@ -39,8 +47,8 @@ class MachineBrand(models.Model):
|
||||
remark = fields.Text('备注')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
# 机床
|
||||
|
||||
#机床
|
||||
class MachineTool(models.Model):
|
||||
_name = 'sf.machine_tool'
|
||||
_description = '机床'
|
||||
@@ -86,7 +94,7 @@ class MachineTool(models.Model):
|
||||
state = fields.Selection(
|
||||
[("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")],
|
||||
default='正常', string="机床状态")
|
||||
#0606新增字段
|
||||
# 0606新增字段
|
||||
machine_tool_picture = fields.Binary('图片')
|
||||
heightened_way = fields.Selection([
|
||||
('sifudianji', '伺服电机驱动'),
|
||||
@@ -260,7 +268,7 @@ class MachineToolType(models.Model):
|
||||
default="", string="刀把类型")
|
||||
number_of_knife_library = fields.Integer('刀库数量')
|
||||
rotate_speed = fields.Integer('转速')
|
||||
#0606新增字段
|
||||
# 0606新增字段
|
||||
created_user = fields.Many2one('res.users', string='创建人', default=lambda self: self.env.user)
|
||||
machine_tool_picture = fields.Binary('图片')
|
||||
heightened_way = fields.Selection([
|
||||
@@ -269,31 +277,19 @@ class MachineToolType(models.Model):
|
||||
('chilunjia', '齿轮架驱动')
|
||||
], string="主轴加高方式", default='sifudianji')
|
||||
workpiece_load = fields.Char('工件最大负载(kg)')
|
||||
lead_screw = fields.Char('丝杆')
|
||||
workbench_L = fields.Char('工作台长度(mm)')
|
||||
workbench_W = fields.Char('工作台宽度(mm)')
|
||||
guide_rail = fields.Char('导轨')
|
||||
machine_tool_L = fields.Char('机床长度(mm)')
|
||||
machine_tool_W = fields.Char('机床宽度(mm)')
|
||||
machine_tool_H = fields.Char('机床高度(mm)')
|
||||
feed_speed = fields.Char('进给速度(mm/min)')
|
||||
tool_speed = fields.Char('刀具速度(m/min)')
|
||||
distance_min = fields.Char('主轴端面至工作台面距离MIN(mm)')
|
||||
distance_max = fields.Char('主轴端面至工作台面距离MAX(mm)')
|
||||
taper = fields.Char('主轴锥度(°)')
|
||||
torque = fields.Char('主轴电机扭矩(n/m)')
|
||||
motor_power = fields.Char('主轴电机功率(kw)')
|
||||
tool_quality_max = fields.Char('刀具最大质量(kg)')
|
||||
tool_long_max = fields.Char('刀具最大长度(mm)')
|
||||
tool_diameter_max = fields.Char('刀具刀径max(mm)')
|
||||
tool_diameter_min = fields.Char('刀具刀径min(mm)')
|
||||
machine_tool_category = fields.Many2one('sf.machine_tool.category', string='机床类型')
|
||||
|
||||
# 多个型号对应一个机床
|
||||
machine_tool_id = fields.Many2one('sf.machine_tool', '机床')
|
||||
number_of_axles = fields.Selection(
|
||||
[("三轴", "三轴"), ("四轴", "四轴"), ("五轴", "五轴")],
|
||||
default="", string="轴数")
|
||||
# 加工进程
|
||||
x_axis = fields.Integer('X轴')
|
||||
y_axis = fields.Integer('Y轴')
|
||||
@@ -301,13 +297,80 @@ class MachineToolType(models.Model):
|
||||
b_axis = fields.Integer('B轴')
|
||||
c_axis = fields.Integer('C轴')
|
||||
remark = fields.Char('备注')
|
||||
precision_min = fields.Float('X轴定位精度min(mm)', digits=(12, 3))
|
||||
precision_max = fields.Float('X轴定位精度max(mm)', digits=(12, 3))
|
||||
control_system_id = fields.Many2one('sf.machine.control_system',
|
||||
string="控制系统")
|
||||
active = fields.Boolean('有效', default=True)
|
||||
code = fields.Char('编码')
|
||||
|
||||
# 1212修改后的字段
|
||||
number_of_axles = fields.Selection(
|
||||
[("三轴", "三轴"), ("四轴", "四轴"), ("五轴", "五轴"), ("六轴", "六轴")],
|
||||
default="", string="轴数")
|
||||
|
||||
# 1212新增字段
|
||||
a_axis = fields.Integer('a轴')
|
||||
function_type = fields.Selection(
|
||||
[("ZXJGZX", "钻铣加工中心"), ("CXJGZX", "车削加工中心"), ("FHJGZX", "复合加工中心")],
|
||||
default="", string="功能类型")
|
||||
T_trough_num = fields.Integer('槽数')
|
||||
T_trough_wide = fields.Float('槽宽(mm)')
|
||||
T_trough_distance = fields.Float('槽距(mm)')
|
||||
|
||||
taper_type_id = fields.Many2one('spindle.taper.type', string='主轴锥孔型号')
|
||||
spindle_center_distance = fields.Float('主轴中心至立柱滑轨面距离(mm)')
|
||||
spindle_continuous_power = fields.Float('主轴持续功率(kw)')
|
||||
spindle_peak_power = fields.Float('主轴峰值功率(kw)')
|
||||
spindle_sustained_torque = fields.Float('主轴持续扭矩(n/m)')
|
||||
spindle_peak_torque = fields.Float('主轴峰值扭矩(n/m)')
|
||||
linear_axis_guides_type = fields.Char('直线轴导轨类型')
|
||||
axis_driven_type = fields.Char('坐标轴驱动类型')
|
||||
|
||||
X_axis_rapid_traverse_speed = fields.Char('X轴快速进给速度(mm/min)')
|
||||
Y_axis_rapid_traverse_speed = fields.Char('Y轴快速进给速度(mm/min)')
|
||||
Z_axis_rapid_traverse_speed = fields.Char('Z轴快速进给速度(mm/min)')
|
||||
a_axis_rapid_traverse_speed = fields.Char('a轴快速进给速度(mm/min)')
|
||||
b_axis_rapid_traverse_speed = fields.Char('b轴快速进给速度(mm/min)')
|
||||
c_axis_rapid_traverse_speed = fields.Char('c轴快速进给速度(mm/min)')
|
||||
straight_cutting_feed_rate = fields.Char('直线切削进给速度(mm/min)')
|
||||
rotary_cutting_feed_rate = fields.Char('回转切削进给速度(mm/min)')
|
||||
|
||||
X_precision = fields.Float('X轴定位精度(mm)', digits=(12, 3))
|
||||
X_precision_repeat = fields.Float('X轴重复定位精度(mm)', digits=(12, 3))
|
||||
Y_precision = fields.Float('Y轴定位精度(mm)', digits=(12, 3))
|
||||
Y_precision_repeat = fields.Float('Y轴重复定位精度(mm)', digits=(12, 3))
|
||||
Z_precision = fields.Float('Z轴定位精度(mm)', digits=(12, 3))
|
||||
Z_precision_repeat = fields.Float('Z轴重复定位精度(mm)', digits=(12, 3))
|
||||
a_precision = fields.Float('a轴定位精度(mm)', digits=(12, 3))
|
||||
a_precision_repeat = fields.Float('a轴重复定位精度(mm)', digits=(12, 3))
|
||||
b_precision = fields.Float('b轴定位精度(mm)', digits=(12, 3))
|
||||
b_precision_repeat = fields.Float('b轴重复定位精度(mm)', digits=(12, 3))
|
||||
c_precision = fields.Float('c轴定位精度(mm)', digits=(12, 3))
|
||||
c_precision_repeat = fields.Float('c轴重复定位精度(mm)', digits=(12, 3))
|
||||
|
||||
tool_full_diameter_max = fields.Float('刀具满刀最大直径(mm)')
|
||||
tool_perimeter_diameter_max = fields.Float('刀具邻空刀最大直径(mm)')
|
||||
T_tool_time = fields.Integer('T-T换刀时间(s)')
|
||||
C_tool_time = fields.Integer('C-C换刀时间(s)')
|
||||
|
||||
jg_image_id = fields.Many2many('maintenance.equipment.image', 'jg_equipment_id', string='加工能力',
|
||||
domain="[('type', '=', '加工能力')]")
|
||||
lq_image_id = fields.Many2many('maintenance.equipment.image', 'lq_equipment_id', string='冷却方式',
|
||||
domain="[('type', '=', '冷却方式')]")
|
||||
|
||||
|
||||
#待删除字段
|
||||
precision_min = fields.Float('X轴定位精度min(mm)', digits=(12, 3))
|
||||
precision_max = fields.Float('X轴定位精度max(mm)', digits=(12, 3))
|
||||
lead_screw = fields.Char('丝杆')
|
||||
guide_rail = fields.Char('导轨')
|
||||
feed_speed = fields.Char('进给速度(mm/min)')
|
||||
tool_speed = fields.Char('刀具速度(m/min)')
|
||||
torque = fields.Char('主轴点击扭矩(n/m)')
|
||||
motor_power = fields.Char('主轴电机功率(kw)')
|
||||
taper = fields.Char('主轴锥度(°)')
|
||||
tool_diameter_max = fields.Char('刀具刀径max(mm)')
|
||||
tool_diameter_min = fields.Char('刀具刀径min(mm)')
|
||||
|
||||
def _get_ids(self, machine_tool_type_code):
|
||||
machine_tool_type_ids = []
|
||||
for item in machine_tool_type_code:
|
||||
@@ -326,5 +389,4 @@ class MachineToolCategory(models.Model):
|
||||
remark = fields.Text('备注')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
category = fields.Selection([('shukong', u'数控'), ('putong', u'普通')], string=u'机床类别',
|
||||
default='shukong')
|
||||
|
||||
default='shukong')
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
from odoo import fields, models
|
||||
import requests
|
||||
from odoo.addons.sf_base.commons.common import Common
|
||||
from urllib.parse import urlencode
|
||||
from odoo import fields, models
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -19,29 +17,7 @@ class MrsProductionMaterials(models.Model):
|
||||
remark = fields.Text("备注")
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
# def open_url_action(self):
|
||||
# base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url')
|
||||
# # url = 'http://192.168.50.202:8080/api'
|
||||
# url = 'https://bfw.jikimo.com/'
|
||||
# # data = {
|
||||
# # 'key' : 'value'
|
||||
# # }
|
||||
#
|
||||
# response = requests.get(url)
|
||||
# response.raise_for_status()
|
||||
# return {
|
||||
# 'type': 'ir.actions.act_url',
|
||||
# 'url': response.url,
|
||||
# 'target': 'new'
|
||||
# }
|
||||
|
||||
|
||||
|
||||
def open_url_action(self):
|
||||
# sf_sync_config = self.env['res.config.settings'].get_values()
|
||||
# token = sf_sync_config['token']
|
||||
# sf_secret_key = sf_sync_config['sf_secret_key']
|
||||
# headers = Common.get_headers(self, token, sf_secret_key)
|
||||
url = 'http://192.168.50.127:8081'
|
||||
params = {
|
||||
'user_id': self._uid
|
||||
@@ -68,12 +44,12 @@ class MrsMaterialModel(models.Model):
|
||||
density = fields.Float("密度(kg/m³)")
|
||||
materials_id = fields.Many2one('sf.production.materials', "材料名")
|
||||
tensile_strength = fields.Char("拉伸强度(n/mm²)")
|
||||
standards_id = fields.Many2one('sf.international.standards', '制造标准')
|
||||
standards_id = fields.Many2one('sf.international.standards', '执行标准')
|
||||
alloy_code = fields.Char('合金牌号')
|
||||
price = fields.Float('单价/kg')
|
||||
apply = fields.Many2many('material.apply', string='材料应用')
|
||||
materials_code = fields.Char('材料代号')
|
||||
hardness = fields.Float("硬度(hrc)")
|
||||
hardness = fields.Integer("硬度(hrc)")
|
||||
rough_machining = fields.Float("粗加工Vc(m/min)")
|
||||
finish_machining = fields.Float("精加工Vc(m/min)")
|
||||
remark = fields.Text("备注")
|
||||
@@ -132,6 +108,7 @@ class MrsProcessingOrder(models.Model):
|
||||
index=True, string='加工工艺')
|
||||
production_process_id = fields.Many2one('sf.production.process', string="表面工艺")
|
||||
|
||||
|
||||
class SupplierSort(models.Model):
|
||||
_name = 'sf.supplier.sort'
|
||||
_description = '供应商排序'
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import json
|
||||
import requests
|
||||
from odoo import models, fields, api
|
||||
from odoo.addons.sf_base.commons.common import Common
|
||||
from odoo.exceptions import ValidationError
|
||||
import requests
|
||||
import json
|
||||
|
||||
|
||||
class FunctionalFixtureType(models.Model):
|
||||
@@ -62,7 +62,8 @@ class FunctionalFixture(models.Model):
|
||||
def _get_name(self):
|
||||
for record in self:
|
||||
if record.type:
|
||||
if not record.transfer_tray_model_ids and not record.pneumatic_tray_model_ids and not record.magnetic_tray_model_ids and not record.vice_tray_model_ids:
|
||||
if not record.transfer_tray_model_ids and not record.pneumatic_tray_model_ids and \
|
||||
not record.magnetic_tray_model_ids and not record.vice_tray_model_ids:
|
||||
record.name = ''
|
||||
if record.transfer_tray_model_ids:
|
||||
for i in record.transfer_tray_model_ids:
|
||||
|
||||
@@ -1,304 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
|
||||
from odoo import fields, models, api
|
||||
# from odoo.exceptions import UserError
|
||||
# # from odoo.addons import sf_base, sf_common
|
||||
# from datetime import datetime
|
||||
|
||||
|
||||
# 功能刀具物料
|
||||
class CuttingToolMaterial(models.Model):
|
||||
_name = 'sf.cutting.tool.material'
|
||||
_description = '刀具物料'
|
||||
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
remark = fields.Char('备注')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
# 功能刀具
|
||||
class FunctionalCuttingTool(models.Model):
|
||||
_name = 'sf.functional.cutting.tool'
|
||||
_description = '功能刀具'
|
||||
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
functional_model_number = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型')
|
||||
integral_model_number = fields.Many2one('sf.integral.cutting.tool', string='整体式刀具型号')
|
||||
blade_model_number = fields.Many2one('sf.blade', string='刀片型号')
|
||||
cutterbar_model_number = fields.Many2one('sf.cutter.bar', string='刀杆型号')
|
||||
cutterpad_model_number = fields.Many2one('sf.cutter.pad', string='刀盘型号')
|
||||
handle_model_number = fields.Many2one('sf.handle', string='刀柄型号')
|
||||
chuck_model_number = fields.Many2one('sf.chuck', string='夹头型号')
|
||||
diameter = fields.Float('直径(mm)')
|
||||
tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
|
||||
string='刀具等级')
|
||||
machining_accuracy = fields.Float('加工精度(mm)')
|
||||
tool_length = fields.Float('装刀长')
|
||||
blade_number = fields.Integer('刃数')
|
||||
integral_blade_length = fields.Float('整体刃长(mm)')
|
||||
effective_blade_length = fields.Float('有效刃长(mm)')
|
||||
max_life = fields.Float('最大寿命值')
|
||||
is_standard = fields.Boolean('是否标准刀')
|
||||
applicable_range = fields.Char('适用范围')
|
||||
image = fields.Binary('图片')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
# 功能刀具类型
|
||||
class FunctionalCuttingToolModel(models.Model):
|
||||
_name = 'sf.functional.cutting.tool.model'
|
||||
_description = '功能刀具类型'
|
||||
|
||||
name = fields.Char('名称')
|
||||
code = fields.Char('编码')
|
||||
remark = fields.Char('备注')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
# 整体式刀具
|
||||
class IntegralCuttingTool(models.Model):
|
||||
_name = 'sf.integral.cutting.tool'
|
||||
_description = '整体式刀具'
|
||||
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('型号名称')
|
||||
# 关联刀具物料
|
||||
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
|
||||
# 整体式刀具类型字段,关联整体式刀具类型对象
|
||||
integral_model_number = fields.Many2one('sf.integral.cutting.tool.model', '整体式刀具类型')
|
||||
# 增加品牌、总长度(mm)、柄部长度(mm)、刃部长度(mm)、直径(mm)、刃数、前角(°)、后角(°)、主偏角(°)、材料型号、配对螺母(mm)、适用夹头型号、适用范围、图片、创建人、创建时间等字段
|
||||
brand = fields.Many2one('sf.machine.brand', '品牌', domain="[('tag_ids.name', 'ilike', '刀具')]")
|
||||
total_length = fields.Float('总长度(mm)')
|
||||
shank_length = fields.Float('柄部长度(mm)')
|
||||
blade_length = fields.Float('刃部长度(mm)')
|
||||
diameter = fields.Float('直径(mm)')
|
||||
blade_number = fields.Integer('刃数')
|
||||
front_angle = fields.Float('前角(°)')
|
||||
rear_angle = fields.Float('后角(°)')
|
||||
main_included_angle = fields.Float('主偏角(°)')
|
||||
material_model = fields.Many2one('sf.materials.model', '材料型号')
|
||||
nut = fields.Float('配对螺母(mm)')
|
||||
# 适用夹头型号可以多选
|
||||
chuck_model = fields.Many2many('sf.chuck', string='适用夹头型号')
|
||||
scope = fields.Char('适用范围')
|
||||
image = fields.Binary('图片')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
# 整体式刀具类型
|
||||
class IntegralCuttingToolModel(models.Model):
|
||||
_name = 'sf.integral.cutting.tool.model'
|
||||
_description = '整体式刀具类型'
|
||||
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
# 关联刀具物料
|
||||
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
|
||||
remark = fields.Char('备注')
|
||||
|
||||
|
||||
# 刀片
|
||||
class Blade(models.Model):
|
||||
_name = 'sf.blade'
|
||||
_description = '刀片'
|
||||
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('型号名称')
|
||||
# 关联刀具物料
|
||||
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
|
||||
# 刀片类型字段,关联刀片类型对象
|
||||
blade_model_number = fields.Many2one('sf.blade.model', '刀片类型')
|
||||
# 编码、型号名称、刀片类型、品牌、长度L(mm)、宽度D(mm)、高度T(mm)、顶角(°)、前角(°)、后角(°)、主偏角(°)、R角(°)、材料型号、加工硬度、配对螺母(mm)、适用刀杆/刀盘型号、刀尖半径(mm)、图片、创建人、创建时间字段
|
||||
brand = fields.Many2one('sf.machine.brand', '品牌', )
|
||||
length = fields.Float('长度L(mm)')
|
||||
width = fields.Float('宽度D(mm)')
|
||||
height = fields.Float('高度T(mm)')
|
||||
top_angle = fields.Float('顶角(°)')
|
||||
front_angle = fields.Float('前角(°)')
|
||||
rear_angle = fields.Float('后角(°)')
|
||||
main_included_angle = fields.Float('主偏角(°)')
|
||||
r_angle = fields.Float('R角(°)')
|
||||
material_model = fields.Many2one('sf.materials.model', '材料型号')
|
||||
hardness = fields.Char('加工硬度')
|
||||
nut = fields.Float('配对螺母(mm)')
|
||||
# 适用刀杆型号可以多选
|
||||
cutter_bar = fields.Many2many('sf.cutter.bar', string='适用刀杆型号')
|
||||
# 适用刀盘型号可以多选
|
||||
cutter_pad = fields.Many2many('sf.cutter.pad', string='适用刀盘型号')
|
||||
radius = fields.Float('刀尖半径(mm)')
|
||||
image = fields.Binary('图片')
|
||||
|
||||
|
||||
# 刀片类型
|
||||
class BladeModel(models.Model):
|
||||
_name = 'sf.blade.model'
|
||||
_description = '刀片类型'
|
||||
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
# 关联刀具物料
|
||||
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
|
||||
# 刀片类型字段,关联刀片对象
|
||||
blade_ids = fields.One2many('sf.blade', 'blade_model_number', '刀片类型')
|
||||
remark = fields.Char('备注')
|
||||
|
||||
|
||||
# 刀杆
|
||||
class CutterBar(models.Model):
|
||||
_name = 'sf.cutter.bar'
|
||||
_description = '刀杆'
|
||||
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('型号名称')
|
||||
# 关联刀具物料
|
||||
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
|
||||
# 刀杆类型字段,关联刀杆类型对象
|
||||
cutter_bar_model_number = fields.Many2one('sf.cutter.bar.model', '刀杆类型')
|
||||
# 品牌、C柄径(mm)、L总长(mm)、材料型号、刃数、D刃径(mm)、适用刀片型号、配对扳手(mm)、配备螺丝(mm)、刀尖圆角半径、精度等级、硬度(°)、适用范围、图片、创建人、创建时间
|
||||
brand = fields.Many2one('sf.machine.brand', '品牌')
|
||||
c_diameter = fields.Float('C柄径(mm)')
|
||||
total_length = fields.Float('L总长(mm)')
|
||||
material_model = fields.Many2one('sf.materials.model', '材料型号')
|
||||
blade_number = fields.Integer('刃数')
|
||||
d_diameter = fields.Float('D刃径(mm)')
|
||||
blade = fields.Many2many('sf.blade', string='适用刀片型号')
|
||||
wrench = fields.Float('配对扳手(mm)')
|
||||
screw = fields.Float('配备螺丝(mm)')
|
||||
radius = fields.Float('刀尖圆角半径')
|
||||
accuracy = fields.Char('精度等级')
|
||||
hardness = fields.Char('硬度(°)')
|
||||
scope = fields.Char('适用范围')
|
||||
image = fields.Binary('图片')
|
||||
|
||||
|
||||
# 刀杆类型
|
||||
class CutterBarModel(models.Model):
|
||||
_name = 'sf.cutter.bar.model'
|
||||
_description = '刀杆类型'
|
||||
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
# 关联刀具物料
|
||||
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
|
||||
remark = fields.Char('备注')
|
||||
|
||||
|
||||
# 刀盘
|
||||
class CutterPad(models.Model):
|
||||
_name = 'sf.cutter.pad'
|
||||
_description = '刀盘'
|
||||
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('型号名称')
|
||||
# 关联刀具物料
|
||||
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
|
||||
# 刀盘类型字段,关联刀盘类型对象
|
||||
cutter_pad_model_number = fields.Many2one('sf.cutter.pad.model', '刀盘类型')
|
||||
# 增加品牌、C柄径(mm)、L总长(mm)、材料型号、刃数、D刃径(mm)、适用刀片型号、配对扳手(mm)、配备螺丝(mm)、刀尖圆角半径、精度等级、硬度(°)、适用范围、图片、创建人、创建时间
|
||||
brand = fields.Many2one('sf.machine.brand', '品牌')
|
||||
c_diameter = fields.Float('C柄径(mm)')
|
||||
total_length = fields.Float('L总长(mm)')
|
||||
material_model = fields.Many2one('sf.materials.model', '材料型号')
|
||||
blade_number = fields.Integer('刃数')
|
||||
d_diameter = fields.Float('D刃径(mm)')
|
||||
blade = fields.Many2many('sf.blade', string='适用刀片型号')
|
||||
wrench = fields.Float('配对扳手(mm)')
|
||||
screw = fields.Float('配备螺丝(mm)')
|
||||
radius = fields.Float('刀尖圆角半径')
|
||||
accuracy = fields.Char('精度等级')
|
||||
hardness = fields.Char('硬度(°)')
|
||||
scope = fields.Char('适用范围')
|
||||
image = fields.Binary('图片')
|
||||
|
||||
|
||||
# 刀盘类型
|
||||
class CutterPadModel(models.Model):
|
||||
_name = 'sf.cutter.pad.model'
|
||||
_description = '刀盘类型'
|
||||
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
# 关联刀具物料
|
||||
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
|
||||
remark = fields.Char('备注')
|
||||
|
||||
|
||||
# 刀柄
|
||||
class Handle(models.Model):
|
||||
_name = 'sf.handle'
|
||||
_description = '刀柄'
|
||||
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('型号名称')
|
||||
# 关联刀具物料
|
||||
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
|
||||
# 刀柄类型字段,关联刀柄类型对象
|
||||
handle_model_number = fields.Many2one('sf.handle.model', '刀柄类型')
|
||||
# 增加、刀柄类型、品牌、L(mm)、L1(mm)、D1(mm)、重量(kg)、材料型号、本体精度(mm)、配对螺母(mm)、适用夹头型号、夹持范围(mm)、检测精度、检测硬度、标准转速、图片、创建人、创建时间
|
||||
brand = fields.Many2one('sf.machine.brand', '品牌')
|
||||
length = fields.Float('L(mm)')
|
||||
length1 = fields.Float('L1(mm)')
|
||||
diameter1 = fields.Float('D1(mm)')
|
||||
weight = fields.Float('重量(kg)')
|
||||
material_model = fields.Many2one('sf.materials.model', '材料型号')
|
||||
body_accuracy = fields.Float('本体精度(mm)')
|
||||
nut = fields.Float('配对螺母(mm)')
|
||||
chuck_model = fields.Many2many('sf.chuck.model', string='适用夹头型号')
|
||||
clamping_range = fields.Float('夹持范围(mm)')
|
||||
detection_accuracy = fields.Float('检测精度')
|
||||
detection_hardness = fields.Char('检测硬度')
|
||||
standard_speed = fields.Float('标准转速')
|
||||
image = fields.Binary('图片')
|
||||
|
||||
|
||||
# 刀柄类型
|
||||
class HandleModel(models.Model):
|
||||
_name = 'sf.handle.model'
|
||||
_description = '刀柄类型'
|
||||
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
# 关联刀具物料
|
||||
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
|
||||
remark = fields.Char('备注')
|
||||
|
||||
|
||||
# 夹头对象(夹头型号对象)
|
||||
class Chuck(models.Model):
|
||||
_name = 'sf.chuck'
|
||||
_description = '夹头'
|
||||
_rec_name = 'code'
|
||||
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('型号名称')
|
||||
# 关联刀具物料
|
||||
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
|
||||
# 夹头类型字段,关联夹头类型对象
|
||||
chuck_model_number = fields.Many2one('sf.chuck.model', '夹头类型')
|
||||
# 增加品牌、精度(mm)、外径(mm)、内径(mm)、高度(mm)、材料型号、配对螺母(mm)、适用刀柄型号、夹持范围(mm)、特性、图片、创建人、创建时间
|
||||
brand = fields.Many2one('sf.machine.brand', '品牌')
|
||||
accuracy = fields.Float('精度(mm)')
|
||||
diameter = fields.Float('外径(mm)')
|
||||
inner_diameter = fields.Float('内径(mm)')
|
||||
height = fields.Float('高度(mm)')
|
||||
material_model = fields.Many2one('sf.materials.model', '材料型号')
|
||||
nut = fields.Float('配对螺母(mm)')
|
||||
handle_model = fields.Many2many('sf.handle.model', string='适用刀柄型号')
|
||||
clamping_range = fields.Float('夹持范围(mm)')
|
||||
feature = fields.Char('特性')
|
||||
image = fields.Binary('图片')
|
||||
|
||||
|
||||
# 夹头类型
|
||||
class ChuckModel(models.Model):
|
||||
_name = 'sf.chuck.model'
|
||||
_description = '夹头类型'
|
||||
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
# 关联刀具物料
|
||||
cutting_tool_material = fields.Many2one('sf.cutting.tool.material', '刀具物料')
|
||||
remark = fields.Char('备注')
|
||||
@@ -2,11 +2,6 @@
|
||||
from odoo import fields, models, api
|
||||
|
||||
|
||||
# from datetime import datetime
|
||||
# from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
# 刀具物料
|
||||
class CuttingToolMaterial(models.Model):
|
||||
_name = 'sf.cutting.tool.material'
|
||||
_description = '刀具物料'
|
||||
@@ -26,58 +21,7 @@ class FunctionalCuttingTool(models.Model):
|
||||
name = fields.Char('名称')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型')
|
||||
mrs_cutting_tool_model_id = fields.Many2one('sf.cutting.tool.model', string='刀具型号')
|
||||
|
||||
# # 整体式刀具型号
|
||||
# mrs_cutting_tool_integral_model_ids = fields.Many2many('sf.cutting.tool.model', 'rel_integral_model_functional_sf',
|
||||
# string='整体式刀具型号', domain=
|
||||
# [('cutting_tool_type', '=', '整体式刀具')])
|
||||
# # 刀片型号
|
||||
# mrs_cutting_tool_blade_model_ids = fields.Many2many('sf.cutting.tool.model', 'rel_blade_model_functional_sf',
|
||||
# string='刀片型号', domain=
|
||||
# [('cutting_tool_type', '=', '刀片')])
|
||||
# # 刀杆型号
|
||||
# mrs_cutting_tool_cutterbar_model_ids = fields.Many2many('sf.cutting.tool.model',
|
||||
# 'rel_cutterbar_model_functional_sf',
|
||||
# string='刀杆型号', domain=
|
||||
# [('cutting_tool_type', '=', '刀杆')])
|
||||
# # 刀盘型号
|
||||
# mrs_cutting_tool_cutterpad_model_ids = fields.Many2many('sf.cutting.tool.model',
|
||||
# 'rel_cutterpad_model_functional_sf',
|
||||
# string='刀盘型号', domain=
|
||||
# [('cutting_tool_type', '=', '刀盘')])
|
||||
# # 刀柄型号
|
||||
# mrs_cutting_tool_cutterhandle_model_ids = fields.Many2many('sf.cutting.tool.model',
|
||||
# 'rel_cutterhandle_model_functional_sf',
|
||||
# string='刀柄型号',
|
||||
# domain=
|
||||
# [('cutting_tool_type', '=', '刀柄')])
|
||||
# # 夹头型号
|
||||
# mrs_cutting_tool_cutterhead_model_ids = fields.Many2many('sf.cutting.tool.model',
|
||||
# 'rel_cutterhead_model_functional_sf',
|
||||
# string='夹头型号', domain=
|
||||
# [('cutting_tool_type', '=', '夹头')])
|
||||
#
|
||||
# diameter = fields.Float('直径(mm)')
|
||||
# tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
|
||||
# string='刀具等级')
|
||||
# machining_accuracy = fields.Float('加工精度(mm)')
|
||||
# tool_length = fields.Float('装刀长')
|
||||
# blade_number = fields.Integer('刃数')
|
||||
# integral_blade_length = fields.Float('整体刃长(mm)')
|
||||
# effective_blade_length = fields.Float('有效刃长(mm)')
|
||||
# max_life = fields.Float('最大寿命值')
|
||||
# is_standard = fields.Boolean('是否标准刀')
|
||||
# applicable_range = fields.Char('适用范围')
|
||||
# image = fields.Binary('图片')
|
||||
# active = fields.Boolean('有效', default=True)
|
||||
#
|
||||
# def _get_functional_tool_model_ids(self, functional_tool_model_code):
|
||||
# functional_tool_model_ids = []
|
||||
# for item in functional_tool_model_code:
|
||||
# functional_tool_model = self.env['sf.cutting.tool.model'].search([('code', '=', item)])
|
||||
# functional_tool_model_ids.append(functional_tool_model.id)
|
||||
# return [(6, 0, functional_tool_model_ids)]
|
||||
mrs_cutting_tool_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀具型号')
|
||||
|
||||
|
||||
# 功能刀具类型
|
||||
@@ -91,133 +35,6 @@ class FunctionalCuttingToolModel(models.Model):
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
# 刀具型号
|
||||
class CuttingToolModel(models.Model):
|
||||
_name = 'sf.cutting.tool.model'
|
||||
_description = '刀具型号'
|
||||
|
||||
name = fields.Char('名称')
|
||||
cutting_tool_material_id = fields.Many2one('sf.cutting.tool.material', string='刀具物料')
|
||||
cutting_tool_type = fields.Char(string="刀具物料类型", related='cutting_tool_material_id.name', store=True)
|
||||
cutting_tool_type_id = fields.Many2one('sf.cutting.tool.type', string='刀具类型',
|
||||
)
|
||||
brand_id = fields.Many2one('sf.machine.brand', '品牌', domain="[('tag_ids.name', 'ilike', '刀具')]")
|
||||
tool_length = fields.Integer('长度(mm)')
|
||||
tool_width = fields.Integer('宽度(mm)')
|
||||
tool_height = fields.Integer('高度(mm)')
|
||||
tool_thickness = fields.Integer('厚度(mm)')
|
||||
tool_weight = fields.Float('重量(kg)')
|
||||
coating_material = fields.Char('涂层材质')
|
||||
|
||||
# 整体式刀具参数
|
||||
total_length = fields.Float('总长度(mm)')
|
||||
shank_length = fields.Float('柄部长度(mm)')
|
||||
blade_length = fields.Float('刃部长度(mm)')
|
||||
diameter = fields.Float('直径(mm)')
|
||||
blade_number = fields.Integer('刃数')
|
||||
front_angle = fields.Float('前角(°)')
|
||||
rear_angle = fields.Float('后角(°)')
|
||||
main_included_angle = fields.Float('主偏角(°)')
|
||||
material_model_id = fields.Many2one('sf.materials.model', '材料型号')
|
||||
nut = fields.Float('配对螺母(mm)')
|
||||
# 适用夹头型号可以多选
|
||||
chuck_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='cutting_tool_model_handle_chuck_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '夹头')]",
|
||||
string='适用夹头型号')
|
||||
# 刀片参数
|
||||
top_angle = fields.Float('顶角(°)')
|
||||
jump_accuracy = fields.Float('径跳精度(um)')
|
||||
working_hardness = fields.Char('加工硬度(hrc)')
|
||||
cutter_bar_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='cutting_tool_model_blade_cutter_bar_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '刀杆')]",
|
||||
string='适用刀杆型号'
|
||||
)
|
||||
cutter_pad_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='cutting_tool_model_blade_cutter_pad_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '刀盘')]",
|
||||
string='适用刀盘型号' # 使用空列表作为默认值
|
||||
)
|
||||
# 刀杆/参数
|
||||
blade_diameter = fields.Float('刃径(mm)')
|
||||
blade_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='cutting_tool_model_pad_blade_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '刀片')]",
|
||||
string='适用刀片型号' # 使用空列表作为默认值
|
||||
)
|
||||
wrench = fields.Float('配对扳手(mm)')
|
||||
screw = fields.Float('配备螺丝(mm)')
|
||||
accuracy_level = fields.Char('精度等级')
|
||||
# 刀柄参数
|
||||
diameter_max = fields.Float('最大直径(mm)')
|
||||
clamping_diameter = fields.Float('夹持直径(mm)')
|
||||
flange_length = fields.Float('法兰柄长度(mm)')
|
||||
flange_diameter = fields.Float('法兰直径(mm)')
|
||||
# 夹头参数
|
||||
outer_diameter = fields.Float('外径(mm)')
|
||||
inner_diameter = fields.Float('内径(mm)')
|
||||
handle_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='cutting_tool_model_chuck_handle_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '刀柄')]",
|
||||
string='适用刀柄型号'
|
||||
)
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
def _get_code(self, cutting_tool_type_code):
|
||||
cutting_tool_model = self.search(
|
||||
[('code', 'ilike', cutting_tool_type_code)],
|
||||
limit=1,
|
||||
order="id desc")
|
||||
if not cutting_tool_model:
|
||||
num = "%03d" % 1
|
||||
else:
|
||||
m = int(cutting_tool_model.code[-3:]) + 1
|
||||
num = "%03d" % m
|
||||
return "%s%s" % (cutting_tool_type_code, num)
|
||||
|
||||
code = fields.Char(string='编码', readonly=True)
|
||||
|
||||
def _onchange_cutting_tool_material_id(self, cutting_tool_material_id):
|
||||
if cutting_tool_material_id:
|
||||
if cutting_tool_material_id.name == "整体式刀具":
|
||||
code = self._get_code("JKM-T-DJWL-ZTDJ-")
|
||||
elif cutting_tool_material_id.name == "刀片":
|
||||
code = self._get_code("JKM-T-DJWL-DPIA-")
|
||||
elif cutting_tool_material_id.name == "刀杆":
|
||||
code = self._get_code("JKM-T-DJWL-DGAN-")
|
||||
elif cutting_tool_material_id.name == "刀盘":
|
||||
code = self._get_code("JKM-T-DJWL-DPAN-")
|
||||
elif cutting_tool_material_id.name == "夹头":
|
||||
code = self._get_code("JKM-T-DJWL-DJIA-")
|
||||
else:
|
||||
code = self._get_code("JKM-T-DJWL-DBIN-")
|
||||
return code
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals):
|
||||
obj = super(CuttingToolModel, self).create(vals)
|
||||
if obj.cutting_tool_material_id:
|
||||
code = self._onchange_cutting_tool_material_id(obj.cutting_tool_material_id)
|
||||
obj.code = code
|
||||
return obj
|
||||
|
||||
|
||||
# 刀具类型
|
||||
class CuttingToolType(models.Model):
|
||||
_name = 'sf.cutting.tool.type'
|
||||
@@ -229,3 +46,190 @@ class CuttingToolType(models.Model):
|
||||
cutting_tool_material_id = fields.Many2one('sf.cutting.tool.material', '刀具物料')
|
||||
remark = fields.Char('备注')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
# 刀具标准库
|
||||
class CuttingToolModel(models.Model):
|
||||
_name = 'sf.cutting_tool.standard.library'
|
||||
_description = '刀具标准库'
|
||||
|
||||
code = fields.Char(string='编码')
|
||||
name = fields.Char('名称')
|
||||
# 关联刀具物料
|
||||
cutting_tool_material_id = fields.Many2one('sf.cutting.tool.material', '刀具物料', required=True)
|
||||
# 刀具物料类型
|
||||
cutting_tool_type = fields.Char(related='cutting_tool_material_id.name', string='刀具物料类型',
|
||||
store=True)
|
||||
# 关联刀具类型
|
||||
cutting_tool_type_id = fields.Many2one('sf.cutting.tool.type', '类型',
|
||||
domain="[('cutting_tool_material_id.name', '=', cutting_tool_type)]")
|
||||
brand_id = fields.Many2one('sf.machine.brand', '品牌')
|
||||
status = fields.Boolean(string='状态', default=False)
|
||||
image = fields.Binary('图片')
|
||||
|
||||
# 整体式刀具参数
|
||||
material_model_id = fields.Many2one('mrs.materials.model', '刀具材质')
|
||||
tool_hardness = fields.Integer('刀具硬度(hrc)')
|
||||
coating_material = fields.Char('涂层材质')
|
||||
blade_type = fields.Char('刃部类型')
|
||||
integral_coarse_medium_fine = fields.Selection([('粗', '粗'), ('中', '中'), ('精', '精')], '粗/中/精')
|
||||
integral_run_out_accuracy_max = fields.Char('整体式刀具端跳精度max')
|
||||
integral_run_out_accuracy_min = fields.Char('整体式刀具端跳精度min')
|
||||
|
||||
fit_blade_shape_id = fields.Many2one('maintenance.equipment.image',
|
||||
'适配刀片形状', domain=[('type', '=', '刀片形状')])
|
||||
suitable_machining_method_ids = fields.Many2many('maintenance.equipment.image',
|
||||
'suitable_machining_method_library_rel',
|
||||
'适合加工方式', domain=[('type', '=', '加工能力')])
|
||||
blade_tip_characteristics_id = fields.Many2one('maintenance.equipment.image',
|
||||
'刀尖特征', domain=[('type', '=', '刀尖特征')])
|
||||
handle_type_id = fields.Many2one('maintenance.equipment.image',
|
||||
'柄部类型', domain=[('type', '=', '柄部类型')])
|
||||
cutting_direction_ids = fields.Many2many('maintenance.equipment.image', 'cutting_direction_library_rel',
|
||||
'走刀方向', domain=[('type', '=', '走刀方向')])
|
||||
suitable_coolant_ids = fields.Many2many('maintenance.equipment.image', 'suitable_coolant_library_rel',
|
||||
'适合冷却液', domain=[('type', '=', '冷却液')])
|
||||
compaction_way_id = fields.Many2one('maintenance.equipment.image',
|
||||
'压紧方式', domain=[('type', '=', '压紧方式')])
|
||||
integral_tool_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
|
||||
'standard_library_id', string='整体式刀具基本参数')
|
||||
blade_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
|
||||
'standard_library_id', string='刀片基本参数')
|
||||
cutter_bar_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
|
||||
'standard_library_id', string='刀杆基本参数')
|
||||
cutter_head_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
|
||||
'standard_library_id', string='刀盘基本参数')
|
||||
knife_handle_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
|
||||
'standard_library_id', string='刀柄基本参数')
|
||||
chuck_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
|
||||
'standard_library_id', string='夹头基本参数')
|
||||
cutting_speed_ids = fields.One2many('sf.cutting.speed', 'standard_library_id', string='切削速度Vc')
|
||||
feed_per_tooth_ids = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz',
|
||||
domain=[('cutting_speed', '!=', False)])
|
||||
feed_per_tooth_ids_2 = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz',
|
||||
domain=[('machining_method', '!=', False)])
|
||||
feed_per_tooth_ids_3 = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz',
|
||||
domain=[('cutting_speed', '!=', False)])
|
||||
feed_per_tooth_ids_4 = fields.One2many('sf.feed.per.tooth', 'standard_library_id', '每齿走刀量fz',
|
||||
domain=[('machining_method', '!=', False)])
|
||||
material_model_id = fields.Many2one('sf.materials.model', '材料型号')
|
||||
# 适用夹头型号可以多选
|
||||
chuck_ids = fields.Many2many(
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='cutting_tool_type_library_handle_chuck_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_material_id.name', '=', '夹头')]",
|
||||
string='适用夹头型号')
|
||||
cutter_bar_ids = fields.Many2many(
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='cutting_tool_type_library_cutter_bar_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_material_id.name', '=', '刀杆')]",
|
||||
string='适用刀杆型号'
|
||||
)
|
||||
cutter_pad_ids = fields.Many2many(
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='cutting_tool_type_library_cutter_pad_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_material_id.name', '=', '刀盘')]",
|
||||
string='适用刀盘型号' # 使用空列表作为默认值
|
||||
)
|
||||
# 刀杆/参数
|
||||
blade_ids = fields.Many2many(
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='cutting_tool_type_library_pad_blade_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_material_id.name', '=', '刀片')]",
|
||||
string='适用刀片型号' # 使用空列表作为默认值
|
||||
)
|
||||
handle_ids = fields.Many2many(
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='cutting_tool_type_library_chuck_handle_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_material_id.name', '=', '刀柄')]",
|
||||
string='适用刀柄型号'
|
||||
)
|
||||
active = fields.Boolean('有效', default=True)
|
||||
is_cloud = fields.Boolean('云端数据', default=False)
|
||||
|
||||
def _get_ids(self, cutting_tool_type_code, factory_short_name):
|
||||
cutting_tool_type_ids = []
|
||||
for item in cutting_tool_type_code:
|
||||
cutting_tool_type = self.search([('code', '=', item.replace("JKM", factory_short_name))])
|
||||
if cutting_tool_type:
|
||||
cutting_tool_type_ids.append(cutting_tool_type.id)
|
||||
return [(6, 0, cutting_tool_type_ids)]
|
||||
|
||||
|
||||
class MaintenanceStandardImage(models.Model):
|
||||
_name = 'maintenance.equipment.image'
|
||||
_description = '能力特征库'
|
||||
|
||||
active = fields.Boolean('有效', default=True)
|
||||
name = fields.Char('名称')
|
||||
image = fields.Binary(string='图文')
|
||||
type = fields.Selection(
|
||||
[('加工能力', '加工能力'), ('刀尖特征', '刀尖特征'), ('柄部类型', '柄部类型'), ('走刀方向', '走刀方向'),
|
||||
('冷却液', '冷却液'), ('压紧方式', '压紧方式'), ('刀片形状', '刀片形状'), ('冷却方式', '冷却方式')],
|
||||
string='特征')
|
||||
equipment_id = fields.Many2many('maintenance.equipment', 'image_id', string='设备')
|
||||
equipment_lq_id = fields.Many2many('maintenance.equipment', 'image_lq_id', string='设备')
|
||||
jg_equipment_id = fields.Many2many('sf.machine_tool.type', 'jg_image_id', string='机床型号')
|
||||
lq_equipment_id = fields.Many2many('sf.machine_tool.type', 'lq_image_id', string='机床型号')
|
||||
|
||||
def _get_ids(self, name_arr):
|
||||
ability_feature_ids = []
|
||||
for item in name_arr:
|
||||
ability_feature = self.search([('name', '=', item)])
|
||||
if ability_feature:
|
||||
ability_feature_ids.append(ability_feature.id)
|
||||
return [(6, 0, ability_feature_ids)]
|
||||
|
||||
@api.model
|
||||
def name_search(self, name='', args=None, operator='ilike', limit=100):
|
||||
# 调用父类的name_search方法,获取原始的结果列表
|
||||
res = super().name_search(name, args, operator, limit)
|
||||
# 定义一个空字典用来存储id和name的映射关系
|
||||
name_dict = {}
|
||||
# 遍历结果列表,将id和name存入字典中
|
||||
for item in res:
|
||||
id = item[0]
|
||||
name = item[1]
|
||||
name_dict[id] = name
|
||||
# 根据id列表搜索符合条件的记录
|
||||
records = self.browse(name_dict.keys())
|
||||
# 定义一个新的结果列表用来存储修改后的结果
|
||||
new_res = []
|
||||
# 遍历每条记录
|
||||
for record in records:
|
||||
# 获取记录的id,name和image属性
|
||||
id = record.id
|
||||
name = name_dict[id]
|
||||
image = record.image
|
||||
# 如果image不为空,将其转换为data URI scheme
|
||||
if image:
|
||||
data_uri = f"data:image/png;base64,{image.decode('utf-8')}"
|
||||
else:
|
||||
data_uri = ""
|
||||
# 将这三个属性组成一个数组,并添加到结果列表中 result.append([id, name, data_uri]) # 返回结果列表 return result
|
||||
new_res.append([id, name, data_uri])
|
||||
# 返回新的结果列表
|
||||
return new_res
|
||||
|
||||
@api.model
|
||||
def search_read(self, domain=None, fields=None, offset=0, limit=None, order=None):
|
||||
# 调用原生的search_read方法获取记录
|
||||
records = super(MaintenanceStandardImage, self).search_read(domain, fields, offset, limit, order)
|
||||
# 遍历每条记录,添加image数据
|
||||
for record in records:
|
||||
image_field = self.browse(record['id']).image
|
||||
if image_field:
|
||||
record['image'] = f"data:image/png;base64,{image_field.decode('utf-8')}"
|
||||
else:
|
||||
record['image'] = ""
|
||||
return records
|
||||
|
||||
384
sf_base/models/tool_other_features.py
Normal file
384
sf_base/models/tool_other_features.py
Normal file
@@ -0,0 +1,384 @@
|
||||
from odoo import fields, models, api
|
||||
|
||||
|
||||
class ToolMaterialsBasicParameters(models.Model):
|
||||
_name = 'sf.tool.materials.basic.parameters'
|
||||
_description = '刀具物料基本参数'
|
||||
|
||||
name = fields.Char('物料号', size=50)
|
||||
standard_library_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀具标准库')
|
||||
cutting_tool_type = fields.Char(related='standard_library_id.cutting_tool_type', string='刀具物料类型',
|
||||
store=True)
|
||||
|
||||
# 整体式刀具参数
|
||||
total_length = fields.Float('总长度(mm)')
|
||||
blade_number = fields.Selection(
|
||||
[('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8')],
|
||||
string='刃数(个)')
|
||||
neck_diameter = fields.Float('颈部直径(mm)')
|
||||
neck_length = fields.Float('颈部长度(mm)')
|
||||
handle_diameter = fields.Float('柄部直径(mm)')
|
||||
handle_length = fields.Float('柄部长度(mm)')
|
||||
blade_tip_diameter = fields.Integer('刀尖直径(mm)')
|
||||
blade_tip_working_size = fields.Char('刀尖处理尺寸(R半径mm/倒角)', size=20)
|
||||
blade_tip_taper = fields.Integer('刀尖锥度(°)')
|
||||
blade_diameter = fields.Float('刃部直径(mm)')
|
||||
blade_length = fields.Float('刃部长度(mm)')
|
||||
blade_helix_angle = fields.Integer('刃部螺旋角(°)')
|
||||
blade_width = fields.Float('刃部宽度(mm)')
|
||||
blade_depth = fields.Float('刃部深度(mm)')
|
||||
pitch = fields.Float('牙距(mm)')
|
||||
cutting_depth = fields.Float('切削深度(mm)')
|
||||
# 刀片参数
|
||||
length = fields.Float('长度(mm)')
|
||||
thickness = fields.Float('厚度(mm)')
|
||||
width = fields.Float('宽度(mm)')
|
||||
cutting_blade_length = fields.Float('切削刃长(mm)')
|
||||
relief_angle = fields.Integer('后角(°)')
|
||||
blade_tip_circular_arc_radius = fields.Char('刀尖圆弧半径(mm)', size=20)
|
||||
inscribed_circle_diameter = fields.Float('内接圆直径(mm)')
|
||||
install_aperture_diameter = fields.Float('安装孔直径(mm)')
|
||||
chip_breaker_groove = fields.Selection([('无', '无'), ('单面', '单面'), ('双面', '双面')],
|
||||
string='有无断屑槽')
|
||||
blade_teeth_model = fields.Selection(
|
||||
[('无', '无'), ('V牙型', 'V牙型'), ('米制全牙型', '米制全牙型'), ('美制全牙型', '美制全牙型'),
|
||||
('惠氏全牙型', '惠氏全牙型'), ('BSPT全牙型', 'BSPT全牙型'), ('NPT全牙型', 'NPT全牙型'),
|
||||
('UNJ全牙型', 'UNJ全牙型'), ('DIN405圆牙型', 'DIN405圆牙型'), ('ACME梯形', 'ACME梯形'),
|
||||
('石油管螺纹刀片', '石油管螺纹刀片'), ('矮牙ACME梯形', '矮牙ACME梯形'),
|
||||
('Trapeze30° 103', 'Trapeze30° 103')], string='刀片牙型', default='无')
|
||||
blade_blade_number = fields.Selection([('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'),
|
||||
('7', '7'), ('8', '8'), ('9', '9'), ('10', '10')],
|
||||
string='刀片的刃数(个)')
|
||||
main_included_angle = fields.Integer('主偏角(°)')
|
||||
top_angle = fields.Integer('顶角(°)')
|
||||
blade_tip_dip_angle = fields.Integer('刀尖倾角(°)')
|
||||
side_cutting_edge_angle = fields.Integer('侧切削角(°)')
|
||||
thread_model = fields.Selection([('无', '无'), ('外螺纹', '外螺纹'), ('内螺纹', '内螺纹')], string='螺纹类型',
|
||||
default='无')
|
||||
thread_num = fields.Float('每英寸螺纹数(tpi)')
|
||||
blade_tip_height_tolerance = fields.Char('刀尖高度公差(mm)', size=20)
|
||||
inscribed_circle_tolerance = fields.Char('内接圆公差(mm)', size=20)
|
||||
thickness_tolerance = fields.Char('厚度公差(mm)', size=20)
|
||||
# 刀杆参数
|
||||
height = fields.Float('高度(mm)')
|
||||
blade_height = fields.Float('刃部高度(mm)')
|
||||
knife_head_height = fields.Float('刀头高度(mm)')
|
||||
knife_head_width = fields.Float('刀头宽度(mm)')
|
||||
knife_head_length = fields.Float('刀头长度(mm)')
|
||||
cut_depth_max = fields.Float('最大切削深度(mm)')
|
||||
cutter_arbor_diameter = fields.Float('刀杆直径(mm)')
|
||||
min_machining_aperture = fields.Integer('最小加工孔径(mm)')
|
||||
install_blade_tip_num = fields.Integer('可装刀片数/齿数(个)')
|
||||
cutting_blade_model = fields.Char('切削类型', size=20)
|
||||
is_cooling_hole = fields.Boolean('有无冷却孔')
|
||||
locating_slot_code = fields.Char('定位槽代号', size=20)
|
||||
installing_structure = fields.Char('安装结构', size=20)
|
||||
blade_ids = fields.Many2many(
|
||||
'sf.cutting.tool.type',
|
||||
relation='basic_param_pad_blade_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_material_id.name', '=', '刀片')]",
|
||||
string='适配刀片型号' # 使用空列表作为默认值
|
||||
)
|
||||
tool_shim = fields.Char('适配刀垫型号', size=50)
|
||||
cotter_pin = fields.Char('适配销钉型号', size=50)
|
||||
pressing_plate = fields.Char('适配压板型号', size=50)
|
||||
screw = fields.Char('适配螺钉型号', size=50)
|
||||
spanner = fields.Char('适配扳手型号', size=50)
|
||||
# 刀盘参数
|
||||
cutter_head_diameter = fields.Float('刀盘直径(mm)')
|
||||
interface_diameter = fields.Float('接口直径(mm)')
|
||||
# 刀柄参数
|
||||
flange_shank_length = fields.Float('法兰柄长(mm)')
|
||||
handle_external_diameter = fields.Float('柄部外径(mm)')
|
||||
handle_inside_diameter = fields.Float('柄部内径(mm)')
|
||||
min_clamping_diameter = fields.Float('最小夹持直径(mm)')
|
||||
max_clamping_diameter = fields.Float('最大夹持直径(mm)')
|
||||
clamping_mode = fields.Char('夹持方式', size=20)
|
||||
max_load_capacity = fields.Float('最大负载能力(kg)')
|
||||
taper = fields.Integer('锥度(°)')
|
||||
tool_changing_time = fields.Integer('换刀时间(s)')
|
||||
standard_rotate_speed = fields.Integer('标准转速(n/min)')
|
||||
max_rotate_speed = fields.Integer('最大转速(n/min)')
|
||||
diameter_slip_accuracy = fields.Char('径跳精度(mm)', size=20)
|
||||
cooling_model = fields.Char('冷却类型', size=20)
|
||||
is_rough_machining = fields.Boolean('可粗加工', default=False)
|
||||
is_finish_machining = fields.Boolean('可精加工', default=False)
|
||||
is_quick_cutting = fields.Boolean('可高速切削', default=False)
|
||||
is_drill_hole = fields.Boolean('可钻孔', default=False)
|
||||
is_safe_lock = fields.Boolean('有无安全锁', default=False)
|
||||
# 夹头参数
|
||||
er_size_model = fields.Char('ER尺寸型号', size=20)
|
||||
outer_diameter = fields.Float('外径(mm)')
|
||||
inner_diameter = fields.Float('内径(mm)')
|
||||
run_out_accuracy = fields.Char('跳动精度(mm)', size=20)
|
||||
top_diameter = fields.Float('顶部直径(mm)')
|
||||
weight = fields.Float('重量(kg)', size=20)
|
||||
clamping_length = fields.Float('夹持长度(mm)')
|
||||
clamping_tolerance = fields.Char('夹持公差(mm)', size=20)
|
||||
cooling_jacket = fields.Char('适用冷却套型号', size=50)
|
||||
handle_ids = fields.Many2many(
|
||||
'sf.cutting.tool.type',
|
||||
relation='basic_param_chuck_handle_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_material_id.name', '=', '刀柄')]",
|
||||
string='适用刀柄型号'
|
||||
)
|
||||
|
||||
def _json_integral_tool_basic_param(self, obj):
|
||||
integral_tool_basic_param_str = (0, '', {
|
||||
'name': obj['name'],
|
||||
'cutting_tool_type': obj['cutting_tool_type'],
|
||||
'total_length': obj['total_length'],
|
||||
'blade_diameter': obj['blade_diameter'],
|
||||
'blade_length': obj['blade_length'],
|
||||
'blade_number': obj['blade_number'],
|
||||
'neck_length': obj['neck_length'],
|
||||
'neck_diameter': obj['neck_diameter'],
|
||||
'handle_diameter': obj['handle_diameter'],
|
||||
'handle_length': obj['handle_length'],
|
||||
'blade_tip_diameter': obj['blade_tip_diameter'],
|
||||
'blade_tip_working_size': obj['blade_tip_working_size'],
|
||||
'blade_tip_taper': obj['blade_tip_taper'],
|
||||
'blade_helix_angle': obj['blade_helix_angle'],
|
||||
'blade_width': obj['blade_width'],
|
||||
'blade_depth': obj['blade_depth'],
|
||||
'pitch': obj['pitch'],
|
||||
'cutting_depth': obj['cutting_depth'],
|
||||
})
|
||||
return integral_tool_basic_param_str
|
||||
|
||||
def _json_blade_basic_param(self, obj):
|
||||
blade_basic_param_str = (0, '', {
|
||||
'name': obj['name'],
|
||||
'cutting_tool_type': obj['cutting_tool_type'],
|
||||
'length': obj['length'],
|
||||
'thickness': obj['thickness'],
|
||||
'width': obj['width'],
|
||||
'cutting_blade_length': obj['cutting_blade_length'],
|
||||
'relief_angle': obj['relief_angle'],
|
||||
'blade_tip_circular_arc_radius': obj['blade_tip_circular_arc_radius'],
|
||||
'inscribed_circle_diameter': obj['inscribed_circle_diameter'],
|
||||
'install_aperture_diameter': obj['install_aperture_diameter'],
|
||||
'pitch': obj['pitch'],
|
||||
'chip_breaker_groove': obj['chip_breaker_groove'],
|
||||
'blade_teeth_model': '无' if not obj['bladed_teeth_model'] else obj['bladed_teeth_model'],
|
||||
'blade_blade_number': obj['blade_blade_number'],
|
||||
'cutting_depth': obj['cutting_depth'],
|
||||
'blade_width': obj['blade_width'],
|
||||
'main_included_angle': obj['main_included_angle'],
|
||||
'top_angle': obj['top_angle'],
|
||||
'blade_tip_dip_angle': obj['blade_tip_dip_angle'],
|
||||
'side_cutting_edge_angle': obj['side_cutting_edge_angle'],
|
||||
'thread_model': '无' if not obj['thread_model'] else obj['thread_model'],
|
||||
'thread_num': obj['thread_num'],
|
||||
'blade_tip_height_tolerance': obj['blade_tip_height_tolerance'],
|
||||
'inscribed_circle_tolerance': obj['inscribed_circle_tolerance'],
|
||||
'thickness_tolerance': obj['thickness_tolerance'],
|
||||
})
|
||||
return blade_basic_param_str
|
||||
|
||||
def _json_cutter_arbor_basic_param(self, obj):
|
||||
cutter_arbor_basic_param_str = (0, '', {
|
||||
'name': obj['name'],
|
||||
'cutting_tool_type': obj['cutting_tool_type'],
|
||||
'height': obj['height'],
|
||||
'width': obj['width'],
|
||||
'total_length': obj['total_length'],
|
||||
'knife_head_height': obj['knife_head_height'],
|
||||
'knife_head_width': obj['knife_head_width'],
|
||||
'knife_head_length': obj['knife_head_length'],
|
||||
'cutter_arbor_diameter': obj['cutter_arbor_diameter'],
|
||||
'main_included_angle': obj['main_included_angle'],
|
||||
'relief_angle': obj['relief_angle'],
|
||||
'cutting_depth': obj['cutting_depth'],
|
||||
'min_machining_aperture': obj['min_machining_aperture'],
|
||||
'install_blade_tip_num': obj['install_blade_tip_num'],
|
||||
'cutting_blade_model': obj['cutting_blade_model'],
|
||||
'is_cooling_hole': obj['is_cooling_hole'],
|
||||
'locating_slot_code': obj['locating_slot_code'],
|
||||
'installing_structure': obj['installing_structure'],
|
||||
'blade_ids': [(6, 0, [])] if not obj.get('blade_codes') else
|
||||
self.evn['sf.cutting_tool.standard.library']._get_ids(obj['blade_codes']),
|
||||
'tool_shim': obj['tool_shim'],
|
||||
'cotter_pin': obj['cotter_pin'],
|
||||
'pressing_plate': obj['pressing_plate'],
|
||||
'screw': obj['screw'],
|
||||
'spanner': obj['spanner'],
|
||||
})
|
||||
return cutter_arbor_basic_param_str
|
||||
|
||||
def _json_cutter_head_basic_param(self, obj):
|
||||
cutter_head_basic_param_str = (0, '', {
|
||||
'name': obj['name'],
|
||||
'cutting_tool_type': obj['cutting_tool_type'],
|
||||
'install_blade_tip_num': obj['install_blade_tip_num'],
|
||||
'blade_diameter': obj['blade_diameter'],
|
||||
'cutter_head_diameter': obj['cutter_head_diameter'],
|
||||
'interface_diameter': obj['interface_diameter'],
|
||||
'total_length': obj['total_length'],
|
||||
'blade_length': obj['blade_length'],
|
||||
'cutting_depth': obj['cutting_depth'],
|
||||
'main_included_angle': obj['main_included_angle'],
|
||||
'installing_structure': obj['installing_structure'],
|
||||
'blade_ids': [(6, 0, [])] if not obj.get('blade_codes') else
|
||||
self.evn['sf.cutting_tool.standard.library']._get_ids(obj['blade_codes']),
|
||||
'screw': obj['screw'],
|
||||
'spanner': obj['spanner'],
|
||||
'cutting_blade_model': obj['cutting_blade_model'],
|
||||
'is_cooling_hole': obj['is_cooling_hole'],
|
||||
'locating_slot_code': obj['locating_slot_code'],
|
||||
})
|
||||
return cutter_head_basic_param_str
|
||||
|
||||
def _json_knife_handle_basic_param(self, obj):
|
||||
knife_handle_basic_param_str = (0, '', {
|
||||
'name': obj['name'],
|
||||
'cutting_tool_type': obj['cutting_tool_type'],
|
||||
'total_length': obj['total_length'],
|
||||
'flange_shank_length': obj['flange_shank_length'],
|
||||
'handle_external_diameter': obj['handle_external_diameter'],
|
||||
'handle_inside_diameter': obj['handle_inside_diameter'],
|
||||
'min_clamping_diameter': obj['min_clamping_diameter'],
|
||||
'max_clamping_diameter': obj['max_clamping_diameter'],
|
||||
'clamping_mode': obj['clamping_mode'],
|
||||
'max_load_capacity': obj['max_load_capacity'],
|
||||
'taper': obj['taper'],
|
||||
'tool_changing_time': obj['tool_changing_time'],
|
||||
'standard_rotate_speed': obj['standard_rotate_speed'],
|
||||
'max_rotate_speed': obj['max_rotate_speed'],
|
||||
'diameter_slip_accuracy': obj['diameter_slip_accuracy'],
|
||||
'cooling_model': obj['cooling_model'],
|
||||
'is_rough_machining': obj['is_rough_machining'],
|
||||
'is_finish_machining': obj['is_finish_machining'],
|
||||
'is_quick_cutting': obj['is_quick_cutting'],
|
||||
'is_drill_hole': obj['is_drill_hole'],
|
||||
'is_safe_lock': obj['is_safe_lock'],
|
||||
'screw': obj['screw'],
|
||||
'spanner': obj['spanner'],
|
||||
})
|
||||
return knife_handle_basic_param_str
|
||||
|
||||
def _json_chuck_basic_param(self, obj):
|
||||
chuck_basic_param_str = (0, '', {
|
||||
'name': obj['name'],
|
||||
'cutting_tool_type': obj['cutting_tool_type'],
|
||||
'er_size_model': obj['er_size_model'],
|
||||
'min_clamping_diameter': obj['min_clamping_diameter'],
|
||||
'max_clamping_diameter': obj['max_clamping_diameter'],
|
||||
'outer_diameter': obj['outer_diameter'],
|
||||
'inner_diameter': obj['inner_diameter'],
|
||||
'run_out_accuracy': obj['run_out_accuracy'],
|
||||
'total_length': obj['total_length'],
|
||||
'taper': obj['taper'],
|
||||
'run_out_accuracy': obj['run_out_accuracy'],
|
||||
'top_diameter': obj['top_diameter'],
|
||||
'weight': obj['weight'],
|
||||
'clamping_mode': obj['clamping_mode'],
|
||||
'clamping_length': obj['clamping_length'],
|
||||
'clamping_tolerance': obj['clamping_tolerance'],
|
||||
'max_load_capacity': obj['max_load_capacity'],
|
||||
'handle_ids': [(6, 0, [])] if not obj.get(
|
||||
'handle_codes') else self.evn['sf.cutting_tool.standard.library']._get_ids(obj['handle_codes']),
|
||||
'cooling_jacket': obj['cooling_jacket'],
|
||||
})
|
||||
return chuck_basic_param_str
|
||||
|
||||
|
||||
class CuttingSpeed(models.Model):
|
||||
_name = 'sf.cutting.speed'
|
||||
_description = '切削速度Vc'
|
||||
|
||||
product_template_id = fields.Many2one('product.template')
|
||||
standard_library_id = fields.Many2one('sf.cutting_tool.standard.library', string='标准库')
|
||||
execution_standard_id = fields.Many2one('sf.international.standards', string='执行标准', store=True)
|
||||
material_code = fields.Char('材料代号')
|
||||
material_id = fields.Many2one('sf.materials.model', '材料名称',
|
||||
domain="[('standards_id', '=', execution_standard_id)]")
|
||||
slope_milling_angle = fields.Integer('坡铣角度(°)')
|
||||
material_grade = fields.Char('材料牌号')
|
||||
tensile_strength = fields.Char('拉伸强度 (N/mm²)')
|
||||
hardness = fields.Integer('硬度(HRC)')
|
||||
cutting_speed_n1 = fields.Char('径向切宽 ae=100%D1 ap=1*D1 切削速度Vc')
|
||||
cutting_speed_n2 = fields.Char('径向切宽 ae=50%D1 ap=1.5*D1 切削速度Vc')
|
||||
cutting_speed_n3 = fields.Char('径向切宽 ae=25%D1 ap=L1max 切削速度Vc')
|
||||
cutting_speed_n4 = fields.Char('径向切宽 ae=15%D1 ap=L1max 切削速度Vc')
|
||||
cutting_speed_n5 = fields.Char('径向切宽 ae=5%D1 ap=L1max 切削速度Vc')
|
||||
rough_machining = fields.Char('粗加工 Vc(m/min)')
|
||||
precision_machining = fields.Char('精加工 Vc(m/min)')
|
||||
application = fields.Selection([('主应用', '主应用'), ('次应用', '次应用')], '主/次应用')
|
||||
|
||||
def _json_cutting_speed(self, obj):
|
||||
cutting_speed_str = (0, '', {
|
||||
'execution_standard_id': self.env['sf.international.standards'].search(
|
||||
[('code', '=', obj['execution_standard_code'])]).id,
|
||||
'material_code': obj['material_code'],
|
||||
'material_id': self.env['sf.materials.model'].search([('materials_no', '=', obj['material_name_code'])]).id,
|
||||
'material_grade': obj['material_grade'],
|
||||
'tensile_strength': obj['tensile_strength'],
|
||||
'hardness': obj['hardness'],
|
||||
'cutting_speed_n1': obj['cutting_speed_n1'],
|
||||
'cutting_speed_n2': obj['cutting_speed_n2'],
|
||||
'cutting_speed_n3': obj['cutting_speed_n3'],
|
||||
'cutting_speed_n4': obj['cutting_speed_n4'],
|
||||
'cutting_speed_n5': obj['cutting_speed_n5'],
|
||||
'rough_machining': obj['rough_machining'],
|
||||
'precision_machining': obj['precision_machining'],
|
||||
'application': obj['application'],
|
||||
})
|
||||
return cutting_speed_str
|
||||
|
||||
|
||||
class FeedPerTooth(models.Model):
|
||||
_name = 'sf.feed.per.tooth'
|
||||
_description = '每齿走刀量fz'
|
||||
_order = 'machining_method desc, blade_diameter, materials_type_id'
|
||||
|
||||
product_template_id = fields.Many2one('product.template')
|
||||
standard_library_id = fields.Many2one('sf.cutting_tool.standard.library', string='标准库')
|
||||
cutting_speed = fields.Char('径向切宽 ae(mm)')
|
||||
machining_method = fields.Selection([('直铣', '直铣'), ('坡铣', '坡铣')], string='加工方式')
|
||||
materials_type_id = fields.Many2one('sf.materials.model', string='材料型号')
|
||||
blade_diameter = fields.Integer('刃部直径(mm)', readonly=True)
|
||||
feed_per_tooth = fields.Char('每齿走刀量 (mm/z)')
|
||||
|
||||
def _json_feed_per_tooth(self, obj):
|
||||
feed_per_tooth_str = (0, '', {
|
||||
'cutting_speed': obj['cutting_speed'],
|
||||
'blade_diameter': obj['blade_diameter'],
|
||||
'feed_per_tooth': obj['feed_per_tooth'],
|
||||
})
|
||||
return feed_per_tooth_str
|
||||
|
||||
def _json_feed_per_tooth_2(self, obj):
|
||||
feed_per_tooth_2_str = (0, '', {
|
||||
'machining_method': obj['machining_method'],
|
||||
'materials_type_id': self.env['sf.materials.model'].search(
|
||||
[('materials_no', '=', obj['materials_type_code'])]).id,
|
||||
'blade_diameter': obj['blade_diameter'],
|
||||
'feed_per_tooth': obj['feed_per_tooth'],
|
||||
})
|
||||
return feed_per_tooth_2_str
|
||||
|
||||
def _json_feed_per_tooth_3(self, obj):
|
||||
feed_per_tooth_3_str = (0, '', {
|
||||
'cutting_speed': obj['cutting_speed'],
|
||||
'feed_per_tooth': obj['feed_per_tooth'],
|
||||
})
|
||||
return feed_per_tooth_3_str
|
||||
|
||||
def _json_feed_per_tooth_4(self, obj):
|
||||
feed_per_tooth_4_str = (0, '', {
|
||||
'machining_method': obj['machining_method'],
|
||||
'materials_type_id': self.env['sf.materials.model'].search(
|
||||
[('materials_no', '=', obj['materials_type_code'])]).id,
|
||||
'feed_per_tooth': obj['feed_per_tooth'],
|
||||
})
|
||||
return feed_per_tooth_4_str
|
||||
|
||||
# @api.depends('product_template_id')
|
||||
# def _compute_product_template_id(self):
|
||||
# if self.product_template_id is not None:
|
||||
# self.blade_diameter = self.product_template_id.cutting_tool_blade_diameter
|
||||
@@ -1,4 +1,89 @@
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="group_quality" model="res.groups">
|
||||
<field name="name">质检岗</field>
|
||||
<field name="category_id" ref="base.module_category_manufacturing_quality"/>
|
||||
</record>
|
||||
|
||||
<record id="group_quality_director" model="res.groups">
|
||||
<field name="name">质量总监</field>
|
||||
<field name="category_id" ref="base.module_category_manufacturing_quality"/>
|
||||
</record>
|
||||
<record id="group_sf_mrp_user" model="res.groups">
|
||||
<field name="name">制造普通用户</field>
|
||||
<field name="category_id" ref="base.module_category_manufacturing_manufacturing"/>
|
||||
<field name="implied_ids" eval="[(4, ref('mrp.group_mrp_user'))]"/>
|
||||
</record>
|
||||
<!-- <record id="group_sf_mrp_manager" model="res.groups">-->
|
||||
<!-- <field name="name">制造管理用户</field>-->
|
||||
<!-- <field name="implied_ids" eval="[(4, ref('group_sf_mrp_user'))]"/>-->
|
||||
|
||||
<!-- </record>-->
|
||||
<!-- <record id="group_sf_mrp_manager" model="res.groups">-->
|
||||
<!-- <field name="name">制造管理用户</field>-->
|
||||
<!-- <field name="implied_ids" eval="[(4, ref('group_sf_mrp_user'))]"/>-->
|
||||
<!-- <field name="category_id" ref="base.module_category_manufacturing_manufacturing"/>-->
|
||||
<!-- </record>-->
|
||||
<record id="group_sf_equipment_user" model="res.groups">
|
||||
<field name="name">机床操作岗</field>
|
||||
<field name="implied_ids" eval="[(4, ref('group_sf_mrp_user'))]"/>
|
||||
<field name="category_id" ref="base.module_category_manufacturing_manufacturing"/>
|
||||
</record>
|
||||
<record id="group_sf_tool_user" model="res.groups">
|
||||
<field name="name">刀具组装岗</field>
|
||||
<field name="implied_ids" eval="[(4, ref('group_sf_mrp_user'))]"/>
|
||||
<field name="category_id" ref="base.module_category_manufacturing_manufacturing"/>
|
||||
</record>
|
||||
<record id="group_sf_order_user" model="res.groups">
|
||||
<field name="name">工件装夹岗</field>
|
||||
<field name="implied_ids" eval="[(4, ref('group_sf_mrp_user'))]"/>
|
||||
<field name="category_id" ref="base.module_category_manufacturing_manufacturing"/>
|
||||
</record>
|
||||
|
||||
<record id="group_sf_mrp_manager" model="res.groups">
|
||||
<field name="name">生产总监</field>
|
||||
<field name="implied_ids" eval="[(4, ref('group_sf_mrp_user'))]"/>
|
||||
<field name="category_id" ref="base.module_category_manufacturing_manufacturing"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.module.category" id="module_category_plan">
|
||||
<field name="name">计划</field>
|
||||
<field name="sequence">20</field>
|
||||
</record>
|
||||
|
||||
<record id="group_sale_salemanager" model="res.groups">
|
||||
<field name="name">销售经理</field>
|
||||
<field name="category_id" ref="base.module_category_sales_sales"/>
|
||||
</record>
|
||||
|
||||
<record id="group_sale_director" model="res.groups">
|
||||
<field name="name">销售总监</field>
|
||||
<field name="category_id" ref="base.module_category_sales_sales"/>
|
||||
</record>
|
||||
|
||||
<record id="group_plan_dispatch" model="res.groups">
|
||||
<field name="name">计划调度岗</field>
|
||||
<field name="category_id" ref="module_category_plan"/>
|
||||
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="group_plan_director" model="res.groups">
|
||||
<field name="name">计划总监</field>
|
||||
<field name="category_id" ref="module_category_plan"/>
|
||||
<!-- <field name="implied_ids" eval="[(4, ref('sf_base.group_plan_dispatch'))]"/>-->
|
||||
</record>
|
||||
|
||||
<record id="group_purchase" model="res.groups">
|
||||
<field name="name">采购岗</field>
|
||||
<field name="category_id" ref="base.module_category_inventory_purchase"/>
|
||||
</record>
|
||||
|
||||
<record id="group_purchase_director" model="res.groups">
|
||||
<field name="name">采购总监</field>
|
||||
<field name="category_id" ref="base.module_category_inventory_purchase"/>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -15,7 +15,6 @@ access_sf_production_process_category,sf_production_process_category,model_sf_pr
|
||||
access_sf_machine_tool_category,sf_machine_tool_category,model_sf_machine_tool_category,base.group_user,1,1,1,1
|
||||
access_sf_cutting_tool_material,sf_cutting_tool_material,model_sf_cutting_tool_material,base.group_user,1,1,1,1
|
||||
access_sf_cutting_tool_type,sf_cutting_tool_type,model_sf_cutting_tool_type,base.group_user,1,1,1,1
|
||||
access_sf_cutting_tool_model,sf_cutting_tool_model,model_sf_cutting_tool_model,base.group_user,1,1,1,1
|
||||
access_sf_functional_cutting_tool,sf_functional_cutting_tool,model_sf_functional_cutting_tool,base.group_user,1,1,1,1
|
||||
access_sf_functional_cutting_tool_model,sf_functional_cutting_tool_model,model_sf_functional_cutting_tool_model,base.group_user,1,1,1,1
|
||||
access_sf_fixture_material,sf_fixture_material,model_sf_fixture_material,base.group_user,1,1,1,1
|
||||
@@ -26,6 +25,24 @@ access_sf_functional_fixture,sf_functional_fixture,model_sf_functional_fixture,b
|
||||
access_sf_sync_common,sf_sync_common,model_sf_sync_common,base.group_user,1,1,1,1
|
||||
access_sf_international_standards,sf_international_standards,model_sf_international_standards,base.group_user,1,1,1,1
|
||||
access_material_apply,material_apply,model_material_apply,base.group_user,1,1,1,1
|
||||
access_sf_cutting_tool_standard_library,sf_cutting_tool_standard_library,model_sf_cutting_tool_standard_library,base.group_user,1,1,1,1
|
||||
access_sf_tool_materials_basic_parameters,sf_tool_materials_basic_parameters,model_sf_tool_materials_basic_parameters,base.group_user,1,1,1,1
|
||||
access_sf_cutting_speed,sf_cutting_speed,model_sf_cutting_speed,base.group_user,1,1,1,1
|
||||
access_sf_feed_per_tooth,sf_feed_per_tooth,model_sf_feed_per_tooth,base.group_user,1,1,1,1
|
||||
access_maintenance_equipment_image,maintenance_equipment_image,model_maintenance_equipment_image,base.group_user,1,1,1,1
|
||||
access_purchase_order_group_purchase,access_purchase_order_group_purchase,purchase.model_purchase_order,sf_base.group_purchase,1,1,1,0
|
||||
access_purchase_order_group_purchase_director,access_purchase_order_group_purchase_director,purchase.model_purchase_order,sf_base.group_purchase_director,1,1,1,0
|
||||
access_purchase_order_line_group_purchase,access_purchase_order_line_group_purchase,purchase.model_purchase_order_line,sf_base.group_purchase,1,1,1,0
|
||||
access_purchase_order_line_group_purchase_director,access_purchase_order_line_group_purchase_director,purchase.model_purchase_order_line,sf_base.group_purchase_director,1,1,1,0
|
||||
access_spindle_taper_type,spindle_taper_type,model_spindle_taper_type,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
|
||||
access_purchase_order,purchase.order,purchase.model_purchase_order,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_res_partner,res.partner,base.model_res_partner,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_purchase_order_line,purchase.order.line,purchase.model_purchase_order_line,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_account_move_line,account.move.line,account.model_account_move_line,sf_base.group_plan_dispatch,1,0,0,0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -34,8 +34,14 @@ div:has(.o_required_modifier) > label::before {
|
||||
|
||||
.o_kanban_renderer .o_kanban_record .o_kanban_record_has_image_fill .o_kanban_image_fill_left {
|
||||
flex: unset !important;
|
||||
min-width: 100px;
|
||||
}
|
||||
.o_kanban_renderer .o_kanban_record .o_kanban_record_title {
|
||||
font-weight: bold;
|
||||
}
|
||||
.o_kanban_renderer .o_kanban_record .oe_kanban_details ul {
|
||||
margin-top: calc(var(--KanbanRecord-gap-v) * 0.5);
|
||||
}
|
||||
|
||||
.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom {
|
||||
margin-top: 5px;
|
||||
display: inline !important;
|
||||
@@ -161,4 +167,25 @@ td.o_required_modifier {
|
||||
display: flex !important;
|
||||
justify-content: flex-start !important;
|
||||
align-items: center !important;
|
||||
}
|
||||
}
|
||||
|
||||
//用于label外的div
|
||||
.type_label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.button_width button {
|
||||
width:11rem;
|
||||
margin-top: -9px;
|
||||
height: 2.5rem;
|
||||
line-height: 1.5rem;
|
||||
}
|
||||
|
||||
.button_width{
|
||||
display: flex;
|
||||
}
|
||||
.o_field_widget.o_field_many2one {
|
||||
flex-direction: row !important;
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,10 @@
|
||||
<field name="name" string="模糊搜索"
|
||||
filter_domain="['|',('name', 'ilike', self),('remark', 'ilike', self)]"/>
|
||||
<filter name="filter_active" string="已归档" domain="[('active','=',False)]"/>
|
||||
|
||||
<searchpanel>
|
||||
<field name="brand_id" select="multi" icon="fa-building" enable_counters="1"/>
|
||||
<field name="machine_tool_category" select="multi" icon="fa-building" enable_counters="1"/>
|
||||
</searchpanel>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -90,7 +93,7 @@
|
||||
<field name="name">tree.sf.machine_tool.type</field>
|
||||
<field name="model">sf.machine_tool.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="机床型号" create="0" delete="1" edit="0">
|
||||
<tree string="机床型号" create="1" delete="1" edit="1">
|
||||
<field name="code"/>
|
||||
<field name="name" string="名称"/>
|
||||
<field name="machine_tool_category"/>
|
||||
@@ -105,20 +108,16 @@
|
||||
<field name="name">form.sf.machine_tool.type</field>
|
||||
<field name="model">sf.machine_tool.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="机床型号" create="0" edit="1" delete="0">
|
||||
<form string="机床型号" delete="0">
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="name" placeholder="e.g. LED Monitor"/>
|
||||
<field name="name" required="1" placeholder="名称"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<!-- <label for="name"/>-->
|
||||
<!-- <h1>-->
|
||||
<!-- <field name="name" string="设备名称" placeholder="e.g. LED Monitor"/>-->
|
||||
<!-- </h1>-->
|
||||
<field name="code" force_save="1" readonly="1"/>
|
||||
<field name="code" force_save="1"/>
|
||||
<field name="brand_id" required="1"
|
||||
domain="[('tag_ids', '=', '机床')]"
|
||||
options="{'no_create': True}"/>
|
||||
@@ -128,10 +127,40 @@
|
||||
<field name="machine_tool_picture" widget="image" nolabel="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="加工能力">
|
||||
<div>
|
||||
<field name='jg_image_id' widget="custom_many2many_checkboxes">
|
||||
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"
|
||||
options="{'size': [100, 100], 'click enlarge': True}"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</div>
|
||||
|
||||
</group>
|
||||
<group string="冷却方式">
|
||||
<div>
|
||||
<field name='lq_image_id' widget="custom_many2many_checkboxes">
|
||||
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"
|
||||
options="{'size': [100, 100], 'click enlarge': True}"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</div>
|
||||
|
||||
</group>
|
||||
|
||||
|
||||
<notebook>
|
||||
<page string="基本信息">
|
||||
<group>
|
||||
<group string="基本参数">
|
||||
<group string="基础参数">
|
||||
<field name="control_system_id" required="1" options="{'no_create': True}"/>
|
||||
<label for="workbench_L" string="工作台尺寸(mm)"/>
|
||||
<div class="test_model">
|
||||
@@ -143,33 +172,47 @@
|
||||
<field name="workbench_W" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="workpiece_load"/>
|
||||
<label for="machine_tool_L" string="机床尺寸(mm)"/>
|
||||
<div class="test_model">
|
||||
<label for="machine_tool_L" string="长"/>
|
||||
<field name="machine_tool_L" class="o_address_zip" required="1"
|
||||
<field name="machine_tool_L" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="machine_tool_W" string="宽"/>
|
||||
<field name="machine_tool_W" class="o_address_zip" required="1"
|
||||
<field name="machine_tool_W" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="machine_tool_H" string="高"/>
|
||||
<field name="machine_tool_H" class="o_address_zip" required="1"
|
||||
<field name="machine_tool_H" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="feed_speed" required="1"/>
|
||||
<label for="precision_min" string="X轴定位精度(mm)"/>
|
||||
<label for="T_trough_num" string="T型槽尺寸:"/>
|
||||
<div class="test_model">
|
||||
<label for="precision_min" string="最小"/>
|
||||
<field name="precision_min" class="o_address_zip" required="1"
|
||||
<label for="T_trough_num" string="槽数"/>
|
||||
<field name="T_trough_num" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="precision_max" string="最大"/>
|
||||
<field name="precision_max" class="o_address_zip" required="1"
|
||||
<label for="T_trough_wide" string="槽宽(mm)"/>
|
||||
<field name="T_trough_wide" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="T_trough_distance" string="槽距(mm)"/>
|
||||
<field name="T_trough_distance" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="workpiece_load" required="1"/>
|
||||
<field name="number_of_knife_library" required="1" options="{'format': false}"/>
|
||||
<field name="lead_screw" required="1"/>
|
||||
<!-- <field name="feed_speed" required="1"/>-->
|
||||
<!-- <label for="precision_min" string="X轴定位精度(mm)"/>-->
|
||||
<!-- <div class="test_model">-->
|
||||
<!-- <label for="precision_min" string="最小(min)"/>-->
|
||||
<!-- <field name="precision_min" class="o_address_zip" required="1"-->
|
||||
<!-- options="{'format': false}"/>-->
|
||||
<!-- <span>&nbsp;</span>-->
|
||||
<!-- <label for="precision_max" string="最大(max)"/>-->
|
||||
<!-- <field name="precision_max" class="o_address_zip" required="1"-->
|
||||
<!-- options="{'format': false}"/>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <field name="lead_screw" required="1"/>-->
|
||||
<!-- <field name="guide_rail" required="1"/>-->
|
||||
<field name="number_of_axles" required="1" widget="radio"
|
||||
options="{'horizontal': true}"/>
|
||||
<label for="x_axis" string="加工行程(mm)"
|
||||
@@ -187,59 +230,104 @@
|
||||
<label for="z_axis" string="z"/>
|
||||
<field name="z_axis" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<br></br>
|
||||
<label for="b_axis" string="b"
|
||||
<span>&nbsp;</span>
|
||||
<label for="a_axis" string="a"
|
||||
attrs="{'invisible': [('number_of_axles', '=', '三轴')]}"/>
|
||||
<field name="b_axis" class="o_address_zip" required="1"
|
||||
<field name="a_axis" class="o_address_zip"
|
||||
attrs="{'invisible': [('number_of_axles', '=', '三轴')]}"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="c_axis" string="c"
|
||||
<label for="b_axis" string="b"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴'])]}"/>
|
||||
<field name="c_axis" class="o_address_zip" required="1"
|
||||
<field name="b_axis" class="o_address_zip"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴'])]}"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="c_axis" string="c"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴','五轴'])]}"/>
|
||||
<field name="c_axis" class="o_address_zip"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴','五轴'])]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
</group>
|
||||
<group string="主轴">
|
||||
<field name="taper" required="1"/>
|
||||
<field name="rotate_speed" string="主轴转速(r/min)" required="1"
|
||||
<field name="taper_type_id" required="1"/>
|
||||
<label for="distance_min" string="主轴端面-工作台距离(mm)"/>
|
||||
<div class="test_model">
|
||||
<label for="distance_min" string="最小(min)"/>
|
||||
<field name="distance_min" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="distance_max" string="最大(max)"/>
|
||||
<field name="distance_max" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="rotate_speed" string="主轴最高转速(r/min)"
|
||||
options="{'format': false}"/>
|
||||
<field name="heightened_way" required="1"/>
|
||||
<field name="torque" required="1"/>
|
||||
<field name="motor_power" required="1"/>
|
||||
<label for="distance_min" string="主轴端面-工作台距离(mm)"/>
|
||||
<div class="test_model">
|
||||
<label for="distance_min" string="最小"/>
|
||||
<field name="distance_min" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="distance_max" string="最大"/>
|
||||
<field name="distance_max" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="guide_rail" required="1"/>
|
||||
</group>
|
||||
<group></group>
|
||||
<group string="刀具">
|
||||
<field name="knife_type" required="1"/>
|
||||
<field name="tool_speed" required="1"/>
|
||||
<field name="tool_long_max" required="1"/>
|
||||
<label for="tool_diameter_min" string="刀具刀径(mm)"/>
|
||||
<div class="test_model">
|
||||
<label for="tool_diameter_min" string="最小"/>
|
||||
<field name="tool_diameter_min" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>Φ
|
||||
<span>&nbsp;</span>
|
||||
<label for="tool_diameter_max" string="最大"/>
|
||||
<field name="tool_diameter_max" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>Φ
|
||||
</div>
|
||||
<field name="tool_quality_max" required="1"/>
|
||||
<field name="spindle_center_distance"/>
|
||||
<field name="spindle_continuous_power"/>
|
||||
<field name="spindle_peak_power"/>
|
||||
<field name="spindle_sustained_torque"/>
|
||||
<field name="spindle_peak_torque"/>
|
||||
<field name="heightened_way"/>
|
||||
<field name="linear_axis_guides_type"/>
|
||||
<field name="axis_driven_type"/>
|
||||
|
||||
<!-- <field name="distance" required="1"/>-->
|
||||
</group>
|
||||
</group>
|
||||
<group string="其它">
|
||||
<field name="remark"/>
|
||||
</page>
|
||||
<page string="进给/精度参数">
|
||||
<group>
|
||||
<group string="进给参数">
|
||||
<field name="X_axis_rapid_traverse_speed"/>
|
||||
<field name="Y_axis_rapid_traverse_speed"/>
|
||||
<field name="Z_axis_rapid_traverse_speed"/>
|
||||
<field name="a_axis_rapid_traverse_speed"/>
|
||||
<field name="b_axis_rapid_traverse_speed"/>
|
||||
<field name="c_axis_rapid_traverse_speed"/>
|
||||
<field name="straight_cutting_feed_rate"/>
|
||||
<field name="rotary_cutting_feed_rate"/>
|
||||
</group>
|
||||
<group string="精度参数">
|
||||
<field name="X_precision"/>
|
||||
<field name="X_precision_repeat"/>
|
||||
<field name="Y_precision"/>
|
||||
<field name="Y_precision_repeat"/>
|
||||
<field name="Z_precision"/>
|
||||
<field name="Z_precision_repeat"/>
|
||||
<field name="a_precision"/>
|
||||
<field name="a_precision_repeat"/>
|
||||
<field name="b_precision"/>
|
||||
<field name="b_precision_repeat"/>
|
||||
<field name="c_precision"/>
|
||||
<field name="c_precision_repeat"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="刀库参数">
|
||||
<group>
|
||||
<group string="刀具">
|
||||
<!-- <field name="knife_type" required="1"/>-->
|
||||
<field name="number_of_knife_library" required="1" options="{'format': false}"/>
|
||||
<!-- <field name="tool_speed" required="1"/>-->
|
||||
<field name="tool_full_diameter_max"/>
|
||||
<field name="tool_perimeter_diameter_max"/>
|
||||
<field name="tool_long_max"/>
|
||||
<!-- <label for="tool_diameter_min" string="刀具刀径(mm)"/>-->
|
||||
<!-- <div class="test_model">-->
|
||||
<!-- <label for="tool_diameter_min" string="最小(min)"/>-->
|
||||
<!-- <field name="tool_diameter_min" class="o_address_zip" required="1"-->
|
||||
<!-- options="{'format': false}"/>-->
|
||||
<!-- <span>&nbsp;</span>-->
|
||||
<!-- <label for="tool_diameter_max" string="最大(max)"/>-->
|
||||
<!-- <field name="tool_diameter_max" class="o_address_zip" required="1"-->
|
||||
<!-- options="{'format': false}"/>-->
|
||||
<!-- </div>-->
|
||||
<field name="tool_quality_max"/>
|
||||
<field name="T_tool_time"/>
|
||||
<field name="C_tool_time"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
|
||||
@@ -269,6 +269,7 @@
|
||||
<filter name="filter_active" string="已归档" domain="[('active','=',False)]"/>
|
||||
<searchpanel class="account_root">
|
||||
<field name="materials_id" icon="fa-filter"/>
|
||||
<field name="standards_id" icon="fa-filter"/>
|
||||
</searchpanel>
|
||||
</search>
|
||||
</field>
|
||||
|
||||
@@ -1,234 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- action -->
|
||||
<record id="action_sf_cutting_tool" model="ir.actions.act_window">
|
||||
<field name="name">整体式刀具型号</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.integral.cutting.tool</field>
|
||||
<!-- <field name="view_type">form</field> -->
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- 功能刀具action -->
|
||||
<record id="action_sf_functional_cutting_tool" model="ir.actions.act_window">
|
||||
<field name="name">功能刀具</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.functional.cutting.tool</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- 刀片action -->
|
||||
<record id="action_sf_cutting_tool_blade" model="ir.actions.act_window">
|
||||
<field name="name">刀片型号</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.blade</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- 刀杆action -->
|
||||
<record id="action_sf_cutting_tool_rod" model="ir.actions.act_window">
|
||||
<field name="name">刀杆型号</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.cutter.bar</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- 刀盘action -->
|
||||
<record id="action_sf_cutting_tool_disc" model="ir.actions.act_window">
|
||||
<field name="name">刀盘型号</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.cutter.pad</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- 刀柄action -->
|
||||
<record id="action_sf_cutting_tool_handle" model="ir.actions.act_window">
|
||||
<field name="name">刀柄型号</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.handle</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- 夹头action -->
|
||||
<record id="action_sf_cutting_tool_clamp_head" model="ir.actions.act_window">
|
||||
<field name="name">夹头型号</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.chuck</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- 功能刀具类型action -->
|
||||
<record id="action_sf_functional_cutting_tool_type" model="ir.actions.act_window">
|
||||
<field name="name">功能刀具类型</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.functional.cutting.tool.model</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- 整体式刀具类型action -->
|
||||
<record id="action_sf_integral_cutting_tool_type" model="ir.actions.act_window">
|
||||
<field name="name">整体式刀具类型</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.integral.cutting.tool.model</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- 刀片类型action -->
|
||||
<record id="action_sf_cutting_tool_blade_type" model="ir.actions.act_window">
|
||||
<field name="name">刀片类型</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.blade.model</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- 刀杆类型action -->
|
||||
<record id="action_sf_cutting_tool_rod_type" model="ir.actions.act_window">
|
||||
<field name="name">刀杆类型</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.cutter.bar.model</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- 刀盘类型action -->
|
||||
<record id="action_sf_cutting_tool_disc_type" model="ir.actions.act_window">
|
||||
<field name="name">刀盘类型</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.cutter.pad.model</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- 刀柄类型action -->
|
||||
<record id="action_sf_cutting_tool_handle_type" model="ir.actions.act_window">
|
||||
<field name="name">刀柄类型</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.handle.model</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- 夹头类型action -->
|
||||
<record id="action_sf_cutting_tool_clamp_head_type" model="ir.actions.act_window">
|
||||
<field name="name">夹头类型</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.chuck.model</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- 刀具物料action -->
|
||||
<record id="action_sf_cutting_tool_material" model="ir.actions.act_window">
|
||||
<field name="name">刀具物料</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.cutting.tool.material</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<!-- 功能刀具 -->
|
||||
<!-- <menuitem-->
|
||||
<!-- id="menu_sf_functional_cutting_tool"-->
|
||||
<!-- parent="menu_sf_base"-->
|
||||
<!-- name="功能刀具"-->
|
||||
<!-- sequence="3"-->
|
||||
<!-- action="action_sf_functional_cutting_tool"-->
|
||||
<!-- />-->
|
||||
<!-- 刀具物料 -->
|
||||
<menuitem
|
||||
id="menu_sf_cutting_tool_material"
|
||||
parent="menu_sf_base"
|
||||
name="刀具物料"
|
||||
sequence="1"
|
||||
action="action_sf_cutting_tool_material"
|
||||
/>
|
||||
|
||||
|
||||
<!-- 整体式刀具 -->
|
||||
<menuitem
|
||||
id="menu_sf_integral_cutting_tool"
|
||||
parent="menu_sf_base"
|
||||
name="整体式刀具型号"
|
||||
sequence="9"
|
||||
action="action_sf_cutting_tool"
|
||||
/>
|
||||
<!-- 刀片 -->
|
||||
<menuitem
|
||||
id="menu_sf_cutting_tool_blade"
|
||||
parent="menu_sf_base"
|
||||
name="刀片型号"
|
||||
sequence="12"
|
||||
action="action_sf_cutting_tool_blade"
|
||||
/>
|
||||
<!-- 刀杆 -->
|
||||
<menuitem
|
||||
id="menu_sf_cutting_tool_rod"
|
||||
parent="menu_sf_base"
|
||||
name="刀杆型号"
|
||||
sequence="16"
|
||||
action="action_sf_cutting_tool_rod"
|
||||
/>
|
||||
<!-- 刀盘 -->
|
||||
<menuitem
|
||||
id="menu_sf_cutting_tool_disc"
|
||||
parent="menu_sf_base"
|
||||
name="刀盘型号"
|
||||
sequence="20"
|
||||
action="action_sf_cutting_tool_disc"
|
||||
/>
|
||||
<!-- 刀柄 -->
|
||||
<menuitem
|
||||
id="menu_sf_cutting_tool_handle"
|
||||
parent="menu_sf_base"
|
||||
name="刀柄型号"
|
||||
sequence="28"
|
||||
action="action_sf_cutting_tool_handle"
|
||||
/>
|
||||
<!-- 夹头 -->
|
||||
<menuitem
|
||||
id="menu_sf_cutting_tool_clamp_head"
|
||||
parent="menu_sf_base"
|
||||
name="夹头型号"
|
||||
sequence="36"
|
||||
action="action_sf_cutting_tool_clamp_head"
|
||||
/>
|
||||
<!-- 功能刀具类型 -->
|
||||
<menuitem
|
||||
id="menu_sf_functional_cutting_tool_type"
|
||||
parent="menu_sf_base"
|
||||
name="功能刀具类型"
|
||||
sequence="40"
|
||||
action="action_sf_functional_cutting_tool_type"
|
||||
/>
|
||||
<!-- 整体式刀具类型 -->
|
||||
<menuitem
|
||||
id="menu_sf_integral_cutting_tool_type"
|
||||
parent="menu_sf_base"
|
||||
name="整体式刀具类型"
|
||||
sequence="44"
|
||||
action="action_sf_integral_cutting_tool_type"
|
||||
/>
|
||||
<!-- 刀片类型 -->
|
||||
<menuitem
|
||||
id="menu_sf_cutting_tool_blade_type"
|
||||
parent="menu_sf_base"
|
||||
name="刀片类型"
|
||||
sequence="48"
|
||||
action="action_sf_cutting_tool_blade_type"
|
||||
/>
|
||||
<!-- 刀杆类型 -->
|
||||
<menuitem
|
||||
id="menu_sf_cutting_tool_rod_type"
|
||||
parent="menu_sf_base"
|
||||
name="刀杆类型"
|
||||
sequence="52"
|
||||
action="action_sf_cutting_tool_rod_type"
|
||||
/>
|
||||
<!-- 刀盘类型 -->
|
||||
<menuitem
|
||||
id="menu_sf_cutting_tool_disc_type"
|
||||
parent="menu_sf_base"
|
||||
name="刀盘类型"
|
||||
sequence="56"
|
||||
action="action_sf_cutting_tool_disc_type"
|
||||
/>
|
||||
<!-- 刀柄类型 -->
|
||||
<menuitem
|
||||
id="menu_sf_cutting_tool_handle_type"
|
||||
parent="menu_sf_base"
|
||||
name="刀柄类型"
|
||||
sequence="60"
|
||||
action="action_sf_cutting_tool_handle_type"
|
||||
/>
|
||||
<!-- 夹头类型 -->
|
||||
<menuitem
|
||||
id="menu_sf_cutting_tool_clamp_head_type"
|
||||
parent="menu_sf_base"
|
||||
name="夹头类型"
|
||||
sequence="64"
|
||||
action="action_sf_cutting_tool_clamp_head_type"
|
||||
/>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -1,849 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- 刀具物料tree view -->
|
||||
<record id="view_cutting_tool_material_tree" model="ir.ui.view">
|
||||
<field name="name">sf.cutting.tool.material.tree</field>
|
||||
<field name="model">sf.cutting.tool.material</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="刀具物料">
|
||||
<field name="code"/>
|
||||
<field name="name" string="名称"/>
|
||||
<field name="remark"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀具物料form view -->
|
||||
<record id="view_cutting_tool_material_form" model="ir.ui.view">
|
||||
<field name="name">sf.cutting.tool.material.form</field>
|
||||
<field name="model">sf.cutting.tool.material</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="刀具物料">
|
||||
<sheet>
|
||||
<group col='1'>
|
||||
<group string='基本信息'>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="name" string="名称"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- ================================================刀具物料视图================================================ -->
|
||||
<record model="ir.ui.view" id="view_cutting_tool_material_search">
|
||||
<field name="name">sf.cutting.tool.material.search</field>
|
||||
<field name="model">sf.cutting.tool.material</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="刀具物料">
|
||||
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="code" string="编码搜索" filter_domain="[('code','ilike',self)]"/>
|
||||
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 功能刀具tree view -->
|
||||
<record id="view_functional_cutting_tool_tree" model="ir.ui.view">
|
||||
<field name="name">sf.functional.cutting.tool.tree</field>
|
||||
<field name="model">sf.functional.cutting.tool</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="功能刀具">
|
||||
<field name="code" />
|
||||
<field name="name" />
|
||||
<field name="functional_model_number" />
|
||||
<field name="integral_model_number"/>
|
||||
<field name="blade_model_number" optional="hide"/>
|
||||
<field name="cutterbar_model_number" optional="hide"/>
|
||||
<field name="cutterpad_model_number" optional="hide"/>
|
||||
<field name="handle_model_number" optional="hide"/>
|
||||
<field name="chuck_model_number" optional="hide"/>
|
||||
<field name="diameter" optional="show"/>
|
||||
<field name="tool_grade" optional="show"/>
|
||||
<field name="machining_accuracy" optional="hide"/>
|
||||
<field name="tool_length" optional="show"/>
|
||||
<field name="blade_number" optional="show"/>
|
||||
<field name="integral_blade_length" optional="show"/>
|
||||
<field name="effective_blade_length" optional="show"/>
|
||||
<field name="max_life" optional="show"/>
|
||||
<field name="is_standard" optional="show"/>
|
||||
<field name="applicable_range" optional="show"/>
|
||||
<field name="image" widget='image' optional="show"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- form view -->
|
||||
<record id="view_functional_cutting_tool_form" model="ir.ui.view">
|
||||
<field name="name">sf.functional.cutting.tool.form</field>
|
||||
<field name="model">sf.functional.cutting.tool</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="功能刀具">
|
||||
<sheet>
|
||||
<group col='1'>
|
||||
<group string='基本信息'>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="functional_model_number"/>
|
||||
<field name="integral_model_number"/>
|
||||
<field name="blade_model_number"/>
|
||||
<field name="cutterbar_model_number"/>
|
||||
<field name="cutterpad_model_number"/>
|
||||
<field name="handle_model_number"/>
|
||||
<field name="chuck_model_number"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="image" nolabel="1" widget="image"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<group string='参数信息'>
|
||||
<group>
|
||||
<field name="diameter"/>
|
||||
<field name="tool_grade"/>
|
||||
<field name="machining_accuracy"/>
|
||||
<field name="tool_length"/>
|
||||
<field name="blade_number"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="integral_blade_length"/>
|
||||
<field name="effective_blade_length"/>
|
||||
<field name="max_life"/>
|
||||
<field name="is_standard"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string='其他信息'>
|
||||
<group>
|
||||
<field name="applicable_range"/>
|
||||
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 功能刀具search view -->
|
||||
<record model="ir.ui.view" id="view_sf_functional_cutting_tool_search">
|
||||
<field name="name">sf.functional.cutting.tool.search</field>
|
||||
<field name="model">sf.functional.cutting.tool</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="功能刀具">
|
||||
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="code" string="编码搜索" filter_domain="[('code','ilike',self)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 整体式刀具tree view -->
|
||||
<record id="view_integral_cutting_tool_tree" model="ir.ui.view">
|
||||
<field name="name">sf.integral.cutting.tool.tree</field>
|
||||
<field name="model">sf.integral.cutting.tool</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="整体式刀具">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="integral_model_number"/>
|
||||
<field name="brand"/>
|
||||
<field name="image" widget='image'/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- form view -->
|
||||
<record id="view_integral_cutting_tool_form" model="ir.ui.view">
|
||||
<field name="name">sf.integral.cutting.tool.form</field>
|
||||
<field name="model">sf.integral.cutting.tool</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="整体式刀具">
|
||||
<sheet>
|
||||
<group col='1'>
|
||||
<group string='基本信息'>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="integral_model_number"/>
|
||||
<field name="brand"/>
|
||||
<field name="cutting_tool_material"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="image" nolabel="1" widget="image"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<group string='参数信息'>
|
||||
<group>
|
||||
<field name="total_length"/>
|
||||
<field name="shank_length"/>
|
||||
<field name="blade_length"/>
|
||||
<field name="diameter"/>
|
||||
<field name="blade_number"/>
|
||||
<field name="chuck_model" widget="many2many_tags" options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
|
||||
</group>
|
||||
<group>
|
||||
<field name="front_angle"/>
|
||||
<field name="rear_angle"/>
|
||||
<field name="main_included_angle"/>
|
||||
<field name="material_model"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string='其他信息'>
|
||||
<group>
|
||||
<field name="nut"/>
|
||||
<field name="scope"/>
|
||||
|
||||
</group>
|
||||
|
||||
</group>
|
||||
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 整体式刀具search view -->
|
||||
<record model="ir.ui.view" id="view_integral_cutting_tool_search">
|
||||
<field name="name">sf.integral.cutting.tool.search</field>
|
||||
<field name="model">sf.integral.cutting.tool</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="整体式刀具">
|
||||
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="code" string="编码搜索" filter_domain="[('code','ilike',self)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀片tree -->
|
||||
<record id="view_blade_tree" model="ir.ui.view">
|
||||
<field name="name">sf.blade.tree</field>
|
||||
<field name="model">sf.blade</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="刀片">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="blade_model_number"/>
|
||||
<field name="image" widget='image'/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀片form -->
|
||||
<record id="view_blade_form" model="ir.ui.view">
|
||||
<field name="name">sf.blade.form</field>
|
||||
<field name="model">sf.blade</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="刀片">
|
||||
<sheet>
|
||||
<group col='1'>
|
||||
<group string='基本信息'>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="blade_model_number"/>
|
||||
<field name="brand" options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="cutting_tool_material"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="image" nolabel="1" widget="image"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<group string='参数信息'>
|
||||
<group>
|
||||
<field name="length"/>
|
||||
<field name="width"/>
|
||||
<field name="height"/>
|
||||
<field name="top_angle"/>
|
||||
<field name="front_angle"/>
|
||||
<field name="cutter_bar" widget="many2many_tags" options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="cutter_pad" widget="many2many_tags" options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="main_included_angle"/>
|
||||
<field name="r_angle"/>
|
||||
<field name="material_model"/>
|
||||
<field name="hardness"/>
|
||||
<field name="radius"/>
|
||||
<field name="rear_angle"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string='其他信息'>
|
||||
<group>
|
||||
<field name="nut"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀片search view -->
|
||||
<record model="ir.ui.view" id="view_blade_search">
|
||||
<field name="name">sf.blade.search</field>
|
||||
<field name="model">sf.blade</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="刀片">
|
||||
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="code" string="编码搜索" filter_domain="[('code','ilike',self)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀杆tree -->
|
||||
<record id="view_cutter_bar_tree" model="ir.ui.view">
|
||||
<field name="name">sf.cutter.bar.tree</field>
|
||||
<field name="model">sf.cutter.bar</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="刀杆">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="cutter_bar_model_number"/>
|
||||
<field name="image" widget='image'/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀杆form -->
|
||||
<record id="view_cutter_bar_form" model="ir.ui.view">
|
||||
<field name="name">sf.cutter.bar.form</field>
|
||||
<field name="model">sf.cutter.bar</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="刀杆">
|
||||
<sheet>
|
||||
<group col='1'>
|
||||
<group string='基本信息'>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="cutter_bar_model_number"/>
|
||||
<field name="brand"/>
|
||||
<field name="cutting_tool_material"/>
|
||||
<field name="blade" widget="many2many_tags" options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
|
||||
</group>
|
||||
<group>
|
||||
<field name="image" nolabel="1" widget="image"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<group string='参数信息'>
|
||||
<group>
|
||||
<field name="c_diameter"/>
|
||||
<field name="total_length"/>
|
||||
<field name="material_model"/>
|
||||
<field name="blade_number"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="d_diameter"/>
|
||||
<field name="radius"/>
|
||||
<field name="accuracy"/>
|
||||
<field name="hardness"/>
|
||||
|
||||
</group>
|
||||
</group>
|
||||
<group string='其他信息'>
|
||||
<group>
|
||||
<field name="wrench"/>
|
||||
<field name="screw"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="scope"/>
|
||||
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀杆search view -->
|
||||
<record model="ir.ui.view" id="view_cutter_bar_search">
|
||||
<field name="name">sf.cutter.bar.search</field>
|
||||
<field name="model">sf.cutter.bar</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="刀杆">
|
||||
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="code" string="编码搜索" filter_domain="[('code','ilike',self)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 刀盘tree -->
|
||||
<record id="view_cutter_pad_tree" model="ir.ui.view">
|
||||
<field name="name">sf.cutter.pad.tree</field>
|
||||
<field name="model">sf.cutter.pad</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="刀盘">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="cutter_pad_model_number"/>
|
||||
<field name="image" widget='image'/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀盘form -->
|
||||
<record id="view_cutter_pad_form" model="ir.ui.view">
|
||||
<field name="name">sf.cutter.pad.form</field>
|
||||
<field name="model">sf.cutter.pad</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="刀盘">
|
||||
<sheet>
|
||||
<group col='1'>
|
||||
<group string='基本信息'>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="cutter_pad_model_number"/>
|
||||
<field name="brand"/>
|
||||
<field name="cutting_tool_material"/>
|
||||
<field name="blade" widget="many2many_tags" options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
|
||||
</group>
|
||||
<group>
|
||||
<field name="image" nolabel="1" widget="image"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<group string='参数信息'>
|
||||
<group>
|
||||
<field name="c_diameter"/>
|
||||
<field name="total_length"/>
|
||||
<field name="material_model"/>
|
||||
<field name="blade_number"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="d_diameter"/>
|
||||
<field name="radius"/>
|
||||
<field name="accuracy"/>
|
||||
<field name="hardness"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string='其他信息'>
|
||||
<group>
|
||||
<field name="wrench"/>
|
||||
<field name="screw"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="scope"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀盘search view -->
|
||||
<record model="ir.ui.view" id="view_cutter_pad_search">
|
||||
<field name="name">sf.cutter.pad.search</field>
|
||||
<field name="model">sf.cutter.pad</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="刀盘">
|
||||
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="code" string="编码搜索" filter_domain="[('code','ilike',self)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 刀柄tree -->
|
||||
<record id="view_cutter_handle_tree" model="ir.ui.view">
|
||||
<field name="name">sf.cutter.handle.tree</field>
|
||||
<field name="model">sf.handle</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="刀柄">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="handle_model_number"/>
|
||||
<field name="image" widget='image'/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀柄form -->
|
||||
<record id="view_cutter_handle_form" model="ir.ui.view">
|
||||
<field name="name">sf.cutter.handle.form</field>
|
||||
<field name="model">sf.handle</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="刀柄">
|
||||
<sheet>
|
||||
<group col='1'>
|
||||
<group string='基本信息'>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="handle_model_number"/>
|
||||
<field name="brand"/>
|
||||
<field name="cutting_tool_material"/>
|
||||
<field name="chuck_model" widget="many2many_tags" options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
|
||||
</group>
|
||||
<group>
|
||||
<field name="image" nolabel="1" widget="image"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<group string='参数信息'>
|
||||
<group>
|
||||
<field name="length"/>
|
||||
<field name="length1"/>
|
||||
<field name="diameter1"/>
|
||||
<field name="weight"/>
|
||||
<field name="material_model"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="body_accuracy"/>
|
||||
<field name="clamping_range"/>
|
||||
<field name="detection_accuracy"/>
|
||||
<field name="detection_hardness"/>
|
||||
<field name="standard_speed"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string='其他信息'>
|
||||
<group>
|
||||
<field name="nut"/>
|
||||
</group>
|
||||
<!-- <group> -->
|
||||
<!-- <field name="scope"/> -->
|
||||
<!-- <field name="blade"/> -->
|
||||
<!-- </group> -->
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀柄search view -->
|
||||
<record model="ir.ui.view" id="view_handle_search">
|
||||
<field name="name">sf.handle.search</field>
|
||||
<field name="model">sf.handle</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="刀柄">
|
||||
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="code" string="编码搜索" filter_domain="[('code','ilike',self)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 夹头tree -->
|
||||
<record id="view_cutter_chuck_tree" model="ir.ui.view">
|
||||
<field name="name">sf.cutter.chuck.tree</field>
|
||||
<field name="model">sf.chuck</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="夹头">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="chuck_model_number"/>
|
||||
<field name="image" widget='image'/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 夹头form -->
|
||||
<record id="view_cutter_chuck_form" model="ir.ui.view">
|
||||
<field name="name">sf.cutter.chuck.form</field>
|
||||
<field name="model">sf.chuck</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="夹头">
|
||||
<sheet>
|
||||
<group col='1'>
|
||||
<group string='基本信息'>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="chuck_model_number"/>
|
||||
<field name="brand"/>
|
||||
<field name="cutting_tool_material"/>
|
||||
<field name="handle_model" widget="many2many_tags" options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
|
||||
</group>
|
||||
<group>
|
||||
<field name="image" nolabel="1" widget="image"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<group string='参数信息'>
|
||||
<group>
|
||||
<field name="accuracy"/>
|
||||
<field name="diameter"/>
|
||||
<field name="inner_diameter"/>
|
||||
<field name="height"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="material_model"/>
|
||||
<field name="clamping_range"/>
|
||||
<field name="feature"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string='其他信息'>
|
||||
<group>
|
||||
<field name="nut"/>
|
||||
</group>
|
||||
<!-- <group> -->
|
||||
<!-- <field name="scope"/> -->
|
||||
<!-- <field name="blade"/> -->
|
||||
<!-- </group> -->
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 夹头search view -->
|
||||
<record model="ir.ui.view" id="view_chuck_search">
|
||||
<field name="name">sf.chuck.search</field>
|
||||
<field name="model">sf.chuck</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="夹头">
|
||||
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="code" string="编码搜索" filter_domain="[('code','ilike',self)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 功能刀具类型tree -->
|
||||
<record id="view_cutter_function_tree" model="ir.ui.view">
|
||||
<field name="name">sf.cutter.function.tree</field>
|
||||
<field name="model">sf.functional.cutting.tool.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="功能刀具类型">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="remark"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 功能刀具类型form -->
|
||||
<record id="view_cutter_function_form" model="ir.ui.view">
|
||||
<field name="name">sf.cutter.function.form</field>
|
||||
<field name="model">sf.functional.cutting.tool.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="功能刀具类型">
|
||||
<sheet>
|
||||
<group string="功能刀具类型">
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 整体式刀具类型tree -->
|
||||
<record id="view_integral_cutting_tool_model_tree" model="ir.ui.view">
|
||||
<field name="name">sf.integral.cutting.tool.model.tree</field>
|
||||
<field name="model">sf.integral.cutting.tool.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="整体式刀具类型">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="remark"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 整体式刀具类型form -->
|
||||
<record id="view_integral_cutting_tool_model_form" model="ir.ui.view">
|
||||
<field name="name">sf.integral.cutting.tool.model.form</field>
|
||||
<field name="model">sf.integral.cutting.tool.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="整体式刀具类型">
|
||||
<sheet>
|
||||
<group string="整体式刀具类型">
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="cutting_tool_material"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀片类型tree -->
|
||||
<record id="view_blade_model_tree" model="ir.ui.view">
|
||||
<field name="name">sf.blade.model.tree</field>
|
||||
<field name="model">sf.blade.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="刀片类型">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="remark"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀片类型form -->
|
||||
<record id="view_blade_model_form" model="ir.ui.view">
|
||||
<field name="name">sf.blade.model.form</field>
|
||||
<field name="model">sf.blade.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="刀片类型">
|
||||
<sheet>
|
||||
<group string="刀片类型">
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="cutting_tool_material"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀杆类型tree -->
|
||||
<record id="view_cutter_bar_model_tree" model="ir.ui.view">
|
||||
<field name="name">sf.cutter.bar.model.tree</field>
|
||||
<field name="model">sf.cutter.bar.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="刀杆类型">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="remark"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀杆类型form -->
|
||||
<record id="view_cutter_bar_model_form" model="ir.ui.view">
|
||||
<field name="name">sf.cutter.bar.model.form</field>
|
||||
<field name="model">sf.cutter.bar.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="刀杆类型">
|
||||
<sheet>
|
||||
<group string="刀杆类型">
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="cutting_tool_material"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀盘类型tree -->
|
||||
<record id="view_cutter_pad_model_tree" model="ir.ui.view">
|
||||
<field name="name">sf.cutter.pad.model.tree</field>
|
||||
<field name="model">sf.cutter.pad.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="刀盘类型">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="remark"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀盘类型form -->
|
||||
<record id="view_cutter_pad_model_form" model="ir.ui.view">
|
||||
<field name="name">sf.cutter.pad.model.form</field>
|
||||
<field name="model">sf.cutter.pad.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="刀盘类型">
|
||||
<sheet>
|
||||
<group string="刀盘类型">
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="cutting_tool_material"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 刀柄类型tree -->
|
||||
<record id="view_handle_model_tree" model="ir.ui.view">
|
||||
<field name="name">sf.handle.model.tree</field>
|
||||
<field name="model">sf.handle.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="刀柄类型">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="remark"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 刀柄类型form -->
|
||||
<record id="view_handle_model_form" model="ir.ui.view">
|
||||
<field name="name">sf.handle.model.form</field>
|
||||
<field name="model">sf.handle.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="刀柄类型">
|
||||
<sheet>
|
||||
<group string="刀柄类型">
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="cutting_tool_material"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 夹头类型tree -->
|
||||
<record id="view_chuck_model_tree" model="ir.ui.view">
|
||||
<field name="name">sf.chuck.model.tree</field>
|
||||
<field name="model">sf.chuck.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="夹头类型">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="remark"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 夹头类型form -->
|
||||
<record id="view_chuck_model_form" model="ir.ui.view">
|
||||
<field name="name">sf.chuck.model.form</field>
|
||||
<field name="model">sf.chuck.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="夹头类型">
|
||||
<sheet>
|
||||
<group string="夹头类型">
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="cutting_tool_material"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
134
sf_base/views/tool_basic_param.xml
Normal file
134
sf_base/views/tool_basic_param.xml
Normal file
@@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- ================================================刀具基础参数================================================ -->
|
||||
<record id="view_sf_tool_materials_basic_parameters_integral_tree" model="ir.ui.view">
|
||||
<field name="name">sf.tool.materials.basic.parameters.tree</field>
|
||||
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="基础参数" delete="0" create="0" edit="0" sample="1">
|
||||
<field name="total_length" />
|
||||
<field name="blade_number" />
|
||||
<field name="neck_diameter"/>
|
||||
<field name="neck_length"/>
|
||||
<field name="handle_diameter" />
|
||||
<field name="handle_length" />
|
||||
<field name="blade_tip_diameter"/>
|
||||
<field name="blade_tip_working_size"/>
|
||||
<field name="blade_tip_taper" />
|
||||
<field name="blade_diameter" />
|
||||
<field name="blade_length"/>
|
||||
<field name="blade_helix_angle"/>
|
||||
<field name="blade_width" />
|
||||
<field name="blade_width" />
|
||||
<field name="pitch"/>
|
||||
<field name="cutting_depth"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_sf_tool_materials_basic_parameters_blade_tree" model="ir.ui.view">
|
||||
<field name="name">sf.tool.materials.basic.parameters.tree</field>
|
||||
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="基础参数" delete="0" create="0">
|
||||
<field name="total_length" />
|
||||
<field name="length" />
|
||||
<field name="thickness"/>
|
||||
<field name="width"/>
|
||||
<field name="cutting_blade_length" />
|
||||
<field name="relief_angle" />
|
||||
<field name="blade_tip_circular_arc_radius"/>
|
||||
<field name="inscribed_circle_diameter"/>
|
||||
<field name="install_aperture_diameter" />
|
||||
<field name="chip_breaker_groove" />
|
||||
<field name="blade_teeth_model"/>
|
||||
<field name="blade_blade_number"/>
|
||||
<field name="main_included_angle" />
|
||||
<field name="top_angle" />
|
||||
<field name="blade_tip_dip_angle"/>
|
||||
<field name="side_cutting_edge_angle"/>
|
||||
<field name="thread_model"/>
|
||||
<field name="thread_num" />
|
||||
<field name="blade_tip_height_tolerance" />
|
||||
<field name="inscribed_circle_tolerance"/>
|
||||
<field name="thickness_tolerance"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_sf_tool_materials_basic_parameters_cutter_bar_tree" model="ir.ui.view">
|
||||
<field name="name">sf.tool.materials.basic.parameters.tree</field>
|
||||
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="基础参数" delete="0" create="0">
|
||||
<field name="total_length" />
|
||||
<field name="height" />
|
||||
<field name="blade_height"/>
|
||||
<field name="cut_depth_max"/>
|
||||
<field name="cutter_arbor_diameter" />
|
||||
<field name="min_machining_aperture" />
|
||||
<field name="install_blade_tip_num"/>
|
||||
<field name="cutting_blade_model"/>
|
||||
<field name="is_cooling_hole" />
|
||||
<field name="locating_slot_code" />
|
||||
<field name="installing_structure"/>
|
||||
<field name="blade_ids"/>
|
||||
<field name="tool_shim" />
|
||||
<field name="cotter_pin" />
|
||||
<field name="pressing_plate"/>
|
||||
<field name="screw"/>
|
||||
<field name="spanner" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_sf_tool_materials_basic_parameters_tree" model="ir.ui.view">
|
||||
<field name="name">sf.tool.materials.basic.parameters.tree</field>
|
||||
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="基础参数" >
|
||||
<field name="total_length" />
|
||||
<field name="blade_number" />
|
||||
<field name="neck_diameter"/>
|
||||
<field name="neck_length"/>
|
||||
<field name="handle_diameter" />
|
||||
<field name="handle_length" />
|
||||
<field name="blade_tip_diameter"/>
|
||||
<field name="blade_tip_working_size"/>
|
||||
<field name="blade_tip_taper" />
|
||||
<field name="blade_diameter" />
|
||||
<field name="blade_length"/>
|
||||
<field name="blade_helix_angle"/>
|
||||
<field name="blade_width" />
|
||||
<field name="blade_width" />
|
||||
<field name="pitch"/>
|
||||
<field name="cutting_depth"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_sf_tool_materials_basic_parameters_search">
|
||||
<field name="name">sf.tool.materials.basic.parameters.search</field>
|
||||
<field name="model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_sf_tool_materials_basic_parameters" model="ir.actions.act_window">
|
||||
<field name="name">基础参数</field>
|
||||
<field name="res_model">sf.tool.materials.basic.parameters</field>
|
||||
<field name="view_mode">tree</field>
|
||||
|
||||
<!-- <field name="context">{'selection_mode': 'single'}</field>-->
|
||||
<field name="domain">[]</field>
|
||||
<!-- <field name="multi">false</field>-->
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -16,11 +16,11 @@
|
||||
<field name="res_model">sf.cutting.tool.type</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
<!-- 刀具型号action -->
|
||||
<record id="action_sf_cutting_tool" model="ir.actions.act_window">
|
||||
<field name="name">刀具型号</field>
|
||||
<!-- 刀具标准库action -->
|
||||
<record id="action_sf_cutting_tool_standard_library" model="ir.actions.act_window">
|
||||
<field name="name">刀具标准库</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.cutting.tool.model</field>
|
||||
<field name="res_model">sf.cutting_tool.standard.library</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<!-- 功能刀具action -->
|
||||
@@ -61,14 +61,13 @@
|
||||
sequence="2"
|
||||
action="action_sf_cutting_tool_type"
|
||||
/>
|
||||
<!-- 刀具型号 -->
|
||||
<!-- <menuitem-->
|
||||
<!-- id="menu_sf_integral_cutting_tool"-->
|
||||
<!-- parent="menu_sf_cutting_tool"-->
|
||||
<!-- name="刀具型号"-->
|
||||
<!-- sequence="3"-->
|
||||
<!-- action="action_sf_cutting_tool"-->
|
||||
<!-- />-->
|
||||
<menuitem
|
||||
id="menu_sf_cutting_tool_standard_library"
|
||||
parent="menu_sf_cutting_tool"
|
||||
name="刀具标准库"
|
||||
sequence="3"
|
||||
action="action_sf_cutting_tool_standard_library"
|
||||
/>
|
||||
<!-- 功能刀具 -->
|
||||
<!-- <menuitem-->
|
||||
<!-- id="menu_sf_functional_cutting_tool"-->
|
||||
@@ -86,5 +85,12 @@
|
||||
action="action_sf_functional_cutting_tool_model_type"
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
id="menu_sf_maintenance_equipment_image"
|
||||
name="能力特征库"
|
||||
parent="menu_sf_cutting_tool"
|
||||
action="action_maintenance_equipment_image"
|
||||
sequence="5"/>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -14,29 +14,6 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="view_cutting_tool_material_form" model="ir.ui.view">-->
|
||||
<!-- <field name="name">sf.cutting.tool.material.form</field>-->
|
||||
<!-- <field name="model">sf.cutting.tool.material</field>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <form string="刀具物料">-->
|
||||
<!-- <sheet>-->
|
||||
<!-- <group col='1'>-->
|
||||
<!-- <group string='基本信息'>-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="code"/>-->
|
||||
<!-- <field name="name"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="remark"/>-->
|
||||
<!-- </group>-->
|
||||
|
||||
<!-- </group>-->
|
||||
<!-- </group>-->
|
||||
<!-- </sheet>-->
|
||||
<!-- </form>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<record model="ir.ui.view" id="view_cutting_tool_material_search">
|
||||
<field name="name">sf.cutting.tool.material.search</field>
|
||||
<field name="model">sf.cutting.tool.material</field>
|
||||
@@ -58,13 +35,6 @@
|
||||
<field name="code"/>
|
||||
<field name="name" string="名称"/>
|
||||
<field name="mrs_cutting_tool_type_id"/>
|
||||
<!-- <field name="mrs_cutting_tool_integral_model_ids" optional="hide"/>-->
|
||||
<!-- <field name="mrs_cutting_tool_blade_model_ids" optional="hide"/>-->
|
||||
<!-- <field name="mrs_cutting_tool_cutterbar_model_ids" optional="hide"/>-->
|
||||
<!-- <field name="mrs_cutting_tool_cutterpad_model_ids" optional="hide"/>-->
|
||||
<!-- <field name="mrs_cutting_tool_cutterhandle_model_ids" optional="hide"/>-->
|
||||
<!-- <field name="mrs_cutting_tool_cutterhead_model_ids" optional="hide"/>-->
|
||||
<!-- <field name="image" widget='image'/>-->
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -83,52 +53,9 @@
|
||||
<field name="mrs_cutting_tool_type_id"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="mrs_cutting_tool_model_id"
|
||||
options="{'no_create': True, 'no_quick_create': True}"
|
||||
attrs="{'invisible': True}"/>
|
||||
<!-- <field name="mrs_cutting_tool_integral_model_ids"-->
|
||||
<!-- options="{'no_create': True, 'no_quick_create': True}"-->
|
||||
<!-- widget="many2many_tags"/>-->
|
||||
<!-- <field name="mrs_cutting_tool_blade_model_ids"-->
|
||||
<!-- options="{'no_create': True, 'no_quick_create': True}"-->
|
||||
<!-- widget="many2many_tags"/>-->
|
||||
<!-- <field name="mrs_cutting_tool_cutterbar_model_ids"-->
|
||||
<!-- options="{'no_create': True, 'no_quick_create': True}"-->
|
||||
<!-- widget="many2many_tags"/>-->
|
||||
<!-- <field name="mrs_cutting_tool_cutterpad_model_ids"-->
|
||||
<!-- options="{'no_create': True, 'no_quick_create': True}"-->
|
||||
<!-- widget="many2many_tags"/>-->
|
||||
<!-- <field name="mrs_cutting_tool_cutterhandle_model_ids"-->
|
||||
<!-- options="{'no_create': True, 'no_quick_create': True}"-->
|
||||
<!-- widget="many2many_tags"/>-->
|
||||
<!-- <field name="mrs_cutting_tool_cutterhead_model_ids"-->
|
||||
<!-- options="{'no_create': True, 'no_quick_create': True}"-->
|
||||
<!-- widget="many2many_tags"/>-->
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
</group>
|
||||
<!-- <group>-->
|
||||
<!-- <field name="image" nolabel="1" widget="image"/>-->
|
||||
<!-- </group>-->
|
||||
|
||||
</group>
|
||||
<!-- <group string='参数信息'>-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="diameter"/>-->
|
||||
<!-- <field name="tool_grade"/>-->
|
||||
<!-- <field name="machining_accuracy"/>-->
|
||||
<!-- <field name="tool_length"/>-->
|
||||
<!-- <field name="blade_number"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="integral_blade_length"/>-->
|
||||
<!-- <field name="effective_blade_length"/>-->
|
||||
<!-- <field name="max_life"/>-->
|
||||
<!-- <field name="is_standard"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- </group>-->
|
||||
<!-- <group string='其他信息'>-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="applicable_range"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- </group>-->
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
@@ -160,25 +87,6 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- <record id="view_cutter_function_form" model="ir.ui.view">-->
|
||||
<!-- <field name="name">sf.cutter.function.form</field>-->
|
||||
<!-- <field name="model">sf.functional.cutting.tool.model</field>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <form string="功能刀具类型">-->
|
||||
<!-- <sheet>-->
|
||||
<!-- <group string="功能刀具类型">-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="code"/>-->
|
||||
<!-- <field name="name"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="remark"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- </group>-->
|
||||
<!-- </sheet>-->
|
||||
<!-- </form>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<!-- 功能刀具类型搜索 -->
|
||||
<record model="ir.ui.view" id="view_cutter_function_search">
|
||||
@@ -193,130 +101,323 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ================================================刀具型号================================================ -->
|
||||
<record id="view_cutting_tool_model_tree" model="ir.ui.view">
|
||||
<field name="name">sf.cutting.tool.model.tree</field>
|
||||
<field name="model">sf.cutting.tool.model</field>
|
||||
<!-- ================================================刀具标准库================================================ -->
|
||||
<record id="view_cutting_tool_standard_library_tree" model="ir.ui.view">
|
||||
<field name="name">sf.cutting_tool.standard.library.tree</field>
|
||||
<field name="model">sf.cutting_tool.standard.library</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="刀具型号" edit="0" delete="0" create="1">
|
||||
<field name="code"/>
|
||||
<field name="name" string="名称"/>
|
||||
<tree string="刀具标准库" delete="0" create="0" edit="0">
|
||||
<field name="code" readonly="True"/>
|
||||
<field name="name" readonly="True" string="型号名称"/>
|
||||
<field name="cutting_tool_material_id"/>
|
||||
<field name="cutting_tool_type_id"/>
|
||||
<field name="brand_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_cutting_tool_model_form" model="ir.ui.view">
|
||||
<field name="name">sf.cutting.tool.model.form</field>
|
||||
<field name="model">sf.cutting.tool.model</field>
|
||||
<record id="view_cutting_tool_standard_library_form" model="ir.ui.view">
|
||||
<field name="name">sf.cutting_tool.standard.library.form</field>
|
||||
<field name="model">sf.cutting_tool.standard.library</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="刀具型号" edit="0" delete="0" create="1">
|
||||
<form string="刀具标准库" delete="0" create="0" edit="0">
|
||||
<sheet>
|
||||
<field name="image" widget='image' class="oe_avatar"
|
||||
options="{'zoom': true, 'preview_image':'image_128'}"/>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="name" placeholder="e.g. LED Monitor"/>
|
||||
<field name="code"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="code" />
|
||||
<field name="cutting_tool_material_id"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="cutting_tool_material_id"/>
|
||||
<field name="cutting_tool_type"/>
|
||||
<field name="cutting_tool_type_id"/>
|
||||
<field name="brand_id"/>
|
||||
<label for="integral_run_out_accuracy_min" string="端跳精度"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<div class="o_address_format"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
|
||||
<label for="integral_run_out_accuracy_min" string="最小"/>
|
||||
<field name="integral_run_out_accuracy_min" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
<label for="integral_run_out_accuracy_max" string="最大"/>
|
||||
<field name="integral_run_out_accuracy_max" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
</div>
|
||||
<field name="cutter_bar_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}" search="[]"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutter_pad_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}" search="[]"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="material_model_id" placeholder="请选择" string="材质"
|
||||
attrs="{'required': [('cutting_tool_type', 'not in', ['刀柄', '夹头'])]}"/>
|
||||
<field name="tool_hardness" string="硬度(hrc)" options="{'format': false}"
|
||||
widget="integer"/>
|
||||
<field name="coating_material"/>
|
||||
<field name="blade_type"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_coarse_medium_fine" placeholder="请选择"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="适配刀片形状"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'in', ('刀柄','夹头','整体式刀具',False))]}">
|
||||
<field name="fit_blade_shape_id" string="" widget="many2one_radio"/>
|
||||
</group>
|
||||
<group string="适合加工方式"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||
<field name="suitable_machining_method_ids" string=""
|
||||
widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
<group string="刀尖特征"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||
<field name="blade_tip_characteristics_id" string=""
|
||||
widget="many2one_radio"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||
<group string="柄部类型" attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
|
||||
<field name="handle_type_id" string="" widget="many2one_radio"/>
|
||||
</group>
|
||||
<group string="压紧方式"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}">
|
||||
<field name="compaction_way_id" string="" widget="many2one_radio"/>
|
||||
</group>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||
<group string="走刀方向">
|
||||
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
<group string="适合冷却液">
|
||||
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
<!-- <group>-->
|
||||
<!-- <field name="image" nolabel="1" widget="image"/>-->
|
||||
<!-- </group>-->
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="参数"
|
||||
attrs="{'invisible': [('cutting_tool_type', '=', False)]}">
|
||||
<group>
|
||||
<!--整体式刀具-->
|
||||
<group>
|
||||
<field name="brand_id"/>
|
||||
<field name="cutting_tool_type_id" />
|
||||
<field name="material_model_id"/>
|
||||
<field name="total_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀柄'))]}"/>
|
||||
<field name="shank_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="blade_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<page string="基本参数">
|
||||
<field name="integral_tool_basic_parameters_ids" import_button="true"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
|
||||
<tree editable="bottom" class="center" delete="1">
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="total_length"/>
|
||||
<field name="blade_diameter" class="diameter"/>
|
||||
<field name="blade_length"/>
|
||||
<field name="blade_number" placeholder="请选择"/>
|
||||
<field name="neck_length"/>
|
||||
<field name="neck_diameter" class="diameter"/>
|
||||
<field name="handle_diameter" class="diameter"/>
|
||||
<field name="handle_length"/>
|
||||
<field name="blade_tip_working_size" class="du"/>
|
||||
<field name="blade_tip_diameter" class="diameter"/>
|
||||
<field name="blade_tip_taper" class="du"/>
|
||||
<field name="blade_helix_angle" class="du"/>
|
||||
<field name="pitch"/>
|
||||
<field name="blade_width"/>
|
||||
<field name="blade_depth"/>
|
||||
<field name="cutting_depth"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
<!--刀片-->
|
||||
<label for="tool_length" string="尺寸(mm)"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("刀片","刀杆","刀盘"))]}'/>
|
||||
<div class="test_model"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("刀片","刀杆","刀盘"))]}'>
|
||||
<label for="tool_length" string="长"/>
|
||||
<field name="tool_length" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="tool_width" string="宽"/>
|
||||
<field name="tool_width" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="tool_thickness" string="厚"/>
|
||||
<field name="tool_thickness" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片','刀杆','刀盘'))]}"/>
|
||||
<field name="blade_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="blade_number"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片','刀杆','刀盘'))]}"/>
|
||||
<field name="diameter_max"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="flange_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="flange_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<!--夹头-->
|
||||
<field name="outer_diameter"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<field name="inner_diameter"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<field name="tool_height"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<field name="tool_weight"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("夹头","刀柄"))]}'/>
|
||||
<field name="clamping_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头','刀柄'))]}"/>
|
||||
<field name="cutter_bar_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutter_pad_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="blade_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="chuck_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀柄'))]}"/>
|
||||
<field name="handle_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头'))]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="jump_accuracy"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="front_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
<field name="top_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
<field name="rear_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
<field name="main_included_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
<field name="coating_material"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
<field name="accuracy_level"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'in', ('刀柄'))]}"/>
|
||||
<field name="working_hardness"/>
|
||||
<field name="wrench"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头','刀柄','刀杆','刀盘' ))]}"/>
|
||||
<field name="screw"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头','刀柄'))]}"/>
|
||||
<field name="nut"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<field name="blade_basic_parameters_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}">
|
||||
<tree editable="bottom" class="center" delete="1">
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="length"/>
|
||||
<field name="thickness"/>
|
||||
<field name="width"/>
|
||||
<field name="cutting_blade_length"/>
|
||||
<field name="relief_angle" class="du"/>
|
||||
<field name="blade_tip_circular_arc_radius"/>
|
||||
<field name="inscribed_circle_diameter" class="diameter"/>
|
||||
<field name="install_aperture_diameter" class="diameter"/>
|
||||
<field name="pitch"/>
|
||||
<field name="chip_breaker_groove" placeholder="请选择"/>
|
||||
<field name="blade_teeth_model" placeholder="请选择"/>
|
||||
<field name="cutting_depth" string="最大切削深度(mm)"/>
|
||||
<field name="blade_blade_number" string="刃数(个)"/>
|
||||
<field name="blade_width" string="刃宽(mm)"/>
|
||||
<field name="main_included_angle"/>
|
||||
<field name="top_angle"/>
|
||||
<field name="blade_tip_dip_angle"/>
|
||||
<field name="side_cutting_edge_angle"/>
|
||||
<field name="thread_model" placeholder="请选择"/>
|
||||
<field name="thread_num"/>
|
||||
<field name="blade_tip_height_tolerance"/>
|
||||
<field name="inscribed_circle_tolerance"/>
|
||||
<field name="thickness_tolerance"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="cutter_bar_basic_parameters_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}">
|
||||
<tree editable="bottom" class="center" delete="1">
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="height"/>
|
||||
<field name="width"/>
|
||||
<field name="total_length"/>
|
||||
<field name="blade_height"/>
|
||||
<field name="blade_width"/>
|
||||
<field name="blade_length"/>
|
||||
<field name="blade_diameter" class="diameter"/>
|
||||
<field name="cutter_arbor_diameter" class="diameter"/>
|
||||
<field name="main_included_angle" class="du"/>
|
||||
<field name="relief_angle" class="du"/>
|
||||
<field name="cutting_depth" string="最大切削深度(mm)"/>
|
||||
<field name="min_machining_aperture" class="diameter"/>
|
||||
<field name="install_blade_tip_num"/>
|
||||
<field name="cutting_blade_model"/>
|
||||
<field name="is_cooling_hole" />
|
||||
<field name="locating_slot_code"/>
|
||||
<field name="installing_structure"/>
|
||||
<field name="blade_ids" widget="many2many_tags" placeholder="请选择"/>
|
||||
<field name="tool_shim"/>
|
||||
<field name="cotter_pin"/>
|
||||
<field name="pressing_plate"/>
|
||||
<field name="screw"/>
|
||||
<field name="spanner"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
<field name="cutter_head_basic_parameters_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}">
|
||||
<tree editable="bottom" class="center" delete="1">
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="install_blade_tip_num"/>
|
||||
<field name="blade_diameter" class="diameter"/>
|
||||
<field name="cutter_head_diameter" class="diameter"/>
|
||||
<field name="interface_diameter" class="diameter"/>
|
||||
<field name="total_length"/>
|
||||
<field name="blade_length"/>
|
||||
<field name="cutting_depth" string="最大切削深度(mm)"/>
|
||||
<field name="main_included_angle" class="du"/>
|
||||
<field name="installing_structure"/>
|
||||
<field name="blade_ids" widget="many2many_tags" placeholder="请选择"/>
|
||||
<field name="screw"/>
|
||||
<field name="spanner"/>
|
||||
<field name="cutting_blade_model"/>
|
||||
<field name="is_cooling_hole" />
|
||||
<field name="locating_slot_code"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
<field name="knife_handle_basic_parameters_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}">
|
||||
<tree editable="bottom" class="center" delete="1">
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="total_length"/>
|
||||
<field name="flange_shank_length"/>
|
||||
<field name="handle_external_diameter" class="diameter"/>
|
||||
<field name="handle_inside_diameter" class="diameter"/>
|
||||
<field name="min_clamping_diameter" class="diameter"/>
|
||||
<field name="max_clamping_diameter" class="diameter"/>
|
||||
<field name="clamping_mode"/>
|
||||
<field name="max_load_capacity"/>
|
||||
<field name="taper" class="du"/>
|
||||
<field name="tool_changing_time"/>
|
||||
<field name="standard_rotate_speed"/>
|
||||
<field name="max_rotate_speed"/>
|
||||
<field name="diameter_slip_accuracy"/>
|
||||
<field name="cooling_model"/>
|
||||
<field name="is_rough_machining" />
|
||||
<field name="is_finish_machining" />
|
||||
<field name="is_quick_cutting" />
|
||||
<field name="is_drill_hole" />
|
||||
<field name="is_safe_lock" />
|
||||
<field name="screw"/>
|
||||
<field name="spanner"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="chuck_basic_parameters_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}">
|
||||
<tree editable="bottom" class="center" delete="1">
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="er_size_model"/>
|
||||
<field name="min_clamping_diameter" class="diameter" required="1"/>
|
||||
<field name="max_clamping_diameter" class="diameter"/>
|
||||
<field name="outer_diameter" class="diameter"/>
|
||||
<field name="inner_diameter" class="diameter"/>
|
||||
<field name="total_length"/>
|
||||
<field name="taper" class="du"/>
|
||||
<field name="run_out_accuracy"/>
|
||||
<field name="top_diameter" class="diameter"/>
|
||||
<field name="weight"/>
|
||||
<field name="clamping_mode"/>
|
||||
<field name="clamping_length"/>
|
||||
<field name="clamping_tolerance"/>
|
||||
<field name="max_load_capacity"/>
|
||||
<field name="handle_ids" widget="many2many_tags" placeholder="请选择"/>
|
||||
<field name="cooling_jacket"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="切削速度Vc"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}">
|
||||
<field name="cutting_speed_ids">
|
||||
<tree editable="bottom" class="center" delete="1">
|
||||
<field name="execution_standard_id" placeholder="请选择" required="1"/>
|
||||
<field name="material_code" readonly="1"/>
|
||||
<field name="material_id" placeholder="请选择"
|
||||
attrs="{'readonly': [('execution_standard_id', '=', False)], 'required': [('execution_standard_id', '!=', False)]}"/>
|
||||
<field name="material_grade" readonly="1"/>
|
||||
<field name="tensile_strength" readonly="1"/>
|
||||
<field name="hardness" readonly="1"/>
|
||||
<field name="slope_milling_angle" widget="du"/>
|
||||
<field name="cutting_speed_n1"/>
|
||||
<field name="cutting_speed_n2"/>
|
||||
<field name="cutting_speed_n3"/>
|
||||
<field name="cutting_speed_n4"/>
|
||||
<field name="cutting_speed_n5"/>
|
||||
<field name="rough_machining"/>
|
||||
<field name="precision_machining"/>
|
||||
<field name="application" placeholder="请选择" required="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="每齿走刀量fz"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}">
|
||||
<field name="feed_per_tooth_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具'))]}">
|
||||
<tree editable="bottom" class="center" create="0" delete="0">
|
||||
<field name="cutting_speed"/>
|
||||
<field name="blade_diameter"/>
|
||||
<field name="feed_per_tooth" required="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="feed_per_tooth_ids_2"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具'))]}">
|
||||
<tree editable="bottom" class="center" create="0" delete="0">
|
||||
<field name="machining_method"/>
|
||||
<field name="materials_type_id"/>
|
||||
<field name="blade_diameter"/>
|
||||
<field name="feed_per_tooth" required="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="feed_per_tooth_ids_3"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}">
|
||||
<tree editable="bottom" class="center" create="0" delete="0">
|
||||
<field name="cutting_speed"/>
|
||||
<field name="feed_per_tooth" required="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="feed_per_tooth_ids_4"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}">
|
||||
<tree editable="bottom" class="center" create="0" delete="0">
|
||||
<field name="machining_method"/>
|
||||
<field name="materials_type_id"/>
|
||||
<field name="feed_per_tooth" required="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
@@ -324,17 +425,16 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 刀具型号搜索 -->
|
||||
<record id="view_cutting_tool_model_search" model="ir.ui.view">
|
||||
<field name="name">sf.cutting.tool.model.search</field>
|
||||
<field name="model">sf.cutting.tool.model</field>
|
||||
<record id="view_cutting_tool_standard_library_search" model="ir.ui.view">
|
||||
<field name="name">sf.cutting_tool.standard.library.search</field>
|
||||
<field name="model">sf.cutting_tool.standard.library</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="刀具型号">
|
||||
<search string="刀具标准库">
|
||||
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="code" string="编码搜索" filter_domain="[('code','ilike',self)]"/>
|
||||
<filter name="filter_active" string="已归档" domain="[('active','=',False)]"/>
|
||||
<searchpanel class="account_root">
|
||||
<field name="cutting_tool_material_id" icon="fa-filter"/>
|
||||
<field name="cutting_tool_material_id" icon="fa-filter" enable_counters="1"/>
|
||||
</searchpanel>
|
||||
</search>
|
||||
</field>
|
||||
@@ -355,27 +455,6 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="view_cutting_tool_type_form" model="ir.ui.view">-->
|
||||
<!-- <field name="name">sf.cutting.tool.type.form</field>-->
|
||||
<!-- <field name="model">sf.cutting.tool.type</field>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <form string="刀具类型">-->
|
||||
<!-- <sheet>-->
|
||||
<!-- <group string="刀具类型">-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="code"/>-->
|
||||
<!-- <field name="name"/>-->
|
||||
<!-- <field name="mrs_cutting_tool_material_id" options="{'no_create': True, 'no_quick_create': True}"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="remark"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- </group>-->
|
||||
<!-- </sheet>-->
|
||||
<!-- </form>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<!-- 刀具类型搜索 -->
|
||||
<record id="view_cutting_tool_type_search" model="ir.ui.view">
|
||||
<field name="name">sf.cutting.tool.type.search</field>
|
||||
@@ -391,6 +470,72 @@
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
||||
<!-- ================================================能力特征库================================================ -->
|
||||
<record id="view_maintenance_equipment_image_tree" model="ir.ui.view">
|
||||
<field name="name">maintenance.equipment.image.tree</field>
|
||||
<field name="model">maintenance.equipment.image</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="能力特征库" editable="bottom" delete="0" create="0">
|
||||
<field name="name" readonly="1"/>
|
||||
<field name="type" readonly="1"/>
|
||||
<field name="image" widget="custom_image" readonly="1"/>
|
||||
<field name="equipment_id"/>
|
||||
<field name="active" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_maintenance_equipment_image_search">
|
||||
<field name="name">maintenance.equipment.image.search</field>
|
||||
<field name="model">maintenance.equipment.image</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name"/>
|
||||
<searchpanel class="account_root">
|
||||
<field name="type" icon="fa-filter" enable_counters="1"/>
|
||||
</searchpanel>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_maintenance_equipment_image" model="ir.actions.act_window">
|
||||
<field name="name">能力特征库</field>
|
||||
<field name="res_model">maintenance.equipment.image</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="domain">[]</field>
|
||||
</record>
|
||||
|
||||
<!-- ================================================刀具基础参数================================================ -->
|
||||
<!-- <record id="view_sf_tool_materials_basic_parameters_tree" model="ir.ui.view">-->
|
||||
<!-- <field name="name">sf.tool.materials.basic.parameters.tree</field>-->
|
||||
<!-- <field name="model">sf.tool.materials.basic.parameters</field>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <tree string="基础参数" delete="0" create="0">-->
|
||||
<!-- <field name="total_length" />-->
|
||||
<!-- <field name="blade_number" />-->
|
||||
<!-- <field name="neck_diameter"/>-->
|
||||
<!-- <field name="neck_length"/>-->
|
||||
<!-- <field name="handle_diameter" />-->
|
||||
<!-- <field name="handle_length" />-->
|
||||
<!-- <field name="blade_tip_diameter"/>-->
|
||||
<!-- <field name="blade_tip_working_size"/>-->
|
||||
<!-- <field name="blade_tip_taper" />-->
|
||||
<!-- <field name="blade_diameter" />-->
|
||||
<!-- <field name="blade_length"/>-->
|
||||
<!-- <field name="blade_helix_angle"/>-->
|
||||
<!-- <field name="blade_width" />-->
|
||||
<!-- <field name="blade_width" />-->
|
||||
<!-- <field name="pitch"/>-->
|
||||
<!-- <field name="cutting_depth"/>-->
|
||||
<!-- </tree>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*-coding:utf-8-*-
|
||||
from . import controllers
|
||||
from . import models
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.cs.jikimo.com',
|
||||
'depends': ['sf_base'],
|
||||
'depends': ['sf_base', 'delivery'],
|
||||
'data': [
|
||||
'views/res_partner_view.xml',
|
||||
# 'views/view.xml',
|
||||
'views/view.xml',
|
||||
'report/bill_report.xml',
|
||||
],
|
||||
'demo': [
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
from .import controllers
|
||||
|
||||
from . import controllers
|
||||
|
||||
@@ -59,7 +59,7 @@ class Sf_Bf_Connect(http.Controller):
|
||||
self_machining_bom_line = self_machining_bom.with_user(
|
||||
request.env.ref("base.user_admin")).bom_create_line(
|
||||
self_machining_embryo)
|
||||
if self_machining_bom_line == False:
|
||||
if not self_machining_bom_line:
|
||||
res['status'] = 2
|
||||
res['message'] = '该订单模型的材料型号在您分配的工厂里暂未有原材料,请先配置再进行分配'
|
||||
request.cr.rollback()
|
||||
@@ -84,7 +84,7 @@ class Sf_Bf_Connect(http.Controller):
|
||||
# 创建坯料的bom的组件
|
||||
outsource_bom_line = outsource_bom.with_user(
|
||||
request.env.ref("base.user_admin")).bom_create_line(outsource_embryo)
|
||||
if outsource_bom_line == False:
|
||||
if not outsource_bom_line:
|
||||
res['status'] = 2
|
||||
res['message'] = '该订单模型的材料型号在您分配的工厂里暂未有原材料,请先配置再进行分配'
|
||||
request.cr.rollback()
|
||||
|
||||
@@ -2,4 +2,3 @@ from . import http
|
||||
from . import models
|
||||
from . import process_status
|
||||
from . import jd_eclp
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#import cpca
|
||||
import logging
|
||||
import base64
|
||||
import requests
|
||||
import logging
|
||||
from datetime import datetime
|
||||
from odoo.exceptions import UserError
|
||||
import requests
|
||||
import cpca
|
||||
# from odoo.exceptions import UserError
|
||||
# from odoo.exceptions import ValidationError
|
||||
from odoo import api, fields, models
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -37,53 +38,73 @@ class JdEclp(models.Model):
|
||||
deliveryType = fields.Selection([('6', '特快零担'), ('25', '特快重货')], string='运输类型', default='25')
|
||||
# bill = fields.Char(string='物流面单')
|
||||
|
||||
# bill = fields.Many2one('ir.attachment', string='物流面单', compute='query_bill_pdf')
|
||||
# bill = fields.Many2one('ir.attachment', string='物流面单', compute='query_bill_pdf')
|
||||
# bill_show = fields.Binary(string='物流面单展示', readonly=True, related='self.bill.datas')
|
||||
bill_show = fields.Binary(string='物流面单展示', readonly=True)
|
||||
check_out = fields.Char(string='查询是否为出库单', compute='_check_is_out')
|
||||
|
||||
@api.depends('name')
|
||||
def _check_is_out(self):
|
||||
"""
|
||||
判断是否为出库单
|
||||
"""
|
||||
if self.name:
|
||||
is_check_out = self.name.split('/')
|
||||
self.check_out = is_check_out[1]
|
||||
|
||||
@api.depends('carrier_tracking_ref')
|
||||
def query_bill_pdf(self):
|
||||
"""
|
||||
查询物流面单,并赋值给bill
|
||||
"""
|
||||
self.bill = self.env['ir.attachment'].sudo().search([('name', '=', self.carrier_tracking_ref)])
|
||||
|
||||
@api.depends('origin')
|
||||
def _truck_info(self):
|
||||
"""
|
||||
根据销售订单号,获取收货人信息
|
||||
"""
|
||||
# if 'S' in self.origin:
|
||||
# if self.receiverName and self.receiverMobile and self.receiverProvinceName and self.receiverCityName and self.receiverCountyName and self.receiverTownName:
|
||||
# if self.receiverName and self.receiverMobile and self.receiverProvinceName and self.receiverCityName and
|
||||
# self.receiverCountyName and self.receiverTownName:
|
||||
sale_order_id = self.env['sale.order'].search([('name', '=', self.origin)])
|
||||
# stock_picking_type_id = self.enc['stock.picking.type'].search([('picking_type_id', '=', '')])
|
||||
# if sale_order_id.address_of_delivery != False:
|
||||
# stock_picking_type_id = self.enc['stock.picking.type'].search([('picking_type_id', '=', '')])
|
||||
# if sale_order_id.address_of_delivery != False:
|
||||
# if not sale_order_id:
|
||||
# raise ValidationError("找不到对应的销售订单")
|
||||
try:
|
||||
if 'OUT' in self.name:
|
||||
raw_addres = sale_order_id.address_of_delivery.split('这是一个标志位,用来不分隔字符串')
|
||||
# _logger.info('=================dddd====', sale_order_id.address_of_delivery)
|
||||
# _logger.info('========================================', raw_addres)
|
||||
# _logger.info('=================dddd====', self.display_name)
|
||||
# _logger.info('=================dddd====', type(self.display_name))
|
||||
# # _logger.info(self.receiverName, self.receiverMobile)
|
||||
# _logger.info(1111111111111111111111111111111111111111111111)
|
||||
self.receiverName = sale_order_id.person_of_delivery
|
||||
self.receiverMobile = sale_order_id.telephone_of_delivery
|
||||
self.receiverProvinceName = cpca.transform(raw_addres).values.tolist()[0][0]
|
||||
self.receiverCityName = cpca.transform(raw_addres).values.tolist()[0][1]
|
||||
self.receiverCountyName = cpca.transform(raw_addres).values.tolist()[0][2]
|
||||
self.receiverTownName = cpca.transform(raw_addres).values.tolist()[0][3]
|
||||
if 'OUT' in self.name and sale_order_id.address_of_delivery:
|
||||
raw_address = sale_order_id.address_of_delivery.split('这是一个标志位,用来不分隔字符串')
|
||||
if sale_order_id.person_of_delivery:
|
||||
self.receiverName = sale_order_id.person_of_delivery
|
||||
if sale_order_id.telephone_of_delivery:
|
||||
self.receiverMobile = sale_order_id.telephone_of_delivery
|
||||
if raw_address:
|
||||
self.receiverProvinceName = cpca.transform(raw_address).values.tolist()[0][0]
|
||||
self.receiverCityName = cpca.transform(raw_address).values.tolist()[0][1]
|
||||
self.receiverCountyName = cpca.transform(raw_address).values.tolist()[0][2]
|
||||
self.receiverTownName = cpca.transform(raw_address).values.tolist()[0][3]
|
||||
else:
|
||||
self.receiverName = self.receiverName
|
||||
self.receiverMobile = self.receiverMobile
|
||||
self.receiverProvinceName = self.receiverProvinceName
|
||||
self.receiverCityName = self.receiverCityName
|
||||
self.receiverCountyName = self.receiverCountyName
|
||||
self.receiverTownName = self.receiverTownName
|
||||
self.receiverName = False
|
||||
self.receiverMobile = False
|
||||
self.receiverProvinceName = False
|
||||
self.receiverCityName = False
|
||||
self.receiverCountyName = False
|
||||
self.receiverTownName = False
|
||||
except Exception as e:
|
||||
print(f"Error address is none: {e}")
|
||||
pass
|
||||
|
||||
|
||||
raise ValidationError(f"传值有误: {e}")
|
||||
|
||||
def create_order(self):
|
||||
"""
|
||||
创建订单
|
||||
"""
|
||||
if not self.receiverName or not self.receiverMobile or not self.receiverProvinceName \
|
||||
or not self.receiverCityName or not self.receiverCountyName or not self.receiverTownName:
|
||||
raise ValidationError("当前销售订单缺失收货人信息,补充后才可发起物流!")
|
||||
# sale_order_id = self.env['sale.order'].search([('name', '=', self.origin)])
|
||||
|
||||
# if self.carrier_id == '京东物流':
|
||||
config = self.env['res.config.settings'].get_values()
|
||||
createTime = str(datetime.now())
|
||||
json1 = {
|
||||
'params': {
|
||||
@@ -107,7 +128,7 @@ class JdEclp(models.Model):
|
||||
},
|
||||
}
|
||||
_logger.info('准备调接口1')
|
||||
url1 = 'https://bfm.cs.jikimo.com/api/create/jd/order'
|
||||
url1 = config['bfm_url'] + '/api/create/jd/order'
|
||||
requests.post(url1, json=json1, data=None)
|
||||
_logger.info('调用成功1')
|
||||
_logger.info('准备调接口2')
|
||||
@@ -116,7 +137,7 @@ class JdEclp(models.Model):
|
||||
'orderNo': self.origin,
|
||||
},
|
||||
}
|
||||
url2 = 'https://bfm.cs.jikimo.com/api/get/jd/no'
|
||||
url2 = config['bfm_url'] + '/api/get/jd/no'
|
||||
response = requests.post(url2, json=json2, data=None)
|
||||
# _logger.info('调用成功2', response.json()['result']['wbNo'])
|
||||
self.carrier_tracking_ref = response.json()['result']['wbNo']
|
||||
@@ -125,12 +146,18 @@ class JdEclp(models.Model):
|
||||
# raise UserError("选择京东物流才能下单呦")
|
||||
|
||||
def get_bill(self):
|
||||
"""
|
||||
获取物流面单
|
||||
"""
|
||||
if not self.carrier_tracking_ref:
|
||||
raise ValidationError("未下物流单,请先点击京东物流下单按钮!")
|
||||
config = self.env['res.config.settings'].get_values()
|
||||
json1 = {
|
||||
'params': {
|
||||
'no': self.origin,
|
||||
},
|
||||
}
|
||||
url1 = 'https://bfm.cs.jikimo.com/api/create/jd/bill'
|
||||
url1 = config['bfm_url'] + '/api/create/jd/bill'
|
||||
response = requests.post(url1, json=json1, data=None)
|
||||
# _logger.info('调用成功2', response.json())
|
||||
|
||||
@@ -153,5 +180,3 @@ class JdEclp(models.Model):
|
||||
# 'model_name': 'stock.picking',
|
||||
})
|
||||
_logger.info(attachment)
|
||||
# _logger.info(attachment.datas)
|
||||
# _logger.info(attachment.datas_fname)
|
||||
|
||||
@@ -4,7 +4,6 @@ import uuid
|
||||
import string
|
||||
import random
|
||||
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
__author__ = 'jinling.yang'
|
||||
@@ -25,4 +24,4 @@ class ResPartner(models.Model):
|
||||
return ran_str
|
||||
|
||||
sf_token = fields.Char(u'Token', default=get_token)
|
||||
sf_secret_key = fields.Char(u'密钥', default=get_secret)
|
||||
sf_secret_key = fields.Char(u'密钥', default=get_secret)
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
||||
from odoo.exceptions import ValidationError
|
||||
from collections import defaultdict, namedtuple
|
||||
from datetime import datetime
|
||||
import logging
|
||||
from odoo.exceptions import UserError
|
||||
import requests
|
||||
from odoo import fields, models
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -33,8 +30,8 @@ class StatusChange(models.Model):
|
||||
'process_start_time': process_start_time,
|
||||
},
|
||||
}
|
||||
# url1 = config['bfm_url'] + '/api/get/state/get_order'
|
||||
# requests.post(url1, json=json1, data=None)
|
||||
url1 = config['bfm_url'] + '/api/get/state/get_order'
|
||||
requests.post(url1, json=json1, data=None)
|
||||
logging.info('接口已经执行=============')
|
||||
|
||||
return res
|
||||
@@ -57,8 +54,8 @@ class StatusChange(models.Model):
|
||||
'state': '待派单',
|
||||
},
|
||||
}
|
||||
# url1 = config['bfm_url'] + '/api/get/state/cancel_order'
|
||||
# requests.post(url1, json=json1, data=None)
|
||||
url1 = config['bfm_url'] + '/api/get/state/cancel_order'
|
||||
requests.post(url1, json=json1, data=None)
|
||||
|
||||
return res
|
||||
|
||||
@@ -105,7 +102,6 @@ class StatusChange(models.Model):
|
||||
#
|
||||
# return True
|
||||
|
||||
|
||||
# def action_cancel(self):
|
||||
# """ Cancel SO after showing the cancel wizard when needed. (cfr `_show_cancel_wizard`)
|
||||
#
|
||||
@@ -198,24 +194,25 @@ class FinishStatusChange(models.Model):
|
||||
if self.user_has_groups('stock.group_reception_report') \
|
||||
and self.picking_type_id.auto_show_reception_report:
|
||||
lines = self.move_ids.filtered(lambda
|
||||
m: m.product_id.type == 'product' and m.state != 'cancel' and m.quantity_done and not m.move_dest_ids)
|
||||
m: m.product_id.type == 'product' and m.state != 'cancel'
|
||||
and m.quantity_done and not m.move_dest_ids)
|
||||
if lines:
|
||||
# don't show reception report if all already assigned/nothing to assign
|
||||
wh_location_ids = self.env['stock.location']._search(
|
||||
[('id', 'child_of', self.picking_type_id.warehouse_id.view_location_id.id),
|
||||
('usage', '!=', 'supplier')])
|
||||
if self.env['stock.move'].search([
|
||||
('state', 'in', ['confirmed', 'partially_available', 'waiting', 'assigned']),
|
||||
('product_qty', '>', 0),
|
||||
('location_id', 'in', wh_location_ids),
|
||||
('move_orig_ids', '=', False),
|
||||
('picking_id', 'not in', self.ids),
|
||||
('product_id', 'in', lines.product_id.ids)], limit=1):
|
||||
('state', 'in', ['confirmed', 'partially_available', 'waiting', 'assigned']),
|
||||
('product_qty', '>', 0),
|
||||
('location_id', 'in', wh_location_ids),
|
||||
('move_orig_ids', '=', False),
|
||||
('picking_id', 'not in', self.ids),
|
||||
('product_id', 'in', lines.product_id.ids)], limit=1):
|
||||
action = self.action_view_reception_report()
|
||||
action['context'] = {'default_picking_ids': self.ids}
|
||||
return action
|
||||
|
||||
out_start_time = str(datetime.now())
|
||||
# out_start_time = str(datetime.now())
|
||||
json2 = {
|
||||
'params': {
|
||||
'model_name': 'jikimo.process.order',
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
|
||||
<record id="add_check_out_view_picking_form" model="ir.ui.view">
|
||||
<field name="name">增加一个check_out字段</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//form//sheet//div[@name='button_box']" position="inside">
|
||||
<field name="check_out" invisible="True"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="custom_view_picking_form" model="ir.ui.view">
|
||||
<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//header//button[@name='action_assign']" position="after">
|
||||
<button string="京东物流下单" name="create_order" type="object" confirm="是否确认物流下单" class="btn-primary"
|
||||
attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<button string="获取物流面单" name="get_bill" type="object" confirm="是否获取物流面单" class="btn-primary"
|
||||
attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="tracking_view" model="ir.ui.view">
|
||||
<field name="name">tracking</field>
|
||||
<field name="model">stock.picking</field>
|
||||
@@ -7,45 +33,33 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group//field[@name='carrier_id']" position="after">
|
||||
<!-- <field name="senderNickName" domain="[('self.name', 'like', '%OUT%')]"/> -->
|
||||
<field name="senderNickName" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
||||
<field name="expressItemName" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
||||
<field name="deliveryType" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
||||
<field name="receiverName" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
||||
<field name="receiverMobile" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
||||
<field name="receiverProvinceName" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
||||
<field name="receiverCityName" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
||||
<field name="receiverCountyName" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
||||
<field name="receiverTownName" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
||||
<field name="receiverCompany" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
||||
<field name="remark" attrs="{'invisible': [('name', 'like', '%OUT%')]}"/>
|
||||
<field name="grossWeight"/>
|
||||
<field name="grossVolume"/>
|
||||
<field name="pickupBeginTime"/>
|
||||
<field name="bill"/>
|
||||
|
||||
<field name="senderNickName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="expressItemName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="deliveryType" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="receiverName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="receiverMobile" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="receiverProvinceName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="receiverCityName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="receiverCountyName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="receiverTownName" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="receiverCompany" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="remark" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="grossWeight" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="grossVolume" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="pickupBeginTime" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
<field name="bill_show" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
</xpath>
|
||||
<xpath expr="//group//field[@name='group_id']" position="after">
|
||||
<field name="bill_show" widget="pdf_viewer"/>
|
||||
|
||||
<field name="bill_show" widget="pdf_viewer" attrs="{'invisible': [('check_out', '!=', 'OUT')]}"/>
|
||||
</xpath>
|
||||
<xpath expr="//group[@name='other_infos']" position="after">
|
||||
<!-- <group>-->
|
||||
<div>
|
||||
<button string="京东物流下单" name="create_order" type="object" confirm="是否确认物流下单" class="btn-primary"/>
|
||||
</div>
|
||||
|
||||
<!-- </group>-->
|
||||
<!-- <group>-->
|
||||
<div>
|
||||
<button string="获取物流面单" name="get_bill" type="object" confirm="是否获取物流面单" class="btn-primary"/>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- </group>-->
|
||||
|
||||
</xpath>
|
||||
|
||||
|
||||
<!-- <xpath expr="//group[@name='other_infos']" position="after"> -->
|
||||
<!-- <div> -->
|
||||
<!-- <button string="京东物流下单" name="create_order" type="object" confirm="是否确认物流下单" class="btn-primary"/> -->
|
||||
<!-- </div> -->
|
||||
<!-- <div> -->
|
||||
<!-- <button string="获取物流面单" name="get_bill" type="object" confirm="是否获取物流面单" class="btn-primary"/> -->
|
||||
<!-- </div> -->
|
||||
<!-- </xpath> -->
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -1 +1 @@
|
||||
# from . import models
|
||||
from . import models
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
{
|
||||
'name': '机企猫智能工厂 产品管理',
|
||||
'name': '机企猫智能工厂 产品',
|
||||
'version': '1.0',
|
||||
'summary': '智能工厂产品模块',
|
||||
'sequence': 1,
|
||||
@@ -10,13 +10,12 @@
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['mrp', 'base', 'sale', 'sf_manufacturing', 'web_widget_model_viewer', 'mrp_subcontracting', 'purchase_stock',
|
||||
'uom','jikimo_frontend'],
|
||||
'depends': ['sf_base', 'web_widget_model_viewer', 'mrp_subcontracting', 'purchase_stock', 'uom', ],
|
||||
'data': [
|
||||
'data/product_data.xml',
|
||||
'data/uom_data.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'views/product_template_view.xml',
|
||||
'views/product_workorder.xml'
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
|
||||
@@ -30,6 +30,30 @@
|
||||
<field name="type">夹具</field>
|
||||
</record>
|
||||
|
||||
<record id="product_category_functional_tool_sf" model="product.category">
|
||||
<field name="name">功能刀具</field>
|
||||
<field name="type">功能刀具</field>
|
||||
</record>
|
||||
|
||||
<record id="res_partner_bfm" model="res.partner">
|
||||
<field name="name">业务平台</field>
|
||||
<!-- <field name="company_id" ref="base.main_company"/>-->
|
||||
</record>
|
||||
|
||||
<record id="product_functional_tool_sf" model="product.product">
|
||||
<field name="name">功能刀具</field>
|
||||
<field name="categ_id" ref="product_category_functional_tool_sf"/>
|
||||
<field name="route_ids"
|
||||
eval="[ref('stock.route_warehouse0_mto')]"/>
|
||||
<field name="invoice_policy">delivery</field>
|
||||
<field name="detailed_type">product</field>
|
||||
<field name="sale_ok">false</field>
|
||||
<field name="uom_id" ref="uom.product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="tracking">serial</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_sf" model="product.product">
|
||||
<field name="name">CNC加工产品模板</field>
|
||||
<field name="active" eval="False"/>
|
||||
@@ -44,7 +68,7 @@
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="single_manufacturing">true</field>
|
||||
<field name="tracking">serial</field>
|
||||
<field name="is_bfm">false</field>
|
||||
<field name="is_bfm">true</field>
|
||||
</record>
|
||||
<record id="product_embryo_sf_self_machining" model="product.product">
|
||||
<field name="name">坯料自加工模板</field>
|
||||
@@ -60,7 +84,7 @@
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="single_manufacturing">true</field>
|
||||
<field name="tracking">serial</field>
|
||||
<field name="is_bfm">false</field>
|
||||
<field name="is_bfm">true</field>
|
||||
</record>
|
||||
|
||||
<record id="product_embryo_sf_outsource" model="product.product">
|
||||
@@ -76,7 +100,7 @@
|
||||
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="tracking">serial</field>
|
||||
<field name="is_bfm">false</field>
|
||||
<field name="is_bfm">true</field>
|
||||
</record>
|
||||
<record id="product_embryo_sf_purchase" model="product.product">
|
||||
<field name="name">坯料采购模板</field>
|
||||
@@ -91,7 +115,7 @@
|
||||
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="tracking">serial</field>
|
||||
<field name="is_bfm">false</field>
|
||||
<field name="is_bfm">true</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -1,6 +1 @@
|
||||
# from . import product_template
|
||||
from . import product_supplierinfo
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,112 @@
|
||||
from odoo import models
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class ResProductCategory(models.Model):
|
||||
_inherit = "product.category"
|
||||
|
||||
type = fields.Selection(
|
||||
[("成品", "成品"), ("坯料", "坯料"), ("原材料", "原材料"), ("表面工艺", "表面工艺"), ("刀具", "刀具"),
|
||||
("夹具", "夹具"), ("功能刀具", "功能刀具")],
|
||||
default="", string="类型")
|
||||
|
||||
|
||||
class ResProductProduct(models.Model):
|
||||
_inherit = 'product.product'
|
||||
|
||||
single_manufacturing = fields.Boolean(string="单个制造")
|
||||
is_bfm = fields.Boolean('业务平台是否自动创建', default=False)
|
||||
|
||||
|
||||
class ResProducTemplate(models.Model):
|
||||
_inherit = 'product.template'
|
||||
|
||||
single_manufacturing = fields.Boolean(string="单个制造")
|
||||
|
||||
|
||||
class ResMrpBomMo(models.Model):
|
||||
_inherit = 'mrp.bom'
|
||||
|
||||
subcontractor_id = fields.Many2one('res.partner', string='外包商')
|
||||
|
||||
def bom_create_line_has(self, embryo):
|
||||
vals = {
|
||||
'bom_id': self.id,
|
||||
'product_id': embryo.id,
|
||||
'product_tmpl_id': embryo.product_tmpl_id.id,
|
||||
'product_qty': 1,
|
||||
'product_uom_id': 1
|
||||
}
|
||||
return self.env['mrp.bom.line'].create(vals)
|
||||
|
||||
# 业务平台分配工厂后在智能工厂先创建销售订单再创建该产品后再次进行创建bom
|
||||
def bom_create(self, product, bom_type, product_type):
|
||||
bom_id = self.env['mrp.bom'].create({
|
||||
'product_tmpl_id': product.product_tmpl_id.id,
|
||||
'type': bom_type,
|
||||
# 'subcontractor_id': '' or subcontract.partner_id.id,
|
||||
'product_qty': 1,
|
||||
'product_uom_id': 1
|
||||
})
|
||||
if bom_type == 'subcontract' and product_type is not False:
|
||||
subcontract = self.get_supplier(product.materials_type_id)
|
||||
bom_id.subcontractor_id = subcontract.partner_id.id
|
||||
return bom_id
|
||||
|
||||
# 坯料BOM组件:选取当前坯料原材料,
|
||||
# 然后根据当前的坯料的体积得出需要的原材料重量(立方米m³) *材料密度 * 1000 = 所需原材料重量KG(公斤)
|
||||
# 坯料所需原材料公式:当前的坯料的体积(立方米m³) *材料密度 * 1000 = 所需原材料重量KG(公斤)
|
||||
|
||||
def bom_create_line(self, embryo):
|
||||
# 选取当前坯料原材料
|
||||
raw_bom_line = self.get_raw_bom(embryo)
|
||||
if raw_bom_line:
|
||||
qty = 1
|
||||
if round(embryo.volume * raw_bom_line.materials_type_id.density / 1000000) > 1:
|
||||
qty = round(embryo.volume * raw_bom_line.materials_type_id.density / 1000000)
|
||||
bom_line = self.env['mrp.bom.line'].create({
|
||||
'bom_id': self.id,
|
||||
'product_id': raw_bom_line.id,
|
||||
'product_tmpl_id': raw_bom_line.product_tmpl_id.id,
|
||||
'product_qty': qty,
|
||||
'product_uom_id': raw_bom_line.uom_id.id,
|
||||
})
|
||||
return bom_line
|
||||
else:
|
||||
return False
|
||||
|
||||
# 查询材料型号默认排第一的供应商
|
||||
|
||||
def get_supplier(self, materials_type):
|
||||
seller_id = self.env['sf.supplier.sort'].search(
|
||||
[('materials_model_id', '=', materials_type.id)],
|
||||
limit=1,
|
||||
order='sequence asc')
|
||||
return seller_id
|
||||
|
||||
# 匹配bom
|
||||
|
||||
def get_bom(self, product):
|
||||
embryo_has = self.env['product.product'].search(
|
||||
[('categ_id.type', '=', '坯料'), ('materials_type_id', '=', product.materials_type_id.id),
|
||||
('length', '>', product.length), ('width', '>', product.width),
|
||||
('height', '>', product.height), ('is_bfm', '=', False)
|
||||
],
|
||||
limit=1,
|
||||
order='volume desc'
|
||||
)
|
||||
if embryo_has:
|
||||
rate_of_waste = ((embryo_has.volume - product.model_volume) % embryo_has.volume) * 100
|
||||
if rate_of_waste <= 20:
|
||||
return embryo_has
|
||||
else:
|
||||
return
|
||||
|
||||
# 查bom的原材料
|
||||
def get_raw_bom(self, product):
|
||||
raw_bom = self.env['product.product'].search(
|
||||
[('categ_id.type', '=', '原材料'), ('materials_type_id', '=', product.materials_type_id.id)])
|
||||
return raw_bom
|
||||
|
||||
|
||||
class ResSupplierInfo(models.Model):
|
||||
@@ -8,5 +116,5 @@ class ResSupplierInfo(models.Model):
|
||||
for supplier in self:
|
||||
boms = supplier.product_id.variant_bom_ids
|
||||
boms |= supplier.product_tmpl_id.bom_ids.filtered(lambda b: not b.product_id or b.product_id in (
|
||||
supplier.product_id or supplier.product_tmpl_id.product_variant_ids))
|
||||
supplier.product_id or supplier.product_tmpl_id.product_variant_ids))
|
||||
supplier.is_subcontractor = supplier.partner_id in boms.subcontractor_id
|
||||
|
||||
@@ -1,407 +0,0 @@
|
||||
from odoo import models, fields, api
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.modules import get_resource_path
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
import logging
|
||||
import base64
|
||||
import hashlib
|
||||
import os
|
||||
|
||||
|
||||
# class ResProduct(models.Model):
|
||||
# _inherit = 'product.template'
|
||||
|
||||
# image_1920 = fields.Image(related='cutting_tool_parameter_image', store=True,
|
||||
# domain=[('cutting_tool_parameter_image', '!=', False)])
|
||||
|
||||
# @api.constrains('cutting_tool_parameter_length',)
|
||||
# def _check_length_or_width(self):
|
||||
# for record in self:
|
||||
# if record.cutting_tool == '刀片':
|
||||
# if record.cutting_tool_parameter_length <= 0 \
|
||||
# and record.cutting_tool_parameter_width <= 0:
|
||||
# raise ValueError('该产品中有字段不能为零,请确认并重新输入!')
|
||||
#
|
||||
#
|
||||
# @api.constrains('cutting_tool_parameter_length',
|
||||
# 'cutting_tool_parameter_width')
|
||||
# def _check_length_or_width(self):
|
||||
# for record in self:
|
||||
# if record.cutting_tool == '刀片':
|
||||
# if record.cutting_tool_parameter_length <= 0 \
|
||||
# and record.cutting_tool_parameter_width <= 0:
|
||||
# raise ValueError('该产品中有字段不能为零,请确认并重新输入!')
|
||||
# # if self.cutting_tool == '刀片':
|
||||
# # if self.cutting_tool_parameter_length == 0 \
|
||||
# # or self.cutting_tool_parameter_width == 0:
|
||||
# # raise ValueError('该产品中有字段不能为零,请确认并重新输入!')
|
||||
#
|
||||
# @api.constrains('cutting_tool_parameter_height')
|
||||
# def _check_height(self):
|
||||
# if self.cutting_tool == '刀片':
|
||||
# if self.cutting_tool_parameter_height <= 0:
|
||||
# raise ValueError('该产品中高度不能为零,请确认并重新输入!')
|
||||
#
|
||||
# @api.constrains('cutting_tool_parameter_top_angle')
|
||||
# def _check_top_angle(self):
|
||||
# if self.cutting_tool == '刀片':
|
||||
# if self.cutting_tool_parameter_top_angle <= 0:
|
||||
# raise ValueError('该产品中顶角不能为零,请确认并重新输入!')
|
||||
#
|
||||
# @api.constrains('cutting_tool_parameter_r_angle')
|
||||
# def _check_r_angle(self):
|
||||
# if self.cutting_tool == '刀片':
|
||||
# if self.cutting_tool_parameter_r_angle <= 0:
|
||||
# raise ValueError('该产品中R角不能为零,请确认并重新输入!')
|
||||
#
|
||||
# @api.constrains('cutting_tool_parameter_radius')
|
||||
# def _check_radius(self):
|
||||
# if self.cutting_tool == '刀片':
|
||||
# if self.cutting_tool_parameter_radius <= 0:
|
||||
# raise ValueError('该产品中刀尖半径不能为零,请确认并重新输入!')
|
||||
#
|
||||
# @api.constrains('cutting_tool_parameter_handle_length',
|
||||
# 'cutting_tool_parameter_length1',
|
||||
# 'cutting_tool_parameter_diameter1')
|
||||
# # 'cutting_tool_parameter_body_accuracy',
|
||||
# # 'cutting_tool_parameter_detection_accuracy',
|
||||
# # 'cutting_tool_parameter_detection_hardness')
|
||||
# def _check_handle(self):
|
||||
# for record in self:
|
||||
# if record.cutting_tool == '刀柄':
|
||||
# if record.cutting_tool_parameter_handle_length == 0 \
|
||||
# or record.cutting_tool_parameter_diameter1 == 0 \
|
||||
# or record.cutting_tool_parameter_length1 == 0:
|
||||
# # or record.cutting_tool_parameter_detection_accuracy == 0 \
|
||||
# # or record.cutting_tool_parameter_detection_hardness == 0 \
|
||||
# # or record.cutting_tool_parameter_body_accuracy == 0:
|
||||
# raise ValueError('该产品中有字段不能为零,请确认并重新输入!')
|
||||
# # if self.cutting_tool == '刀柄':
|
||||
# # if self.cutting_tool_parameter_handle_length == 0 \
|
||||
# # or self.cutting_tool_parameter_diameter1 == 0 \
|
||||
# # or self.cutting_tool_parameter_length1 == 0 \
|
||||
# # or self.cutting_tool_parameter_detection_accuracy == 0 \
|
||||
# # or self.cutting_tool_parameter_detection_hardness == 0 \
|
||||
# # or self.cutting_tool_parameter_body_accuracy == 0:
|
||||
# # raise ValueError('该产品中有字段不能为零,请确认并重新输入!')
|
||||
#
|
||||
# @api.constrains('cutting_tool_parameter_weight')
|
||||
# def _check_weight(self):
|
||||
# if self.cutting_tool == '刀柄':
|
||||
# if self.cutting_tool_parameter_weight == 0:
|
||||
# raise ValueError('该产品中重量不能为零,请确认并重新输入!')
|
||||
|
||||
# @api.constrains('cutting_tool_parameter_c_diameter',
|
||||
# 'cutting_tool_parameter_l_total_length',
|
||||
# 'cutting_tool_parameter_d_diameter',
|
||||
# 'cutting_tool_parameter_wrench',
|
||||
# 'cutting_tool_parameter_screw',
|
||||
# 'cutting_tool_parameter_rounded_corner',
|
||||
# 'cutting_tool_parameter_hardness')
|
||||
# def _check_angle(self):
|
||||
# if self.cutting_tool in ['刀杆', '刀盘']:
|
||||
# if self.cutting_tool_parameter_c_diameter == 0 \
|
||||
# or self.cutting_tool_parameter_l_total_length == 0 \
|
||||
# or self.cutting_tool_parameter_d_diameter == 0 \
|
||||
# or self.cutting_tool_parameter_wrench == 0 \
|
||||
# or self.cutting_tool_parameter_screw == 0 \
|
||||
# or self.cutting_tool_parameter_rounded_corner == 0 \
|
||||
# or self.cutting_tool_parameter_hardness:
|
||||
# raise ValueError('该产品中有字段不能为零,请确认并重新输入!')
|
||||
|
||||
# @api.constrains('cutting_tool_parameter_c_diameter',
|
||||
# 'cutting_tool_parameter_l_total_length',
|
||||
# 'cutting_tool_parameter_diameter1')
|
||||
# def _check_angle(self):
|
||||
# for record in self:
|
||||
# if record.cutting_tool == '整体式刀具' or record.cutting_tool == '刀片':
|
||||
# if record.cutting_tool_parameter_c_diameter == 0 \
|
||||
# or record.cutting_tool_parameter_l_total_length == 0 \
|
||||
# or record.cutting_tool_parameter_diameter1 == 0:
|
||||
# raise ValueError('该产品中有字段不能为零,请确认并重新输入!')
|
||||
|
||||
# @api.constrains('cutting_tool_parameter_outer_diameter',
|
||||
# 'cutting_tool_parameter_inner_diameter',
|
||||
# 'cutting_tool_parameter_body_accuracy',
|
||||
# 'cutting_tool_parameter_handle_length',
|
||||
# 'cutting_tool_parameter_length1',
|
||||
# 'cutting_tool_parameter_diameter1')
|
||||
# def _check_angle(self):
|
||||
# for record in self:
|
||||
# if record.cutting_tool == '整体式刀具' or record.cutting_tool == '刀片':
|
||||
# if record.cutting_tool_parameter_front_angle == 0 \
|
||||
# or record.cutting_tool_parameter_rear_angle == 0 \
|
||||
# or record.cutting_tool_parameter_main_included_angle == 0:
|
||||
# raise ValueError('该产品中有字段不能为零,请确认并重新输入!')
|
||||
|
||||
# @api.constrains('cutting_tool_parameter_front_angle',
|
||||
# 'cutting_tool_parameter_rear_angle',
|
||||
# 'cutting_tool_parameter_main_included_angle')
|
||||
# def _check_angle(self):
|
||||
# for record in self:
|
||||
# if record.cutting_tool == '整体式刀具' or record.cutting_tool == '刀片':
|
||||
# if record.cutting_tool_parameter_front_angle <= 0 \
|
||||
# or record.cutting_tool_parameter_rear_angle <= 0 \
|
||||
# or record.cutting_tool_parameter_main_included_angle <= 0:
|
||||
# raise ValueError('该产品中有字段不能为零,请确认并重新输入!')
|
||||
#
|
||||
# @api.constrains('cutting_tool_parameter_total_length',
|
||||
# 'cutting_tool_parameter_shank_length',
|
||||
# 'cutting_tool_parameter_blade_length',
|
||||
# 'cutting_tool_parameter_diameter')
|
||||
# def _check_length(self):
|
||||
# for record in self:
|
||||
# if record.cutting_tool == '整体式刀具':
|
||||
# if record.cutting_tool_parameter_total_length <= 0 \
|
||||
# or record.cutting_tool_parameter_shank_length <= 0 \
|
||||
# or record.cutting_tool_parameter_blade_length <= 0 \
|
||||
# or record.cutting_tool_parameter_diameter <= 0:
|
||||
# raise ValueError('该产品中有字段不能为零,请确认并重新输入!')
|
||||
|
||||
# @api.constrains('cutting_tool_parameter_total_length',
|
||||
# 'cutting_tool_parameter_shank_length',
|
||||
# 'cutting_tool_parameter_blade_length',
|
||||
# 'cutting_tool_parameter_diameter')
|
||||
# def _check_length(self):
|
||||
# for record in self:
|
||||
# if record.cutting_tool == '整体式刀具':
|
||||
# if record.cutting_tool_parameter_total_length == 0 \
|
||||
# or record.cutting_tool_parameter_shank_length == 0 \
|
||||
# or record.cutting_tool_parameter_blade_length == 0 \
|
||||
# or record.cutting_tool_parameter_diameter == 0:
|
||||
# raise ValueError('该产品中有字段不能为零,请确认并重新输入!')
|
||||
|
||||
# @api.constrains('cutting_tool_parameter_blade_number')
|
||||
# def _check_blade_number(self):
|
||||
# if self.cutting_tool in ['整体式刀具', '刀杆', '刀盘']:
|
||||
# if self.cutting_tool_parameter_blade_number <= 0:
|
||||
# raise ValueError('该产品中刃数不能为零,请确认并重新输入!')
|
||||
#
|
||||
# @api.constrains('cutting_tool_parameter_nut')
|
||||
# def _check_nut(self):
|
||||
# if self.cutting_tool in ['整体式刀具', '刀片', '刀柄', '夹头']:
|
||||
# if self.cutting_tool_parameter_nut <= 0:
|
||||
# raise ValueError('该产品中配对螺母不能为零,请确认并重新输入!')
|
||||
|
||||
|
||||
# @api.onchange('cutting_tool_material_id')
|
||||
# def _get_cutting_tool_material_info(self):
|
||||
# for item in self:
|
||||
# if self.cutting_tool_type == '整体式刀具':
|
||||
# item.cutting_tool_parameter_brand_id = item.cutting_tool_model_id.brand.id
|
||||
# item.cutting_tool_parameter_total_length = item.cutting_tool_model_id.total_length
|
||||
# item.cutting_tool_parameter_shank_length = item.cutting_tool_model_id.shank_length
|
||||
# item.cutting_tool_parameter_blade_length = item.cutting_tool_model_id.blade_length
|
||||
# item.cutting_tool_parameter_diameter = item.cutting_tool_model_id.diameter
|
||||
# item.cutting_tool_parameter_nut = item.cutting_tool_model_id.nut
|
||||
# item.cutting_tool_parameter_blade_number = item.cutting_tool_model_id.blade_number
|
||||
# item.cutting_tool_parameter_material_model_id = item.cutting_tool_model_id.material_model.id
|
||||
# item.cutting_tool_parameter_front_angle = item.cutting_tool_model_id.front_angle
|
||||
# item.cutting_tool_parameter_rear_angle = item.cutting_tool_model_id.rear_angle
|
||||
# item.cutting_tool_parameter_main_included_angle = item.cutting_tool_model_id.main_included_angle
|
||||
# item.cutting_tool_parameter_chuck_model_ids = self._get_ids(
|
||||
# item.cutting_tool_model_id.chuck_model)
|
||||
# item.cutting_tool_parameter_scope = item.cutting_tool_model_id.scope
|
||||
# item.image_1920 = '' if not item.cutting_tool_model_id.image else item.cutting_tool_model_id.image
|
||||
# elif self.cutting_tool_type == '刀片':
|
||||
# item.cutting_tool_parameter_brand_id = item.cutting_tool_model_id.brand.id
|
||||
# item.cutting_tool_parameter_top_angle = item.cutting_tool_model_id.top_angle
|
||||
# item.cutting_tool_parameter_front_angle = item.cutting_tool_model_id.front_angle
|
||||
# item.cutting_tool_parameter_rear_angle = item.cutting_tool_model_id.rear_angle
|
||||
# item.cutting_tool_parameter_main_included_angle = item.cutting_tool_model_id.main_included_angle
|
||||
# item.cutting_tool_parameter_r_angle = item.cutting_tool_model_id.r_angle
|
||||
# item.cutting_tool_parameter_working_hardness = item.cutting_tool_model_id.hardness
|
||||
# item.cutting_tool_parameter_material_model_id = item.cutting_tool_model_id.material_model.id
|
||||
# item.cutting_tool_parameter_length = item.cutting_tool_model_id.length
|
||||
# item.cutting_tool_parameter_width = item.cutting_tool_model_id.width
|
||||
# item.cutting_tool_parameter_height = item.cutting_tool_model_id.height
|
||||
# item.cutting_tool_parameter_radius = item.cutting_tool_model_id.radius
|
||||
# item.cutting_tool_parameter_nut = item.cutting_tool_model_id.nut
|
||||
# item.cutting_tool_parameter_cutter_bar_ids = self._get_ids(item.cutting_tool_model_id.cutter_bar)
|
||||
# item.cutting_tool_parameter_cutter_pad_ids = self._get_ids(item.cutting_tool_model_id.cutter_pad)
|
||||
# item.image_1920 = '' if not item.cutting_tool_model_id.image else item.cutting_tool_model_id.image
|
||||
# elif self.cutting_tool_type == '刀杆':
|
||||
# item.cutting_tool_parameter_brand_id = item.cutting_tool_model_id.brand.id
|
||||
# item.cutting_tool_parameter_c_diameter = item.cutting_tool_model_id.c_diameter
|
||||
# item.cutting_tool_parameter_d_diameter = item.cutting_tool_model_id.d_diameter
|
||||
# item.cutting_tool_parameter_l_total_length = item.cutting_tool_model_id.total_length
|
||||
# item.cutting_tool_parameter_wrench = item.cutting_tool_model_id.wrench
|
||||
# item.cutting_tool_parameter_screw = item.cutting_tool_model_id.screw
|
||||
# item.cutting_tool_parameter_blade_ids = self._get_ids(item.cutting_tool_model_id.blade)
|
||||
# item.cutting_tool_parameter_scope = item.cutting_tool_model_id.scope
|
||||
# item.cutting_tool_parameter_material_model_id = item.cutting_tool_model_id.material_model.id
|
||||
# item.cutting_tool_parameter_rounded_corner = item.cutting_tool_model_id.radius
|
||||
# item.cutting_tool_parameter_accuracy_level = item.cutting_tool_model_id.accuracy
|
||||
# item.cutting_tool_parameter_blade_number = item.cutting_tool_model_id.blade_number
|
||||
# item.cutting_tool_parameter_hardness = item.cutting_tool_model_id.hardness
|
||||
# item.image_1920 = '' if not item.cutting_tool_model_id.image else item.cutting_tool_model_id.image
|
||||
# elif self.cutting_tool_type == '刀盘':
|
||||
# item.cutting_tool_parameter_brand_id = item.cutting_tool_model_id.brand.id
|
||||
# item.cutting_tool_parameter_c_diameter = item.cutting_tool_model_id.c_diameter
|
||||
# item.cutting_tool_parameter_d_diameter = item.cutting_tool_model_id.d_diameter
|
||||
# item.cutting_tool_parameter_l_total_length = item.cutting_tool_model_id.total_length
|
||||
# item.cutting_tool_parameter_wrench = item.cutting_tool_model_id.wrench
|
||||
# item.cutting_tool_parameter_screw = item.cutting_tool_model_id.screw
|
||||
# item.cutting_tool_parameter_blade_ids = item.cutting_tool_model_id.blade.id
|
||||
# item.cutting_tool_parameter_scope = item.cutting_tool_model_id.scope
|
||||
# item.cutting_tool_parameter_material_model_id = item.cutting_tool_model_id.material_model.id
|
||||
# item.cutting_tool_parameter_rounded_corner = item.cutting_tool_model_id.radius
|
||||
# item.cutting_tool_parameter_accuracy_level = item.cutting_tool_model_id.accuracy
|
||||
# item.cutting_tool_parameter_blade_number = item.cutting_tool_model_id.blade_number
|
||||
# item.cutting_tool_parameter_hardness = item.cutting_tool_model_id.hardness
|
||||
# item.image_1920 = '' if not item.cutting_tool_model_id.image else item.cutting_tool_model_id.image
|
||||
# elif self.cutting_tool_type == '刀柄':
|
||||
# item.cutting_tool_parameter_brand_id = item.cutting_tool_model_id.brand.id
|
||||
# item.cutting_tool_parameter_handle_length = item.cutting_tool_model_id.length
|
||||
# item.cutting_tool_parameter_length1 = item.cutting_tool_model_id.length1
|
||||
# item.cutting_tool_parameter_diameter1 = item.cutting_tool_model_id.diameter1
|
||||
# item.cutting_tool_parameter_body_accuracy = item.cutting_tool_model_id.body_accuracy
|
||||
# item.cutting_tool_parameter_nut = item.cutting_tool_model_id.nut
|
||||
# item.cutting_tool_parameter_clamping_range = item.cutting_tool_model_id.clamping_range
|
||||
# item.cutting_tool_parameter_weight = item.cutting_tool_model_id.weight
|
||||
# item.cutting_tool_parameter_material_model_id = item.cutting_tool_model_id.material_model.id
|
||||
# item.cutting_tool_parameter_chuck_model_ids = self._get_ids(item.cutting_tool_model_id.chuck_model)
|
||||
# item.cutting_tool_parameter_detection_accuracy = item.cutting_tool_model_id.detection_accuracy
|
||||
# item.cutting_tool_parameter_detection_hardness = item.cutting_tool_model_id.detection_hardness
|
||||
# item.cutting_tool_parameter_standard_speed = item.cutting_tool_model_id.standard_speed
|
||||
# item.image_1920 = '' if not item.cutting_tool_model_id.image else item.cutting_tool_model_id.image
|
||||
# elif self.cutting_tool_type == '夹头':
|
||||
# item.cutting_tool_parameter_brand_id = item.cutting_tool_model_id.brand.id
|
||||
# item.cutting_tool_parameter_outer_diameter = item.cutting_tool_model_id.diameter
|
||||
# item.cutting_tool_parameter_inner_diameter = item.cutting_tool_model_id.inner_diameter
|
||||
# item.cutting_tool_parameter_accuracy = item.cutting_tool_model_id.accuracy
|
||||
# item.cutting_tool_parameter_nut = item.cutting_tool_model_id.nut
|
||||
# item.cutting_tool_parameter_clamping_range = item.cutting_tool_model_id.clamping_range
|
||||
# item.cutting_tool_parameter_handle_model_ids = self._get_ids(item.cutting_tool_model_id.handle_model)
|
||||
# item.cutting_tool_parameter_material_model_id = item.cutting_tool_model_id.material_model.id
|
||||
# item.cutting_tool_parameter_height = item.cutting_tool_model_id.height
|
||||
# item.cutting_tool_parameter_feature = item.cutting_tool_model_id.feature
|
||||
# item.image_1920 = '' if not item.cutting_tool_model_id.image else item.cutting_tool_model_id.image
|
||||
# else:
|
||||
# item.cutting_tool_parameter_brand_id = False
|
||||
# item.cutting_tool_parameter_total_length = False
|
||||
# item.cutting_tool_parameter_shank_length = False
|
||||
# item.cutting_tool_parameter_blade_length = False
|
||||
# item.cutting_tool_parameter_diameter = False
|
||||
# item.cutting_tool_parameter_nut = False
|
||||
# item.cutting_tool_parameter_blade_number = False
|
||||
# item.cutting_tool_parameter_material_model_id = False
|
||||
# item.cutting_tool_parameter_front_angle = False
|
||||
# item.cutting_tool_parameter_rear_angle = False
|
||||
# item.cutting_tool_parameter_main_included_angle = False
|
||||
# item.cutting_tool_parameter_chuck_model_ids = False
|
||||
# item.cutting_tool_parameter_scope = False
|
||||
# item.cutting_tool_parameter_top_angle = False
|
||||
# item.cutting_tool_parameter_r_angle = False
|
||||
# item.cutting_tool_parameter_working_hardness = False
|
||||
# item.cutting_tool_parameter_length = False
|
||||
# item.cutting_tool_parameter_width = False
|
||||
# item.cutting_tool_parameter_height = False
|
||||
# item.cutting_tool_parameter_radius = False
|
||||
# item.cutting_tool_parameter_cutter_bar_ids = False
|
||||
# item.cutting_tool_parameter_cutter_pad_ids = False
|
||||
# item.cutting_tool_parameter_c_diameter = False
|
||||
# item.cutting_tool_parameter_d_diameter = False
|
||||
# item.cutting_tool_parameter_l_total_length = False
|
||||
# item.cutting_tool_parameter_wrench = False
|
||||
# item.cutting_tool_parameter_screw = False
|
||||
# item.cutting_tool_parameter_blade_ids = False
|
||||
# item.cutting_tool_parameter_rounded_corner = False
|
||||
# item.cutting_tool_parameter_accuracy_level = False
|
||||
# item.cutting_tool_parameter_hardness = False
|
||||
# item.cutting_tool_parameter_handle_length = False
|
||||
# item.cutting_tool_parameter_length1 = False
|
||||
# item.cutting_tool_parameter_diameter1 = False
|
||||
# item.cutting_tool_parameter_body_accuracy = False
|
||||
# item.cutting_tool_parameter_clamping_range = False
|
||||
# item.cutting_tool_parameter_weight = False
|
||||
# item.cutting_tool_parameter_detection_accuracy = False
|
||||
# item.cutting_tool_parameter_detection_hardness = False
|
||||
# item.cutting_tool_parameter_standard_speed = False
|
||||
# item.image_1920 = False
|
||||
|
||||
|
||||
class ResMrpBom(models.Model):
|
||||
_inherit = 'mrp.bom'
|
||||
|
||||
def bom_create_line_has(self, embryo):
|
||||
vals = {
|
||||
'bom_id': self.id,
|
||||
'product_id': embryo.id,
|
||||
'product_tmpl_id': embryo.product_tmpl_id.id,
|
||||
'product_qty': 1,
|
||||
'product_uom_id': 1
|
||||
}
|
||||
return self.env['mrp.bom.line'].create(vals)
|
||||
|
||||
# 业务平台分配工厂后在智能工厂先创建销售订单再创建该产品后再次进行创建bom
|
||||
def bom_create(self, product, bom_type, product_type):
|
||||
bom_id = self.env['mrp.bom'].create({
|
||||
'product_tmpl_id': product.product_tmpl_id.id,
|
||||
'type': bom_type,
|
||||
# 'subcontractor_id': '' or subcontract.partner_id.id,
|
||||
'product_qty': 1,
|
||||
'product_uom_id': 1
|
||||
})
|
||||
if bom_type == 'subcontract' and product_type is not False:
|
||||
subcontract = self.get_supplier(product.materials_type_id)
|
||||
bom_id.subcontractor_id = subcontract.partner_id.id
|
||||
return bom_id
|
||||
|
||||
# 坯料BOM组件:选取当前坯料原材料,
|
||||
# 然后根据当前的坯料的体积得出需要的原材料重量(立方米m³) *材料密度 * 1000 = 所需原材料重量KG(公斤)
|
||||
# 坯料所需原材料公式:当前的坯料的体积(立方米m³) *材料密度 * 1000 = 所需原材料重量KG(公斤)
|
||||
def bom_create_line(self, embryo):
|
||||
# 选取当前坯料原材料
|
||||
raw_bom_line = self.get_raw_bom(embryo)
|
||||
if raw_bom_line:
|
||||
bom_line = self.env['mrp.bom.line'].create({
|
||||
'bom_id': self.id,
|
||||
'product_id': raw_bom_line.id,
|
||||
'product_tmpl_id': raw_bom_line.product_tmpl_id.id,
|
||||
'product_qty': round(embryo.volume * raw_bom_line.materials_type_id.density / 1000000),
|
||||
'product_uom_id': raw_bom_line.uom_id.id,
|
||||
})
|
||||
return bom_line
|
||||
else:
|
||||
return False
|
||||
|
||||
# 查询材料型号默认排第一的供应商
|
||||
def get_supplier(self, materials_type):
|
||||
seller_id = self.env['sf.supplier.sort'].search(
|
||||
[('materials_model_id', '=', materials_type.id)],
|
||||
limit=1,
|
||||
order='sequence asc')
|
||||
return seller_id
|
||||
|
||||
# 匹配bom
|
||||
def get_bom(self, product):
|
||||
embryo_has = self.env['product.product'].search(
|
||||
[('categ_id.type', '=', '坯料'), ('materials_type_id', '=', product.materials_type_id.id),
|
||||
('length', '>', product.length), ('width', '>', product.width),
|
||||
('height', '>', product.height), ('is_bfm', '=', False)
|
||||
],
|
||||
limit=1,
|
||||
order='volume desc'
|
||||
)
|
||||
logging.info('get_bom-vals:%s' % embryo_has)
|
||||
if embryo_has:
|
||||
rate_of_waste = ((embryo_has.volume - product.model_volume) % embryo_has.volume) * 100
|
||||
if rate_of_waste <= 20:
|
||||
return embryo_has
|
||||
else:
|
||||
return
|
||||
|
||||
# 查bom的原材料
|
||||
def get_raw_bom(self, product):
|
||||
raw_bom = self.env['product.product'].search(
|
||||
[('categ_id.type', '=', '原材料'), ('materials_type_id', '=', product.materials_type_id.id)])
|
||||
return raw_bom
|
||||
|
||||
# @api.constrains('type')
|
||||
# def _check_type(self):
|
||||
# category = self.env['product.category'].search(
|
||||
# [('type', '=', self.type)])
|
||||
# if category:
|
||||
# raise ValidationError("该类别已存在,请选择其他类别")
|
||||
4
sf_dlm/security/group_security.xml
Normal file
4
sf_dlm/security/group_security.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<odoo>
|
||||
<data>
|
||||
</data>
|
||||
</odoo>
|
||||
11
sf_dlm/security/ir.model.access.csv
Normal file
11
sf_dlm/security/ir.model.access.csv
Normal file
@@ -0,0 +1,11 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -1,469 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="view_product_template_only_form_inherit_sf">
|
||||
<field name="name">product.template.only.form.inherit.sf</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="barcode" position="replace">
|
||||
<field name='barcode' invisible="1"/>
|
||||
</field>
|
||||
<field name="default_code" position="replace">
|
||||
<field name='default_code' invisible="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_product_template_form_inherit_sf">
|
||||
<field name="name">product.template.form.inherit.sf</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="sale.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//label[@for='list_price']" position="before">
|
||||
<field name='categ_type' invisible="1"/>
|
||||
<field name="upload_model_file"
|
||||
widget="many2many_binary"
|
||||
attrs="{'invisible': ['|', ('categ_type', '!=', '成品'),('categ_type', '=', False)]}"/>
|
||||
<field name="model_file" widget="Viewer3D" string="模型" readonly="1" force_save="1"
|
||||
attrs="{'invisible': ['|','|', ('categ_type', '!=', '成品'),('categ_type', '=', False),('model_file', '=', False)]}"/>
|
||||
</xpath>
|
||||
<field name="categ_id" position="replace">
|
||||
<field name='categ_id' invisible="1"/>
|
||||
</field>
|
||||
<field name="product_tag_ids" position="after">
|
||||
<field name="default_code" attrs="{'invisible': [('product_variant_count', '>', 1)]}"/>
|
||||
<field name="barcode" attrs="{'invisible': [('product_variant_count', '>', 1)]}"/>
|
||||
</field>
|
||||
<field name="invoice_policy" position="after">
|
||||
<field name='categ_id'/>
|
||||
<field name='cutting_tool_type' invisible="1"/>
|
||||
<field name="fixture_material_type" invisible="1"/>
|
||||
<field name="embryo_model_type_id" string="模型类型"
|
||||
attrs="{'invisible': ['|',('categ_type', '!=', '坯料'),('categ_type', '=', False)]}"/>
|
||||
<field name="materials_id" string="材料" placeholder="请选择"
|
||||
attrs="{'invisible': [('categ_type', 'not in', ['成品','坯料', '原材料'])]}"/>
|
||||
<field name="materials_type_id" string="型号" placeholder="请选择"
|
||||
domain="[('materials_id', '=', materials_id)]"
|
||||
attrs="{'invisible': [('categ_type', 'not in', ['成品','坯料', '原材料'])]}"/>
|
||||
<field name="server_product_process_parameters_id" string="表面工艺参数"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': ['|',('categ_type', '!=', '表面工艺'),('categ_type', '=', False)]}"/>
|
||||
<field name="cutting_tool_material_id" attrs="{'invisible': [('categ_type', '!=', '刀具')]}"
|
||||
placeholder="请选择"/>
|
||||
<field name="cutting_tool_model_id" placeholder="请选择"
|
||||
context="{'default_cutting_tool_material_id': cutting_tool_material_id,'default_cutting_tool_type_id': cutting_tool_type_id}"
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')]}"
|
||||
domain="[('cutting_tool_material_id','=',cutting_tool_material_id)]"/>
|
||||
<field name="fixture_material_id" attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||
placeholder="请选择"/>
|
||||
<field name="fixture_model_id" string="型号" placeholder="请选择"
|
||||
context="{'default_fixture_material_id': fixture_material_id,'default_multi_mounting_type_id': fixture_multi_mounting_type_id}"
|
||||
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||
domain="[('fixture_material_id','=',fixture_material_id)]"/>
|
||||
</field>
|
||||
|
||||
<xpath expr="//label[@for='volume']" position="before">
|
||||
<label for="length" string="尺寸"
|
||||
attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}"/>
|
||||
<div class="o_address_format"
|
||||
attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}">
|
||||
<label for="length" string="长"/>
|
||||
<field name="length" class="o_address_zip"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="width" string="宽"/>
|
||||
<field name="width" class="o_address_zip"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="height" string="高"/>
|
||||
<field name="height" class="o_address_zip"/>
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr="//page[last()]" position="after">
|
||||
<page string="加工参数">
|
||||
<group>
|
||||
<group string="模型">
|
||||
<label for="model_long" string="尺寸[mm]"/>
|
||||
<div class="o_address_format">
|
||||
<label for="model_long" string="长"/>
|
||||
<field name="model_long" class="o_address_zip"/>
|
||||
<label for="model_width" string="宽"/>
|
||||
<field name="model_width" class="o_address_zip"/>
|
||||
<label for="model_height" string="高"/>
|
||||
<field name="model_height" class="o_address_zip"/>
|
||||
</div>
|
||||
<field name="model_volume" string="体积[mm³]"/>
|
||||
<field name="product_model_type_id" string="模型类型"/>
|
||||
<field name="model_processing_panel" placeholder="例如R,U" string="加工面板"/>
|
||||
<field name="model_machining_precision"/>
|
||||
<field name="model_process_parameters_ids" string="表面工艺参数" widget="many2many_tags"
|
||||
options="{'no_create': True}"/>
|
||||
<field name="model_remark" string="备注说明"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="//page[last()-1]" position="after">
|
||||
<page string="刀具物料参数" attrs="{'invisible': [('categ_type', '!=', '刀具')]}">
|
||||
<group>
|
||||
<group attrs="{'invisible': [('categ_type', '!=', '刀具')]}" col="1">
|
||||
<field name="cutting_tool_type_id" options="{'no_create': True}" placeholder="请选择" />
|
||||
<field name="brand_id" options="{'no_create': True}" placeholder="请选择"/>
|
||||
<field name="materials_type_id" options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'in', ('整体式刀具','夹头','刀柄'))]}"
|
||||
placeholder="请选择"/>
|
||||
<field name="cutting_tool_total_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀柄','夹头'))]}"/>
|
||||
|
||||
<field name="cutting_tool_flange_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
|
||||
<field name="materials_type_id" options="{'no_create': True}" string="刀具材质"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"
|
||||
placeholder="请选择"/>
|
||||
<field name="tool_hardness" string="刀具硬度(hrc)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="materials_type_id" options="{'no_create': True}" string="夹头材质"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"
|
||||
placeholder="请选择"/>
|
||||
<field name="tool_hardness" string="夹头硬度(hrc)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
<field name="materials_type_id" options="{'no_create': True}" string="刀柄材质"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"
|
||||
placeholder="请选择"/>
|
||||
<field name="tool_hardness" string="刀柄硬度(hrc)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
|
||||
<field name="cutting_tool_blade_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_blade_diameter" string="刃部直径(mm)" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_blade_type"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_blade_helix_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_blade_number" placeholder="请选择"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
|
||||
|
||||
<!--刀片-->
|
||||
<label for="tool_length" string="尺寸(mm)"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("刀片","刀杆","刀盘"))]}'/>
|
||||
<div class="test_model"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("刀片","刀杆","刀盘"))]}'>
|
||||
<label for="tool_length" string="长"/>
|
||||
<field name="tool_length" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="tool_width" string="宽"/>
|
||||
<field name="tool_width" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="tool_thickness" string="厚"/>
|
||||
<field name="tool_thickness" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="cutting_tool_diameter" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片','刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_blade_diameter" class="diameter" string="刃径"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_blade_number"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片','刀杆','刀盘'))]}"/>
|
||||
<!--夹头-->
|
||||
|
||||
<field name="cutting_tool_clamping_way"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_clamping_length"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<field name="cutting_tool_clamping_tolerance"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<label for="cutting_tool_clamping_diameter_min" string="夹持直径"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("夹头","刀柄"))]}'/>
|
||||
<div class="o_address_format"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("夹头","刀柄"))]}'>
|
||||
<label for="cutting_tool_clamping_diameter_min" string="最小"/>
|
||||
<field name="cutting_tool_clamping_diameter_min" class="o_address_zip diameter"
|
||||
options="{'format': false}"
|
||||
attrs="{'required': [('cutting_tool_type','not in',('夹头','刀柄'))]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
<label for="cutting_tool_clamping_diameter_max" string="最大"/>
|
||||
<field name="cutting_tool_clamping_diameter_max" class="o_address_zip diameter"
|
||||
options="{'format': false}"
|
||||
attrs="{'required': [('cutting_tool_type','not in',('夹头','刀柄'))]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
</div>
|
||||
<field name="cutting_tool_head_diameter" class="diameter"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<field name="cutting_tool_outer_diameter" class="diameter"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<field name="cutting_tool_inner_diameter" class="diameter"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
|
||||
<field name="cutting_tool_standard_speed"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_speed_max"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_change_time"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_cooling_type"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_dynamic_balance_class"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('categ_type', '!=', '刀具')]}">
|
||||
<!--整体式刀具-->
|
||||
<field name="cutting_tool_shank_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_shank_diameter" string="柄部直径(mm)" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_neck_length" string="颈部长度(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_neck_diameter" string="颈部直径(mm)" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_blade_tip_diameter" string="刀尖直径(mm)" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_blade_tip_taper" string="刀尖锥度(°)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
|
||||
<label for="cutting_tool_run_out_accuracy_min" string="端跳精度"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<div class="o_address_format"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
|
||||
<label for="cutting_tool_run_out_accuracy_min" string="最小"/>
|
||||
<field name="cutting_tool_run_out_accuracy_min" class="o_address_zip"
|
||||
options="{'format': false}"
|
||||
attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
<label for="cutting_tool_run_out_accuracy_max" string="最大"/>
|
||||
<field name="cutting_tool_run_out_accuracy_max" class="o_address_zip"
|
||||
options="{'format': false}"
|
||||
attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
</div>
|
||||
<field name="cutting_tool_coarse_medium_fine" string="粗/中/精" placeholder="请选择"
|
||||
attrs="{'required': [('cutting_tool_type','=','整体式刀具')],'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
|
||||
<field name="tool_weight"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("夹头","刀柄"))]}'/>
|
||||
<field name="cutting_tool_taper"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头','刀柄'))]}"/>
|
||||
|
||||
<label for="cutting_tool_detection_accuracy_min" string="检测精度"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("刀柄"))]}'/>
|
||||
<div class="o_address_format"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("刀柄"))]}'>
|
||||
<label for="cutting_tool_detection_accuracy_min" string="最小"/>
|
||||
<field name="cutting_tool_detection_accuracy_min" class="o_address_zip"
|
||||
options="{'format': false}"
|
||||
attrs="{'required': [('cutting_tool_type','=','刀柄')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
<label for="cutting_tool_detection_accuracy_max" string="最大"/>
|
||||
<field name="cutting_tool_detection_accuracy_max" class="o_address_zip"
|
||||
options="{'format': false}"
|
||||
attrs="{'required': [('cutting_tool_type','=','刀柄')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
</div>
|
||||
<field name="cutting_tool_body_accuracy"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_jump_accuracy"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_front_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_top_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_rear_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_main_included_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="coating_material"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片','刀柄'))]}"/>
|
||||
<field name="cutting_tool_accuracy_level"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'in', ('刀柄', '整体式刀具','夹头'))]}"/>
|
||||
<field name="cutting_tool_working_hardness"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'in', ('整体式刀具','夹头','刀柄'))]}"/>
|
||||
|
||||
<!-- <field name="tool_height" attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>-->
|
||||
|
||||
|
||||
<field name="cutting_tool_is_rough_finish"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_is_finish"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_is_drill_hole"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_is_high_speed_cutting"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_is_safety_lock" string="有无安全锁"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
|
||||
|
||||
<field name="cutting_tool_jump_accuracy" string="跳动精度(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
<field name="coating_material"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
<field name="cutting_tool_er_size_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
<field name="cutting_tool_handle_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
<field name="cooling_suit_type_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
|
||||
<field name="cutting_tool_wrench"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘' ))]}"/>
|
||||
<!-- <field name="cutting_tool_screw"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀柄'))]}"/>-->
|
||||
<field name="cutting_tool_nut"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
|
||||
<field name="cutting_tool_cutter_bar_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_cutter_pad_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_blade_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
|
||||
<field name="cutting_tool_chuck_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘','刀柄'))]}"/>
|
||||
<field name="apply_lock_nut_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="apply_lock_wrench_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
|
||||
|
||||
</group>
|
||||
</group>
|
||||
<group col="1" attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
|
||||
<group string="适合加工方式">
|
||||
<field name="suitable_machining_method_ids" string=""
|
||||
widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
<group>
|
||||
<group string="刀尖特征">
|
||||
<field name="blade_tip_characteristics_ids" string=""
|
||||
widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
<group string="柄部类型">
|
||||
<field name="handle_type_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<group string="走刀方向">
|
||||
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
<group string="适合冷却液">
|
||||
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="切削速度Vc">
|
||||
<field name="cutting_speed_ids" string="" widget="one2many">
|
||||
<tree editable="bottom">
|
||||
<!-- <field name="order"/>-->
|
||||
<field name="execution_standard_id"/>
|
||||
<field name="material_code"/>
|
||||
<field name="material_name"/>
|
||||
<field name="material_grade"/>
|
||||
<field name="tensile_strength"/>
|
||||
<field name="hardness"/>
|
||||
<field name="cutting_speed_n1"/>
|
||||
<field name="cutting_speed_n2"/>
|
||||
<field name="cutting_speed_n3"/>
|
||||
<field name="cutting_speed_n4"/>
|
||||
<field name="cutting_speed_n5"/>
|
||||
<field name="rough_machining"/>
|
||||
<field name="precision_machining"/>
|
||||
<field name="application"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="每齿走刀量fz">
|
||||
<field name="feed_per_tooth_ids" string="" widget="one2many">
|
||||
<tree editable="bottom">
|
||||
<field name="cutting_speed"
|
||||
attrs="{'readonly': [('materials_type_id','!=',False)]}"/>
|
||||
<field name="machining_method" placeholder="请选择"
|
||||
attrs="{'readonly': [('cutting_speed','!=',False)]}"/>
|
||||
<field name="materials_type_id" placeholder="请选择"
|
||||
attrs="{'readonly': [('cutting_speed','!=',False)]}"/>
|
||||
<field name="blade_diameter"/>
|
||||
<field name="feed_per_tooth"/>
|
||||
<field name="unit"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
|
||||
</group>
|
||||
</page>
|
||||
<page string="夹具物料参数" attrs="{'invisible': [('categ_type', '!=', '夹具')]}">
|
||||
<group attrs='{"invisible": [("fixture_material_type","not in",("气动夹具","转接板(锁板)夹具","磁吸夹具","虎钳夹具","零点卡盘"))]}'>
|
||||
<group>
|
||||
<field name="brand_id"/>
|
||||
<field name="fixture_multi_mounting_type_id" options="{'no_create': True}"
|
||||
attrs="{'required': [('categ_type', '=', '夹具')]}"/>
|
||||
<label for="tool_length" string="尺寸(mm)"/>
|
||||
<div class="o_address_format">
|
||||
<label for="tool_length" string="长"/>
|
||||
<field name="tool_length" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<!-- <span>&nbsp;</span>-->
|
||||
<label for="tool_width" string="宽"/>
|
||||
<field name="tool_width" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<!-- <span>&nbsp;</span>-->
|
||||
<label for="tool_height" string="高"/>
|
||||
<field name="tool_height" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="tool_weight"></field>
|
||||
<label for="fixture_clamp_workpiece_length_max" string="夹持工件最大尺寸(mm)"
|
||||
attrs='{"invisible": [("fixture_material_type","=",("零点卡盘"))]}'/>
|
||||
<div class="o_address_format"
|
||||
attrs='{"invisible": [("fixture_material_type","=",("零点卡盘"))]}'>
|
||||
<label for="fixture_clamp_workpiece_length_max" string="长"/>
|
||||
<field name="fixture_clamp_workpiece_length_max" class="o_address_zip"
|
||||
options="{'format': false}"
|
||||
attrs="{'required': [('fixture_material_type', 'in',('气动夹具','转接板(锁板)夹具','磁吸夹具','虎钳夹具'))]}"/>
|
||||
<!-- <span>&nbsp;</span>-->
|
||||
<label for="fixture_clamp_workpiece_width_max" string="宽"/>
|
||||
<field name="fixture_clamp_workpiece_width_max" class="o_address_zip"
|
||||
options="{'format': false}"
|
||||
attrs="{'required': [('fixture_material_type', 'in',('气动夹具','转接板(锁板)夹具','磁吸夹具','虎钳夹具'))]}"/>
|
||||
<!-- <span>&nbsp;</span>-->
|
||||
<label for="fixture_clamp_workpiece_height_max" string="高"/>
|
||||
<field name="fixture_clamp_workpiece_height_max" class="o_address_zip"
|
||||
options="{'format': false}"
|
||||
attrs="{'required': [('fixture_material_type', 'in',('气动托盘','转接板(锁板)夹具','磁吸夹具','虎钳夹具'))]}"/>
|
||||
</div>
|
||||
<field name="fixture_clamp_workpiece_diameter_max"
|
||||
attrs="{'invisible': [('fixture_material_type','=','零点卡盘')],'required': [('fixture_material_type', 'in',('气动夹具','转接板(锁板)夹具','磁吸夹具','虎钳夹具'))]}"/>
|
||||
<field name="fixture_maximum_carrying_weight"></field>
|
||||
<field name="fixture_maximum_clamping_force"></field>
|
||||
</group>
|
||||
<group>
|
||||
<field name="materials_type_id" options="{'no_create': True}"/>
|
||||
<field name="fixture_clamping_way"
|
||||
attrs='{"invisible": [("fixture_material_type","not in",("气动夹具","磁吸夹具","虎钳夹具"))]}'/>
|
||||
<field name="fixture_port_type"
|
||||
attrs='{"invisible": [("fixture_material_type","not in",("气动夹具","磁吸夹具","虎钳夹具"))]}'/>
|
||||
<field name="fixture_through_hole_size"
|
||||
attrs='{"invisible": [("fixture_material_type","!=",("转接板(锁板)夹具"))]}'/>
|
||||
<field name="fixture_screw_size"
|
||||
attrs='{"invisible": [("fixture_material_type","!=",("转接板(锁板)夹具"))]}'/>
|
||||
<field name="fixture_driving_way"
|
||||
attrs='{"invisible": [("fixture_material_type","not in",("虎钳夹具","零点卡盘"))]}'/>
|
||||
<field name="fixture_apply_machine_tool_type_ids" options="{'no_create': True}"
|
||||
widget="many2many_tags"
|
||||
attrs='{"invisible": [("fixture_material_type","!=",("零点卡盘"))]}'/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_product_category_form_inherit_sf" model="ir.ui.view">
|
||||
<field name="name">product.category.form.inherit.sf</field>
|
||||
@@ -505,11 +42,53 @@
|
||||
</group>
|
||||
</page>
|
||||
<page name="inventory" position="attributes">
|
||||
<attribute name="groups">stock.group_stock_user,product.group_stock_packaging</attribute>
|
||||
<attribute name="groups">
|
||||
stock.group_stock_user,product.group_stock_packaging,sf_base.group_sale_salemanager,sf_base.group_sale_director,sf_base.group_purchase,sf_base.group_purchase_director
|
||||
</attribute>
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_form_view_procurement_button_inherit_sf" model="ir.ui.view">
|
||||
<field name="name">product.template_procurement.form.inherit.sf</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="stock.product_template_form_view_procurement_button"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@name='action_open_quants']" position="attributes">
|
||||
<attribute name="groups">
|
||||
stock.group_stock_user,sf_base.group_sale_salemanager,sf_base.group_sale_director,sf_base.group_purchase,sf_base.group_purchase_director
|
||||
</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//button[@name='action_product_tmpl_forecast_report']" position="attributes">
|
||||
<attribute name="groups">
|
||||
stock.group_stock_user,sf_base.group_sale_salemanager,sf_base.group_sale_director,sf_base.group_purchase,sf_base.group_purchase_director
|
||||
</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//button[@name='action_view_stock_move_lines']" position="attributes">
|
||||
<attribute name="groups">
|
||||
stock.group_stock_user,sf_base.group_sale_salemanager,sf_base.group_sale_director,sf_base.group_purchase,sf_base.group_purchase_director
|
||||
</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//button[@name='action_view_orderpoints']" position="attributes">
|
||||
<attribute name="groups">
|
||||
stock.group_stock_user,sf_base.group_sale_salemanager,sf_base.group_sale_director,sf_base.group_purchase,sf_base.group_purchase_director
|
||||
</attribute>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//button[@name='action_view_related_putaway_rules']" position="attributes">
|
||||
<attribute name="groups">
|
||||
stock.group_stock_user,sf_base.group_sale_salemanager,sf_base.group_sale_director,sf_base.group_purchase,sf_base.group_purchase_director
|
||||
</attribute>
|
||||
</xpath>
|
||||
|
||||
<!-- <xpath expr="//button[@name='action_view_orderpoints']" position="attributes">-->
|
||||
<!-- <attribute name="groups">-->
|
||||
<!-- stock.group_stock_user,sf_base.group_sale_salemanager,sf_base.group_sale_director,sf_base.group_purchase,sf_base.group_purchase_director-->
|
||||
<!-- </attribute>-->
|
||||
<!-- </xpath>-->
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_mrp_bom_form_inherit_sf" model="ir.ui.view">
|
||||
<field name="name">mrp.bom.form.inherit.sf</field>
|
||||
<field name="model">mrp.bom</field>
|
||||
@@ -543,5 +122,6 @@
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="view_mrp_production_workorder_tray_form_inherit_sf1" model="ir.ui.view">
|
||||
<field name="name">production.workorder.dlm</field>
|
||||
<field name="model">mrp.workorder</field>
|
||||
<field name="inherit_id" ref="sf_manufacturing.view_mrp_production_workorder_tray_form_inherit_sf"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<page string="开料要求" attrs='{"invisible": [("routing_type","!=","切割")]}'>
|
||||
<group>
|
||||
<group>
|
||||
<field name="product_tmpl_id_materials_id" widget="many2one"/>
|
||||
<field name="product_tmpl_id_materials_type_id" widget="many2one"/>
|
||||
|
||||
</group>
|
||||
<group>
|
||||
<field name="product_tmpl_id_length"/>
|
||||
<field name="product_tmpl_id_width"/>
|
||||
<field name="product_tmpl_id_height"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
0
sf_dlm_management/__init__.py
Normal file
0
sf_dlm_management/__init__.py
Normal file
25
sf_dlm_management/__manifest__.py
Normal file
25
sf_dlm_management/__manifest__.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
{
|
||||
'name': '机企猫智能工厂 产品管理',
|
||||
'version': '1.0',
|
||||
'summary': '智能工厂产品模块',
|
||||
'sequence': 1,
|
||||
'description': """
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['sf_sale', 'sf_dlm', 'sf_manufacturing'],
|
||||
'data': [
|
||||
# 'data/stock_data.xml',
|
||||
'views/product_template_management_view.xml',
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
'qweb': [
|
||||
],
|
||||
'license': 'LGPL-3',
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
}
|
||||
116
sf_dlm_management/data/product_data.xml
Normal file
116
sf_dlm_management/data/product_data.xml
Normal file
@@ -0,0 +1,116 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<record id="product_category_embryo_sf" model="product.category">
|
||||
<field name="name">坯料</field>
|
||||
<field name="type">坯料</field>
|
||||
</record>
|
||||
<record id="product_category_finished_sf" model="product.category">
|
||||
<field name="name">成品</field>
|
||||
<field name="type">成品</field>
|
||||
</record>
|
||||
|
||||
<record id="product_category_raw_sf" model="product.category">
|
||||
<field name="name">原材料</field>
|
||||
<field name="type">原材料</field>
|
||||
</record>
|
||||
|
||||
<record id="product_category_surface_technics_sf" model="product.category">
|
||||
<field name="name">表面工艺</field>
|
||||
<field name="type">表面工艺</field>
|
||||
</record>
|
||||
|
||||
<record id="product_category_cutting_tool_sf" model="product.category">
|
||||
<field name="name">刀具</field>
|
||||
<field name="type">刀具</field>
|
||||
</record>
|
||||
|
||||
<record id="product_category_clamp_sf" model="product.category">
|
||||
<field name="name">夹具</field>
|
||||
<field name="type">夹具</field>
|
||||
</record>
|
||||
|
||||
<record id="product_category_functional_tool_sf" model="product.category">
|
||||
<field name="name">功能刀具</field>
|
||||
<field name="type">功能刀具</field>
|
||||
</record>
|
||||
|
||||
<record id="product_functional_tool_sf" model="product.product">
|
||||
<field name="name">功能刀具</field>
|
||||
<field name="categ_id" ref="product_category_functional_tool_sf"/>
|
||||
<field name="route_ids"
|
||||
eval="[ref('stock.route_warehouse0_mto')]"/>
|
||||
<field name="invoice_policy">delivery</field>
|
||||
<field name="detailed_type">product</field>
|
||||
<field name="sale_ok">false</field>
|
||||
<field name="uom_id" ref="uom.product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="tracking">serial</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_sf" model="product.product">
|
||||
<field name="name">CNC加工产品模板</field>
|
||||
<field name="active" eval="False"/>
|
||||
<field name="categ_id" ref="product_category_finished_sf"/>
|
||||
<field name="route_ids"
|
||||
eval="[ref('stock.route_warehouse0_mto'), ref('mrp.route_warehouse0_manufacture')]"/>
|
||||
<field name="invoice_policy">delivery</field>
|
||||
<field name="detailed_type">product</field>
|
||||
<field name="purchase_ok">false</field>
|
||||
<field name="uom_id" ref="uom.product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<!-- <field name="single_manufacturing">true</field>-->
|
||||
<field name="tracking">serial</field>
|
||||
<!-- <field name="is_bfm">false</field>-->
|
||||
</record>
|
||||
<record id="product_embryo_sf_self_machining" model="product.product">
|
||||
<field name="name">坯料自加工模板</field>
|
||||
<field name="active" eval="False"/>
|
||||
<field name="categ_id" ref="product_category_embryo_sf"/>
|
||||
<field name="route_ids"
|
||||
eval="[ref('stock.route_warehouse0_mto'), ref('mrp.route_warehouse0_manufacture')]"/>
|
||||
<field name="invoice_policy">delivery</field>
|
||||
<field name="detailed_type">product</field>
|
||||
<field name="purchase_ok">false</field>
|
||||
<field name="uom_id" ref="uom.product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<!-- <field name="single_manufacturing">true</field>-->
|
||||
<field name="tracking">serial</field>
|
||||
<!-- <field name="is_bfm">false</field>-->
|
||||
</record>
|
||||
|
||||
<record id="product_embryo_sf_outsource" model="product.product">
|
||||
<field name="name">坯料外协加工模板</field>
|
||||
<field name="active" eval="False"/>
|
||||
<field name="categ_id" ref="product_category_embryo_sf"/>
|
||||
<field name="route_ids"
|
||||
eval="[ref('stock.route_warehouse0_mto'), ref('purchase_stock.route_warehouse0_buy'),ref('mrp_subcontracting.route_resupply_subcontractor_mto')]"/>
|
||||
<field name="invoice_policy">delivery</field>
|
||||
<field name="detailed_type">product</field>
|
||||
<field name="purchase_ok">true</field>
|
||||
<field name="uom_id" ref="uom.product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="tracking">serial</field>
|
||||
<field name="is_bfm">false</field>
|
||||
</record>
|
||||
<record id="product_embryo_sf_purchase" model="product.product">
|
||||
<field name="name">坯料采购模板</field>
|
||||
<field name="active" eval="False"/>
|
||||
<field name="categ_id" ref="product_category_embryo_sf"/>
|
||||
<field name="route_ids"
|
||||
eval="[ref('stock.route_warehouse0_mto'), ref('purchase_stock.route_warehouse0_buy')]"/>
|
||||
<field name="invoice_policy">delivery</field>
|
||||
<field name="detailed_type">product</field>
|
||||
<field name="purchase_ok">true</field>
|
||||
<field name="uom_id" ref="uom.product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="tracking">serial</field>
|
||||
<field name="is_bfm">false</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
37
sf_dlm_management/data/stock_data.xml
Normal file
37
sf_dlm_management/data/stock_data.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<record id="stock_location_tool_room" model="stock.location">
|
||||
<field name="name">刀具房</field>
|
||||
<field name="usage">internal</field>
|
||||
<field name="location_type">库区</field>
|
||||
<field name="area_type">存货区</field>
|
||||
<field name="barcode">DJF</field>
|
||||
<field name="active">true</field>
|
||||
<field name="product_type"
|
||||
eval="[ref('sf_dlm.product_category_cutting_tool_sf'),
|
||||
ref('sf_dlm.product_category_functional_tool_sf')]"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_tool_assembly" model="stock.location">
|
||||
<field name="name">刀具组装位置</field>
|
||||
<field name="usage">internal</field>
|
||||
<field name="barcode">DJZZ</field>
|
||||
<field name="active">true</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="after_assembly_picking_in" model="stock.picking.type">
|
||||
<field name="name">刀具组装入库</field>
|
||||
<field name="code">internal</field>
|
||||
<field name="sequence_id" ref="sf_manufacturing.tool_assembly_in"/>
|
||||
<field name="active">true</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="sequence_code">ZR</field>
|
||||
<field name="default_location_src_id" ref="sf_manufacturing.stock_location_locations_virtual_after_assembly"/>
|
||||
<field name="default_location_dest_id" ref="stock_location_tool_room"/>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
2
sf_dlm_management/models/__init__.py
Normal file
2
sf_dlm_management/models/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# from . import product_template
|
||||
# from . import product_supplierinfo
|
||||
529
sf_dlm_management/views/product_template_management_view.xml
Normal file
529
sf_dlm_management/views/product_template_management_view.xml
Normal file
@@ -0,0 +1,529 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="view_sale_product_template_form_inherit_sf">
|
||||
<field name="name">product.template.form.inherit.sf</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="sf_sale.view_product_template_form_inherit_sf"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="invoice_policy" position="after">
|
||||
<field name='categ_id'/>
|
||||
<field name='is_bfm' invisible="1"/>
|
||||
<field name='categ_type' invisible="1"/>
|
||||
<field name="upload_model_file"
|
||||
widget="many2many_binary"
|
||||
attrs="{'invisible': ['|', '|',('categ_type', '!=', '成品'),('categ_type', '=', False),('is_bfm','=', True)]}"/>
|
||||
<field name="model_file" widget="Viewer3D" string="模型" readonly="1" force_save="1"
|
||||
attrs="{'invisible': ['|','|', ('categ_type', '!=', '成品'),('categ_type', '=', False),('model_file', '=', False)]}"/>
|
||||
<field name='cutting_tool_type' invisible="1"/>
|
||||
<field name="fixture_material_type" invisible="1"/>
|
||||
<field name="embryo_model_type_id" string="模型类型"
|
||||
attrs="{'invisible': ['|',('categ_type', '!=', '坯料'),('categ_type', '=', False)]}"/>
|
||||
<field name="materials_id" string="材料" placeholder="请选择"
|
||||
attrs="{'invisible': [('categ_type', 'not in', ['成品','坯料', '原材料'])]}"/>
|
||||
<field name="materials_type_id" string="型号" placeholder="请选择"
|
||||
domain="[('materials_id', '=', materials_id)]"
|
||||
attrs="{'invisible': [('categ_type', 'not in', ['成品','坯料', '原材料'])]}"/>
|
||||
<field name="server_product_process_parameters_id" string="表面工艺参数"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': ['|',('categ_type', '!=', '表面工艺'),('categ_type', '=', False)]}"/>
|
||||
<field name="cutting_tool_material_id" attrs="{'invisible': [('categ_type', '!=', '刀具')]}"
|
||||
placeholder="请选择"/>
|
||||
<field name="cutting_tool_model_id" placeholder="请选择"
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')]}"
|
||||
domain="[('cutting_tool_material_id','=',cutting_tool_material_id)]"/>
|
||||
<field name="specification_id" placeholder="请选择" options='{"limit": 1}'
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')]}"
|
||||
domain="[('standard_library_id','=',cutting_tool_model_id)]"/>
|
||||
<field name="fixture_material_id" attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||
placeholder="请选择"/>
|
||||
<field name="fixture_model_id" string="型号" placeholder="请选择"
|
||||
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||
domain="[('fixture_material_id','=',fixture_material_id)]"/>
|
||||
</field>
|
||||
|
||||
<xpath expr="//label[@for='volume']" position="before">
|
||||
<label for="length" string="尺寸"
|
||||
attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}"/>
|
||||
<div class="o_address_format"
|
||||
attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}">
|
||||
<label for="length" string="长"/>
|
||||
<field name="length" class="o_address_zip"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="width" string="宽"/>
|
||||
<field name="width" class="o_address_zip"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="height" string="高"/>
|
||||
<field name="height" class="o_address_zip"/>
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr="//page[last()]" position="after">
|
||||
<page string="加工参数">
|
||||
<group>
|
||||
<group string="模型">
|
||||
<label for="model_long" string="尺寸[mm]"/>
|
||||
<div class="o_address_format">
|
||||
<label for="model_long" string="长"/>
|
||||
<field name="model_long" class="o_address_zip"/>
|
||||
<label for="model_width" string="宽"/>
|
||||
<field name="model_width" class="o_address_zip"/>
|
||||
<label for="model_height" string="高"/>
|
||||
<field name="model_height" class="o_address_zip"/>
|
||||
</div>
|
||||
<field name="model_volume" string="体积[mm³]"/>
|
||||
<field name="product_model_type_id" string="模型类型"/>
|
||||
<field name="model_processing_panel" placeholder="例如R,U" string="加工面板"/>
|
||||
<field name="model_machining_precision"/>
|
||||
<field name="model_process_parameters_ids" string="表面工艺参数"
|
||||
widget="many2many_tags"
|
||||
options="{'no_create': True}"/>
|
||||
<field name="model_remark" string="备注说明"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_product_template_only_form_inherit_sf">
|
||||
<field name="name">product.template.only.form.inherit.sf</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="barcode" position="replace">
|
||||
<field name='barcode' invisible="1"/>
|
||||
</field>
|
||||
<field name="default_code" position="replace">
|
||||
<field name='default_code' invisible="1"/>
|
||||
</field>
|
||||
<xpath expr="//page[@name='variants']" position="before">
|
||||
<page string="刀具物料参数" attrs="{'invisible': [('categ_type', '!=', '刀具')]}">
|
||||
<group>
|
||||
<group attrs="{'invisible': [('categ_type', '!=', '刀具')]}" col="1">
|
||||
<field name="cutting_tool_type_id" options="{'no_create': True}"
|
||||
placeholder="请选择"/>
|
||||
<field name="brand_id" options="{'no_create': True}" placeholder="请选择"/>
|
||||
<field name="cutting_tool_total_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','夹头','刀柄'))]}"/>
|
||||
<field name="tool_hardness" string="硬度(hrc)"/>
|
||||
<label for="cutting_tool_run_out_accuracy_min" string="端跳精度"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<div class="o_address_format"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
|
||||
<label for="cutting_tool_run_out_accuracy_min" string="最小"/>
|
||||
<field name="cutting_tool_run_out_accuracy_min" class="o_address_zip"
|
||||
options="{'format': false}"
|
||||
attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
<label for="cutting_tool_run_out_accuracy_max" string="最大"/>
|
||||
<field name="cutting_tool_run_out_accuracy_max" class="o_address_zip"
|
||||
options="{'format': false}"
|
||||
attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
</div>
|
||||
|
||||
<field name="tool_width"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<field name="tool_height"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<field name="cutting_tool_flange_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_shank_outer_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_shank_inner_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
|
||||
<!-- <field name="materials_type_id" options="{'no_create': True}" string="刀具材质"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"-->
|
||||
<!-- placeholder="请选择"/>-->
|
||||
<!-- <field name="tool_hardness" string="刀具硬度(hrc)"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>-->
|
||||
<!-- <field name="materials_type_id" options="{'no_create': True}" string="夹头材质"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"-->
|
||||
<!-- placeholder="请选择"/>-->
|
||||
<!-- <field name="tool_hardness" string="夹头硬度(hrc)"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>-->
|
||||
<!-- <field name="materials_type_id" options="{'no_create': True}" string="刀柄材质"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"-->
|
||||
<!-- placeholder="请选择"/>-->
|
||||
<!-- <field name="tool_hardness" string="刀柄硬度(hrc)"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>-->
|
||||
|
||||
<field name="cutting_tool_blade_diameter" string="刃部直径(mm)" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_blade_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_blade_width"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_blade_depth"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_blade_helix_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_blade_number" placeholder="请选择"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_blade_tip_working_size"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_blade_tip_diameter" string="刀尖直径(mm)" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_blade_tip_taper" string="刀尖锥度(°)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<!--刀片-->
|
||||
<label for="tool_length" string="尺寸(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<div class="test_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}">
|
||||
<label for="tool_length" string="长"/>
|
||||
<field name="tool_length" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="tool_thickness" string="厚"/>
|
||||
<field name="tool_thickness" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="tool_width" string="宽"/>
|
||||
<field name="tool_width" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="cutting_tool_cut_blade_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_blade_tip_circular_arc_radius"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_blade_tip_height_tolerance"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_inscribed_circle_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_inscribed_circle_tolerance"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_install_aperture_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_chip_breaker_groove"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_cut_depth_max"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_blade_blade_number" string="刃数"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_blade_width" string="刃宽"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<!--刀杆-->
|
||||
|
||||
<label for="cutting_tool_knife_head_length" string="刀头尺寸(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<div class="test_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}">
|
||||
<label for="cutting_tool_knife_head_length" string="长"/>
|
||||
<field name="cutting_tool_knife_head_length" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="cutting_tool_knife_head_width" string="宽"/>
|
||||
<field name="cutting_tool_knife_head_width" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="cutting_tool_knife_head_height" string="高"/>
|
||||
<field name="cutting_tool_knife_head_height" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="cutting_tool_blade_diameter" string="刃部直径(mm)" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
|
||||
<field name="cutting_tool_blade_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}"/>
|
||||
|
||||
<field name="cutting_tool_cutter_arbor_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<field name="cutting_tool_cut_blade_length" string="切削刃长度(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_cut_depth_max"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_min_machining_aperture"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<field name="cutting_tool_install_blade_tip_num"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<!--刀盘-->
|
||||
<field name="cutting_tool_cutter_head_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}"/>
|
||||
<field name="cutting_tool_interface_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}"/>
|
||||
|
||||
<!--夹头-->
|
||||
<field name="cutting_tool_clamping_length"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<field name="cutting_tool_clamping_tolerance"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<label for="cutting_tool_clamping_diameter_min" string="夹持直径"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("夹头","刀柄"))]}'/>
|
||||
<div class="o_address_format"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("夹头","刀柄"))]}'>
|
||||
<label for="cutting_tool_clamping_diameter_min" string="最小"/>
|
||||
<field name="cutting_tool_clamping_diameter_min" class="o_address_zip diameter"
|
||||
options="{'format': false}"
|
||||
attrs="{'required': [('cutting_tool_type','not in',('夹头','刀柄'))]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
<label for="cutting_tool_clamping_diameter_max" string="最大"/>
|
||||
<field name="cutting_tool_clamping_diameter_max" class="o_address_zip diameter"
|
||||
options="{'format': false}"
|
||||
attrs="{'required': [('cutting_tool_type','not in',('夹头','刀柄'))]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
</div>
|
||||
<field name="cutting_tool_clamping_way"
|
||||
attrs="{'invisible': [('cutting_tool_type','not in',('刀柄','夹头'))]}"/>
|
||||
<field name="cutting_tool_top_diameter" class="diameter"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<field name="cutting_tool_outer_diameter" class="diameter"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<field name="cutting_tool_inner_diameter" class="diameter"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<!--夹头-->
|
||||
|
||||
<field name="cutting_tool_standard_speed"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_speed_max"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_change_time"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_cooling_type"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('categ_type', '!=', '刀具')]}">
|
||||
<field name="materials_type_id" options="{'no_create': True}" placeholder="请选择"
|
||||
string="材质"/>
|
||||
<field name="coating_material"/>
|
||||
<field name="cutting_tool_blade_type"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_coarse_medium_fine" string="粗/中/精" placeholder="请选择"
|
||||
attrs="{'required': [('cutting_tool_type','=','整体式刀具')],'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
<!--整体式刀具-->
|
||||
<field name="cutting_tool_shank_diameter" string="柄部直径(mm)" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_shank_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_neck_diameter" string="颈部直径(mm)" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_neck_length" string="颈部长度(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_cut_depth"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_pitch"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="tool_weight"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("夹头","刀柄"))]}'/>
|
||||
<field name="cutting_tool_taper"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头','刀柄'))]}"/>
|
||||
<field name="cutting_tool_jump_accuracy"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_rear_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_main_included_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片','刀杆'))]}"/>
|
||||
<!-- <field name="cutting_tool_front_angle"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>-->
|
||||
<field name="cutting_tool_top_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_blade_tip_dip_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_side_cutting_edge_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_pitch"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_bladed_teeth_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_thickness_tolerance"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_thread_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_thread_num"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_cutter_bar_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_cutter_pad_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<!--刀柄-->
|
||||
<field name="cutting_tool_is_rough_finish"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_is_finish"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_is_drill_hole"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_is_high_speed_cutting"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_is_safety_lock" string="有无安全锁"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
|
||||
|
||||
<field name="cutting_tool_jump_accuracy" string="跳动精度(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
<field name="cutting_tool_max_load_capacity"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
<field name="cutting_tool_er_size_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
<field name="cutting_tool_handle_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
<field name="cooling_suit_type_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
<!-- 刀杆 -->
|
||||
<field name="cutting_tool_rear_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<field name="cutting_tool_installing_structure"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_is_cooling_hole"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_locating_slot_code"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_blade_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_tool_shim"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<field name="cutting_tool_cotter_pin"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<field name="cutting_tool_pressing_plate"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<field name="cutting_tool_screw"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀柄'))]}"/>
|
||||
<field name="cutting_tool_wrench"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀柄'))]}"/>
|
||||
<!-- 刀盘 -->
|
||||
<field name="cutting_tool_blade_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}"/>
|
||||
<field name="cutting_tool_blade_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}"/>
|
||||
|
||||
</group>
|
||||
</group>
|
||||
<group string="适配刀片形状"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'in', ('刀柄','夹头','整体式刀具',False))]}">
|
||||
<field name="fit_blade_shape_id" string="" widget="many2one_radio"/>
|
||||
</group>
|
||||
<group string="适合加工方式"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||
<field name="suitable_machining_method_ids" string=""
|
||||
widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
<group string="刀尖特征"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||
<field name="blade_tip_characteristics_id" string=""
|
||||
widget="many2one_radio"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||
<group string="柄部类型"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
|
||||
<field name="handle_type_id" string="" widget="many2one_radio"/>
|
||||
</group>
|
||||
<group string="压紧方式"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}">
|
||||
<field name="compaction_way_id" string="" widget="many2one_radio"/>
|
||||
</group>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||
<group string="走刀方向">
|
||||
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
<group string="适合冷却液">
|
||||
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="切削速度Vc"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}">
|
||||
<field name="cutting_speed_ids" string="" widget="one2many">
|
||||
<tree editable="bottom">
|
||||
<!-- <field name="order"/>-->
|
||||
<field name="execution_standard_id"/>
|
||||
<field name="material_code"/>
|
||||
<field name="material_id"/>
|
||||
<field name="material_grade"/>
|
||||
<field name="tensile_strength"/>
|
||||
<field name="hardness"/>
|
||||
<field name="cutting_speed_n1"/>
|
||||
<field name="cutting_speed_n2"/>
|
||||
<field name="cutting_speed_n3"/>
|
||||
<field name="cutting_speed_n4"/>
|
||||
<field name="cutting_speed_n5"/>
|
||||
<field name="rough_machining"/>
|
||||
<field name="precision_machining"/>
|
||||
<field name="application"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="每齿走刀量fz"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}">
|
||||
<field name="feed_per_tooth_ids" string="" widget="one2many">
|
||||
<tree editable="bottom">
|
||||
<field name="cutting_speed"
|
||||
attrs="{'readonly': [('materials_type_id','!=',False)]}"/>
|
||||
<field name="machining_method" placeholder="请选择"
|
||||
attrs="{'readonly': [('cutting_speed','!=',False)]}"/>
|
||||
<field name="materials_type_id" placeholder="请选择"
|
||||
attrs="{'readonly': [('cutting_speed','!=',False)]}"/>
|
||||
<field name="blade_diameter"/>
|
||||
<field name="feed_per_tooth"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</page>
|
||||
<page string="夹具物料参数" attrs="{'invisible': [('categ_type', '!=', '夹具')]}">
|
||||
<group attrs='{"invisible": [("fixture_material_type","not in",("气动夹具","转接板(锁板)夹具","磁吸夹具","虎钳夹具","零点卡盘","零点托盘"))]}'>
|
||||
<group>
|
||||
<field name="brand_id"/>
|
||||
<field name="fixture_multi_mounting_type_id" options="{'no_create': True}"/>
|
||||
<label for="tool_length" string="尺寸(mm)"/>
|
||||
<div class="o_address_format">
|
||||
<label for="tool_length" string="长"/>
|
||||
<field name="tool_length" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<!-- <span>&nbsp;</span>-->
|
||||
<label for="tool_width" string="宽"/>
|
||||
<field name="tool_width" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<!-- <span>&nbsp;</span>-->
|
||||
<label for="tool_height" string="高"/>
|
||||
<field name="tool_height" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="tool_weight"></field>
|
||||
<label for="fixture_clamp_workpiece_length_max" string="夹持工件最大尺寸(mm)"
|
||||
attrs='{"invisible": [("fixture_material_type","in",("零点卡盘","零点托盘"))]}'/>
|
||||
<div class="o_address_format"
|
||||
attrs='{"invisible": [("fixture_material_type","in",("零点卡盘","零点托盘"))]}'>
|
||||
<label for="fixture_clamp_workpiece_length_max" string="长"/>
|
||||
<field name="fixture_clamp_workpiece_length_max" class="o_address_zip"
|
||||
options="{'format': false}"
|
||||
attrs="{'required': [('fixture_material_type', 'in',('气动夹具','转接板(锁板)夹具','磁吸夹具','虎钳夹具'))]}"/>
|
||||
<!-- <span>&nbsp;</span>-->
|
||||
<label for="fixture_clamp_workpiece_width_max" string="宽"/>
|
||||
<field name="fixture_clamp_workpiece_width_max" class="o_address_zip"
|
||||
options="{'format': false}"
|
||||
attrs="{'required': [('fixture_material_type', 'in',('气动夹具','转接板(锁板)夹具','磁吸夹具','虎钳夹具'))]}"/>
|
||||
<!-- <span>&nbsp;</span>-->
|
||||
<label for="fixture_clamp_workpiece_height_max" string="高"/>
|
||||
<field name="fixture_clamp_workpiece_height_max" class="o_address_zip"
|
||||
options="{'format': false}"
|
||||
attrs="{'required': [('fixture_material_type', 'in',('气动托盘','转接板(锁板)夹具','磁吸夹具','虎钳夹具'))]}"/>
|
||||
</div>
|
||||
<field name="fixture_clamp_workpiece_diameter_max"
|
||||
attrs="{'invisible': [('fixture_material_type','in',('零点卡盘','零点托盘'))],'required': [('fixture_material_type', 'in',('气动夹具','转接板(锁板)夹具','磁吸夹具','虎钳夹具'))]}"/>
|
||||
<field name="fixture_maximum_carrying_weight"></field>
|
||||
<field name="fixture_maximum_clamping_force"></field>
|
||||
</group>
|
||||
<group>
|
||||
<field name="materials_type_id" options="{'no_create': True}"/>
|
||||
<field name="fixture_clamping_way"
|
||||
attrs='{"invisible": [("fixture_material_type","not in",("气动夹具","磁吸夹具","虎钳夹具"))]}'/>
|
||||
<field name="fixture_port_type"
|
||||
attrs='{"invisible": [("fixture_material_type","not in",("气动夹具","磁吸夹具","虎钳夹具"))]}'/>
|
||||
<field name="fixture_through_hole_size"
|
||||
attrs='{"invisible": [("fixture_material_type","!=",("转接板(锁板)夹具"))]}'/>
|
||||
<field name="fixture_screw_size"
|
||||
attrs='{"invisible": [("fixture_material_type","!=",("转接板(锁板)夹具"))]}'/>
|
||||
<field name="fixture_driving_way"
|
||||
attrs='{"invisible": [("fixture_material_type","not in",("虎钳夹具","零点卡盘","零点托盘"))]}'/>
|
||||
<field name="fixture_apply_machine_tool_type_ids" options="{'no_create': True}"
|
||||
widget="many2many_tags"
|
||||
attrs='{"invisible": [("fixture_material_type","not in",("零点卡盘","零点托盘"))]}'/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -22,23 +22,25 @@
|
||||
'views/ftp_button.xml',
|
||||
|
||||
'views/compensation.xml',
|
||||
# 只有它被屏蔽了
|
||||
# 'views/SfWorkOrderBarcodes.xml',
|
||||
'views/WorkCenterBarcodes.xml',
|
||||
'views/Stock_picking_Barcodes.xml',
|
||||
# 'views/machine_monitor.xml',
|
||||
'views/machine_monitor.xml',
|
||||
'views/machine_info_present.xml',
|
||||
'views/delivery_record.xml',
|
||||
'views/res_config_settings_views.xml',
|
||||
|
||||
],
|
||||
'assets': {
|
||||
'web.assets_backend': [
|
||||
# 'sf_machine_connect/static/src/xml/barcode_button.xml',
|
||||
# 'sf_machine_connect/static/src/js/barcode_button.js',
|
||||
# 'sf_machine_connect/static/src/css/barcode_button.css',
|
||||
'web.assets_backend': [
|
||||
# 'sf_machine_connect/static/src/xml/barcode_button.xml',
|
||||
# 'sf_machine_connect/static/src/js/barcode_button.js',
|
||||
# 'sf_machine_connect/static/src/css/barcode_button.css',
|
||||
],
|
||||
|
||||
},
|
||||
# 'external_dependencies': {'python': ['opcua(使用pip install opcua -i https://pypi.tuna.tsinghua.edu.cn/simple)']},
|
||||
|
||||
'installable': True,
|
||||
'application': True,
|
||||
|
||||
@@ -1,22 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import base64
|
||||
import logging
|
||||
import os
|
||||
import json
|
||||
import hashlib
|
||||
import time
|
||||
import requests
|
||||
from datetime import datetime, timedelta
|
||||
from odoo.http import request
|
||||
from odoo import fields, models, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.addons.sf_machine_connect.models import py2opcua, ftp_operate
|
||||
|
||||
import shutil
|
||||
import base64
|
||||
import logging
|
||||
from io import BytesIO
|
||||
from zipfile import ZipFile
|
||||
from odoo.exceptions import MissingError
|
||||
from datetime import datetime, timedelta
|
||||
import requests
|
||||
from odoo.http import request
|
||||
from odoo import fields, models, api
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.addons.sf_machine_connect.models import py2opcua, ftp_operate
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -61,11 +55,11 @@ class FtpButton(models.Model):
|
||||
raise UserError("补偿值写入执行超时,请检查机床状态或者写入状态")
|
||||
|
||||
# host="192.168.2.158", port=8080, username="MITSUBISHI", password="CNC"
|
||||
host = self.workorder_id.workcenter_id.machine_tool_id.ftp_host
|
||||
port = self.workorder_id.workcenter_id.machine_tool_id.ftp_port
|
||||
username = self.workorder_id.workcenter_id.machine_tool_id.ftp_num
|
||||
pwd = self.workorder_id.workcenter_id.machine_tool_id.ftp_pwd
|
||||
remote_path = self.workorder_id.workcenter_id.machine_tool_id.ftp_remote_path
|
||||
host = self.workorder_id.equipment_id.ftp_host
|
||||
port = self.workorder_id.equipment_id.ftp_port
|
||||
username = self.workorder_id.equipment_id.ftp_num
|
||||
pwd = self.workorder_id.equipment_id.ftp_pwd
|
||||
remote_path = self.workorder_id.equipment_id.ftp_remote_path
|
||||
print(host, port, username, pwd, remote_path)
|
||||
ftp = ftp_operate.FtpController(host, port, username, pwd)
|
||||
# ftp.delAllfile('C://Users//马广威//Desktop//ftp')
|
||||
@@ -108,8 +102,8 @@ class FtpButton(models.Model):
|
||||
下发NC代码前自动补偿三元检测偏差值
|
||||
:return:
|
||||
"""
|
||||
hongbianliang550 = self.workorder_id.workcenter_id.machine_tool_id.x_compensation_node
|
||||
hongbianliang551 = self.workorder_id.workcenter_id.machine_tool_id.y_compensation_node
|
||||
hongbianliang550 = self.workorder_id.equipment_id.x_compensation_node
|
||||
hongbianliang551 = self.workorder_id.equipment_id.y_compensation_node
|
||||
try:
|
||||
temp_dict = {}
|
||||
temp_dict[hongbianliang550] = self.workorder_id.compensation_value_x
|
||||
@@ -125,9 +119,9 @@ class Machine_ftp(models.Model):
|
||||
"""
|
||||
数据采集类
|
||||
"""
|
||||
_inherit = 'sf.machine_tool'
|
||||
_inherit = 'maintenance.equipment'
|
||||
|
||||
workorder_ids = fields.One2many('mrp.workorder', 'machine_tool_id', string='工单')
|
||||
# workorder_ids = fields.One2many('mrp.workorder', 'machine_tool_id', string='工单')
|
||||
|
||||
# 机床配置项目
|
||||
# ftp相关
|
||||
@@ -264,7 +258,7 @@ class WorkCenterBarcode(models.Model):
|
||||
compensation_value_y = fields.Float(string='Y轴补偿值')
|
||||
button_compensation_state = fields.Boolean(string='是否已经补偿', readonly=True)
|
||||
button_up_all_state = fields.Boolean(string='是否已经全部下发', readonly=True)
|
||||
machine_tool_id = fields.Many2one('sf.machine_tool', string='机床')
|
||||
machine_tool_id = fields.Many2one('sf.machine_tool.type', string='机床')
|
||||
machine_tool_name = fields.Char(string='机床名称', default='未知机床', compute='_run_info', readonly=True)
|
||||
machine_tool_type_id = fields.Char(string='机床型号', default='未知型号', compute='_run_info', readonly=True)
|
||||
machine_tool_status = fields.Boolean(string='在线状态', compute='_run_info', readonly=True)
|
||||
@@ -282,27 +276,27 @@ class WorkCenterBarcode(models.Model):
|
||||
machine_tool_compensation_value_y = fields.Char('y补偿值', compute='_run_info', readonly=True)
|
||||
delivery_records = fields.One2many('delivery.record', 'workorder_id', string="下发记录")
|
||||
|
||||
@api.depends('workcenter_id.machine_tool_id.timestamp')
|
||||
@api.depends('equipment_id.timestamp')
|
||||
def _run_info(self):
|
||||
# self.machine_tool_name = '1号机床'
|
||||
self.machine_tool_name = self.workcenter_id.machine_tool_id.name
|
||||
self.machine_tool_type_id = self.workcenter_id.machine_tool_id.type_id.name
|
||||
self.machine_tool_status = self.workcenter_id.machine_tool_id.status
|
||||
self.machine_tool_run_status = self.workcenter_id.machine_tool_id.run_status
|
||||
self.machine_tool_timestamp = self.workcenter_id.machine_tool_id.timestamp
|
||||
self.machine_tool_time_on = self.workcenter_id.machine_tool_id.time_on
|
||||
self.machine_tool_time_on_now = self.workcenter_id.machine_tool_id.time_on_now
|
||||
self.machine_tool_tool_num = self.workcenter_id.machine_tool_id.tool_num
|
||||
self.machine_tool_program = self.workcenter_id.machine_tool_id.program
|
||||
self.machine_tool_machine_ip = self.workcenter_id.machine_tool_id.machine_ip
|
||||
self.machine_tool_cut_status = self.workcenter_id.machine_tool_id.cut_status
|
||||
self.machine_tool_name = self.equipment_id.name
|
||||
self.machine_tool_type_id = self.equipment_id.type_id.name
|
||||
self.machine_tool_status = self.equipment_id.status
|
||||
self.machine_tool_run_status = self.equipment_id.run_status
|
||||
self.machine_tool_timestamp = self.equipment_id.timestamp
|
||||
self.machine_tool_time_on = self.equipment_id.time_on
|
||||
self.machine_tool_time_on_now = self.equipment_id.time_on_now
|
||||
self.machine_tool_tool_num = self.equipment_id.tool_num
|
||||
self.machine_tool_program = self.equipment_id.program
|
||||
self.machine_tool_machine_ip = self.equipment_id.machine_ip
|
||||
self.machine_tool_cut_status = self.equipment_id.cut_status
|
||||
self.machine_tool_compensation_value_x = self.compensation_value_x
|
||||
self.machine_tool_compensation_value_y = self.compensation_value_y
|
||||
|
||||
def compensation(self):
|
||||
|
||||
hongbianliang550 = self.workcenter_id.machine_tool_id.x_compensation_node
|
||||
hongbianliang551 = self.workcenter_id.machine_tool_id.y_compensation_node
|
||||
hongbianliang550 = self.equipment_id.x_compensation_node
|
||||
hongbianliang551 = self.equipment_id.y_compensation_node
|
||||
try:
|
||||
temp_dict = {}
|
||||
temp_dict[hongbianliang550] = self.compensation_value_x
|
||||
@@ -340,11 +334,11 @@ class WorkCenterBarcode(models.Model):
|
||||
except Exception:
|
||||
raise UserError("补偿值写入执行超时,请检查机床状态或者写入状态")
|
||||
sequence_collect = []
|
||||
host = self.workcenter_id.machine_tool_id.ftp_host
|
||||
port = self.workcenter_id.machine_tool_id.ftp_port
|
||||
username = self.workcenter_id.machine_tool_id.ftp_num
|
||||
pwd = self.workcenter_id.machine_tool_id.ftp_pwd
|
||||
remote_path = self.workcenter_id.machine_tool_id.ftp_remote_path
|
||||
host = self.equipment_id.ftp_host
|
||||
port = self.equipment_id.ftp_port
|
||||
username = self.equipment_id.ftp_num
|
||||
pwd = self.equipment_id.ftp_pwd
|
||||
remote_path = self.equipment_id.ftp_remote_path
|
||||
_logger.info("=====================1666666661111================%s,%s,%s,%s" % (host, port, username, pwd))
|
||||
ftp = ftp_operate.FtpController(host, port, username, pwd)
|
||||
_logger.info("=====================1777777777111================")
|
||||
@@ -404,11 +398,11 @@ class WorkCenterBarcode(models.Model):
|
||||
except Exception:
|
||||
raise UserError("补偿值写入执行超时,请检查机床状态或者写入状态")
|
||||
sequence_collect = []
|
||||
host = self.workcenter_id.machine_tool_id.ftp_host
|
||||
port = self.workcenter_id.machine_tool_id.ftp_port
|
||||
username = self.workcenter_id.machine_tool_id.ftp_num
|
||||
pwd = self.workcenter_id.machine_tool_id.ftp_pwd
|
||||
remote_path = self.workcenter_id.machine_tool_id.ftp_remote_path
|
||||
host = self.equipment_id.ftp_host
|
||||
port = self.equipment_id.ftp_port
|
||||
username = self.equipment_id.ftp_num
|
||||
pwd = self.equipment_id.ftp_pwd
|
||||
remote_path = self.equipment_id.ftp_remote_path
|
||||
_logger.info("=====================1666666661111================%s,%s,%s,%s" % (host, port, username, pwd))
|
||||
ftp = ftp_operate.FtpController(host, port, username, pwd)
|
||||
_logger.info("=====================1777777777111================")
|
||||
@@ -471,7 +465,7 @@ class WorkCenterBarcode(models.Model):
|
||||
raise UserError('NC下发执行超时, 请检查下发状态')
|
||||
|
||||
def get__state(self):
|
||||
pay_time = str(datetime.now())
|
||||
# pay_time = str(datetime.now())
|
||||
json = {
|
||||
'params': {
|
||||
'model_name': 'jikimo.process.order',
|
||||
@@ -514,7 +508,6 @@ class WorkCenterBarcode(models.Model):
|
||||
print('111111111111111111111')
|
||||
workorder_obj_target = self.env['mrp.workorder'].sudo().search([('tray_code', '=', barcode)])
|
||||
workorder_obj_current = self.env['mrp.workorder'].sudo().search([('id', '=', kwargs['current_id'])])
|
||||
# workorder_cnc = self.env['mrp.workorder'].sudo().search(['&', ('production_id', '=', workorder_obj.production_id.id), ('name', '=', 'CNC加工')])
|
||||
workorder_cnc = self.env['mrp.workorder'].sudo().search(
|
||||
['&', ('production_id', '=', workorder_obj_target.production_id.id),
|
||||
('name', '=', workorder_obj_current.name)])
|
||||
@@ -540,7 +533,7 @@ class WorkCenterBarcode(models.Model):
|
||||
action1 = json.dumps(action)
|
||||
return action1
|
||||
else:
|
||||
return False
|
||||
return None
|
||||
|
||||
def cnc_file_download(self):
|
||||
"""
|
||||
@@ -550,7 +543,7 @@ class WorkCenterBarcode(models.Model):
|
||||
|
||||
# 如果没有附件,直接返回
|
||||
if not self.cnc_ids:
|
||||
return
|
||||
return None
|
||||
|
||||
# 处理第一个附件的文件名
|
||||
first_attachment = self.cnc_ids[0].cnc_id
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
import logging
|
||||
from ftplib import FTP
|
||||
|
||||
@@ -20,7 +19,6 @@ class FTP_P(FTP):
|
||||
cmd = 'LIST'
|
||||
templist = []
|
||||
tempdic = {}
|
||||
func = None
|
||||
if args[-1:] and type(args[-1]) != type(''):
|
||||
args, func = args[:-1], args[-1]
|
||||
for arg in args:
|
||||
@@ -49,7 +47,6 @@ class FtpController:
|
||||
self.port = port
|
||||
self.username = username
|
||||
self.password = password
|
||||
# _logger.info("===================ftppppp==================%s,%s,%s,%s" % self.host, self.port, self.username, self.password)
|
||||
# 测试
|
||||
print("==============================================")
|
||||
print(self.username, self.port, self.host, self.password)
|
||||
@@ -92,7 +89,6 @@ class FtpController:
|
||||
"""
|
||||
self.ftp.close()
|
||||
|
||||
|
||||
def delAllfile(self, ftppath):
|
||||
"""
|
||||
删除ftp服务器端全部文件
|
||||
|
||||
@@ -26,11 +26,11 @@ class Py2opcua:
|
||||
"""
|
||||
# try:
|
||||
self.client.connect()
|
||||
# print("opcua服务器连接成功,可以写入")
|
||||
# return self.client
|
||||
# print("opcua服务器连接成功,可以写入")
|
||||
# return self.client
|
||||
# except Exception as e:
|
||||
# print("opcua服务器连接失败,请检查" + str(e))
|
||||
# temp_dict = temp_dict
|
||||
# temp_dict = temp_dict
|
||||
temp_list = list(temp_dict.items())
|
||||
for i in range(len(temp_list)):
|
||||
# 寻找节点上的变量
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
from odoo import api, fields, models, _
|
||||
from odoo import api, fields, models
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -10,7 +10,7 @@ class ResBFMConfigSettings(models.TransientModel):
|
||||
|
||||
bfm_url = fields.Selection(
|
||||
[("https://bfm.cs.jikimo.com", "开发环境(https://bfm.cs.jikimo.com)"),
|
||||
("https://bfm.r.jikimo.com", "测试环境(https://bfm.r.jikimo.com)"),
|
||||
("https://bfm.t.jikimo.com", "测试环境(https://bfm.t.jikimo.com)"),
|
||||
# ("正式环境", "https://bfm.jikimo.com")], string='bfm环境', store=True)
|
||||
("https://bfm.jikimo.com", "正式环境(https://bfm.jikimo.com)")], string='bfm环境', store=True)
|
||||
|
||||
@@ -33,4 +33,3 @@ class ResBFMConfigSettings(models.TransientModel):
|
||||
super(ResBFMConfigSettings, self).set_values()
|
||||
ir_config = self.env['ir.config_parameter'].sudo()
|
||||
ir_config.set_param("bfm_url", self.bfm_url or "")
|
||||
|
||||
|
||||
@@ -1,56 +1,50 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { browser } from "@web/core/browser/browser";
|
||||
import { Dialog } from "@web/core/dialog/dialog";
|
||||
import { _lt } from "@web/core/l10n/translation";
|
||||
import { useChildRef, useOwnedDialogs, useService } from "@web/core/utils/hooks";
|
||||
import { sprintf } from "@web/core/utils/strings";
|
||||
import { isMobileOS } from "@web/core/browser/feature_detection";
|
||||
import * as BarcodeScanner from "@web/webclient/barcode/barcode_scanner";
|
||||
const { useRef } = owl;
|
||||
const {xml, Component} = owl;
|
||||
// import { browser } from "@web/core/browser/browser";
|
||||
// import * as BarcodeScanner from "@web/webclient/barcode/barcode_scanner";
|
||||
const { Component } = owl;
|
||||
import { standardFieldProps } from "@web/views/fields/standard_field_props";
|
||||
import {registry} from "@web/core/registry";
|
||||
import {useInputField} from "@web/views/fields/input_field_hook";
|
||||
|
||||
export class CodeField extends Component {
|
||||
setup() {
|
||||
console.log('CodeField created')
|
||||
console.log('this',this)
|
||||
console.log('this.props',this.props)
|
||||
console.log('this.props.record',this.props.value)
|
||||
// console.log('CodeField created')
|
||||
// console.log('this',this)
|
||||
// console.log('this.props',this.props)
|
||||
// console.log('this.props.record',this.props.value)
|
||||
useInputField({
|
||||
getValue: () => this.props.value,
|
||||
refName: "scan_code",
|
||||
});
|
||||
console.log('我是setup1')
|
||||
// console.log('我是setup1')
|
||||
super.setup();
|
||||
this.orm = this.env.services.orm;
|
||||
this.record = this.props.record;
|
||||
}
|
||||
|
||||
async onBarcodeBtnClick() {
|
||||
const barcode = await BarcodeScanner.scanBarcode();
|
||||
if (barcode) {
|
||||
await this.onBarcodeScanned(barcode);
|
||||
if ("vibrate" in browser.navigator) {
|
||||
browser.navigator.vibrate(100);
|
||||
}
|
||||
} else {
|
||||
this.notification.add(this.env._t("Please, scan again !"), {
|
||||
type: "warning",
|
||||
});
|
||||
}
|
||||
}
|
||||
// async onBarcodeBtnClick() {
|
||||
// const barcode = await BarcodeScanner.scanBarcode();
|
||||
// if (barcode) {
|
||||
// await this.onBarcodeScanned(barcode);
|
||||
// if ("vibrate" in browser.navigator) {
|
||||
// browser.navigator.vibrate(100);
|
||||
// }
|
||||
// } else {
|
||||
// this.notification.add(this.env._t("Please, scan again !"), {
|
||||
// type: "warning",
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
async search(barcode) {
|
||||
// alert('我是search')
|
||||
const domain = [["code", "=", barcode]];
|
||||
console.log(domain)
|
||||
// console.log(domain)
|
||||
const fields = ["id", "code", "name", "state"];
|
||||
console.log(fields)
|
||||
// console.log(fields)
|
||||
const results = await this.orm.call("sf.tray", "search_read", [domain, fields]);
|
||||
const values = await this.orm.call("sf.tray", "search_read", [domain]);
|
||||
console.log(results)
|
||||
// console.log(results)
|
||||
return results.map((result) => {
|
||||
return {
|
||||
id: result.id,
|
||||
@@ -63,52 +57,52 @@ export class CodeField extends Component {
|
||||
}
|
||||
async onBarcodeScanned(barcode) {
|
||||
const results = await this.search(barcode);
|
||||
console.log(results)
|
||||
// console.log(results)
|
||||
const records = results.filter((r) => !!r.id);
|
||||
console.log(records)
|
||||
// console.log(records)
|
||||
if (records.length === 1) {
|
||||
if (records[0].state === '空闲') {
|
||||
console.log('currentModel',this)
|
||||
console.log('this.record.data',this.record.data)
|
||||
console.log('this.record.data.id', this.record.data.id)
|
||||
const workorder = await this.orm.call('mrp.workorder', 'read', [this.record.data.id]);
|
||||
console.log('workorder', workorder[0])
|
||||
const updatedRecord = await this.orm.call("sf.tray", "write", [
|
||||
[records[0].id],
|
||||
{
|
||||
state: "占用",
|
||||
workorder_id: workorder[0].id,
|
||||
production_id: workorder[0].product_id[0],
|
||||
// workorder_id: workorder.id,
|
||||
}]);
|
||||
console.log(workorder[0].routing_type);
|
||||
console.log(workorder[0].production_id);
|
||||
// console.log('currentModel',this)
|
||||
// console.log('this.record.data',this.record.data)
|
||||
// console.log('this.record.data.id', this.record.data.id)
|
||||
// const workorder = await this.orm.call('mrp.workorder', 'read', [this.record.data.id]);
|
||||
// console.log('workorder', workorder[0])
|
||||
// const updatedRecord = await this.orm.call("sf.tray", "write", [
|
||||
// [records[0].id],
|
||||
// {
|
||||
// state: "占用",
|
||||
// workorder_id: workorder[0].id,
|
||||
// production_id: workorder[0].product_id[0],
|
||||
// // workorder_id: workorder.id,
|
||||
// }]);
|
||||
// console.log(workorder[0].routing_type);
|
||||
// console.log(workorder[0].production_id);
|
||||
// const productionIDS = await this.orm.call('mrp.production', 'search', [[['id', '=', workorder[0].production_id[0]]]]);
|
||||
const productionIDS = await this.orm.call('mrp.workorder', 'search', [[["production_id", "=", workorder[0].production_id[0]]]]);
|
||||
console.log('prooooooo', productionIDS);
|
||||
console.log('values', records[0].values[0]);
|
||||
productionIDS.forEach(async (data) => {
|
||||
// 处理每一个数据
|
||||
console.log(data);
|
||||
const updatetrayRecord = await this.orm.call("mrp.workorder", "write", [
|
||||
[data],
|
||||
{
|
||||
tray_id: records[0].values[0].id,
|
||||
// tray_id: false,
|
||||
}]);
|
||||
console.log(updatetrayRecord)
|
||||
});
|
||||
// const productionIDS = await this.orm.call('mrp.workorder', 'search', [[["production_id", "=", workorder[0].production_id[0]]]]);
|
||||
// console.log('prooooooo', productionIDS);
|
||||
// console.log('values', records[0].values[0]);
|
||||
// productionIDS.forEach(async (data) => {
|
||||
// // 处理每一个数据
|
||||
// // console.log(data);
|
||||
// const updatetrayRecord = await this.orm.call("mrp.workorder", "write", [
|
||||
// [data],
|
||||
// {
|
||||
// tray_id: records[0].values[0].id,
|
||||
// // tray_id: false,
|
||||
// }]);
|
||||
// // console.log(updatetrayRecord)
|
||||
// });
|
||||
this.props.update(records[0].code);
|
||||
$('.o_form_button_save').click();
|
||||
} else {
|
||||
if (records[0].state === '占用') {
|
||||
console.log('此托盘已占用,请检查')
|
||||
alert('此托盘已占用,请检查')
|
||||
// console.log('此托盘已占用,请检查')
|
||||
alert('此托盘已占用,请检查');
|
||||
} else {
|
||||
console.log('此托盘已损坏,请登记')
|
||||
// console.log('此托盘已损坏,请登记')
|
||||
alert('此托盘已损坏,请登记');
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
const searchInput = this.autocompleteContainerRef.el.querySelector("input");
|
||||
searchInput.value = barcode;
|
||||
@@ -119,7 +113,7 @@ export class CodeField extends Component {
|
||||
}
|
||||
}
|
||||
}
|
||||
CodeField.template = 'sf_machine_connect.CodeField'
|
||||
CodeField.template = 'sf_machine_connect.CodeField';
|
||||
// Register the field in the registry
|
||||
CodeField.props = standardFieldProps;
|
||||
registry.category("fields").add("code", CodeField);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
odoo.define('my_module.barcode_handler', function (require) {
|
||||
"use strict";
|
||||
|
||||
var core = require('web.core');
|
||||
// var core = require('web.core');
|
||||
var registry = require('web.field_registry');
|
||||
var session = require('web.session');
|
||||
var FieldChar = require('web.basic_fields').FieldChar;
|
||||
|
||||
var _t = core._t;
|
||||
// var _t = core._t;
|
||||
|
||||
var BarcodeHandlerField = FieldChar.extend({
|
||||
init: function () {
|
||||
@@ -48,4 +48,4 @@ odoo.define('my_module.barcode_handler', function (require) {
|
||||
return {
|
||||
BarcodeHandlerField: BarcodeHandlerField,
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,10 +8,7 @@ const { Component, xml } = owl;
|
||||
|
||||
export class BarcodeHandlerField extends Component {
|
||||
setup() {
|
||||
console.log('99999999111');
|
||||
this.actionService = useService("action")
|
||||
console.log(this.actionService)
|
||||
|
||||
this.actionService = useService("action");
|
||||
const barcode = useService("barcode");
|
||||
// this.rpc = useService("rpc");
|
||||
// useBus(barcode.bus, "barcode_scanned", this.onBarcodeScanned.bind(this));
|
||||
@@ -20,11 +17,8 @@ export class BarcodeHandlerField extends Component {
|
||||
async _rpc(params) {
|
||||
// const { data } = await this.env.services.rpc('/web/dataset/call_kw', params);
|
||||
const response = await this.env.services.rpc('/web/dataset/call_kw', params);
|
||||
console.log('response', response);
|
||||
console.log('response.result', response.result);
|
||||
|
||||
// return response
|
||||
const responseObject = JSON.parse(response)
|
||||
const responseObject = JSON.parse(response);
|
||||
return responseObject;
|
||||
}
|
||||
|
||||
@@ -33,8 +27,6 @@ export class BarcodeHandlerField extends Component {
|
||||
this.props.update(barcode);
|
||||
// const actionService = useService("action");
|
||||
// const productId = 12345
|
||||
console.log('111222222222211111');
|
||||
|
||||
// 根据条形码获取相关数据,例如产品ID
|
||||
const response = await this._rpc({
|
||||
model: 'mrp.workorder',
|
||||
@@ -42,11 +34,10 @@ export class BarcodeHandlerField extends Component {
|
||||
args: [barcode],
|
||||
kwargs:{},
|
||||
});
|
||||
// console.log(productId.result)
|
||||
if (response.result) {
|
||||
const action = response.result;
|
||||
console.log(action)
|
||||
console.log('11111111111111111111111111111111111');
|
||||
// const action = response.result;
|
||||
// console.log(action)
|
||||
// console.log('11111111111111111111111111111111111');
|
||||
// 通过产品ID执行操作并跳转到表单视图
|
||||
// await this.actionService.doAction({
|
||||
// // type: 'ir.actions.act_window',
|
||||
@@ -65,10 +56,9 @@ export class BarcodeHandlerField extends Component {
|
||||
// });
|
||||
await this.actionService.doAction(response.result);
|
||||
} else {
|
||||
console.error("Barcode not found or RPC call failed.");
|
||||
// console.error("Barcode not found or RPC call failed.");
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
BarcodeHandlerField.template = xml``;
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
<odoo>
|
||||
<record id="view_tree_mrs_machine_tool_inherited" model="ir.ui.view">
|
||||
<field name="name">sf_base_extension</field>
|
||||
<field name="model">sf.machine_tool</field>
|
||||
<field name="inherit_id" ref="sf_base.sf_machine_tool_form"/>
|
||||
<field name="model">maintenance.equipment</field>
|
||||
<field name="inherit_id" ref="sf_maintenance.sf_hr_equipment_view_form"/>
|
||||
<field eval="20" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<!-- <xpath expr="//field[@name='knife_type']" position="before">-->
|
||||
<xpath expr="//form//notebook//page[1]" position="inside">
|
||||
<xpath expr="//form//notebook//page[1]" position="after">
|
||||
<!-- <xpath expr="//page[@name='other']" position="before">-->
|
||||
<notebook>
|
||||
<!-- <notebook> -->
|
||||
<page string="机床监控">
|
||||
<group string='状态监控'>
|
||||
<group>
|
||||
@@ -256,49 +256,51 @@
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
<!-- </notebook> -->
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_cutting_tool_inherited" model="ir.ui.view">
|
||||
<field name="name">sf_cutting_tool_extension</field>
|
||||
<field name="model">sf.cutting_tool.type</field>
|
||||
<field name="inherit_id" ref="sf_base.form_sf_cutting_tool_type"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//form//group" position="after">
|
||||
<group string='刀具寿命'>
|
||||
<group>
|
||||
<field name="total_cut_time"/>
|
||||
<field name="tool_position"/>
|
||||
|
||||
</group>
|
||||
<group>
|
||||
<field name="predict_life_time"/>
|
||||
<!-- 刀具寿命 -->
|
||||
<!-- <record id="view_cutting_tool_inherited" model="ir.ui.view"> -->
|
||||
<!-- <field name="name">sf_cutting_tool_extension</field> -->
|
||||
<!-- <field name="model">sf.cutting_tool.type</field> -->
|
||||
<!-- <field name="inherit_id" ref="sf_base.form_sf_machine_tool_type"/> -->
|
||||
<!-- <field name="arch" type="xml"> -->
|
||||
<!-- <xpath expr="//form//group" position="after"> -->
|
||||
<!-- <group string='刀具寿命'> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="total_cut_time"/> -->
|
||||
<!-- <field name="tool_position"/> -->
|
||||
|
||||
</group>
|
||||
<!-- </group> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="predict_life_time"/> -->
|
||||
|
||||
<div>
|
||||
<!-- </group> -->
|
||||
|
||||
<div>
|
||||
<field name='is_connect_tool_position' invisible='1'/>
|
||||
<button string="绑定刀位" name="tool_connect_machine" type="object" confirm="是否确认绑定此刀位"
|
||||
class="btn-primary"/>
|
||||
<!-- <div> -->
|
||||
|
||||
<!-- <div> -->
|
||||
<!-- <field name='is_connect_tool_position' invisible='1'/> -->
|
||||
<!-- <button string="绑定刀位" name="tool_connect_machine" type="object" confirm="是否确认绑定此刀位" -->
|
||||
<!-- class="btn-primary"/> -->
|
||||
<!-- attrs='{"invisible": [("is_connect_tool_position","!=", -->
|
||||
<!-- "False")]}' -->
|
||||
<span> </span>
|
||||
<button string="解绑刀位" name="tool_unconnect_machine" type="object" confirm="是否解绑此刀位"
|
||||
class="btn-primary"/>
|
||||
<!-- <span> </span> -->
|
||||
<!-- <button string="解绑刀位" name="tool_unconnect_machine" type="object" confirm="是否解绑此刀位" -->
|
||||
<!-- class="btn-primary"/> -->
|
||||
<!-- attrs='{"invisible": [("is_connect_tool_position","!=", -->
|
||||
<!-- "False")]}' -->
|
||||
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- </div> -->
|
||||
<!-- </group> -->
|
||||
<!-- </xpath> -->
|
||||
<!-- </field> -->
|
||||
<!-- </record> -->
|
||||
</odoo>
|
||||
|
||||
@@ -1 +1 @@
|
||||
from . import action_up
|
||||
from . import action_up
|
||||
|
||||
@@ -2,16 +2,11 @@
|
||||
import base64
|
||||
import logging
|
||||
import os
|
||||
import json
|
||||
import hashlib
|
||||
import time
|
||||
import requests
|
||||
from datetime import datetime
|
||||
|
||||
from odoo import fields, models, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo import fields, models
|
||||
# from odoo.exceptions import ValidationError
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.addons.sf_machine_connect.models import py2opcua, ftp_operate
|
||||
from odoo.addons.sf_machine_connect.models import ftp_operate
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'category': '工厂设备',
|
||||
'description': """
|
||||
""",
|
||||
'depends': ['maintenance', 'sf_base'],
|
||||
'depends': ['hr_maintenance', 'sf_base'],
|
||||
'data': [
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
@@ -14,9 +14,10 @@
|
||||
'views/maintenance_views.xml',
|
||||
'views/equipment_maintenance_standards_views.xml',
|
||||
'views/maintenance_request_views.xml',
|
||||
'views/maintenance_equipment_category_views.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
'license': 'LGPL-3',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# -*-coding:utf-8-*-
|
||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
||||
from odoo.exceptions import UserError
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
|
||||
class SfEquipmentSaintenanceStandards(models.Model):
|
||||
_name = 'equipment.maintenance.standards'
|
||||
@@ -18,6 +19,7 @@ class SfEquipmentSaintenanceStandards(models.Model):
|
||||
m = int(partner.code[-4:]) + 1
|
||||
num = "%04d" % m
|
||||
return num
|
||||
|
||||
code = fields.Char(string='编码')
|
||||
remark = fields.Char('备注')
|
||||
maintenance_type = fields.Selection([('保养', '保养'), ("检修", "检修")], string='类型', default='保养')
|
||||
@@ -48,8 +50,8 @@ class SfEquipmentSaintenanceStandards(models.Model):
|
||||
string='适用设备',
|
||||
domain="[('category_id', '=', maintenance_equipment_category_id)]"
|
||||
)
|
||||
|
||||
maintenance_standards_ids = fields.One2many('maintenance.standards', 'equipment_maintenance_standards_id', string='维保项目')
|
||||
maintenance_standards_ids = fields.One2many('maintenance.standards', 'equipment_maintenance_standards_id',
|
||||
string='维保项目', widget='one2many_list')
|
||||
eq_maintenance_ids = fields.One2many('maintenance.equipment', 'eq_maintenance_id', string='保养设备')
|
||||
overhaul_ids = fields.One2many('maintenance.equipment', 'overhaul_id', string='检修设备')
|
||||
|
||||
@@ -69,6 +71,7 @@ class SfEquipmentSaintenanceStandards(models.Model):
|
||||
# work.sequence = current_sequence
|
||||
# current_sequence += 1
|
||||
|
||||
|
||||
class SfSaintenanceStandards(models.Model):
|
||||
_name = 'maintenance.standards'
|
||||
_description = '维保项目'
|
||||
@@ -81,6 +84,7 @@ class SfSaintenanceStandards(models.Model):
|
||||
[('电气类', '电气类'), ('机械类', '机械类'), ('程序类', '程序类'), ('系统类', '系统类')], string='类别')
|
||||
equipment_maintenance_standards_id = fields.Many2one('equipment.maintenance.standards', string='设备维保标准')
|
||||
images = fields.One2many('maintenance.standard.image', 'standard_id', string='反馈图片')
|
||||
maintenance_request_ids = fields.Many2many('maintenance.request', string='维保计划')
|
||||
Period = fields.Integer('周期/频次(天)')
|
||||
remark = fields.Char('备注说明')
|
||||
|
||||
@@ -91,7 +95,3 @@ class MaintenanceStandardImage(models.Model):
|
||||
|
||||
image = fields.Binary(string='维保图片')
|
||||
standard_id = fields.Many2one('maintenance.standards', string='Standard')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import base64
|
||||
|
||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
||||
from odoo.exceptions import UserError
|
||||
import logging
|
||||
from datetime import date, datetime, timedelta
|
||||
import requests
|
||||
import json
|
||||
import base64
|
||||
from datetime import timedelta
|
||||
import requests
|
||||
from odoo.addons.sf_base.commons.common import Common
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class SfMaintenanceEquipmentCategory(models.Model):
|
||||
_inherit = 'maintenance.equipment.category'
|
||||
_description = '设备类别'
|
||||
|
||||
equipment_type = fields.Selection([('机床', '机床'), ('机器人', '机器人'), ('AGV小车', 'AGV小车'), ('检测设备', '检测设备')], string='类型', default='机床')
|
||||
equipment_type = fields.Selection([('机床', '机床'), ('机器人', '机器人'), ('AGV小车', 'AGV小车'),
|
||||
('检测设备', '检测设备')], string='类型', default='机床')
|
||||
equipment_type_code = fields.Char('简写')
|
||||
|
||||
|
||||
class SfMaintenanceEquipment(models.Model):
|
||||
@@ -23,6 +23,69 @@ class SfMaintenanceEquipment(models.Model):
|
||||
|
||||
crea_url = "/api/machine_tool/create"
|
||||
|
||||
# 1212修改后的字段
|
||||
number_of_axles = fields.Selection(
|
||||
[("三轴", "三轴"), ("四轴", "四轴"), ("五轴", "五轴"), ("六轴", "六轴")],
|
||||
default="", string="轴数")
|
||||
|
||||
# 1212新增字段
|
||||
a_axis = fields.Integer('a轴')
|
||||
function_type = fields.Selection(
|
||||
[("ZXJGZX", "钻铣加工中心"), ("CXJGZX", "车削加工中心"), ("FHJGZX", "复合加工中心")],
|
||||
default="", string="功能类型")
|
||||
T_trough_num = fields.Integer('槽数')
|
||||
T_trough_wide = fields.Float('槽宽(mm)')
|
||||
T_trough_distance = fields.Float('槽距(mm)')
|
||||
|
||||
taper_type_id = fields.Many2one('spindle.taper.type', string='主轴锥孔型号')
|
||||
spindle_center_distance = fields.Float('主轴中心至立柱滑轨面距离(mm)')
|
||||
spindle_continuous_power = fields.Float('主轴持续功率(kw)')
|
||||
spindle_peak_power = fields.Float('主轴峰值功率(kw)')
|
||||
spindle_sustained_torque = fields.Float('主轴持续扭矩(n/m)')
|
||||
spindle_peak_torque = fields.Float('主轴峰值扭矩(n/m)')
|
||||
linear_axis_guides_type = fields.Char('直线轴导轨类型')
|
||||
axis_driven_type = fields.Char('坐标轴驱动类型')
|
||||
|
||||
X_axis_rapid_traverse_speed = fields.Char('X轴快速进给速度(mm/min)')
|
||||
Y_axis_rapid_traverse_speed = fields.Char('Y轴快速进给速度(mm/min)')
|
||||
Z_axis_rapid_traverse_speed = fields.Char('Z轴快速进给速度(mm/min)')
|
||||
a_axis_rapid_traverse_speed = fields.Char('a轴快速进给速度(mm/min)')
|
||||
b_axis_rapid_traverse_speed = fields.Char('b轴快速进给速度(mm/min)')
|
||||
c_axis_rapid_traverse_speed = fields.Char('c轴快速进给速度(mm/min)')
|
||||
straight_cutting_feed_rate = fields.Char('直线切削进给速度(mm/min)')
|
||||
rotary_cutting_feed_rate = fields.Char('回转切削进给速度(mm/min)')
|
||||
|
||||
X_precision = fields.Float('X轴定位精度(mm)', digits=(12, 3))
|
||||
X_precision_repeat = fields.Float('X轴重复定位精度(mm)', digits=(12, 3))
|
||||
Y_precision = fields.Float('Y轴定位精度(mm)', digits=(12, 3))
|
||||
Y_precision_repeat = fields.Float('Y轴重复定位精度(mm)', digits=(12, 3))
|
||||
Z_precision = fields.Float('Z轴定位精度(mm)', digits=(12, 3))
|
||||
Z_precision_repeat = fields.Float('Z轴重复定位精度(mm)', digits=(12, 3))
|
||||
a_precision = fields.Float('a轴定位精度(mm)', digits=(12, 3))
|
||||
a_precision_repeat = fields.Float('a轴重复定位精度(mm)', digits=(12, 3))
|
||||
b_precision = fields.Float('b轴定位精度(mm)', digits=(12, 3))
|
||||
b_precision_repeat = fields.Float('b轴重复定位精度(mm)', digits=(12, 3))
|
||||
c_precision = fields.Float('c轴定位精度(mm)', digits=(12, 3))
|
||||
c_precision_repeat = fields.Float('c轴重复定位精度(mm)', digits=(12, 3))
|
||||
|
||||
tool_full_diameter_max = fields.Float('刀具满刀最大直径(mm)')
|
||||
tool_perimeter_diameter_max = fields.Float('刀具邻空刀最大直径(mm)')
|
||||
T_tool_time = fields.Integer('T-T换刀时间(s)')
|
||||
C_tool_time = fields.Integer('C-C换刀时间(s)')
|
||||
|
||||
# 待删除字段
|
||||
precision_min = fields.Float('X轴定位精度min(mm)', digits=(12, 3))
|
||||
precision_max = fields.Float('X轴定位精度max(mm)', digits=(12, 3))
|
||||
lead_screw = fields.Char('丝杆')
|
||||
guide_rail = fields.Char('导轨')
|
||||
feed_speed = fields.Char('进给速度(mm/min)')
|
||||
tool_speed = fields.Char('刀具速度(m/min)')
|
||||
torque = fields.Char('主轴点击扭矩(n/m)')
|
||||
motor_power = fields.Char('主轴电机功率(kw)')
|
||||
taper = fields.Char('主轴锥度(°)')
|
||||
tool_diameter_max = fields.Char('刀具刀径max(mm)')
|
||||
tool_diameter_min = fields.Char('刀具刀径min(mm)')
|
||||
|
||||
def get_no(self):
|
||||
partner = self.env['maintenance.equipment'].sudo().search(
|
||||
[('MTcode', '!=', '')],
|
||||
@@ -64,9 +127,10 @@ class SfMaintenanceEquipment(models.Model):
|
||||
else:
|
||||
record.equipment_maintenance_standards_ids = False
|
||||
|
||||
MTcode = fields.Char("编码", default=get_no)
|
||||
MTcode = fields.Char("机台编码", default=get_no)
|
||||
created_user = fields.Many2one('res.users', string='创建人', default=lambda self: self.env.user)
|
||||
equipment_type = fields.Selection([('机床', '机床'), ('机器人', '机器人'), ('AGV小车', 'AGV小车'), ('检测设备', '检测设备')], compute='_compute_category_id')
|
||||
equipment_type = fields.Selection([('机床', '机床'), ('机器人', '机器人'), ('AGV小车', 'AGV小车'),
|
||||
('检测设备', '检测设备')], compute='_compute_category_id')
|
||||
|
||||
@api.depends('category_id')
|
||||
def _compute_category_id(self):
|
||||
@@ -74,16 +138,13 @@ class SfMaintenanceEquipment(models.Model):
|
||||
if record:
|
||||
record.equipment_type = record.category_id.equipment_type
|
||||
|
||||
code = fields.Char('机台号')
|
||||
name = fields.Char('名称')
|
||||
code = fields.Char('行业编码')
|
||||
name = fields.Char('机台号')
|
||||
knife_type = fields.Selection(
|
||||
[("BT40", "BT40"), ("BT30", "BT30"), ("BT50", "BT50")],
|
||||
default="", string="刀把类型")
|
||||
number_of_knife_library = fields.Integer('刀库数量(把)')
|
||||
rotate_speed = fields.Integer('转速')
|
||||
number_of_axles = fields.Selection(
|
||||
[("三轴", "三轴"), ("四轴", "四轴"), ("五轴", "五轴")],
|
||||
default="", string="轴数")
|
||||
# 加工进程
|
||||
x_axis = fields.Integer('X轴')
|
||||
y_axis = fields.Integer('Y轴')
|
||||
@@ -92,8 +153,6 @@ class SfMaintenanceEquipment(models.Model):
|
||||
c_axis = fields.Integer('C轴')
|
||||
remark = fields.Char('备注')
|
||||
is_binding = fields.Boolean('是否绑定机床', default=False)
|
||||
precision_min = fields.Float('X轴定位精度min(mm)', digits=(12, 3))
|
||||
precision_max = fields.Float('X轴定位精度max(mm)', digits=(12, 3))
|
||||
control_system_id = fields.Many2one('sf.machine.control_system',
|
||||
string="控制系统")
|
||||
# 多个机床型号对应一个机床
|
||||
@@ -111,24 +170,15 @@ class SfMaintenanceEquipment(models.Model):
|
||||
('chilunjia', '齿轮架驱动')
|
||||
], string="主轴加高方式", default='sifudianji')
|
||||
workpiece_load = fields.Char('工件最大负载(kg)')
|
||||
lead_screw = fields.Char('丝杆')
|
||||
workbench_L = fields.Char('工作台长度(mm)')
|
||||
workbench_W = fields.Char('工作台宽度(mm)')
|
||||
guide_rail = fields.Char('导轨')
|
||||
machine_tool_L = fields.Char('机床长度(mm)')
|
||||
machine_tool_W = fields.Char('机床宽度(mm)')
|
||||
machine_tool_H = fields.Char('机床高度(mm)')
|
||||
feed_speed = fields.Char('进给速度(mm/min)')
|
||||
tool_speed = fields.Char('刀具速度(m/min)')
|
||||
distance_min = fields.Char('主轴端面至工作台面距离MIN(mm)')
|
||||
distance_max = fields.Char('主轴端面至工作台面距离MAX(mm)')
|
||||
taper = fields.Char('主轴锥度(°)')
|
||||
torque = fields.Char('主轴电机扭矩(n/m)')
|
||||
motor_power = fields.Char('主轴电机功率(kw)')
|
||||
tool_quality_max = fields.Char('刀具最大质量(kg)')
|
||||
tool_long_max = fields.Char('刀具最大长度(mm)')
|
||||
tool_diameter_max = fields.Char('刀具刀径max(mm)')
|
||||
tool_diameter_min = fields.Char('刀具刀径min(mm)')
|
||||
machine_tool_category = fields.Many2one('sf.machine_tool.category', string='机床类型')
|
||||
# 一个机床对应一個加工工厂,一个加工工厂对应多个机床
|
||||
factory_id = fields.Many2one('res.partner', string='所属工厂',
|
||||
@@ -154,6 +204,18 @@ class SfMaintenanceEquipment(models.Model):
|
||||
result.append((parameter.id, name))
|
||||
return result
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
# 在创建设备之前执行一些自定义逻辑
|
||||
|
||||
equipment = super(SfMaintenanceEquipment, self).create(vals)
|
||||
equipment.name = equipment.MTcode + '#' + equipment.category_id.name
|
||||
|
||||
# 在创建设备之后执行一些自定义逻辑
|
||||
# ...
|
||||
|
||||
return equipment
|
||||
|
||||
# @api.constrains('rotate_speed')
|
||||
# def _check_rotate_speed(self):
|
||||
# if self.rotate_speed <= 0:
|
||||
@@ -235,11 +297,53 @@ class SfMaintenanceEquipment(models.Model):
|
||||
item.tool_diameter_min = item.type_id.tool_diameter_min
|
||||
item.machine_tool_category = item.type_id.machine_tool_category.id
|
||||
item.brand_id = item.type_id.brand_id.id
|
||||
#新增修改字段
|
||||
item.taper_type_id = item.type_id.taper_type_id.id
|
||||
item.function_type = item.type_id.function_type
|
||||
item.a_axis = item.type_id.a_axis
|
||||
item.T_trough_num = item.type_id.T_trough_num
|
||||
item.T_trough_wide = item.type_id.T_trough_wide
|
||||
item.T_trough_distance = item.type_id.T_trough_distance
|
||||
item.spindle_center_distance = item.type_id.spindle_center_distance
|
||||
item.spindle_continuous_power = item.type_id.spindle_continuous_power
|
||||
item.spindle_peak_power = item.type_id.spindle_peak_power
|
||||
item.spindle_sustained_torque = item.type_id.spindle_sustained_torque
|
||||
item.spindle_peak_torque = item.type_id.spindle_peak_torque
|
||||
item.linear_axis_guides_type = item.type_id.linear_axis_guides_type
|
||||
item.axis_driven_type = item.type_id.axis_driven_type
|
||||
item.X_axis_rapid_traverse_speed = item.type_id.X_axis_rapid_traverse_speed
|
||||
item.Y_axis_rapid_traverse_speed = item.type_id.Y_axis_rapid_traverse_speed
|
||||
item.Z_axis_rapid_traverse_speed = item.type_id.Z_axis_rapid_traverse_speed
|
||||
item.a_axis_rapid_traverse_speed = item.type_id.a_axis_rapid_traverse_speed
|
||||
item.b_axis_rapid_traverse_speed = item.type_id.b_axis_rapid_traverse_speed
|
||||
item.c_axis_rapid_traverse_speed = item.type_id.c_axis_rapid_traverse_speed
|
||||
item.straight_cutting_feed_rate = item.type_id.straight_cutting_feed_rate
|
||||
item.rotary_cutting_feed_rate = item.type_id.rotary_cutting_feed_rate
|
||||
item.X_precision = item.type_id.X_precision
|
||||
item.X_precision_repeat = item.type_id.X_precision_repeat
|
||||
item.Y_precision = item.type_id.Y_precision
|
||||
item.Y_precision_repeat = item.type_id.Y_precision_repeat
|
||||
item.Z_precision = item.type_id.Z_precision
|
||||
item.Z_precision_repeat = item.type_id.Z_precision_repeat
|
||||
item.a_precision = item.type_id.a_precision
|
||||
item.a_precision_repeat = item.type_id.a_precision_repeat
|
||||
item.b_precision = item.type_id.b_precision
|
||||
item.b_precision_repeat = item.type_id.b_precision_repeat
|
||||
item.c_precision = item.type_id.c_precision
|
||||
item.c_precision_repeat = item.type_id.c_precision_repeat
|
||||
item.tool_full_diameter_max = item.type_id.tool_full_diameter_max
|
||||
item.tool_perimeter_diameter_max = item.type_id.tool_perimeter_diameter_max
|
||||
item.T_tool_time = item.type_id.T_tool_time
|
||||
item.C_tool_time = item.type_id.C_tool_time
|
||||
item.C_tool_time = item.type_id.C_tool_time
|
||||
item.image_id = item.type_id.jg_image_id.ids
|
||||
item.image_lq_id = item.type_id.lq_image_id.ids
|
||||
|
||||
|
||||
# AGV小车设备参数
|
||||
AGV_L = fields.Char('设备尺寸(长)')
|
||||
AGV_W = fields.Char('设备尺寸(宽)')
|
||||
AGV_H = fields.Char('设备尺寸(高)')
|
||||
AGV_L = fields.Char('AGV尺寸(长)')
|
||||
AGV_W = fields.Char('AGV尺寸(宽)')
|
||||
AGV_H = fields.Char('AGV尺寸(高)')
|
||||
AGV_goods_L = fields.Char('载货尺寸(长)')
|
||||
AGV_goods_W = fields.Char('载货尺寸(宽)')
|
||||
AGV_goods_H = fields.Char('载货尺寸(高)')
|
||||
@@ -276,11 +380,12 @@ class SfMaintenanceEquipment(models.Model):
|
||||
detect_L = fields.Char('设备尺寸(长)')
|
||||
detect_W = fields.Char('设备尺寸(宽)')
|
||||
detect_H = fields.Char('设备尺寸(高)')
|
||||
detect_x_axis = fields.Char('X轴')
|
||||
detect_y_axis = fields.Char('Y轴')
|
||||
detect_z_axis = fields.Char('Z轴')
|
||||
detect_x_axis = fields.Char('检测X轴')
|
||||
detect_y_axis = fields.Char('检测Y轴')
|
||||
detect_z_axis = fields.Char('检测Z轴')
|
||||
detect_precision = fields.Char('测量精度')
|
||||
detect_measurement_mode = fields.Selection([('光栅尺', '光栅尺'), ('容栅', '容栅'), ('磁栅', '磁栅'), ('激光干涉仪', '激光干涉仪')], string='测量方式')
|
||||
detect_measurement_mode = fields.Selection([('光栅尺', '光栅尺'), ('容栅', '容栅'), ('磁栅', '磁栅'),
|
||||
('激光干涉仪', '激光干涉仪')], string='测量方式')
|
||||
detect_resolution = fields.Char('分辨率')
|
||||
detect_load_weight_max = fields.Char('最大负载重量')
|
||||
detect_weight = fields.Char('本体总重量')
|
||||
@@ -295,8 +400,8 @@ class SfMaintenanceEquipment(models.Model):
|
||||
detect_object_field_of_view_max = fields.Char('物方视场(最大)')
|
||||
detect_object_field_of_view_min = fields.Char('物方视场(最小)')
|
||||
detect_power_requirements = fields.Char('电源要求')
|
||||
detect_operating_temperature = fields.Char('环境温度')
|
||||
detect_operating_humidity = fields.Char('环境湿度')
|
||||
detect_operating_temperature = fields.Char('检测设备环境温度')
|
||||
detect_operating_humidity = fields.Char('检测设备环境湿度')
|
||||
|
||||
# 机器人设备参数
|
||||
robot_gripping_of_workpieces_L = fields.Char('可抓取工件(长)')
|
||||
@@ -306,15 +411,17 @@ class SfMaintenanceEquipment(models.Model):
|
||||
robot_load_weight_max = fields.Char('最大负载重量')
|
||||
robot_weight = fields.Char('本体总重量')
|
||||
robot_repeatable_positioning_accuracy = fields.Char('重复定位精度')
|
||||
robot_axis_num = fields.Selection([('2轴', '2轴'), ('3轴', '3轴'), ('4轴', '4轴'), ('5轴', '5轴'), ('6轴', '6轴'), ('7轴', '7轴'), ('8轴', '8轴')], string='轴数')
|
||||
robot_axis_num = fields.Selection([('2轴', '2轴'), ('3轴', '3轴'), ('4轴', '4轴'), ('5轴', '5轴'), ('6轴', '6轴'),
|
||||
('7轴', '7轴'), ('8轴', '8轴')], string='轴数')
|
||||
axis_ids = fields.One2many('sf.robot.axis.num', 'equipment_id', string='动作范围')
|
||||
robot_track_dimensions_L = fields.Char('轨道尺寸(长)')
|
||||
robot_track_dimensions_W = fields.Char('轨道尺寸(宽)')
|
||||
robot_track_dimensions_H = fields.Char('轨道尺寸(高)')
|
||||
robot_drive_mode = fields.Char('驱动方式')
|
||||
robot_installation_method = fields.Selection([('置地式', '置地式'), ('壁挂式', '壁挂式'), ('倒挂式', '倒挂式')], string='安装方式')
|
||||
robot_operating_temperature = fields.Char('环境温度')
|
||||
robot_operating_humidity = fields.Char('环境湿度')
|
||||
robot_installation_method = fields.Selection([('置地式', '置地式'), ('壁挂式', '壁挂式'), ('倒挂式', '倒挂式')],
|
||||
string='安装方式')
|
||||
robot_operating_temperature = fields.Char('机器人环境温度')
|
||||
robot_operating_humidity = fields.Char('机器人环境湿度')
|
||||
|
||||
# 其他参数(所有设备)
|
||||
date_of_purchase = fields.Date('采购日期')
|
||||
@@ -349,7 +456,7 @@ class SfMaintenanceEquipment(models.Model):
|
||||
images_ids_names = []
|
||||
for a in self.env['maintenance.equipment.image'].search([('id', 'in', item.image_id.ids)]):
|
||||
images_ids_names.append(a.name)
|
||||
if item.machine_tool_picture != False:
|
||||
if item.machine_tool_picture:
|
||||
image = base64.b64encode(item.machine_tool_picture).decode('utf-8')
|
||||
else:
|
||||
image = False
|
||||
@@ -400,7 +507,45 @@ class SfMaintenanceEquipment(models.Model):
|
||||
'distance_max': item.distance_max,
|
||||
'tool_diameter_min': item.tool_diameter_min,
|
||||
'machine_tool_category': item.machine_tool_category.code,
|
||||
'image_id': images_ids_names
|
||||
'image_id': images_ids_names,
|
||||
'taper_type_id': item.taper_type_id.name,
|
||||
'function_type': item.function_type,
|
||||
'a_axis': item.a_axis,
|
||||
'T_trough_num': item.T_trough_num,
|
||||
'T_trough_wide': item.T_trough_wide,
|
||||
'T_trough_distance': item.T_trough_distance,
|
||||
'spindle_center_distance': item.spindle_center_distance,
|
||||
'spindle_continuous_power': item.spindle_continuous_power,
|
||||
'spindle_peak_power': item.spindle_peak_power,
|
||||
'spindle_sustained_torque': item.spindle_sustained_torque,
|
||||
'spindle_peak_torque': item.spindle_peak_torque,
|
||||
'linear_axis_guides_type': item.linear_axis_guides_type,
|
||||
'axis_driven_type': item.axis_driven_type,
|
||||
'X_axis_rapid_traverse_speed': item.X_axis_rapid_traverse_speed,
|
||||
'Y_axis_rapid_traverse_speed': item.Y_axis_rapid_traverse_speed,
|
||||
'Z_axis_rapid_traverse_speed': item.Z_axis_rapid_traverse_speed,
|
||||
'a_axis_rapid_traverse_speed': item.a_axis_rapid_traverse_speed,
|
||||
'b_axis_rapid_traverse_speed': item.b_axis_rapid_traverse_speed,
|
||||
'c_axis_rapid_traverse_speed': item.c_axis_rapid_traverse_speed,
|
||||
'straight_cutting_feed_rate': item.straight_cutting_feed_rate,
|
||||
'rotary_cutting_feed_rate': item.rotary_cutting_feed_rate,
|
||||
'X_precision': item.X_precision,
|
||||
'X_precision_repeat': item.X_precision_repeat,
|
||||
'Y_precision': item.X_precision,
|
||||
'Y_precision_repeat': item.X_precision_repeat,
|
||||
'Z_precision': item.X_precision,
|
||||
'Z_precision_repeat': item.X_precision_repeat,
|
||||
'a_precision': item.X_precision,
|
||||
'a_precision_repeat': item.X_precision_repeat,
|
||||
'b_precision': item.X_precision,
|
||||
'b_precision_repeat': item.X_precision_repeat,
|
||||
'c_precision': item.X_precision,
|
||||
'c_precision_repeat': item.X_precision_repeat,
|
||||
'tool_full_diameter_max': item.tool_full_diameter_max,
|
||||
'tool_perimeter_diameter_max': item.tool_perimeter_diameter_max,
|
||||
'T_tool_time': item.T_tool_time,
|
||||
'C_tool_time': item.C_tool_time,
|
||||
'jiancheng': item.category_id.equipment_type_code
|
||||
}
|
||||
machine_tool_list.append(val)
|
||||
# kw = machine_tool_list
|
||||
@@ -435,7 +580,8 @@ class SfMaintenanceEquipment(models.Model):
|
||||
if next_maintenance_todo and last_maintenance_done:
|
||||
next_date = next_maintenance_todo.request_date
|
||||
date_gap = next_maintenance_todo.request_date - last_maintenance_done.close_date
|
||||
# If the gap between the last_maintenance_done and the next_maintenance_todo one is bigger than 2 times the period and next request is in the future
|
||||
# If the gap between the last_maintenance_done and the next_maintenance_todo one is bigger than
|
||||
# 2 times the period and next request is in the future
|
||||
# We use 2 times the period to avoid creation too closed request from a manually one created
|
||||
if date_gap > timedelta(0) and date_gap > timedelta(
|
||||
days=equipment.period) * 2 and next_maintenance_todo.request_date > date_now:
|
||||
@@ -447,7 +593,8 @@ class SfMaintenanceEquipment(models.Model):
|
||||
elif next_maintenance_todo:
|
||||
next_date = next_maintenance_todo.request_date
|
||||
date_gap = next_maintenance_todo.request_date - date_now
|
||||
# If next maintenance to do is in the future, and in more than 2 times the period, we insert an new request
|
||||
# If next maintenance to do is in the future, and in more than 2 times the period, we insert
|
||||
# an new request
|
||||
# We use 2 times the period to avoid creation too closed request from a manually one created
|
||||
if date_gap > timedelta(0) and date_gap > timedelta(days=equipment.period) * 2:
|
||||
next_date = date_now + timedelta(days=equipment.period)
|
||||
@@ -477,7 +624,8 @@ class SfMaintenanceEquipment(models.Model):
|
||||
if next_maintenance_todo and last_maintenance_done:
|
||||
next_date = next_maintenance_todo.request_date
|
||||
date_gap = next_maintenance_todo.request_date - last_maintenance_done.close_date
|
||||
# If the gap between the last_maintenance_done and the next_maintenance_todo one is bigger than 2 times the period and next request is in the future
|
||||
# If the gap between the last_maintenance_done and the next_maintenance_todo one is bigger than 2
|
||||
# times the period and next request is in the future
|
||||
# We use 2 times the period to avoid creation too closed request from a manually one created
|
||||
if date_gap > timedelta(0) and date_gap > timedelta(
|
||||
days=equipment.overhaul_period) * 2 and next_maintenance_todo.request_date > date_now:
|
||||
@@ -489,7 +637,8 @@ class SfMaintenanceEquipment(models.Model):
|
||||
elif next_maintenance_todo:
|
||||
next_date = next_maintenance_todo.request_date
|
||||
date_gap = next_maintenance_todo.request_date - date_now
|
||||
# If next maintenance to do is in the future, and in more than 2 times the period, we insert an new request
|
||||
# If next maintenance to do is in the future, and in more than 2 times the period, we insert
|
||||
# an new request
|
||||
# We use 2 times the period to avoid creation too closed request from a manually one created
|
||||
if date_gap > timedelta(0) and date_gap > timedelta(days=equipment.overhaul_period) * 2:
|
||||
next_date = date_now + timedelta(days=equipment.overhaul_period)
|
||||
@@ -579,53 +728,12 @@ class SfMaintenanceEquipment(models.Model):
|
||||
if not next_requests:
|
||||
equipment._create_new_request1(equipment.overhaul_date)
|
||||
|
||||
image_id = fields.Many2many('maintenance.equipment.image', 'equipment_id', string='加工能力', domain="[('type', '=', '加工能力')]")
|
||||
image_id = fields.Many2many('maintenance.equipment.image', 'equipment_id',
|
||||
domain="[('type', '=', '加工能力')]")
|
||||
image_lq_id = fields.Many2many('maintenance.equipment.image', 'equipment_lq_id', string='冷却方式',
|
||||
domain="[('type', '=', '冷却方式')]")
|
||||
|
||||
|
||||
class MaintenanceStandardImage(models.Model):
|
||||
_name = 'maintenance.equipment.image'
|
||||
_description = '能力特征库'
|
||||
|
||||
active = fields.Boolean('有效', default=True)
|
||||
name = fields.Char('名称')
|
||||
image = fields.Binary(string='图文')
|
||||
type = fields.Selection(
|
||||
[('加工能力', '加工能力'), ('刀尖特征', '刀尖特征'), ('柄部类型', '柄部类型'), ('走刀方向', '走刀方向'),
|
||||
('冷却液', '冷却液'), ('压紧方式', '压紧方式'), ('刀片形状', '刀片形状')],
|
||||
string='特征')
|
||||
equipment_id = fields.Many2many('maintenance.equipment', 'image_id', string='设备')
|
||||
|
||||
@api.model
|
||||
def name_search(self, name='', args=None, operator='ilike', limit=100):
|
||||
# 调用父类的name_search方法,获取原始的结果列表
|
||||
res = super().name_search(name, args, operator, limit)
|
||||
# 定义一个空字典用来存储id和name的映射关系
|
||||
name_dict = {}
|
||||
# 遍历结果列表,将id和name存入字典中
|
||||
for item in res:
|
||||
id = item[0]
|
||||
name = item[1]
|
||||
name_dict[id] = name
|
||||
# 根据id列表搜索符合条件的记录
|
||||
records = self.browse(name_dict.keys())
|
||||
# 定义一个新的结果列表用来存储修改后的结果
|
||||
new_res = []
|
||||
# 遍历每条记录
|
||||
for record in records:
|
||||
# 获取记录的id,name和image属性
|
||||
id = record.id
|
||||
name = name_dict[id]
|
||||
image = record.image
|
||||
# 如果image不为空,将其转换为data URI scheme
|
||||
if image:
|
||||
data_uri = f"data:image/png;base64,{image.decode('utf-8')}"
|
||||
else:
|
||||
data_uri = ""
|
||||
# 将这三个属性组成一个数组,并添加到结果列表中 result.append([id, name, data_uri]) # 返回结果列表 return result
|
||||
new_res.append([id, name, data_uri])
|
||||
# 返回新的结果列表
|
||||
return new_res
|
||||
|
||||
class SfRobotAxisNum(models.Model):
|
||||
_name = 'sf.robot.axis.num'
|
||||
_description = '机器人轴参数'
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# -*-coding:utf-8-*-
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class SfMaintenanceLogs(models.Model):
|
||||
_name = 'sf.maintenance.logs'
|
||||
_description = '设备故障日志'
|
||||
@@ -11,16 +12,17 @@ class SfMaintenanceLogs(models.Model):
|
||||
brand = fields.Many2one('sf.machine.brand', related='maintenance_equipment_id.brand_id', string='品牌')
|
||||
maintenance_equipment_id = fields.Many2one('maintenance.equipment', string='设备')
|
||||
code_location = fields.Char(string='编码位置')
|
||||
fault_type = fields.Selection([('电气类', '电气类'), ('机械类', '机械类'), ('程序类', '程序类'), ('系统类', '系统类')], string='故障类型')
|
||||
fault_type = fields.Selection(
|
||||
[('电气类', '电气类'), ('机械类', '机械类'), ('程序类', '程序类'), ('系统类', '系统类')], string='故障类型')
|
||||
fault_code = fields.Char(string='故障代码')
|
||||
fault_alarm_info = fields.Char(string='故障报警信息')
|
||||
alarm_level = fields.Selection([('一级', '一级(严重)'), ('二级', '二级(中等)'), ('三级', '三级(轻微)')], string='报警级别')
|
||||
alarm_level = fields.Selection([('一级', '一级(严重)'), ('二级', '二级(中等)'), ('三级', '三级(轻微)')],
|
||||
string='报警级别')
|
||||
alarm_time = fields.Datetime(string='报警时间')
|
||||
alarm_way = fields.Selection([('文本提示报警', '文本提示报警'), ('声光报警', '声光报警'), ('图文报警', '图文报警')], string='报警方式')
|
||||
alarm_way = fields.Selection([('文本提示报警', '文本提示报警'), ('声光报警', '声光报警'), ('图文报警', '图文报警')],
|
||||
string='报警方式')
|
||||
fault_process = fields.Text(string='故障处理方法')
|
||||
operator = fields.Many2one('res.users', string='处理人')
|
||||
recovery_time = fields.Datetime(string='复原时间')
|
||||
fault_duration = fields.Float(string='故障时长')
|
||||
note = fields.Text(string='备注')
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import base64
|
||||
|
||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class SfMaintenanceEquipmentCategory(models.Model):
|
||||
sf_maintenance_type = fields.Selection([('保养', '保养'), ('检修', '检修')], string='维保类别', default='保养')
|
||||
|
||||
equipment_maintenance_id = fields.Many2one('equipment.maintenance.standards', string='设备维保标准',
|
||||
domain="[('maintenance_type','=',sf_maintenance_type)]")
|
||||
domain="[('maintenance_type','=',sf_maintenance_type)]")
|
||||
|
||||
@api.onchange('sf_maintenance_type')
|
||||
def _compute_equipment_maintenance_request_id(self):
|
||||
@@ -25,7 +25,7 @@ class SfMaintenanceEquipmentCategory(models.Model):
|
||||
if not record.equipment_maintenance_id:
|
||||
record.equipment_maintenance_id = False
|
||||
|
||||
maintenance_standards = fields.Many2many('maintenance.standards', string='维保标准')
|
||||
maintenance_standards = fields.Many2many('maintenance.standards', string='维保项目')
|
||||
|
||||
@api.constrains('equipment_maintenance_id')
|
||||
def _check_equipment_maintenance_id(self):
|
||||
@@ -38,8 +38,3 @@ class SfMaintenanceEquipmentCategory(models.Model):
|
||||
|
||||
def confirm_maintenance_done(self):
|
||||
self.write({'stage_id': 3})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<data noupdate="1">
|
||||
<record id="sf_group_equipment_user" model="res.groups">
|
||||
<field name="name">维保岗</field>
|
||||
<field name="category_id" ref="base.module_category_manufacturing_maintenance"/>
|
||||
<field name="implied_ids" eval="[(4, ref('maintenance.group_equipment_manager'))]"/>
|
||||
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
|
||||
</record>
|
||||
<record id="sf_group_equipment_manager" model="res.groups">
|
||||
<field name="name">设备总监</field>
|
||||
<field name="implied_ids" eval="[(4, ref('sf_group_equipment_user'))]"/>
|
||||
<field name="category_id" ref="base.module_category_manufacturing_maintenance"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -1,11 +1,14 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_equipment_maintenance_standards,equipment_maintenance_standards,model_equipment_maintenance_standards,base.group_user,1,1,1,1
|
||||
access_sf_maintenance_logs,sf_maintenance_logs,model_sf_maintenance_logs,base.group_user,1,1,1,1
|
||||
access_maintenance_equipment,maintenance_equipment,model_maintenance_equipment,base.group_user,1,1,1,1
|
||||
access_maintenance_standards,maintenance_standards,model_maintenance_standards,base.group_user,1,1,1,1
|
||||
access_maintenance_standard_image,maintenance_standard_image,model_maintenance_standard_image,base.group_user,1,1,1,1
|
||||
access_maintenance_equipment_image,maintenance_equipment_image,model_maintenance_equipment_image,base.group_user,1,1,1,1
|
||||
access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,base.group_user,1,1,1,1
|
||||
|
||||
access_equipment_maintenance_standards,equipment_maintenance_standards,model_equipment_maintenance_standards,sf_group_equipment_user,1,1,1,1
|
||||
access_sf_maintenance_logs,sf_maintenance_logs,model_sf_maintenance_logs,sf_group_equipment_user,1,1,1,1
|
||||
access_maintenance_equipment,maintenance_equipment,model_maintenance_equipment,sf_group_equipment_user,1,1,1,1
|
||||
access_maintenance_standards,maintenance_standards,model_maintenance_standards,sf_group_equipment_user,1,1,1,1
|
||||
access_maintenance_standard_image,maintenance_standard_image,model_maintenance_standard_image,sf_group_equipment_user,1,1,1,1
|
||||
access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,sf_group_equipment_user,1,1,1,1
|
||||
|
||||
|
||||
access_maintenance_request,maintenance.request,maintenance.model_maintenance_request,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_maintenance_equipment,maintenance_equipment,model_maintenance_equipment,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_sf_maintenance_logs,sf_maintenance_logs,model_sf_maintenance_logs,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_maintenance_standard_image,maintenance_standard_image,model_maintenance_standard_image,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_equipment_maintenance_standards,equipment_maintenance_standards,model_equipment_maintenance_standards,sf_base.group_plan_dispatch,1,0,0,0
|
||||
|
@@ -1,6 +1,7 @@
|
||||
# -*-coding:utf-8-*-
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
|
||||
class TestEquipmentMaintenanceStandards(TransactionCase):
|
||||
def setUp(self, *args, **kwargs):
|
||||
result = super().setUp(*args, **kwargs)
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<!-- 设备类别 -->
|
||||
<record id="sf_maintenance_equipment_category_tree" model="ir.ui.view">
|
||||
<field name="name">sf.maintenance.equipment.category</field>
|
||||
<field name="model">maintenance.equipment.category</field>
|
||||
<field name="inherit_id" ref="maintenance.hr_equipment_category_view_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='name']" position="after">
|
||||
<field name="equipment_type_code"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 设备类别 -->
|
||||
<record id="sf_maintenance_equipment_category_form" model="ir.ui.view">
|
||||
<field name="name">sf.maintenance.equipment.category</field>
|
||||
<field name="model">maintenance.equipment.category</field>
|
||||
<field name="inherit_id" ref="maintenance.hr_equipment_category_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='technician_user_id']" position="before">
|
||||
<field name="equipment_type" required='1'/>
|
||||
<field name="equipment_type_code" required='1'/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -9,16 +9,16 @@
|
||||
<tree>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="type" optional="hide"/>
|
||||
<field name="brand"/>
|
||||
<field name="maintenance_equipment_id"/>
|
||||
<field name="code_location"/>
|
||||
<field name="code_location" optional="hide"/>
|
||||
<field name="fault_type"/>
|
||||
<field name="fault_code"/>
|
||||
<field name="fault_code" optional="hide"/>
|
||||
<field name="fault_alarm_info"/>
|
||||
<field name="alarm_level"/>
|
||||
<field name="alarm_level" optional="hide"/>
|
||||
<field name="alarm_time"/>
|
||||
<field name="alarm_way"/>
|
||||
<field name="alarm_way" optional="hide"/>
|
||||
<field name="fault_process"/>
|
||||
<field name="operator"/>
|
||||
<field name="recovery_time"/>
|
||||
|
||||
@@ -1,5 +1,63 @@
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
|
||||
<!-- 维保项目表单视图-->
|
||||
|
||||
<record id="view_maintenance_standards_form" model="ir.ui.view">
|
||||
<field name="name">maintenance.standards.form</field>
|
||||
<field name="model">maintenance.standards</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="设备维保项目">
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="maintenance_standards"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
<field name="maintenance_request_ids" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="上传图片" autofocus="autofocus">
|
||||
<field name="images" mode="kanban">
|
||||
<kanban quick_create="1" create="1">
|
||||
<field name="image"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click">
|
||||
<!-- 在这里定义每个卡片的内容 -->
|
||||
<span>
|
||||
<image>
|
||||
<field name="image" preview_image="image_128" widget="image"/>
|
||||
</image>
|
||||
</span>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
<form>
|
||||
<sheet>
|
||||
<field name="image" preview_image="image_128" widget="image"/>
|
||||
<field name="standard_id"/>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_maintenance_standards_tree" model="ir.actions.act_window">
|
||||
<field name="name">Maintenance Standards</field>
|
||||
<field name="res_model">maintenance.standards</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_maintenance_standards_form"/>
|
||||
</record>
|
||||
<!-- equiment.request : actions -->
|
||||
|
||||
<record model="ir.ui.view" id="sf_hr_equipment_request_view_form">
|
||||
@@ -21,17 +79,16 @@
|
||||
<sheet>
|
||||
|
||||
<notebook>
|
||||
<page string="维保标准" attrs="{'invisible': [('equipment_maintenance_id', '=', False)]}">
|
||||
<field name="maintenance_standards" widget="ony2many">
|
||||
<tree>
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<page string="维保标准" attrs="{'invisible': [('equipment_maintenance_id', '=', False)]}" context="{'default_standard_id': 'id'}">
|
||||
<field name="maintenance_standards" widget="one2many_list">
|
||||
<tree multi_edit="" editable="">
|
||||
<field name="name" />
|
||||
<field name="maintenance_standards"/>
|
||||
<field name="images"/>
|
||||
<field name="images" force_save="1" required="1">
|
||||
</field>
|
||||
<field name="remark"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
</page>
|
||||
</notebook>
|
||||
|
||||
@@ -71,40 +128,5 @@
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
|
||||
<!-- 维保项目表单视图-->
|
||||
|
||||
<record id="view_maintenance_standards_form" model="ir.ui.view">
|
||||
<field name="name">maintenance.standards.form</field>
|
||||
<field name="model">maintenance.standards</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="设备维保项目">
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="maintenance_standards"/>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
|
||||
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="上传图片">
|
||||
<field name="images" widget="one2many">
|
||||
<tree editable="bottom">
|
||||
<field name="image" widget="image" options="{'size': [100, 100], 'click enlarge': True}"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
@@ -1,16 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<!-- 设备类别 -->
|
||||
<record id="sf_maintenance_equipment_category" model="ir.ui.view">
|
||||
<field name="name">sf.maintenance.equipment.category</field>
|
||||
<field name="model">maintenance.equipment.category</field>
|
||||
<field name="inherit_id" ref="maintenance.hr_equipment_category_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='technician_user_id']" position="before">
|
||||
<field name="equipment_type" required='1'/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 修改设备表单视图-->
|
||||
<record id="sf_hr_equipment_view_form" model="ir.ui.view">
|
||||
<field name="name">sf_equipment.form</field>
|
||||
@@ -50,13 +39,17 @@
|
||||
<label for="enroll_machine_tool"/>
|
||||
<div class="col-12 col-lg-6 o_setting_box" style="white-space: nowrap">
|
||||
<button type="object" class="oe_highlight" name='enroll_machine_tool' string="机床注册"
|
||||
attrs="{'invisible': [('equipment_type', '!=', '机床'), ('brand_id','!=',False),('type_id','!=',False),('control_system_id','!=',False)]}"/>
|
||||
attrs="{'invisible': [('equipment_type', '!=', '机床'), ('brand_id','!=',False),
|
||||
('type_id','!=',False),('control_system_id','!=',False),('code','!=', False)]}"
|
||||
groups="sf_maintenance.sf_group_equipment_manager"/>
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='category_id']" position="before">
|
||||
<field name="MTcode"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='category_id']" position="after">
|
||||
<field name="state_zc"/>
|
||||
<field name="code"/>
|
||||
|
||||
<field name="code" readonly="1"/>
|
||||
<field name="equipment_type" invisible="1"/>
|
||||
<field name="brand_id" force_save="1"/>
|
||||
<field name="type_id" attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
@@ -68,175 +61,171 @@
|
||||
<page string="设备参数" name="sf_equipment"
|
||||
attrs="{'invisible': [('equipment_type', '!=', '机床')]}">
|
||||
<group>
|
||||
<div class="bigger">
|
||||
<group string="基本参数">
|
||||
<field name="control_system_id" required="1" options="{'no_create': True}"/>
|
||||
<label for="workbench_L" string="工作台尺寸(mm)"/>
|
||||
<div class="test_model">
|
||||
<div>
|
||||
<label for="workbench_L" string="长"/>
|
||||
<field name="workbench_L" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<span>&nbsp;</span>
|
||||
<div>
|
||||
<label for="workbench_W" string="宽"/>
|
||||
<field name="workbench_W" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
</div>
|
||||
<label for="machine_tool_L" string="机床尺寸(mm)"/>
|
||||
<div class="test_model">
|
||||
<div>
|
||||
<label for="machine_tool_L" string="长"/>
|
||||
<field name="machine_tool_L" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="machine_tool_W" string="宽"/>
|
||||
<field name="machine_tool_W" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="machine_tool_H" string="高"/>
|
||||
<field name="machine_tool_H" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
</div>
|
||||
<field name="feed_speed" attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||
|
||||
<label for="precision_min" string="X轴定位精度(mm)"/>
|
||||
<div class="test_model">
|
||||
<div>
|
||||
<label for="precision_min" string="最小(min)"/>
|
||||
<field name="precision_min" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<span>&nbsp;</span>
|
||||
<div>
|
||||
<label for="precision_max" string="最大(max)"/>
|
||||
<field name="precision_max" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
</div>
|
||||
<field name="workpiece_load"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||
|
||||
<field name="lead_screw" attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||
<field name="number_of_axles"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
widget="radio"
|
||||
options="{'horizontal': true}"/>
|
||||
<label for="x_axis" string="加工行程(mm)"
|
||||
attrs="{'invisible': [('number_of_axles', '=', False)]}"/>
|
||||
<div class="test_model"
|
||||
attrs="{'invisible': [('number_of_axles', '=', False)]}">
|
||||
<div>
|
||||
<label for="x_axis" string="x"/>
|
||||
<field name="x_axis" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<span>&nbsp;</span>
|
||||
<div>
|
||||
<label for="y_axis" string="y"/>
|
||||
<field name="y_axis" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<span>&nbsp;</span>
|
||||
<div>
|
||||
<label for="z_axis" string="z"/>
|
||||
<field name="z_axis" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<br></br>
|
||||
<div>
|
||||
<label for="b_axis" string="b"
|
||||
attrs="{'invisible': [('number_of_axles', '=', '三轴')]}"/>
|
||||
<field name="b_axis" class="o_address_zip"
|
||||
attrs="{'invisible': [('number_of_axles', '=', '三轴')]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<span>&nbsp;</span>
|
||||
<div>
|
||||
<label for="c_axis" string="c"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴'])]}"/>
|
||||
<field name="c_axis" class="o_address_zip"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴'])]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
</div>
|
||||
<div class="bigger">
|
||||
<group string="主轴">
|
||||
<field name="taper" attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||
<field name="rotate_speed" string="主轴转速(r/min)"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
<field name="heightened_way"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||
<field name="torque" attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||
<field name="motor_power" attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||
<label for="distance_min" string="主轴端面-工作台距离(mm)"/>
|
||||
<div class="test_model">
|
||||
<div>
|
||||
<label for="distance_min" string="最小(min)"/>
|
||||
<field name="distance_min" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<span>&nbsp;</span>
|
||||
<div>
|
||||
<label for="distance_max" string="最大(max)"/>
|
||||
<field name="distance_max" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
</div>
|
||||
<field name="guide_rail" attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||
</group>
|
||||
</div>
|
||||
<group string="刀具">
|
||||
<field name="number_of_knife_library"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
<field name="knife_type" attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||
<field name="tool_speed" attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||
<field name="tool_long_max"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||
<label for="tool_diameter_min" string="刀具刀径(mm)"/>
|
||||
<group string="基础参数">
|
||||
<field name="control_system_id" required="1" options="{'no_create': True}"/>
|
||||
<label for="workbench_L" string="工作台尺寸(mm)"/>
|
||||
<div class="test_model">
|
||||
<div>
|
||||
<label for="tool_diameter_min" string="最小(min)"/>
|
||||
<field name="tool_diameter_min" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
|
||||
<label for="workbench_L" string="长"/>
|
||||
<field name="workbench_L" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<div>
|
||||
<label for="tool_diameter_max" string="最大(max)"/>
|
||||
<field name="tool_diameter_max" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
|
||||
<label for="workbench_W" string="宽"/>
|
||||
<field name="workbench_W" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="workpiece_load"/>
|
||||
<label for="machine_tool_L" string="机床尺寸(mm)"/>
|
||||
<div class="test_model">
|
||||
<label for="machine_tool_L" string="长"/>
|
||||
<field name="machine_tool_L" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="machine_tool_W" string="宽"/>
|
||||
<field name="machine_tool_W" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="machine_tool_H" string="高"/>
|
||||
<field name="machine_tool_H" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<label for="T_trough_num" string="T型槽尺寸:"/>
|
||||
<div class="test_model">
|
||||
<label for="T_trough_num" string="槽数"/>
|
||||
<field name="T_trough_num" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="T_trough_wide" string="槽宽(mm)"/>
|
||||
<field name="T_trough_wide" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="T_trough_distance" string="槽距(mm)"/>
|
||||
<field name="T_trough_distance" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<!-- <field name="feed_speed" required="1"/>-->
|
||||
<!-- <label for="precision_min" string="X轴定位精度(mm)"/>-->
|
||||
<!-- <div class="test_model">-->
|
||||
<!-- <label for="precision_min" string="最小(min)"/>-->
|
||||
<!-- <field name="precision_min" class="o_address_zip" required="1"-->
|
||||
<!-- options="{'format': false}"/>-->
|
||||
<!-- <span>&nbsp;</span>-->
|
||||
<!-- <label for="precision_max" string="最大(max)"/>-->
|
||||
<!-- <field name="precision_max" class="o_address_zip" required="1"-->
|
||||
<!-- options="{'format': false}"/>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <field name="lead_screw" required="1"/>-->
|
||||
<!-- <field name="guide_rail" required="1"/>-->
|
||||
<field name="number_of_axles" required="1" widget="radio"
|
||||
options="{'horizontal': true}"/>
|
||||
<label for="x_axis" string="加工行程(mm)"
|
||||
attrs="{'invisible': [('number_of_axles', '=', False)]}"/>
|
||||
<div class="test_model"
|
||||
attrs="{'invisible': [('number_of_axles', '=', False)]}">
|
||||
<label for="x_axis" string="x"/>
|
||||
<field name="x_axis" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="y_axis" string="y"/>
|
||||
<field name="y_axis" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="z_axis" string="z"/>
|
||||
<field name="z_axis" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="a_axis" string="a"
|
||||
attrs="{'invisible': [('number_of_axles', '=', '三轴')]}"/>
|
||||
<field name="a_axis" class="o_address_zip"
|
||||
attrs="{'invisible': [('number_of_axles', '=', '三轴')]}"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="b_axis" string="b"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴'])]}"/>
|
||||
<field name="b_axis" class="o_address_zip"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴'])]}"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="c_axis" string="c"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴','五轴'])]}"/>
|
||||
<field name="c_axis" class="o_address_zip"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴','五轴'])]}"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="tool_quality_max"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="主轴">
|
||||
<field name="taper_type_id" required="1"/>
|
||||
<label for="distance_min" string="主轴端面-工作台距离(mm)"/>
|
||||
<div class="test_model">
|
||||
<label for="distance_min" string="最小(min)"/>
|
||||
<field name="distance_min" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="distance_max" string="最大(max)"/>
|
||||
<field name="distance_max" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="rotate_speed" string="主轴最高转速(r/min)"
|
||||
options="{'format': false}"/>
|
||||
<field name="spindle_center_distance"/>
|
||||
<field name="spindle_continuous_power"/>
|
||||
<field name="spindle_peak_power"/>
|
||||
<field name="spindle_sustained_torque"/>
|
||||
<field name="spindle_peak_torque"/>
|
||||
<field name="heightened_way"/>
|
||||
<field name="linear_axis_guides_type"/>
|
||||
<field name="axis_driven_type"/>
|
||||
|
||||
<!-- <field name="distance" required="1"/>-->
|
||||
</group>
|
||||
<group string="刀具">
|
||||
<!-- <field name="knife_type" required="1"/>-->
|
||||
<field name="number_of_knife_library" required="1" options="{'format': false}"/>
|
||||
<!-- <field name="tool_speed" required="1"/>-->
|
||||
<field name="tool_full_diameter_max"/>
|
||||
<field name="tool_perimeter_diameter_max"/>
|
||||
<field name="tool_long_max"/>
|
||||
<!-- <label for="tool_diameter_min" string="刀具刀径(mm)"/>-->
|
||||
<!-- <div class="test_model">-->
|
||||
<!-- <label for="tool_diameter_min" string="最小(min)"/>-->
|
||||
<!-- <field name="tool_diameter_min" class="o_address_zip" required="1"-->
|
||||
<!-- options="{'format': false}"/>-->
|
||||
<!-- <span>&nbsp;</span>-->
|
||||
<!-- <label for="tool_diameter_max" string="最大(max)"/>-->
|
||||
<!-- <field name="tool_diameter_max" class="o_address_zip" required="1"-->
|
||||
<!-- options="{'format': false}"/>-->
|
||||
<!-- </div>-->
|
||||
<field name="tool_quality_max"/>
|
||||
<field name="T_tool_time"/>
|
||||
<field name="C_tool_time"/>
|
||||
</group>
|
||||
|
||||
<group string="进给参数">
|
||||
<field name="X_axis_rapid_traverse_speed"/>
|
||||
<field name="Y_axis_rapid_traverse_speed"/>
|
||||
<field name="Z_axis_rapid_traverse_speed"/>
|
||||
<field name="a_axis_rapid_traverse_speed"/>
|
||||
<field name="b_axis_rapid_traverse_speed"/>
|
||||
<field name="c_axis_rapid_traverse_speed"/>
|
||||
<field name="straight_cutting_feed_rate"/>
|
||||
<field name="rotary_cutting_feed_rate"/>
|
||||
</group>
|
||||
<group string="精度参数">
|
||||
<field name="X_precision"/>
|
||||
<field name="X_precision_repeat"/>
|
||||
<field name="Y_precision"/>
|
||||
<field name="Y_precision_repeat"/>
|
||||
<field name="Z_precision"/>
|
||||
<field name="Z_precision_repeat"/>
|
||||
<field name="a_precision"/>
|
||||
<field name="a_precision_repeat"/>
|
||||
<field name="b_precision"/>
|
||||
<field name="b_precision_repeat"/>
|
||||
<field name="c_precision"/>
|
||||
<field name="c_precision_repeat"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
|
||||
|
||||
|
||||
</page>
|
||||
|
||||
@@ -286,7 +275,7 @@
|
||||
</div>
|
||||
<span>&nbsp;</span>
|
||||
<div>
|
||||
<label for="AGV_goods_H" string="宽"/>
|
||||
<label for="AGV_goods_H" string="高"/>
|
||||
<field name="AGV_goods_H" class="o_address_zip"
|
||||
attrs="{'required': [('equipment_type', '=', 'AGV小车')]}"
|
||||
options="{'format': false}"/>
|
||||
@@ -636,7 +625,7 @@
|
||||
</div>
|
||||
<field name='robot_axis_num' attrs="{'required': [('equipment_type', '=', '机器人')]}"/>
|
||||
|
||||
<field name='axis_ids' widget="One2many">
|
||||
<field name='axis_ids'>
|
||||
<tree editable='bottom'>
|
||||
<field name="name"/>
|
||||
<field name="angle_min"/>
|
||||
@@ -647,6 +636,7 @@
|
||||
<field name="permissible_inertial_torque"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
<label for="robot_track_dimensions_L" string="轨道尺寸"/>
|
||||
<div class="test_model">
|
||||
<div>
|
||||
@@ -918,22 +908,34 @@
|
||||
</group>
|
||||
</page>
|
||||
|
||||
<page string="加工能力" attrs="{'invisible': [('equipment_type', '!=', '机床')]}">
|
||||
|
||||
<field name='image_id' widget="custom_many2many_checkboxes">
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//notebook" position="before">
|
||||
<group string="加工能力" attrs="{'invisible': [('equipment_type', '!=', '机床')]}" >
|
||||
<div>
|
||||
<field name='image_id' widget="custom_many2many_checkboxes" string="">
|
||||
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"
|
||||
options="{'size': [100, 100], 'click enlarge': True}"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</div>
|
||||
</group>
|
||||
<group string="冷却方式" attrs="{'invisible': [('equipment_type', '!=', '机床')]}">
|
||||
<div>
|
||||
<field name='image_lq_id' widget="custom_many2many_checkboxes" string="">
|
||||
|
||||
|
||||
</page>
|
||||
|
||||
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"
|
||||
options="{'size': [100, 100], 'click enlarge': True}"/>
|
||||
</tree>
|
||||
</field>
|
||||
</div>
|
||||
</group>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//field[@name='next_action_date']" position="before">
|
||||
@@ -1135,6 +1137,7 @@
|
||||
<!-- groups="maintenance.group_equipment_manager,base.group_user"-->
|
||||
<!-- sequence="1"/-->
|
||||
<!-- 设备图文展示-->
|
||||
|
||||
<record id="view_maintenance_equipment_image_tree" model="ir.ui.view">
|
||||
<field name="name">maintenance.equipment.image.tree</field>
|
||||
<field name="model">maintenance.equipment.image</field>
|
||||
@@ -1178,5 +1181,13 @@
|
||||
groups="maintenance.group_equipment_manager,base.group_user"
|
||||
sequence="2"/>
|
||||
|
||||
<menuitem
|
||||
id="maintenance.menu_m_dashboard"
|
||||
name="设备清单"
|
||||
parent="maintenance.menu_maintenance_title"
|
||||
groups="maintenance.group_equipment_manager,base.group_user"
|
||||
action="hr_equipment_action1"
|
||||
sequence="0"/>
|
||||
|
||||
|
||||
</odoo>
|
||||
@@ -10,21 +10,19 @@
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['mrp_workorder', 'sf_base', 'sf_maintenance', 'web_widget_model_viewer', 'stock'],
|
||||
'depends': ['sf_base', 'sf_maintenance', 'web_widget_model_viewer', 'sf_warehouse'],
|
||||
'data': [
|
||||
'data/stock_data.xml',
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'views/mrp_views_menus.xml',
|
||||
'views/mrp_production_addional_change.xml',
|
||||
# 'views/mrp_maintenance_views.xml',
|
||||
'views/mrp_routing_workcenter_view.xml',
|
||||
'views/production_line_view.xml',
|
||||
'views/mrp_workcenter_views.xml',
|
||||
'views/mrp_workorder_view.xml',
|
||||
'views/tool_other_features_view.xml',
|
||||
'views/model_type_view.xml',
|
||||
'views/sf_maintenance_equipment.xml',
|
||||
# 'views/kanban_change.xml'
|
||||
|
||||
],
|
||||
'assets': {
|
||||
@@ -43,14 +41,6 @@
|
||||
],
|
||||
'qweb': [
|
||||
],
|
||||
'assets': {
|
||||
'web.assets_backend': [
|
||||
'sf_manufacturing/static/src/js/kanban_change.js',
|
||||
'sf_manufacturing/static/src/scss/kanban_change.scss',
|
||||
'sf_manufacturing/static/src/xml/kanban_change.xml',
|
||||
],
|
||||
|
||||
},
|
||||
'license': 'LGPL-3',
|
||||
'installable': True,
|
||||
'application': False,
|
||||
|
||||
@@ -13,6 +13,12 @@
|
||||
<field name="padding">5</field>
|
||||
</record>
|
||||
|
||||
<record id="tool_assembly_in" model="ir.sequence">
|
||||
<field name="name">My Company 刀具组装入库</field>
|
||||
<field name="prefix">ZR/</field>
|
||||
<field name="padding">5</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_locations_virtual_outcontract" model="stock.location">
|
||||
<field name="name">外协</field>
|
||||
<field name="location_id" ref="stock.stock_location_locations_virtual"/>
|
||||
@@ -22,6 +28,15 @@
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_locations_virtual_after_assembly" model="stock.location">
|
||||
<field name="name">组装后</field>
|
||||
<field name="location_id" ref="stock.stock_location_locations_virtual"/>
|
||||
<field name="usage">internal</field>
|
||||
<field name="barcode">DJ-ZZ</field>
|
||||
<field name="active">true</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record id="outcontract_picking_in" model="stock.picking.type">
|
||||
<field name="name">外协入库</field>
|
||||
<field name="code">internal</field>
|
||||
@@ -45,7 +60,5 @@
|
||||
search="[('barcode','=','WH-PREPRODUCTION')]"/>
|
||||
<field name="default_location_dest_id" ref="stock_location_locations_virtual_outcontract"/>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -8,9 +8,3 @@ from . import mrp_routing_workcenter
|
||||
from . import stock
|
||||
from . import res_user
|
||||
from . import production_line_base
|
||||
from . import tool_other_features
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
from odoo import fields, models,api
|
||||
|
||||
|
||||
class ResProductCategory(models.Model):
|
||||
_inherit = "product.category"
|
||||
|
||||
type = fields.Selection(
|
||||
[("成品", "成品"), ("坯料", "坯料"), ("原材料", "原材料"), ("表面工艺", "表面工艺"), ("刀具", "刀具"),
|
||||
("夹具", "夹具")],
|
||||
default="", string="类型")
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ModelType(models.Model):
|
||||
@@ -48,8 +39,6 @@ class ProductModelTypeRoutingSort(models.Model):
|
||||
# if record:
|
||||
# record.routing_type = record.route_workcenter_id.routing_type
|
||||
|
||||
|
||||
|
||||
routing_type = fields.Selection(string="工序类型", related='route_workcenter_id.routing_type')
|
||||
|
||||
workcenter_ids = fields.Many2many('mrp.workcenter', required=False, related='route_workcenter_id.workcenter_ids')
|
||||
@@ -83,7 +72,6 @@ class EmbryoModelTypeRoutingSort(models.Model):
|
||||
# if record:
|
||||
# record.routing_type = record.route_workcenter_id.routing_type
|
||||
|
||||
|
||||
routing_type = fields.Selection(string="工序类型", related='route_workcenter_id.routing_type')
|
||||
|
||||
workcenter_ids = fields.Many2many('mrp.workcenter', required=False, related='route_workcenter_id.workcenter_ids')
|
||||
@@ -117,7 +105,6 @@ class SurfaceTechnicsModelTypeRoutingSort(models.Model):
|
||||
# if record:
|
||||
# record.routing_type = record.route_workcenter_id.routing_type
|
||||
|
||||
|
||||
routing_type = fields.Selection(string="工序类型", related='route_workcenter_id.routing_type')
|
||||
|
||||
workcenter_ids = fields.Many2many('mrp.workcenter', required=False, related='route_workcenter_id.workcenter_ids')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import api, fields, models, _
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from odoo import api, fields, models, _
|
||||
|
||||
|
||||
class MaintenanceEquipment(models.Model):
|
||||
@@ -63,7 +63,9 @@ class MaintenanceRequest(models.Model):
|
||||
production_company_id = fields.Many2one(string='Production Company', related='production_id.company_id')
|
||||
company_id = fields.Many2one(domain="[('id', '=?', production_company_id)]")
|
||||
|
||||
|
||||
class SfMaintenanceLogs(models.Model):
|
||||
_inherit = 'sf.maintenance.logs'
|
||||
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线', related='maintenance_equipment_id.production_line_id', store=True)
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线',
|
||||
related='maintenance_equipment_id.production_line_id', store=True)
|
||||
|
||||
@@ -15,6 +15,33 @@ class MrpProduction(models.Model):
|
||||
schedule_state = fields.Selection([('未排', '未排'), ('已排', '已排')],
|
||||
string='排程状态', default='未排')
|
||||
|
||||
check_status = fields.Boolean(string='启用状态', default=False, readonly=True)
|
||||
active = fields.Boolean(string='已归档', default=True)
|
||||
|
||||
def action_check(self):
|
||||
"""
|
||||
审核启用
|
||||
"""
|
||||
self.check_status = True
|
||||
|
||||
def action_uncheck(self):
|
||||
"""
|
||||
审核禁用
|
||||
"""
|
||||
self.check_status = False
|
||||
|
||||
def archive(self):
|
||||
"""
|
||||
归档
|
||||
"""
|
||||
self.write({'active': False})
|
||||
|
||||
def unarchive(self):
|
||||
"""
|
||||
取消归档
|
||||
"""
|
||||
self.write({'active': True})
|
||||
|
||||
@api.depends('request_ids')
|
||||
def _compute_maintenance_count(self):
|
||||
for production in self:
|
||||
@@ -120,7 +147,7 @@ class MrpProduction(models.Model):
|
||||
if i == 1 and route.routing_type == '获取CNC加工程序':
|
||||
workorders_values.append(
|
||||
self.env['mrp.workorder'].json_workorder_str('', production, route))
|
||||
if route.is_repeat == True:
|
||||
if route.is_repeat is True:
|
||||
workorders_values.append(
|
||||
self.env['mrp.workorder'].json_workorder_str(k, production, route))
|
||||
if i == processing_panel_len and route.routing_type == '解除装夹':
|
||||
@@ -339,7 +366,7 @@ class MrpProduction(models.Model):
|
||||
current_sequence += 1
|
||||
if work.name == '获取CNC加工程序':
|
||||
work.button_start()
|
||||
# work.fetchCNC()
|
||||
work.fetchCNC()
|
||||
|
||||
# 创建工单并进行排序
|
||||
def _create_workorder(self):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from odoo import fields, models
|
||||
import logging
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResMrpRoutingWorkcenter(models.Model):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from odoo import api, fields, models
|
||||
from datetime import datetime
|
||||
import datetime
|
||||
from collections import defaultdict
|
||||
from odoo import fields, models
|
||||
from odoo.addons.resource.models.resource import Intervals
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ class ResWorkcenter(models.Model):
|
||||
equipment_id = fields.Many2one(
|
||||
'maintenance.equipment', string="设备",
|
||||
)
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线', related='equipment_id.production_line_id', store=True)
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线',
|
||||
related='equipment_id.production_line_id', store=True)
|
||||
|
||||
is_process_outsourcing = fields.Boolean('工艺外协')
|
||||
users_ids = fields.Many2many("res.users", 'users_workcenter')
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import os
|
||||
import json
|
||||
import math
|
||||
import requests
|
||||
import logging
|
||||
import base64
|
||||
# import subprocess
|
||||
from datetime import datetime
|
||||
import requests
|
||||
import os
|
||||
import math
|
||||
from dateutil.relativedelta import relativedelta
|
||||
# import subprocess
|
||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.addons.sf_base.commons.common import Common
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.addons.sf_mrs_connect.models.ftp_operate import FtpController
|
||||
@@ -107,6 +105,11 @@ class ResMrpWorkOrder(models.Model):
|
||||
picking_out_id = fields.Many2one('stock.picking', string='外协出库单')
|
||||
supplier_id = fields.Many2one('res.partner', string='外协供应商')
|
||||
equipment_id = fields.Many2one('maintenance.equipment', string='加工设备')
|
||||
is_ok = fields.Boolean(string='是否合格')
|
||||
# 加工人
|
||||
processing_user_id = fields.Many2one('res.users', string='加工人')
|
||||
# 检测人
|
||||
inspection_user_id = fields.Many2one('res.users', string='检测人')
|
||||
schedule_state = fields.Selection(related='production_id.schedule_state', store=True)
|
||||
# 工件装夹信息
|
||||
functional_fixture_code = fields.Char(string="功能夹具编码", readonly=True)
|
||||
@@ -129,6 +132,13 @@ class ResMrpWorkOrder(models.Model):
|
||||
production_line = fields.Char(string="生产线")
|
||||
preset_program_information = fields.Char(string="预调程序信息")
|
||||
|
||||
@api.onchange('is_ok')
|
||||
def _onchange_inspection_user_id(self):
|
||||
"""
|
||||
检测is_ok(是否合格)被修改的话,就将当前用户赋值给inspection_user_id
|
||||
"""
|
||||
self.inspection_user_id = self.env.user.id
|
||||
|
||||
@api.onchange('functional_fixture_id')
|
||||
def _onchange_functional_fixture_id(self):
|
||||
if self.functional_fixture_id:
|
||||
@@ -165,7 +175,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
y0 = ((y3 - y4) * (y2 * x1 - y1 * x2) - (y1 - y2) * (y4 * x3 - y3 * x4)) / (
|
||||
(y3 - y4) * (x1 - x2) - (y1 - y2) * (x3 - x4))
|
||||
x1 = ((x7 - x8) * (x6 * y5 - x5 * y6) - (x5 - x6) * (x8 * y7 - x7 * y8)) / (
|
||||
(x7 - x8) * (y5 - y6) - (x5 - x6) * (y7 - y8));
|
||||
(x7 - x8) * (y5 - y6) - (x5 - x6) * (y7 - y8))
|
||||
y1 = ((y7 - y8) * (y6 * x5 - y5 * x6) - (y5 - y6) * (y8 * x7 - y7 * x8)) / (
|
||||
(y7 - y8) * (x5 - x6) - (y5 - y6) * (x7 - x8))
|
||||
x = (x0 + x1) / 2
|
||||
@@ -187,6 +197,30 @@ class ResMrpWorkOrder(models.Model):
|
||||
|
||||
# 拼接工单对象属性值
|
||||
def json_workorder_str(self, k, production, route):
|
||||
# 计算预计时长duration_expected
|
||||
if route.routing_type == '切割':
|
||||
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
[('name', '=', '切割')]).time_cycle
|
||||
elif route.routing_type == '获取CNC加工程序':
|
||||
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
[('name', '=', '获取CNC加工程序')]).time_cycle
|
||||
elif route.routing_type == '工件装夹':
|
||||
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
[('name', '=', '工件装夹')]).time_cycle
|
||||
elif route.routing_type == '前置三元定位检测':
|
||||
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
[('name', '=', '前置三元定位检测')]).time_cycle
|
||||
elif route.routing_type == 'CNC加工':
|
||||
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
[('name', '=', 'CNC加工')]).time_cycle
|
||||
elif route.routing_type == '后置三元质量检测':
|
||||
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
[('name', '=', '后置三元质量检测')]).time_cycle
|
||||
elif route.routing_type == '解除装夹':
|
||||
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
[('name', '=', '解除装夹')]).time_cycle
|
||||
else:
|
||||
duration_expected = 60
|
||||
workorders_values_str = [0, '', {
|
||||
'product_uom_id': production.product_uom_id.id,
|
||||
'qty_producing': 0,
|
||||
@@ -201,7 +235,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
production.product_id),
|
||||
'date_planned_start': False,
|
||||
'date_planned_finished': False,
|
||||
'duration_expected': 60,
|
||||
'duration_expected': duration_expected,
|
||||
'duration': 0,
|
||||
|
||||
}]
|
||||
@@ -280,7 +314,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
|
||||
# 验证坯料序列号是否正确
|
||||
def pro_code_is_ok(self, barcode):
|
||||
if barcode != False:
|
||||
if barcode is not False:
|
||||
if barcode != self.pro_code:
|
||||
raise UserError('坯料序列号错误')
|
||||
return False
|
||||
@@ -365,7 +399,8 @@ class ResMrpWorkOrder(models.Model):
|
||||
productions._create_workorder()
|
||||
productions.filtered(lambda p: (not p.orderpoint_id and p.move_raw_ids) or \
|
||||
(
|
||||
p.move_dest_ids.procure_method != 'make_to_order' and not p.move_raw_ids and not p.workorder_ids)).action_confirm()
|
||||
p.move_dest_ids.procure_method != 'make_to_order' and
|
||||
not p.move_raw_ids and not p.workorder_ids)).action_confirm()
|
||||
|
||||
for production in productions:
|
||||
origin_production = production.move_dest_ids and production.move_dest_ids[
|
||||
@@ -401,7 +436,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
[('routing_type', '=', 'CNC加工'), ('production_id', '=', self.production_id.id)], limit=1)
|
||||
res = {'model_code': '' if not cnc.product_id.model_code else cnc.product_id.model_code,
|
||||
'production_no': self.production_id.name,
|
||||
'machine_tool_code': cnc.workcenter_id.machine_tool_id.code,
|
||||
'machine_tool_code': cnc.workcenter_id.equipment_id.code,
|
||||
'material_code': cnc.env['sf.production.materials'].search(
|
||||
[('id', '=', cnc.product_id.materials_id.id)]).materials_no,
|
||||
'material_type_code': cnc.env['sf.materials.model'].search(
|
||||
@@ -457,7 +492,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
|
||||
# 重写工单开始按钮方法
|
||||
def button_start(self):
|
||||
if self.routing_type == '装夹':
|
||||
if self.routing_type == '装夹' and self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name:
|
||||
self.pro_code = self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name
|
||||
# 外协出库单,从“正在等待”变为“就绪”状态
|
||||
if self.is_subcontract is True:
|
||||
@@ -593,13 +628,13 @@ class CNCprocessing(models.Model):
|
||||
logging.info('folder_name:%s' % folder_name)
|
||||
serverdir = os.path.join('/tmp', folder_name, 'return', processing_panel)
|
||||
logging.info('serverdir:%s' % serverdir)
|
||||
for root, dirs, files in os.walk(serverdir):
|
||||
for root, files in os.walk(serverdir):
|
||||
for f in files:
|
||||
logging.info('f:%s' % f)
|
||||
if os.path.splitext(f)[1] == ".pdf":
|
||||
full_path = os.path.join(serverdir, root, f)
|
||||
logging.info('pdf:%s' % full_path)
|
||||
if full_path != False:
|
||||
if full_path is not False:
|
||||
if not cnc_processing.workorder_id.cnc_worksheet:
|
||||
cnc_processing.workorder_id.cnc_worksheet = base64.b64encode(
|
||||
open(full_path, 'rb').read())
|
||||
|
||||
@@ -1,32 +1,20 @@
|
||||
from odoo import models, fields, api
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.modules import get_resource_path
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
import base64
|
||||
import hashlib
|
||||
import os
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.modules import get_resource_path
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
|
||||
|
||||
class ResProductMo(models.Model):
|
||||
_inherit = 'product.template'
|
||||
|
||||
model_file = fields.Binary('模型文件')
|
||||
|
||||
# categ_type = fields.Selection(
|
||||
# [("成品", "成品"), ("坯料", "坯料"), ("原材料", "原材料"), ("表面工艺", "表面工艺"), ("刀具", "刀具"),
|
||||
# ("夹具", "夹具")],
|
||||
# string='产品的类别', compute='_compute_categ_id',
|
||||
# store=True)
|
||||
#
|
||||
# @api.depends('categ_id')
|
||||
# def _compute_categ_id(self):
|
||||
# for record in self:
|
||||
# if record:
|
||||
# record.categ_type = record.categ_id.type
|
||||
|
||||
categ_type = fields.Selection(string='产品的类别', related='categ_id.type', store=True)
|
||||
|
||||
model_name = fields.Char('模型名称')
|
||||
model_long = fields.Float('模型长(mm)', digits=(16, 3))
|
||||
model_width = fields.Float('模型宽(mm)', digits=(16, 3))
|
||||
@@ -43,11 +31,11 @@ class ResProductMo(models.Model):
|
||||
length = fields.Float('长(mm)', digits=(16, 3))
|
||||
width = fields.Float('宽(mm)', digits=(16, 3))
|
||||
height = fields.Float('高(mm)', digits=(16, 3))
|
||||
single_manufacturing = fields.Boolean(string="单个制造")
|
||||
|
||||
# single_manufacturing = fields.Boolean(string="单个制造")
|
||||
model_code = fields.Char('模型编码')
|
||||
is_bfm = fields.Boolean('业务平台是否自动创建', default=False)
|
||||
upload_model_file = fields.Many2many('ir.attachment', 'upload_model_file_attachment_ref', string='上传模型文件')
|
||||
model_file = fields.Binary('模型文件')
|
||||
product_model_type_id = fields.Many2one('sf.model.type', string='产品模型类型')
|
||||
embryo_model_type_id = fields.Many2one('sf.model.type', string='坯料模型类型')
|
||||
materials_id = fields.Many2one('sf.production.materials', string='材料')
|
||||
@@ -60,16 +48,18 @@ class ResProductMo(models.Model):
|
||||
cutting_tool_material_id = fields.Many2one('sf.cutting.tool.material', string='刀具物料')
|
||||
cutting_tool_type = fields.Char(string="刀具物料类型", related='cutting_tool_material_id.name', store=True)
|
||||
|
||||
cutting_tool_model_id = fields.Many2one('sf.cutting.tool.model', string='型号',
|
||||
)
|
||||
cutting_tool_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='型号')
|
||||
specification_id = fields.Many2one('sf.tool.materials.basic.parameters', string='规格')
|
||||
|
||||
cutting_tool_type_id = fields.Many2one('sf.cutting.tool.type', string='类型',
|
||||
domain="[('cutting_tool_material_id.name', '=', cutting_tool_type)]")
|
||||
|
||||
brand_id = fields.Many2one('sf.machine.brand', '品牌')
|
||||
|
||||
tool_length = fields.Float('长度(mm)')
|
||||
tool_width = fields.Float('宽度(mm)')
|
||||
tool_height = fields.Float('高度(mm)')
|
||||
tool_thickness = fields.Integer('厚度(mm)')
|
||||
tool_thickness = fields.Float('厚度(mm)')
|
||||
tool_weight = fields.Float('重量(kg)')
|
||||
tool_hardness = fields.Integer('硬度(hrc)')
|
||||
|
||||
@@ -77,7 +67,7 @@ class ResProductMo(models.Model):
|
||||
# 整体式刀具特有字段
|
||||
cutting_tool_total_length = fields.Float('总长度(mm)', digits=(6, 1))
|
||||
cutting_tool_shank_length = fields.Float('柄部长度(mm)', digits=(6, 1))
|
||||
cutting_tool_blade_length = fields.Float('刃部长度(mm)', digits=(6, 1))
|
||||
cutting_tool_blade_length = fields.Float('刃部长度(mm)')
|
||||
cutting_tool_blade_number = fields.Selection(
|
||||
[('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8')], '刃数(个)')
|
||||
# 整体式刀具新增字段
|
||||
@@ -88,157 +78,381 @@ class ResProductMo(models.Model):
|
||||
cutting_tool_blade_tip_taper = fields.Integer('刀尖锥度(°)')
|
||||
cutting_tool_blade_helix_angle = fields.Integer('刃部螺旋角(°)')
|
||||
cutting_tool_blade_type = fields.Char('刃部类型')
|
||||
cutting_tool_pitch = fields.Float('牙距(mm)')
|
||||
cutting_tool_blade_width = fields.Float('刃部宽度(mm)')
|
||||
cutting_tool_blade_depth = fields.Float('刃部深度(mm)')
|
||||
cutting_tool_cut_depth = fields.Float('切削深度(mm)')
|
||||
cutting_tool_cut_depth_max = fields.Float('最大切削深度(mm)')
|
||||
cutting_tool_coarse_medium_fine = fields.Selection([('粗', '粗'), ('中', '中'), ('精', '精')], '粗/中/精')
|
||||
cutting_tool_run_out_accuracy_max = fields.Float('端跳精度max', digits=(6, 1))
|
||||
cutting_tool_run_out_accuracy_min = fields.Float('端跳精度min', digits=(6, 1))
|
||||
cutting_tool_blade_tip_working_size = fields.Char('刀尖处理尺寸(R半径mm/倒角)', size=20)
|
||||
fit_blade_shape_id = fields.Many2one('maintenance.equipment.image',
|
||||
'适配刀片形状', domain=[('type', '=', '刀片形状')])
|
||||
suitable_machining_method_ids = fields.Many2many('maintenance.equipment.image',
|
||||
'rel_machining_product_template', '适合加工方式',
|
||||
domain=[('type', '=', '加工能力')])
|
||||
blade_tip_characteristics_ids = fields.Many2many('maintenance.equipment.image',
|
||||
'rel_blade_tip_product_template', '刀尖特征',
|
||||
domain=[('type', '=', '刀尖特征')])
|
||||
handle_type_ids = fields.Many2many('maintenance.equipment.image', 'rel_handle_product_template', '柄部类型',
|
||||
domain=[('type', '=', '柄部类型')])
|
||||
blade_tip_characteristics_id = fields.Many2one('maintenance.equipment.image', '刀尖特征',
|
||||
domain=[('type', '=', '刀尖特征')])
|
||||
handle_type_id = fields.Many2one('maintenance.equipment.image', '柄部类型', domain=[('type', '=', '柄部类型')])
|
||||
cutting_direction_ids = fields.Many2many('maintenance.equipment.image', 'rel_cutting_product_template',
|
||||
'走刀方向', domain=[('type', '=', '走刀方向')])
|
||||
suitable_coolant_ids = fields.Many2many('maintenance.equipment.image', 'rel_coolant_product_template',
|
||||
'适合冷却液', domain=[('type', '=', '冷却液')])
|
||||
compaction_way_id = fields.Many2one('maintenance.equipment.image',
|
||||
'压紧方式', domain=[('type', '=', '压紧方式')])
|
||||
|
||||
@api.onchange('cutting_tool_material_id')
|
||||
def _onchange_cutting_tool_material_id(self):
|
||||
for item in self:
|
||||
if item.cutting_tool_material_id.id != item.cutting_tool_model_id.cutting_tool_material_id.id:
|
||||
item.cutting_tool_model_id = False
|
||||
item.specification_id = False
|
||||
item.cutting_tool_type_id = False
|
||||
item.brand_id = False
|
||||
item.tool_hardness = False
|
||||
item.cutting_tool_run_out_accuracy_max = False
|
||||
item.cutting_tool_run_out_accuracy_min = False
|
||||
item.materials_type_id = False
|
||||
item.cutting_tool_blade_type = False
|
||||
item.cutting_tool_total_length = False
|
||||
item.cutting_tool_clamping_way = False
|
||||
item.cutting_tool_blade_diameter = False
|
||||
item.cutting_tool_shank_length = False
|
||||
item.cutting_tool_blade_length = False
|
||||
item.cutting_tool_blade_number = False
|
||||
item.cutting_tool_neck_length = False
|
||||
item.cutting_tool_neck_diameter = False
|
||||
item.cutting_tool_shank_diameter = False
|
||||
item.cutting_tool_blade_tip_diameter = False
|
||||
item.cutting_tool_blade_tip_taper = False
|
||||
item.cutting_tool_blade_helix_angle = False
|
||||
item.cutting_tool_blade_type = False
|
||||
item.cutting_tool_pitch = False
|
||||
item.cutting_tool_blade_width = False
|
||||
item.cutting_tool_blade_depth = False
|
||||
item.cutting_tool_cut_depth = False
|
||||
item.cutting_tool_coarse_medium_fine = False
|
||||
item.cutting_tool_run_out_accuracy_max = False
|
||||
item.cutting_tool_run_out_accuracy_min = False
|
||||
item.cutting_tool_blade_tip_working_size = False
|
||||
item.fit_blade_shape_id = False
|
||||
item.suitable_machining_method_ids = False
|
||||
item.blade_tip_characteristics_id = False
|
||||
item.handle_type_id = False
|
||||
item.cutting_direction_ids = False
|
||||
item.suitable_coolant_ids = False
|
||||
item.compaction_way_id = False
|
||||
item.cutting_speed_ids = False
|
||||
item.feed_per_tooth_ids = False
|
||||
|
||||
# @api.constrains('suitable_machining_method_ids')
|
||||
# def _check_suitable_machining_method_ids(self):
|
||||
# for record in self:
|
||||
# if len(record.suitable_machining_method_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("适合加工方式不能为空!")
|
||||
#
|
||||
# @api.constrains('blade_tip_characteristics_ids')
|
||||
# def _check_blade_tip_characteristics_ids(self):
|
||||
# for record in self:
|
||||
# if len(record.blade_tip_characteristics_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("刀尖特征不能为空!")
|
||||
# if len(record.blade_tip_characteristics_ids) > 1 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("刀尖特征只能单选!")
|
||||
#
|
||||
# @api.constrains('handle_type_ids')
|
||||
# def _check_handle_type_ids(self):
|
||||
# for record in self:
|
||||
# if len(record.handle_type_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("柄部类型不能为空!")
|
||||
# if len(record.handle_type_ids) > 1 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("柄部类型只能单选!")
|
||||
#
|
||||
# @api.constrains('cutting_direction_ids')
|
||||
# def _check_cutting_direction_ids(self):
|
||||
# for record in self:
|
||||
# if len(record.cutting_direction_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("走刀方向不能为空!")
|
||||
#
|
||||
# @api.constrains('suitable_coolant_ids')
|
||||
# def _check_suitable_coolant_ids(self):
|
||||
# for record in self:
|
||||
# if not record.suitable_coolant_ids and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("适合冷却液不能为空!")
|
||||
#
|
||||
# @api.constrains('cutting_tool_total_length')
|
||||
# def _check_cutting_tool_total_length(self):
|
||||
# if self.cutting_tool_total_length <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("总长度不能为0")
|
||||
#
|
||||
# @api.constrains('cutting_tool_shank_length')
|
||||
# def _check_cutting_tool_shank_length(self):
|
||||
# if self.cutting_tool_shank_length <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("柄部长度不能为0")
|
||||
#
|
||||
# @api.constrains('cutting_tool_blade_length')
|
||||
# def _check_cutting_tool_blade_length(self):
|
||||
# if self.cutting_tool_blade_length <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("刃部长度不能为0")
|
||||
#
|
||||
# @api.constrains('cutting_tool_blade_number')
|
||||
# def _check_cutting_tool_blade_number(self):
|
||||
# if self.cutting_tool_blade_number <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("刃数不能为0")
|
||||
#
|
||||
# @api.constrains('integral_shank_diameter')
|
||||
# def _check_integral_shank_diameter(self):
|
||||
# if self.integral_shank_diameter <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("柄部直径不能为0")
|
||||
#
|
||||
# @api.constrains('integral_blade_diameter')
|
||||
# def _check_integral_blade_diameter(self):
|
||||
# if self.integral_blade_diameter <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("刃部直径不能为0")
|
||||
#
|
||||
# @api.constrains('integral_run_out_accuracy_min')
|
||||
# def _check_integral_blade_diameter(self):
|
||||
# if self.integral_run_out_accuracy_min <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("端跳精度最小(min)不能为0")
|
||||
# def choice(self):
|
||||
# if self.cutting_tool_type == '整体式刀具':
|
||||
# tree_view = self.env.ref('sf_base.view_sf_tool_materials_basic_parameters_integral_tree')
|
||||
# elif self.cutting_tool_type == '刀片':
|
||||
# tree_view = self.env.ref('sf_base.view_sf_tool_materials_basic_parameters_blade_tree')
|
||||
# elif self.cutting_tool_type == '刀杆':
|
||||
# tree_view = self.env.ref('sf_base.view_sf_tool_materials_basic_parameters_cutter_bar_tree')
|
||||
# elif self.cutting_tool_type == '刀盘':
|
||||
# tree_view = self.env.ref('sf_base.view_sf_tool_materials_basic_parameters_tree')
|
||||
# elif self.cutting_tool_type == '刀柄':
|
||||
# tree_view = self.env.ref('sf_base.view_sf_tool_materials_basic_parameters_tree')
|
||||
# else:
|
||||
# tree_view = self.env.ref('sf_base.view_sf_tool_materials_basic_parameters_tree')
|
||||
# return {
|
||||
# 'name': _('规格'),
|
||||
# 'view_mode': 'list',
|
||||
# 'view_id': tree_view.id,
|
||||
# 'type': 'ir.actions.act_window',
|
||||
# 'res_model': 'sf.tool.materials.basic.parameters',
|
||||
# 'target': 'new',
|
||||
# 'domain': [('cutting_tool_type', '=', self.cutting_tool_type),
|
||||
# ('standard_library_id', '=', self.cutting_tool_model_id.id)],
|
||||
# }
|
||||
|
||||
@api.onchange('specification_id')
|
||||
def _onchange_specification(self):
|
||||
if self.specification_id:
|
||||
self.cutting_speed_ids = False
|
||||
self.feed_per_tooth_ids = False
|
||||
self.cutting_tool_type_id = self.cutting_tool_model_id.cutting_tool_type_id.id
|
||||
self.brand_id = self.cutting_tool_model_id.brand_id.id
|
||||
self.tool_hardness = self.cutting_tool_model_id.tool_hardness
|
||||
self.cutting_tool_blade_type = self.cutting_tool_model_id.blade_type
|
||||
self.cutting_tool_coarse_medium_fine = self.cutting_tool_model_id.integral_coarse_medium_fine
|
||||
self.materials_type_id = self.cutting_tool_model_id.material_model_id.id
|
||||
self.coating_material = self.cutting_tool_model_id.coating_material
|
||||
if self.cutting_tool_type == '整体式刀具':
|
||||
self.cutting_tool_total_length = self.specification_id.total_length
|
||||
self.cutting_tool_run_out_accuracy_max = self.cutting_tool_model_id.integral_run_out_accuracy_max
|
||||
self.cutting_tool_run_out_accuracy_min = self.cutting_tool_model_id.integral_run_out_accuracy_min
|
||||
self.cutting_tool_blade_diameter = self.specification_id.blade_diameter
|
||||
self.cutting_tool_blade_length = self.specification_id.blade_length
|
||||
self.cutting_tool_blade_number = self.specification_id.blade_number
|
||||
self.cutting_tool_blade_type = self.cutting_tool_model_id.blade_type
|
||||
self.cutting_tool_shank_diameter = self.specification_id.handle_diameter
|
||||
self.cutting_tool_blade_tip_diameter = self.specification_id.blade_tip_diameter
|
||||
self.cutting_tool_blade_tip_taper = self.specification_id.blade_tip_taper
|
||||
self.cutting_tool_blade_helix_angle = self.specification_id.blade_helix_angle
|
||||
self.cutting_tool_pitch = self.specification_id.pitch
|
||||
self.cutting_tool_blade_width = self.specification_id.blade_width
|
||||
self.cutting_tool_blade_depth = self.specification_id.blade_depth
|
||||
self.cutting_tool_cut_depth = self.specification_id.cutting_depth
|
||||
self.cutting_speed_ids = self.cutting_tool_model_id.cutting_speed_ids
|
||||
self.feed_per_tooth_ids = self.cutting_tool_model_id.feed_per_tooth_ids.filtered(
|
||||
lambda r: int(r.blade_diameter) == int(self.specification_id.blade_diameter))
|
||||
elif self.cutting_tool_type == '夹头':
|
||||
self.cutting_tool_clamping_length = self.specification_id.clamping_length
|
||||
self.cutting_tool_clamping_tolerance = self.specification_id.clamping_tolerance
|
||||
self.cutting_tool_clamping_diameter_min = self.specification_id.min_clamping_diameter
|
||||
self.cutting_tool_clamping_diameter_min = self.specification_id.max_clamping_diameter
|
||||
self.cutting_tool_clamping_way = self.specification_id.clamping_mode
|
||||
self.cutting_tool_top_diameter = self.specification_id.top_diameter
|
||||
self.cutting_tool_outer_diameter = self.specification_id.outer_diameter
|
||||
self.cutting_tool_inner_diameter = self.specification_id.inner_diameter
|
||||
self.tool_weight = self.specification_id.weight
|
||||
self.cutting_tool_jump_accuracy = self.specification_id.run_out_accuracy
|
||||
self.cutting_tool_max_load_capacity = self.specification_id.max_load_capacity
|
||||
self.cutting_tool_er_size_model = self.specification_id.er_size_model
|
||||
self.cutting_tool_handle_ids = self.cutting_tool_model_id.handle_ids
|
||||
self.cooling_suit_type_ids = self.specification_id.cooling_jacket
|
||||
elif self.cutting_tool_type == '刀片':
|
||||
self.cutting_tool_total_length = self.specification_id.total_length
|
||||
self.tool_length = self.specification_id.length
|
||||
self.tool_thickness = self.specification_id.thickness
|
||||
self.tool_width = self.specification_id.width
|
||||
self.cutting_tool_cut_blade_length = self.specification_id.cutting_blade_length
|
||||
self.cutting_tool_blade_tip_circular_arc_radius = self.specification_id.blade_tip_circular_arc_radius
|
||||
self.cutting_tool_blade_tip_height_tolerance = self.specification_id.blade_tip_height_tolerance
|
||||
self.cutting_tool_inscribed_circle_diameter = self.specification_id.inscribed_circle_diameter
|
||||
self.cutting_tool_inscribed_circle_tolerance = self.specification_id.inscribed_circle_tolerance
|
||||
self.cutting_tool_install_aperture_diameter = self.specification_id.install_aperture_diameter
|
||||
self.cutting_tool_chip_breaker_groove = self.specification_id.chip_breaker_groove
|
||||
# self.cutting_tool_cut_depth_max = self.specification_id.blade_blade_number
|
||||
self.cutting_tool_blade_blade_number = self.specification_id.blade_blade_number
|
||||
self.cutting_tool_blade_width = self.specification_id.blade_width
|
||||
self.cutting_tool_rear_angle = self.specification_id.relief_angle
|
||||
self.cutting_tool_main_included_angle = self.specification_id.main_included_angle
|
||||
self.cutting_tool_top_angle = self.specification_id.top_angle
|
||||
self.cutting_tool_blade_tip_dip_angle = self.specification_id.blade_tip_dip_angle
|
||||
self.cutting_tool_side_cutting_edge_angle = self.specification_id.side_cutting_edge_angle
|
||||
self.cutting_tool_pitch = self.specification_id.pitch
|
||||
self.cutting_tool_bladed_teeth_model = self.specification_id.blade_teeth_model
|
||||
self.cutting_tool_thickness_tolerance = self.specification_id.thickness_tolerance
|
||||
self.cutting_tool_thread_model = self.specification_id.thread_model
|
||||
self.cutting_tool_thread_num = self.specification_id.thread_num
|
||||
self.cutting_tool_cutter_bar_ids = self.cutting_tool_model_id.cutter_bar_ids.ids
|
||||
self.cutting_tool_cutter_pad_ids = self.cutting_tool_model_id.cutter_pad_ids.ids
|
||||
self.cutting_speed_ids = self.cutting_tool_model_id.cutting_speed_ids
|
||||
self.feed_per_tooth_ids = self.cutting_tool_model_id.feed_per_tooth_ids
|
||||
elif self.cutting_tool_type in ('刀盘', '刀杆'):
|
||||
self.cutting_tool_total_length = self.specification_id.total_length
|
||||
self.tool_length = self.specification_id.length
|
||||
self.tool_thickness = self.specification_id.thickness
|
||||
self.tool_width = self.specification_id.width
|
||||
self.cutting_tool_cut_blade_length = self.specification_id.cutting_blade_length
|
||||
self.cutting_tool_blade_tip_circular_arc_radius = self.specification_id.blade_tip_circular_arc_radius
|
||||
self.cutting_tool_blade_tip_height_tolerance = self.specification_id.blade_tip_height_tolerance
|
||||
self.cutting_tool_inscribed_circle_diameter = self.specification_id.inscribed_circle_diameter
|
||||
self.cutting_tool_inscribed_circle_tolerance = self.specification_id.inscribed_circle_tolerance
|
||||
self.cutting_tool_install_aperture_diameter = self.specification_id.install_aperture_diameter
|
||||
self.cutting_tool_chip_breaker_groove = self.specification_id.chip_breaker_groove
|
||||
# self.cutting_tool_cut_depth_max = self.specification_id.blade_blade_number
|
||||
self.cutting_tool_blade_blade_number = self.specification_id.blade_blade_number
|
||||
self.cutting_tool_blade_width = self.specification_id.blade_width
|
||||
self.cutting_tool_rear_angle = self.specification_id.relief_angle
|
||||
self.cutting_tool_main_included_angle = self.specification_id.main_included_angle
|
||||
self.cutting_tool_top_angle = self.specification_id.top_angle
|
||||
self.cutting_tool_blade_tip_dip_angle = self.specification_id.blade_tip_dip_angle
|
||||
if self.cutting_tool_type == '刀盘':
|
||||
self.cutting_tool_blade_length = self.specification_id.blade_length
|
||||
self.cutting_tool_cutter_head_diameter = self.specification_id.cutter_head_diameter
|
||||
self.cutting_tool_interface_diameter = self.specification_id.interface_diameter
|
||||
else:
|
||||
self.cutting_tool_knife_head_height = self.specification_id.knife_head_height
|
||||
self.cutting_tool_knife_head_width = self.specification_id.knife_head_width
|
||||
self.cutting_tool_knife_head_length = self.specification_id.knife_head_length
|
||||
elif self.cutting_tool_type == '刀柄':
|
||||
self.cutting_tool_total_length = self.specification_id.total_length
|
||||
self.cutting_tool_standard_speed = self.specification_id.standard_rotate_speed
|
||||
self.cutting_tool_speed_max = self.specification_id.max_rotate_speed
|
||||
self.cutting_tool_change_time = self.specification_id.tool_changing_time
|
||||
self.cutting_tool_total_length = self.specification_id.total_length
|
||||
self.cutting_tool_clamping_diameter_max = self.specification_id.max_clamping_diameter
|
||||
self.cutting_tool_clamping_diameter_min = self.specification_id.min_clamping_diameter
|
||||
self.cutting_tool_flange_length = self.specification_id.flange_shank_length
|
||||
self.cutting_tool_shank_outer_diameter = self.specification_id.handle_external_diameter
|
||||
self.cutting_tool_shank_inner_diameter = self.specification_id.handle_inside_diameter
|
||||
self.suitable_machining_method_ids = [(6, 0, [])] if not \
|
||||
self.cutting_tool_model_id.suitable_machining_method_ids \
|
||||
else [(6, 0, self.cutting_tool_model_id.suitable_machining_method_ids.ids)]
|
||||
self.blade_tip_characteristics_id = self.cutting_tool_model_id.blade_tip_characteristics_id.id
|
||||
|
||||
self.handle_type_id = self.cutting_tool_model_id.handle_type_id.id
|
||||
|
||||
self.cutting_direction_ids = [(6, 0,
|
||||
[])] if not self.cutting_tool_model_id.cutting_direction_ids else [
|
||||
(6, 0, self.cutting_tool_model_id.cutting_direction_ids.ids)]
|
||||
|
||||
self.suitable_coolant_ids = [(6, 0,
|
||||
[])] if not self.cutting_tool_model_id.suitable_coolant_ids else [
|
||||
(6, 0, self.cutting_tool_model_id.suitable_coolant_ids.ids)]
|
||||
self.compaction_way_id = self.cutting_tool_model_id.compaction_way_id.id
|
||||
self.fit_blade_shape_id = self.cutting_tool_model_id.fit_blade_shape_id.id
|
||||
else:
|
||||
self.cutting_tool_type_id = False
|
||||
self.brand_id = False
|
||||
self.tool_hardness = False
|
||||
self.cutting_tool_run_out_accuracy_max = False
|
||||
self.cutting_tool_run_out_accuracy_min = False
|
||||
self.materials_type_id = False
|
||||
self.cutting_tool_blade_type = False
|
||||
self.cutting_tool_total_length = False
|
||||
self.cutting_tool_clamping_way = False
|
||||
self.cutting_tool_blade_diameter = False
|
||||
self.cutting_tool_shank_length = False
|
||||
self.cutting_tool_blade_length = False
|
||||
self.cutting_tool_blade_number = False
|
||||
self.cutting_tool_neck_length = False
|
||||
self.cutting_tool_neck_diameter = False
|
||||
self.cutting_tool_shank_diameter = False
|
||||
self.cutting_tool_blade_tip_diameter = False
|
||||
self.cutting_tool_blade_tip_taper = False
|
||||
self.cutting_tool_blade_helix_angle = False
|
||||
self.cutting_tool_blade_type = False
|
||||
self.cutting_tool_pitch = False
|
||||
self.cutting_tool_blade_width = False
|
||||
self.cutting_tool_blade_depth = False
|
||||
self.cutting_tool_cut_depth = False
|
||||
self.cutting_tool_coarse_medium_fine = False
|
||||
self.cutting_tool_run_out_accuracy_max = False
|
||||
self.cutting_tool_run_out_accuracy_min = False
|
||||
self.cutting_tool_blade_tip_working_size = False
|
||||
self.fit_blade_shape_id = False
|
||||
self.suitable_machining_method_ids = False
|
||||
self.blade_tip_characteristics_id = False
|
||||
self.handle_type_id = False
|
||||
self.cutting_direction_ids = False
|
||||
self.suitable_coolant_ids = False
|
||||
self.compaction_way_id = False
|
||||
self.cutting_speed_ids = False
|
||||
self.feed_per_tooth_ids = False
|
||||
|
||||
@api.constrains('fit_blade_shape_id', 'suitable_machining_method_ids', 'blade_tip_characteristics_id',
|
||||
'handle_type_id', 'cutting_direction_ids', 'suitable_coolant_ids', 'compaction_way_id')
|
||||
def _check_cutting_tool_ability(self):
|
||||
if self.cutting_tool_type in ['整体式刀具', '刀片', '刀杆', '刀盘']:
|
||||
if self.cutting_tool_type in ['刀片', '刀杆', '刀盘']:
|
||||
if not self.fit_blade_shape_id:
|
||||
raise ValidationError("请选择适配刀片形状")
|
||||
if self.cutting_tool_type in ['刀杆', '刀盘']:
|
||||
if not self.compaction_way_id:
|
||||
raise ValidationError("请选择压紧方式")
|
||||
if self.cutting_tool_type == '刀片':
|
||||
if not self.suitable_coolant_ids:
|
||||
raise ValidationError("请选择适合冷却液")
|
||||
elif self.cutting_tool_type == '整体式刀具':
|
||||
if not self.handle_type_id:
|
||||
raise ValidationError("请选择柄部类型")
|
||||
if not self.suitable_coolant_ids:
|
||||
raise ValidationError("请选择适合冷却液")
|
||||
if not self.suitable_machining_method_ids:
|
||||
raise ValidationError("请选择适合加工方式")
|
||||
if not self.blade_tip_characteristics_id:
|
||||
raise ValidationError("请选择刀尖特征")
|
||||
if not self.cutting_direction_ids:
|
||||
raise ValidationError("请选择走刀方向")
|
||||
|
||||
cutting_speed_ids = fields.One2many('sf.cutting.speed', 'product_template_id', string='切削速度Vc')
|
||||
feed_per_tooth_ids = fields.One2many('sf.feed.per.tooth', 'product_template_id', string='每齿走刀量fz')
|
||||
|
||||
# @api.constrains('suitable_machining_method_ids')
|
||||
# def _check_suitable_machining_method_ids(self):
|
||||
# for record in self:
|
||||
# if len(record.suitable_machining_method_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("适合加工方式不能为空!")
|
||||
|
||||
# @api.constrains('integral_run_out_accuracy_max')
|
||||
# def _check_integral_run_out_accuracy_max(self):
|
||||
# if self.integral_run_out_accuracy_max <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("端跳精度最大(max)不能为0")
|
||||
|
||||
cutting_tool_diameter = fields.Float('直径(mm)')
|
||||
cutting_tool_front_angle = fields.Integer('前角(°)')
|
||||
cutting_tool_rear_angle = fields.Integer('后角(°)')
|
||||
cutting_tool_main_included_angle = fields.Integer('主偏角(°)')
|
||||
# cutting_tool_material_model_id = fields.Many2one('sf.materials.model', '材料型号')
|
||||
cutting_tool_nut = fields.Float('配对螺母(mm)')
|
||||
# 适用夹头型号可以多选
|
||||
cutting_tool_chuck_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='product_cutting_tool_model_handle_chuck_rel',
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='product_cutting_tool_library_handle_chuck_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '夹头')]",
|
||||
string='适用夹头型号')
|
||||
# 刀片参数
|
||||
cutting_tool_cut_blade_length = fields.Float('切削刃长(mm)')
|
||||
cutting_tool_blade_tip_circular_arc_radius = fields.Char('刀尖圆弧半径(mm)', size=20)
|
||||
cutting_tool_top_angle = fields.Integer('顶角(°)')
|
||||
cutting_tool_jump_accuracy = fields.Float('径跳精度(mm)')
|
||||
cutting_tool_working_hardness = fields.Char('加工硬度(hrc)')
|
||||
cutting_tool_inscribed_circle_diameter = fields.Float('内接圆直径(mm)')
|
||||
cutting_tool_install_aperture_diameter = fields.Float('安装孔直径(mm)')
|
||||
cutting_tool_chip_breaker_groove = fields.Selection([('无', '无'), ('单面', '单面'), ('双面', '双面')],
|
||||
string='有无断屑槽')
|
||||
cutting_tool_bladed_teeth_model = fields.Selection(
|
||||
[('无', '无'), ('V牙型', 'V牙型'), ('米制全牙型', '米制全牙型'), ('美制全牙型', '美制全牙型'),
|
||||
('惠氏全牙型', '惠氏全牙型'), ('BSPT全牙型', 'BSPT全牙型'), ('NPT全牙型', 'NPT全牙型'),
|
||||
('UNJ全牙型', 'UNJ全牙型'), ('DIN405圆牙型', 'DIN405圆牙型'), ('ACME梯形', 'ACME梯形'),
|
||||
('石油管螺纹刀片', '石油管螺纹刀片'), ('矮牙ACME梯形', '矮牙ACME梯形'),
|
||||
('Trapeze30° 103', 'Trapeze30° 103')], string='刀片牙型', default='无')
|
||||
cutting_tool_blade_blade_number = fields.Selection(
|
||||
[('0', '0'), ('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'),
|
||||
('7', '7'), ('8', '8'), ('9', '9'), ('10', '10')],
|
||||
string='刀片的刃数(个)')
|
||||
|
||||
cutting_tool_blade_tip_dip_angle = fields.Integer('刀尖倾角(°)')
|
||||
cutting_tool_side_cutting_edge_angle = fields.Integer('侧切削角(°)')
|
||||
cutting_tool_thread_model = fields.Selection([('无', '无'), ('外螺纹', '外螺纹'), ('内螺纹', '内螺纹')],
|
||||
string='螺纹类型')
|
||||
cutting_tool_thread_num = fields.Float('每英寸螺纹数(tpi)')
|
||||
cutting_tool_blade_tip_height_tolerance = fields.Char('刀尖高度公差(mm)', size=20)
|
||||
cutting_tool_inscribed_circle_tolerance = fields.Char('内接圆公差(mm)', size=20)
|
||||
cutting_tool_thickness_tolerance = fields.Char('厚度公差(mm)', size=20)
|
||||
|
||||
cutting_tool_jump_accuracy = fields.Char('径跳精度(mm)')
|
||||
cutting_tool_working_hardness = fields.Integer('加工硬度(hrc)')
|
||||
cutting_tool_cutter_bar_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='product_cutting_tool_model_blade_cutter_bar_rel',
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='product_cutting_tool_library_cutter_bar_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '刀杆')]",
|
||||
string='适用刀杆型号'
|
||||
)
|
||||
cutting_tool_cutter_pad_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='product_cutting_tool_model_blade_cutter_pad_rel',
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='product_cutting_tool_library_cutter_pad_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '刀盘')]",
|
||||
string='适用刀盘型号' # 使用空列表作为默认值
|
||||
)
|
||||
# 刀杆/参数
|
||||
cutting_tool_knife_head_height = fields.Float('刀头高度(mm)')
|
||||
cutting_tool_knife_head_width = fields.Float('刀头宽度(mm)')
|
||||
cutting_tool_knife_head_length = fields.Float('刀头长度(mm)')
|
||||
cutting_tool_blade_diameter = fields.Float('刃径/刃部直径(mm)')
|
||||
cutting_tool_cutter_arbor_diameter = fields.Float('刀杆直径(mm)')
|
||||
cutting_tool_min_machining_aperture = fields.Integer('最小加工孔径(mm)')
|
||||
cutting_tool_install_blade_tip_num = fields.Integer('可装刀片数/齿数(个)', size=20)
|
||||
cutting_tool_installing_structure = fields.Char('安装结构', size=20)
|
||||
cutting_tool_blade_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='product_cutting_tool_model_pad_blade_rel',
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='product_cutting_tool_library_pad_blade_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '刀片')]",
|
||||
string='适用刀片型号' # 使用空列表作为默认值
|
||||
)
|
||||
cutting_tool_wrench = fields.Float('配对扳手(mm)')
|
||||
# cutting_tool_screw = fields.Float('配备螺丝(mm)')
|
||||
cutting_tool_accuracy_level = fields.Char('精度等级')
|
||||
cutting_tool_tool_shim = fields.Char('适配刀垫型号', size=50)
|
||||
cutting_tool_cotter_pin = fields.Char('适配销钉型号', size=50)
|
||||
cutting_tool_pressing_plate = fields.Char('适配压板型号', size=50)
|
||||
cutting_tool_screw = fields.Char('适配螺钉型号', size=50)
|
||||
cutting_tool_wrench = fields.Char('适配扳手型号')
|
||||
cutting_tool_is_cooling_hole = fields.Boolean('有无冷却孔', default=False)
|
||||
cutting_tool_locating_slot_code = fields.Char('定位槽代号', size=20)
|
||||
# 刀盘参数
|
||||
cutting_tool_cutter_head_diameter = fields.Float('刀盘直径(mm)')
|
||||
cutting_tool_interface_diameter = fields.Float('接口直径(mm)')
|
||||
|
||||
# 刀柄参数
|
||||
cutting_tool_head_diameter = fields.Float('头部直径')
|
||||
cutting_tool_diameter_max = fields.Float('最大直径(mm)')
|
||||
cutting_tool_clamping_diameter = fields.Float('夹持直径(mm)')
|
||||
cutting_tool_shank_outer_diameter = fields.Float('柄部外径(mm)')
|
||||
cutting_tool_shank_inner_diameter = fields.Float('柄部内径(mm)')
|
||||
cutting_tool_clamping_length = fields.Float('夹持长度(mm)')
|
||||
cutting_tool_clamping_tolerance = fields.Float('夹持公差(mm)')
|
||||
cutting_tool_clamping_diameter_max = fields.Float('最大夹持直径')
|
||||
@@ -248,34 +462,30 @@ class ResProductMo(models.Model):
|
||||
cutting_tool_is_rough_finish = fields.Boolean('可粗加工', default=False)
|
||||
cutting_tool_is_finish = fields.Boolean('可精加工', default=False)
|
||||
cutting_tool_is_drill_hole = fields.Boolean('可钻孔', default=False)
|
||||
cutting_tool_is_safety_lock = fields.Boolean('安全锁', default=False)
|
||||
cutting_tool_is_safety_lock = fields.Boolean('有无安全锁', default=False)
|
||||
cutting_tool_is_high_speed_cutting = fields.Boolean('可高速切削', default=False)
|
||||
cutting_tool_dynamic_balance_class = fields.Char('动平衡等级')
|
||||
cutting_tool_change_time = fields.Integer('换刀时间(s)')
|
||||
cutting_tool_clamping_way = fields.Char('夹持方式')
|
||||
cutting_tool_standard_speed = fields.Integer('标准转速(n/min)')
|
||||
cutting_tool_speed_max = fields.Integer('最大转速(n/min)')
|
||||
cutting_tool_cooling_type = fields.Char('冷却类型')
|
||||
cutting_tool_body_accuracy = fields.Float('本体精度(mm)')
|
||||
apply_lock_nut_model = fields.Char('适用锁紧螺母型号')
|
||||
apply_lock_wrench_model = fields.Char('适用锁紧扳手型号')
|
||||
cutting_tool_detection_accuracy_max = fields.Float('最大检测精度(mm)')
|
||||
cutting_tool_detection_accuracy_min = fields.Float('最小检测精度(mm)')
|
||||
# 夹头参数
|
||||
cutting_tool_taper = fields.Integer('锥度(°)')
|
||||
cutting_tool_top_diameter = fields.Float('顶部直径')
|
||||
cutting_tool_outer_diameter = fields.Float('外径(mm)')
|
||||
cutting_tool_inner_diameter = fields.Float('内径(mm)')
|
||||
cooling_suit_type_ids = fields.Char('适用冷却套型号')
|
||||
# cooling_suit_type_ids = fields.Many2many('冷却类型')
|
||||
cutting_tool_max_load_capacity = fields.Float('最大负载能力(kg)')
|
||||
cutting_tool_er_size_model = fields.Char('ER尺寸型号')
|
||||
cutting_tool_handle_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='product_cutting_tool_model_chuck_handle_rel',
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='product_cutting_tool_library_chuck_handle_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '刀柄')]",
|
||||
string='适用刀柄型号'
|
||||
)
|
||||
|
||||
# 夹具参数
|
||||
fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料")
|
||||
fixture_model_id = fields.Many2one('sf.fixture.model', string="夹具型号")
|
||||
@@ -404,12 +614,6 @@ class ResProductMo(models.Model):
|
||||
self.detailed_type = 'product'
|
||||
self.sale_ok = False
|
||||
|
||||
@api.onchange('cutting_tool_material_id')
|
||||
def _onchange_cutting_tool_material_id(self):
|
||||
for item in self:
|
||||
if item.cutting_tool_material_id.id != item.cutting_tool_model_id.cutting_tool_material_id.id:
|
||||
item.cutting_tool_model_id = False
|
||||
|
||||
@api.onchange('fixture_material_id')
|
||||
def _onchange_fixture_material_id(self):
|
||||
for item in self:
|
||||
@@ -446,120 +650,6 @@ class ResProductMo(models.Model):
|
||||
item.fixture_apply_machine_tool_type_ids = self._get_ids(
|
||||
item.fixture_model_id.apply_machine_tool_type_ids)
|
||||
|
||||
# @api.onchange('cutting_tool_model_id')
|
||||
# def _onchange_cutting_tool_model_id(self):
|
||||
# for item in self:
|
||||
# if self.cutting_tool_type is not False:
|
||||
# item.brand_id = item.cutting_tool_model_id.brand_id.id
|
||||
# item.cutting_tool_type_id = item.cutting_tool_model_id.cutting_tool_type_id.id
|
||||
# item.tool_length = item.cutting_tool_model_id.tool_length
|
||||
# item.tool_width = item.cutting_tool_model_id.tool_width
|
||||
# item.tool_height = item.cutting_tool_model_id.tool_height
|
||||
# item.tool_thickness = item.cutting_tool_model_id.tool_thickness
|
||||
# item.tool_weight = item.cutting_tool_model_id.tool_weight
|
||||
# item.coating_material = item.cutting_tool_model_id.coating_material
|
||||
# item.cutting_tool_total_length = item.cutting_tool_model_id.total_length
|
||||
# item.cutting_tool_shank_length = item.cutting_tool_model_id.shank_length
|
||||
# item.cutting_tool_neck_length = item.cutting_tool_model_id.cutting_tool_neck_length
|
||||
# item.cutting_tool_shank_diameter = item.cutting_tool_model_id.cutting_tool_shank_diameter
|
||||
# item.cutting_tool_blade_diameter = item.cutting_tool_model_id.cutting_tool_blade_diameter
|
||||
# item.cutting_tool_neck_diameter = item.cutting_tool_model_id.cutting_tool_neck_diameter
|
||||
# item.cutting_tool_blade_tip_diameter = item.cutting_tool_model_id.cutting_tool_blade_tip_diameter
|
||||
# item.cutting_tool_blade_tip_taper = item.cutting_tool_model_id.cutting_tool_blade_tip_taper
|
||||
# item.cutting_tool_blade_helix_angle = item.cutting_tool_model_id.cutting_tool_blade_helix_angle
|
||||
# item.cutting_tool_blade_type = item.cutting_tool_model_id.cutting_tool_blade_type
|
||||
# item.cutting_tool_coarse_medium_fine = item.cutting_tool_model_id.cutting_tool_coarse_medium_fine
|
||||
# item.tool_hardness = item.cutting_tool_model_id.tool_hardness
|
||||
# item.cutting_tool_run_out_accuracy_max = item.cutting_tool_model_id.cutting_tool_run_out_accuracy_max
|
||||
# item.cutting_tool_run_out_accuracy_min = item.cutting_tool_model_id.cutting_tool_run_out_accuracy_min
|
||||
# item.suitable_machining_method_ids = self._get_ids(
|
||||
# item.cutting_tool_model_id.suitable_machining_method_ids)
|
||||
# item.blade_tip_characteristics_ids = self._get_ids(
|
||||
# item.cutting_tool_model_id.blade_tip_characteristics_ids)
|
||||
# item.handle_type_ids = self._get_ids(item.cutting_tool_model_id.handle_type_ids)
|
||||
# item.cutting_direction_ids = self._get_ids(item.cutting_tool_model_id.cutting_direction_ids)
|
||||
# item.suitable_coolant_ids = self._get_ids(item.cutting_tool_model_id.suitable_coolant_ids)
|
||||
# item.cutting_tool_diameter = item.cutting_tool_model_id.diameter
|
||||
# item.cutting_tool_blade_number = item.cutting_tool_model_id.blade_number
|
||||
# item.cutting_tool_front_angle = item.cutting_tool_model_id.front_angle
|
||||
# item.cutting_tool_rear_angle = item.cutting_tool_model_id.rear_angle
|
||||
# item.cutting_tool_main_included_angle = item.cutting_tool_model_id.main_included_angle
|
||||
# item.materials_type_id = item.cutting_tool_model_id.material_model_id.id
|
||||
# item.cutting_tool_nut = item.cutting_tool_model_id.nut
|
||||
# item.cutting_tool_top_angle = item.cutting_tool_model_id.top_angle
|
||||
# item.cutting_tool_jump_accuracy = item.cutting_tool_model_id.jump_accuracy
|
||||
# item.cutting_tool_working_hardness = item.cutting_tool_model_id.working_hardness
|
||||
# item.cutting_tool_blade_diameter = item.cutting_tool_model_id.blade_diameter
|
||||
# item.cutting_tool_wrench = item.cutting_tool_model_id.wrench
|
||||
# # item.cutting_tool_screw = item.cutting_tool_model_id.screw
|
||||
# item.cutting_tool_accuracy_level = item.cutting_tool_model_id.accuracy_level
|
||||
# item.cutting_tool_diameter_max = item.cutting_tool_model_id.diameter_max
|
||||
# item.cutting_tool_clamping_diameter = item.cutting_tool_model_id.clamping_diameter
|
||||
# item.cutting_tool_flange_length = item.cutting_tool_model_id.flange_length
|
||||
# item.cutting_tool_flange_diameter = item.cutting_tool_model_id.flange_diameter
|
||||
# item.cutting_tool_outer_diameter = item.cutting_tool_model_id.outer_diameter
|
||||
# item.cutting_tool_inner_diameter = item.cutting_tool_model_id.inner_diameter
|
||||
# item.cutting_tool_chuck_ids = self._get_ids(item.cutting_tool_model_id.chuck_ids)
|
||||
# item.cutting_tool_cutter_bar_ids = self._get_ids(item.cutting_tool_model_id.cutter_bar_ids)
|
||||
# item.cutting_tool_cutter_pad_ids = self._get_ids(item.cutting_tool_model_id.cutter_pad_ids)
|
||||
# item.cutting_tool_blade_ids = self._get_ids(item.cutting_tool_model_id.blade_ids)
|
||||
# item.cutting_tool_handle_ids = self._get_ids(item.cutting_tool_model_id.handle_ids)
|
||||
# else:
|
||||
# item.brand_id = False
|
||||
# item.cutting_tool_type_id = False
|
||||
# item.brand_id = False
|
||||
# item.tool_length = False
|
||||
# item.tool_width = False
|
||||
# item.tool_height = False
|
||||
# item.tool_thickness = False
|
||||
# item.tool_weight = False
|
||||
# item.coating_material = False
|
||||
# item.cutting_tool_total_length = False
|
||||
# item.cutting_tool_shank_length = False
|
||||
# item.cutting_tool_blade_length = False
|
||||
# item.cutting_tool_neck_length = False
|
||||
# item.cutting_tool_shank_diameter = False
|
||||
# item.cutting_tool_blade_diameter = False
|
||||
# item.cutting_tool_neck_diameter = False
|
||||
# item.cutting_tool_blade_tip_diameter = False
|
||||
# item.cutting_tool_blade_tip_taper = False
|
||||
# item.cutting_tool_blade_helix_angle = False
|
||||
# item.cutting_tool_blade_type = False
|
||||
# item.cutting_tool_coarse_medium_fine = False
|
||||
# item.tool_hardness = False
|
||||
# item.cutting_tool_run_out_accuracy_max = False
|
||||
# item.cutting_tool_run_out_accuracy_min = False
|
||||
# item.suitable_machining_method_ids = False
|
||||
# item.blade_tip_characteristics_ids = False
|
||||
# item.handle_type_ids = False
|
||||
# item.cutting_direction_ids = False
|
||||
# item.suitable_coolant_ids = False
|
||||
# item.cutting_tool_diameter = False
|
||||
# item.cutting_tool_blade_number = False
|
||||
# item.cutting_tool_front_angle = False
|
||||
# item.cutting_tool_rear_angle = False
|
||||
# item.cutting_tool_main_included_angle = False
|
||||
# item.materials_type_id = False
|
||||
# item.cutting_tool_nut = False
|
||||
# item.cutting_tool_top_angle = False
|
||||
# item.cutting_tool_jump_accuracy = False
|
||||
# item.cutting_tool_working_hardness = False
|
||||
# item.cutting_tool_blade_diameter = False
|
||||
# item.cutting_tool_wrench = False
|
||||
# # item.cutting_tool_screw = False
|
||||
# item.cutting_tool_accuracy_level = False
|
||||
# item.cutting_tool_diameter_max = False
|
||||
# item.cutting_tool_clamping_diameter = False
|
||||
# item.cutting_tool_flange_length = False
|
||||
# item.cutting_tool_flange_diameter = False
|
||||
# item.cutting_tool_outer_diameter = False
|
||||
# item.cutting_tool_inner_diameter = False
|
||||
# item.cutting_tool_chuck_ids = False
|
||||
# item.cutting_tool_cutter_bar_ids = False
|
||||
# item.cutting_tool_cutter_pad_ids = False
|
||||
# item.cutting_tool_blade_ids = False
|
||||
# item.cutting_tool_handle_ids = False
|
||||
|
||||
def _get_volume_uom_id_from_ir_config_parameter(self):
|
||||
product_length_in_feet_param = self.env['ir.config_parameter'].sudo().get_param('product.volume_in_cubic_feet')
|
||||
if product_length_in_feet_param == '1':
|
||||
@@ -592,26 +682,19 @@ class ResProductMo(models.Model):
|
||||
'model_file': '' if not item['model_file'] else base64.b64decode(item['model_file']),
|
||||
'model_name': attachment.name,
|
||||
'upload_model_file': [(6, 0, [attachment.id])],
|
||||
# 'tag_ids': [(6, 0, [t.id for t in account_template.tag_ids])],
|
||||
# 'single_manufacturing': True,
|
||||
# 'tracking': 'serial',
|
||||
'list_price': item['price'],
|
||||
# 'categ_id': self.env.ref('sf_dlm.product_category_finished_sf').id,
|
||||
'materials_id': self.env['sf.production.materials'].search(
|
||||
[('materials_no', '=', item['texture_code'])]).id,
|
||||
'materials_type_id': self.env['sf.materials.model'].search(
|
||||
[('materials_no', '=', item['texture_type_code'])]).id,
|
||||
# 'model_surface_process_ids': self.get_production_process_id(item['surface_process_code']),
|
||||
'model_process_parameters_ids': [(6, 0, [])] if not item.get(
|
||||
'process_parameters_code') else self.get_process_parameters_id(item['process_parameters_code']),
|
||||
'model_remark': item['remark'],
|
||||
'default_code': '%s-%s' % (order_number, i),
|
||||
# 'barcode': item['barcode'],
|
||||
'active': True,
|
||||
# 'route_ids': self._get_routes('')
|
||||
}
|
||||
copy_product_id.sudo().write(vals)
|
||||
# product_id.product_tmpl_id.active = False
|
||||
product_id.product_tmpl_id.active = False
|
||||
return copy_product_id
|
||||
|
||||
def _get_ids(self, param):
|
||||
@@ -667,12 +750,6 @@ class ResProductMo(models.Model):
|
||||
'materials_id': materials_id.id,
|
||||
'materials_type_id': materials_type_id.id,
|
||||
'is_bfm': True,
|
||||
# 'route_ids': self._get_routes(route_type),
|
||||
# 'categ_id': self.env.ref('sf_dlm.product_category_embryo_sf').id,
|
||||
# 'model_surface_process_id': self.env['sf.production.process'].search(
|
||||
# [('process_encode', '=', item['surface_process_code'])]).id,
|
||||
# 'model_process_parameters_id': self.env['sf.processing.technology'].search(
|
||||
# [('process_encode', '=', item['process_parameters_code'])]).id,
|
||||
'active': True
|
||||
}
|
||||
# 外协和采购生成的坯料需要根据材料型号绑定供应商
|
||||
@@ -684,8 +761,6 @@ class ResProductMo(models.Model):
|
||||
partner = self.env['res.partner'].search([('id', '=', supplier.partner_id.id)])
|
||||
partner.is_subcontractor = True
|
||||
no_bom_copy_product_id.write(vals)
|
||||
logging.info('no_bom_copy_product_id-vals:%s' % vals)
|
||||
# product_id.product_tmpl_id.active = False
|
||||
return no_bom_copy_product_id
|
||||
|
||||
@api.model_create_multi
|
||||
@@ -741,7 +816,7 @@ class ResProductMo(models.Model):
|
||||
write_stl_file(shapes, output_file, 'binary', 0.03, 0.5)
|
||||
# 转化为glb
|
||||
output_glb_file = os.path.join('/tmp', str(code) + '.glb')
|
||||
util_path = get_resource_path('sf_dlm', 'static/util')
|
||||
util_path = get_resource_path('sf_base', 'static/util')
|
||||
cmd = 'python3 %s/stl2gltf.py %s %s -b' % (util_path, output_file, output_glb_file)
|
||||
os.system(cmd)
|
||||
# 转base64
|
||||
@@ -751,95 +826,10 @@ class ResProductMo(models.Model):
|
||||
return base64_data
|
||||
|
||||
|
||||
class ResMrpBomMo(models.Model):
|
||||
_inherit = 'mrp.bom'
|
||||
|
||||
subcontractor_id = fields.Many2one('res.partner', string='外包商')
|
||||
|
||||
def bom_create_line_has(self, embryo):
|
||||
vals = {
|
||||
'bom_id': self.id,
|
||||
'product_id': embryo.id,
|
||||
'product_tmpl_id': embryo.product_tmpl_id.id,
|
||||
'product_qty': 1,
|
||||
'product_uom_id': 1
|
||||
}
|
||||
return self.env['mrp.bom.line'].create(vals)
|
||||
|
||||
# 业务平台分配工厂后在智能工厂先创建销售订单再创建该产品后再次进行创建bom
|
||||
def bom_create(self, product, bom_type, product_type):
|
||||
bom_id = self.env['mrp.bom'].create({
|
||||
'product_tmpl_id': product.product_tmpl_id.id,
|
||||
'type': bom_type,
|
||||
# 'subcontractor_id': '' or subcontract.partner_id.id,
|
||||
'product_qty': 1,
|
||||
'product_uom_id': 1
|
||||
})
|
||||
if bom_type == 'subcontract' and product_type is not False:
|
||||
subcontract = self.get_supplier(product.materials_type_id)
|
||||
bom_id.subcontractor_id = subcontract.partner_id.id
|
||||
return bom_id
|
||||
|
||||
# 坯料BOM组件:选取当前坯料原材料,
|
||||
# 然后根据当前的坯料的体积得出需要的原材料重量(立方米m³) *材料密度 * 1000 = 所需原材料重量KG(公斤)
|
||||
# 坯料所需原材料公式:当前的坯料的体积(立方米m³) *材料密度 * 1000 = 所需原材料重量KG(公斤)
|
||||
def bom_create_line(self, embryo):
|
||||
# 选取当前坯料原材料
|
||||
raw_bom_line = self.get_raw_bom(embryo)
|
||||
if raw_bom_line:
|
||||
qty = 1
|
||||
if round(embryo.volume * raw_bom_line.materials_type_id.density / 1000000) > 1:
|
||||
qty = round(embryo.volume * raw_bom_line.materials_type_id.density / 1000000)
|
||||
bom_line = self.env['mrp.bom.line'].create({
|
||||
'bom_id': self.id,
|
||||
'product_id': raw_bom_line.id,
|
||||
'product_tmpl_id': raw_bom_line.product_tmpl_id.id,
|
||||
'product_qty': qty,
|
||||
'product_uom_id': raw_bom_line.uom_id.id,
|
||||
})
|
||||
return bom_line
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
# 查询材料型号默认排第一的供应商
|
||||
|
||||
def get_supplier(self, materials_type):
|
||||
seller_id = self.env['sf.supplier.sort'].search(
|
||||
[('materials_model_id', '=', materials_type.id)],
|
||||
limit=1,
|
||||
order='sequence asc')
|
||||
return seller_id
|
||||
|
||||
# 匹配bom
|
||||
|
||||
def get_bom(self, product):
|
||||
embryo_has = self.env['product.product'].search(
|
||||
[('categ_id.type', '=', '坯料'), ('materials_type_id', '=', product.materials_type_id.id),
|
||||
('length', '>', product.length), ('width', '>', product.width),
|
||||
('height', '>', product.height), ('is_bfm', '=', False)
|
||||
],
|
||||
limit=1,
|
||||
order='volume desc'
|
||||
)
|
||||
logging.info('get_bom-vals:%s' % embryo_has)
|
||||
if embryo_has:
|
||||
rate_of_waste = ((embryo_has.volume - product.model_volume) % embryo_has.volume) * 100
|
||||
if rate_of_waste <= 20:
|
||||
return embryo_has
|
||||
else:
|
||||
return
|
||||
|
||||
# 查bom的原材料
|
||||
def get_raw_bom(self, product):
|
||||
raw_bom = self.env['product.product'].search(
|
||||
[('categ_id.type', '=', '原材料'), ('materials_type_id', '=', product.materials_type_id.id)])
|
||||
return raw_bom
|
||||
|
||||
|
||||
class SfMaintenanceEquipmentAndProductTemplate(models.Model):
|
||||
_inherit = 'maintenance.equipment'
|
||||
_description = '设备'
|
||||
|
||||
product_template_ids = fields.One2many('maintenance.equipment.tool', 'equipment_id', string='机床刀位')
|
||||
|
||||
@api.model_create_multi
|
||||
@@ -862,7 +852,8 @@ class SfMaintenanceEquipmentTool(models.Model):
|
||||
_description = '机床刀位'
|
||||
|
||||
equipment_id = fields.Many2one('maintenance.equipment', string='设备')
|
||||
product_template_id = fields.Many2one('product.template', string='功能刀具名称', domain="[('categ_type', '=', '刀具')]")
|
||||
product_template_id = fields.Many2one('product.template', string='功能刀具名称',
|
||||
domain="[('categ_type', '=', '刀具')]")
|
||||
image_1920 = fields.Binary('图片', related='product_template_id.image_1920')
|
||||
categ_type = fields.Char(string='功能刀具类型')
|
||||
diameter = fields.Char('直径')
|
||||
@@ -875,3 +866,10 @@ class SfMaintenanceEquipmentTool(models.Model):
|
||||
used_value = fields.Char('已使用值')
|
||||
code = fields.Char('机床刀位号')
|
||||
|
||||
name = fields.Char('', compute='_compute_name')
|
||||
|
||||
@api.depends('code')
|
||||
def _compute_name(self):
|
||||
for record in self:
|
||||
if record.code:
|
||||
record.name = record.code
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user