Compare commits
41 Commits
feature/72
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62f0578ce8 | ||
|
|
b2a0899553 | ||
|
|
e0c1e27344 | ||
|
|
8434172fec | ||
|
|
a920d4b4b8 | ||
|
|
4609ddfa7a | ||
|
|
e73c0b15ea | ||
|
|
2347ed9cb3 | ||
|
|
f4829f57a1 | ||
|
|
e4c3435840 | ||
|
|
2a7048dafd | ||
|
|
2bb215f9df | ||
|
|
a2be3a0dbf | ||
|
|
1f4ceab377 | ||
|
|
94d727e8e0 | ||
|
|
cdf6a36c30 | ||
|
|
42d9f894dd | ||
|
|
9416d1c1a0 | ||
|
|
7dd44ca12c | ||
|
|
5a98b20988 | ||
|
|
2738085a1e | ||
|
|
61c1fdbd05 | ||
|
|
7eea5a0ff2 | ||
|
|
714c68c0c1 | ||
|
|
f3e7ba7f68 | ||
|
|
df589b43e7 | ||
|
|
8bdc65c626 | ||
|
|
0c3407572f | ||
|
|
e5404efb60 | ||
|
|
8e8f5eb8be | ||
|
|
cdbc277a94 | ||
|
|
46f60028aa | ||
|
|
bfc071debd | ||
|
|
7fca59322e | ||
|
|
42694c1ac6 | ||
|
|
e88fc012ec | ||
|
|
ff7cd9c927 | ||
|
|
588b7d340f | ||
|
|
5902d61f13 | ||
|
|
8cfad007b9 | ||
|
|
0441f345ef |
@@ -4,4 +4,4 @@ wechatpy==1.8.18
|
||||
pycryptodome==3.22.0
|
||||
openupgradelib==3.10.0
|
||||
opcua==0.98.13
|
||||
openpyxl
|
||||
openpyxl
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
],
|
||||
'web.assets_backend': [
|
||||
'sf_base/static/src/scss/*.scss',
|
||||
'sf_base/static/src/js/*.js',
|
||||
],
|
||||
|
||||
},
|
||||
|
||||
@@ -67,6 +67,52 @@ class BasicParametersFixture(models.Model):
|
||||
mounting_hole_depth = fields.Float('安装孔深度(mm)', digits=(16, 2))
|
||||
centering_diameter = fields.Float('定心直径(mm)', digits=(16, 2))
|
||||
|
||||
# ‘磁吸托盘’ 字段
|
||||
magnet_tray_length = fields.Float('磁吸托盘长度(mm)', digits=(16, 2))
|
||||
magnet_tray_width = fields.Float('磁吸托盘宽度(mm)', digits=(16, 2))
|
||||
magnet_tray_height = fields.Float('磁吸托盘厚度(mm)', digits=(16, 2))
|
||||
magnet_tray_diameter = fields.Float('磁吸托盘直径(mm)', digits=(16, 2))
|
||||
magnet_tray_weight = fields.Float('磁吸托盘重量(kg)', digits=(16, 2))
|
||||
|
||||
magnet_max_adsorp_length = fields.Float('磁吸托盘最大吸附长度(mm)', digits=(16, 2))
|
||||
magnet_max_adsorp_width = fields.Float('磁吸托盘最大吸附宽度(mm)', digits=(16, 2))
|
||||
magnet_max_adsorp_height = fields.Float('磁吸托盘最大吸附厚度(mm)', digits=(16, 2))
|
||||
magnet_max_adsorp_diameter = fields.Float('磁吸托盘最大吸附直径(mm)', digits=(16, 2))
|
||||
magnet_max_adsorp_force = fields.Float('磁吸托盘最大吸附力(N)', digits=(16, 2))
|
||||
|
||||
magnet_unlocking_method = fields.Selection(
|
||||
[('手动', '手动'), ('气动', '气动'), ('液压', '液压'), ('电动', '电动'), ('其他', '其他')],
|
||||
string='磁吸托盘锁紧方式'
|
||||
)
|
||||
magnet_flatness = fields.Char('磁吸托盘平面精度(mm)', size=20)
|
||||
magnet_max_load = fields.Float('磁吸托盘最大负载(kg)', digits=(16, 2))
|
||||
|
||||
# ‘气吸托盘’ 字段
|
||||
air_tray_length = fields.Float('气吸托盘长度(mm)', digits=(16, 2))
|
||||
air_tray_width = fields.Float('气吸托盘宽度(mm)', digits=(16, 2))
|
||||
air_tray_height = fields.Float('气吸托盘高度(mm)', digits=(16, 2))
|
||||
air_tray_diameter = fields.Float('气吸托盘直径(mm)', digits=(16, 2))
|
||||
air_tray_weight = fields.Float('气吸托盘重量(kg)', digits=(16, 2))
|
||||
|
||||
air_max_adsorp_length = fields.Float('气吸托盘最大吸附长度(mm)', digits=(16, 2))
|
||||
air_max_adsorp_width = fields.Float('气吸托盘最大吸附宽度(mm)', digits=(16, 2))
|
||||
air_max_adsorp_height = fields.Float('气吸托盘最大吸附厚度(mm)', digits=(16, 2))
|
||||
air_max_adsorp_diameter = fields.Float('气吸托盘最大吸附直径(mm)', digits=(16, 2))
|
||||
air_max_adsorp_force = fields.Float('气吸托盘最大吸附力(N)', digits=(16, 2))
|
||||
|
||||
air_unlocking_method = fields.Selection(
|
||||
[('手动', '手动'), ('气动', '气动'), ('液压', '液压'), ('电动', '电动'), ('其他', '其他')],
|
||||
string='气吸托盘锁紧方式'
|
||||
)
|
||||
air_flatness = fields.Char('气吸托盘平面精度(mm)', size=20)
|
||||
air_max_load = fields.Float('气吸托盘最大负载(kg)', digits=(16, 2))
|
||||
air_boolean_chip_blowing_function = fields.Boolean('气吸托盘是否有吹屑功能')
|
||||
air_way_to_install = fields.Selection(
|
||||
[('接口式', '接口式'), ('螺栓固定', '螺栓固定'), ('磁吸式', '磁吸式'), ('其他', '其他')],
|
||||
string='气吸托盘安装方式'
|
||||
)
|
||||
|
||||
|
||||
code = fields.Char('编码')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
@@ -85,6 +131,10 @@ class BasicParametersFixture(models.Model):
|
||||
return self._json_adapter_board_fixture_param(fixture_materials_data)
|
||||
elif fixture_materials_name == '三爪卡盘':
|
||||
return self._json_scroll_chuck_param(fixture_materials_data)
|
||||
elif fixture_materials_name == '磁吸托盘':
|
||||
return self._json_magnet_tray_param(fixture_materials_data)
|
||||
elif fixture_materials_name == '气吸托盘':
|
||||
return self._json_air_tray_param(fixture_materials_data)
|
||||
return {}
|
||||
|
||||
def _json_zero_chuck_param(self, obj):
|
||||
@@ -284,3 +334,57 @@ class BasicParametersFixture(models.Model):
|
||||
'centering_diameter': obj['centering_diameter'],
|
||||
'type_of_drive': obj['type_of_drive'],
|
||||
'active': obj['active']}
|
||||
|
||||
def _json_magnet_tray_param(self, obj):
|
||||
"""磁吸托盘:将data数据转换成list数据"""
|
||||
return {
|
||||
'code': obj['code'],
|
||||
'fixture_model_id': self.env['sf.fixture.model'].sudo().search(
|
||||
[('code', '=', obj.get('fixture_model_code'))]).id,
|
||||
'name': obj['name'],
|
||||
'length': obj['length'],
|
||||
'width': obj['width'],
|
||||
'height': obj['height'],
|
||||
'diameter': obj['diameter'],
|
||||
'weight': obj['weight'],
|
||||
'max_adsorp_length': obj['max_adsorp_length'],
|
||||
'max_adsorp_width': obj['max_adsorp_width'],
|
||||
'max_adsorp_height': obj['max_adsorp_height'],
|
||||
'max_adsorp_diameter': obj.get('max_adsorp_diameter'),
|
||||
'max_adsorp_force': obj['max_adsorp_force'],
|
||||
'flatness': obj.get('flatness'),
|
||||
'max_load': obj.get('max_load'),
|
||||
'unlocking_method': obj.get('unlocking_method'),
|
||||
'materials_model_id': self.env['sf.materials.model'].sudo().search(
|
||||
[('materials_no', '=', obj['materials_model_id']), ('active', '=', True)]
|
||||
).id if obj.get('materials_model_id') else False,
|
||||
'active': obj.get('active', True),
|
||||
}
|
||||
|
||||
def _json_air_tray_param(self, obj):
|
||||
"""气吸托盘:将data数据转换成list数据"""
|
||||
return {
|
||||
'code': obj['code'],
|
||||
'fixture_model_id': self.env['sf.fixture.model'].sudo().search(
|
||||
[('code', '=', obj.get('fixture_model_code'))]).id,
|
||||
'name': obj['name'],
|
||||
'length': obj['length'],
|
||||
'width': obj['width'],
|
||||
'height': obj['height'],
|
||||
'diameter': obj['diameter'],
|
||||
'weight': obj['weight'],
|
||||
'max_adsorp_length': obj['max_adsorp_length'],
|
||||
'max_adsorp_width': obj['max_adsorp_width'],
|
||||
'max_adsorp_height': obj['max_adsorp_height'],
|
||||
'max_adsorp_diameter': obj.get('max_adsorp_diameter'),
|
||||
'max_adsorp_force': obj['max_adsorp_force'],
|
||||
'flatness': obj.get('flatness'),
|
||||
'max_load': obj.get('max_load'),
|
||||
'unlocking_method': obj.get('unlocking_method'),
|
||||
'boolean_chip_blowing_function': obj.get('blowing_function', False),
|
||||
'way_to_install': obj.get('way_to_install'),
|
||||
'materials_model_id': self.env['sf.materials.model'].sudo().search(
|
||||
[('materials_no', '=', obj['materials_model_id']), ('active', '=', True)]
|
||||
).id if obj.get('materials_model_id') else False,
|
||||
'active': obj.get('active', True),
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ class MrsMaterialModel(models.Model):
|
||||
materials_num = fields.Char("编码号")
|
||||
name = fields.Char('型号名')
|
||||
need_h = fields.Boolean("热处理", default="false")
|
||||
need_m = fields.Boolean("是否磁吸", default="false")
|
||||
mf_materia_post = fields.Char("热处理后密度")
|
||||
density = fields.Float("密度(kg/m³)")
|
||||
materials_id = fields.Many2one('sf.production.materials', "材料名")
|
||||
|
||||
@@ -35,6 +35,7 @@ class FixtureModel(models.Model):
|
||||
glb_url = fields.Char(string="图片")
|
||||
status = fields.Boolean('状态')
|
||||
active = fields.Boolean('有效', default=False)
|
||||
code = fields.Char(string='编码', readonly=True)
|
||||
|
||||
zero_chuck_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='零点卡盘基本参数')
|
||||
@@ -46,11 +47,14 @@ class FixtureModel(models.Model):
|
||||
string='虎钳夹具基本参数')
|
||||
magnet_fixture_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='磁吸夹具基本参数')
|
||||
magnet_tray_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='磁吸托盘基本参数')
|
||||
adapter_board_fixture_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='转接板(锁板)夹具基本参数')
|
||||
scroll_chuck_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='三爪卡盘基本参数')
|
||||
code = fields.Char(string='编码', readonly=True)
|
||||
air_tray_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='气吸托盘基本参数')
|
||||
|
||||
# def _get_code(self, fixture_model_type_code):
|
||||
# fixture_model = self.env['sf.fixture.model'].sudo().search(
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
import { barcodeGenericHandlers } from '@barcodes/barcode_handlers';
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
|
||||
// 定义新的 clickOnButton 函数
|
||||
function customClickOnButton(selector) {
|
||||
console.log("This is the custom clickOnButton function!");
|
||||
|
||||
const buttons = document.body.querySelectorAll(selector);
|
||||
|
||||
let length = buttons.length;
|
||||
if (length > 0) {
|
||||
buttons[length - 1].click();
|
||||
} else {
|
||||
console.warn(`Button with selector ${selector} not found`);
|
||||
}
|
||||
}
|
||||
|
||||
patch(barcodeGenericHandlers, "start", {
|
||||
start(env, { ui, barcode, notification }) {
|
||||
// 使用新定义的 clickOnButton 函数
|
||||
const COMMANDS = {
|
||||
"O-CMD.EDIT": () => customClickOnButton(".o_form_button_edit"),
|
||||
"O-CMD.DISCARD": () => customClickOnButton(".o_form_button_cancel"),
|
||||
"O-CMD.SAVE": () => customClickOnButton(".o_form_button_save"),
|
||||
"O-CMD.PREV": () => customClickOnButton(".o_pager_previous"),
|
||||
"O-CMD.NEXT": () => customClickOnButton(".o_pager_next"),
|
||||
"O-CMD.PAGER-FIRST": () => updatePager("first"),
|
||||
"O-CMD.PAGER-LAST": () => updatePager("last"),
|
||||
"O-CMD.CONFIRM": () => customClickOnButton(".jikimo_button_confirm"),
|
||||
"O-CMD.FLUSHED": () => customClickOnButton(".jikimo_button_flushed"),
|
||||
};
|
||||
|
||||
barcode.bus.addEventListener("barcode_scanned", (ev) => {
|
||||
const barcode = ev.detail.barcode;
|
||||
if (barcode.startsWith("O-BTN.")) {
|
||||
let targets = [];
|
||||
try {
|
||||
targets = getVisibleElements(ui.activeElement, `[barcode_trigger=${barcode.slice(6)}]`);
|
||||
} catch (_e) {
|
||||
console.warn(`Barcode '${barcode}' is not valid`);
|
||||
}
|
||||
for (let elem of targets) {
|
||||
elem.click();
|
||||
}
|
||||
}
|
||||
if (barcode.startsWith("O-CMD.")) {
|
||||
const fn = COMMANDS[barcode];
|
||||
if (fn) {
|
||||
fn();
|
||||
} else {
|
||||
notification.add(env._t("Barcode: ") + `'${barcode}'`, {
|
||||
title: env._t("Unknown barcode command"),
|
||||
type: "danger"
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
@@ -1,42 +0,0 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { registry } from '@web/core/registry';
|
||||
|
||||
import { formView } from '@web/views/form/form_view';
|
||||
import { FormController } from '@web/views/form/form_controller';
|
||||
|
||||
import { listView } from '@web/views/list/list_view';
|
||||
import { ListController } from '@web/views/list/list_controller'
|
||||
|
||||
import { onRendered, onMounted } from "@odoo/owl";
|
||||
|
||||
export class RemoveFocusFormController extends FormController {
|
||||
setup() {
|
||||
super.setup();
|
||||
|
||||
onMounted(() => {
|
||||
this.__owl__.bdom.el.querySelectorAll(':focus').forEach(element => element.blur());
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
registry.category('views').add('remove_focus_form_view', {
|
||||
...formView,
|
||||
Controller: RemoveFocusFormController,
|
||||
});
|
||||
|
||||
|
||||
export class RemoveFocusListController extends ListController {
|
||||
setup() {
|
||||
super.setup();
|
||||
|
||||
onMounted(() => {
|
||||
this.__owl__.bdom.el.querySelectorAll(':focus').forEach(element => element.blur());
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
registry.category('views').add('remove_focus_list_view', {
|
||||
...listView,
|
||||
Controller: RemoveFocusListController,
|
||||
});
|
||||
@@ -263,6 +263,7 @@
|
||||
<field name="materials_no" readonly="1" force_save="1"/>
|
||||
<field name="gain_way" required="0"/>
|
||||
<field name="density" readonly="1" required="1" class="custom_required"/>
|
||||
<field name="need_m" default="false" readonly="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="rough_machining" required="1"/>
|
||||
@@ -306,6 +307,7 @@
|
||||
<field name="tensile_strength"/>
|
||||
<field name="hardness" optional="show"/>
|
||||
<field name="need_h"/>
|
||||
<field name="need_m"/>
|
||||
<field name="apply" widget="many2many_tags" optional="show"/>
|
||||
<field name="density" optional="show"/>
|
||||
<field name="rough_machining" optional="hide"/>
|
||||
@@ -352,6 +354,7 @@
|
||||
<field name="materials_no"/>
|
||||
<field name="name"/>
|
||||
<field name="need_h"/>
|
||||
<field name="need_m"/>
|
||||
<field name="mf_materia_post"/>
|
||||
<field name="density"/>
|
||||
<field name='materials_id' default="default" invisible="1"/>
|
||||
|
||||
@@ -328,6 +328,52 @@
|
||||
<field name="type_of_drive"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="air_tray_ids"
|
||||
attrs="{'invisible': [('fixture_material_type', '!=', '气吸托盘')]}">
|
||||
<tree editable="bottom" class="center" delete="0">
|
||||
<field name="code" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="length"/>
|
||||
<field name="width"/>
|
||||
<field name="height"/>
|
||||
<field name="diameter"/>
|
||||
<field name="weight" string="重量(kg)"/>
|
||||
<field name="max_adsorp_length"/>
|
||||
<field name="max_adsorp_width"/>
|
||||
<field name="max_adsorp_height"/>
|
||||
<field name="max_adsorp_diameter"/>
|
||||
<field name="max_adsorp_force"/>
|
||||
<field name="flatness"/>
|
||||
<field name="max_load"/>
|
||||
<field name="unlocking_method"/>
|
||||
<field name="boolean_chip_blowing_function"/>
|
||||
<field name="way_to_install"/>
|
||||
<field name="materials_model_id" options="{'no_create': True}" placeholder="请选择"/>
|
||||
<field name="active" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="magnet_tray_ids"
|
||||
attrs="{'invisible': [('fixture_material_type', '!=', '磁吸托盘')]}">
|
||||
<tree editable="bottom" class="center" delete="0">
|
||||
<field name="code" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="length"/>
|
||||
<field name="width"/>
|
||||
<field name="height"/>
|
||||
<field name="diameter"/>
|
||||
<field name="weight" string="重量(kg)"/>
|
||||
<field name="max_adsorp_length"/>
|
||||
<field name="max_adsorp_width"/>
|
||||
<field name="max_adsorp_height"/>
|
||||
<field name="max_adsorp_diameter"/>
|
||||
<field name="max_adsorp_force"/>
|
||||
<field name="flatness"/>
|
||||
<field name="max_load"/>
|
||||
<field name="unlocking_method"/>
|
||||
<field name="materials_model_id" options="{'no_create': True}" placeholder="请选择"/>
|
||||
<field name="active" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="scroll_chuck_ids"
|
||||
attrs="{'invisible': [('fixture_material_type', '!=', '三爪卡盘')]}">
|
||||
<tree editable="bottom" class="center" delete="0">
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
'web.assets_backend': [
|
||||
'sf_demand_plan/static/src/scss/style.css',
|
||||
'sf_demand_plan/static/src/js/print_demand.js',
|
||||
'sf_demand_plan/static/src/js/custom_button.js',
|
||||
]
|
||||
},
|
||||
'license': 'LGPL-3',
|
||||
|
||||
@@ -36,7 +36,7 @@ class PurchaseOrderLine(models.Model):
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
res = super(PurchaseOrderLine, self).create(vals)
|
||||
if not res.demand_plan_line_id:
|
||||
if not res.demand_plan_line_id and res.order_id.origin:
|
||||
origin = [origin.replace(' ', '') for origin in res.order_id.origin.split(',')]
|
||||
if self.env.context.get('demand_plan_line_id'):
|
||||
res.demand_plan_line_id = self.env.context.get('demand_plan_line_id')
|
||||
|
||||
@@ -38,7 +38,7 @@ class SfDemandPlan(models.Model):
|
||||
related='product_id.blank_type')
|
||||
blank_precision = fields.Selection([('精坯', '精坯'), ('粗坯', '粗坯')], string='坯料类型',
|
||||
related='product_id.blank_precision')
|
||||
manual_quotation = fields.Boolean('人工编程',related='product_id.manual_quotation', default=False)
|
||||
manual_quotation = fields.Boolean('人工编程', related='product_id.manual_quotation', default=False)
|
||||
embryo_long = fields.Char('坯料尺寸(mm)', compute='_compute_embryo_long', store=True)
|
||||
is_incoming_material = fields.Boolean('客供料', related='sale_order_line_id.is_incoming_material', store=True)
|
||||
pending_qty = fields.Float(
|
||||
@@ -222,15 +222,17 @@ class SfDemandPlan(models.Model):
|
||||
line_ids = self.line_ids.filtered(lambda p: p.status == '30')
|
||||
sum_product_uom_qty = sum(line_ids.mapped('plan_uom_qty'))
|
||||
customer_location_id = self.env['ir.model.data']._xmlid_to_res_id('stock.stock_location_customers')
|
||||
for line in self.line_ids:
|
||||
if line.manual_quotation and line.custom_made_type == 'automation':
|
||||
raise ValidationError(f"产品{line.product_id.name}为人工编程,不能选择自动化产线加工")
|
||||
if not self.overdelivery_allowed and line_ids.filtered(lambda p: p.location_id.id == customer_location_id):
|
||||
if float_compare(sum_product_uom_qty, self.product_uom_qty,
|
||||
precision_rounding=self.product_id.uom_id.rounding) == 1:
|
||||
raise ValidationError(f"已禁止向合作伙伴/客户超量发货,请更换“补货原因”或将“可超量发货”设置为“是”。")
|
||||
check_overdelivery_allowed = False
|
||||
for line in line_ids:
|
||||
if line.location_id.id == customer_location_id:
|
||||
if not self.overdelivery_allowed:
|
||||
if float_compare(sum_product_uom_qty, self.product_uom_qty,
|
||||
precision_rounding=line.product_id.uom_id.rounding) == 1:
|
||||
check_overdelivery_allowed = True
|
||||
if check_overdelivery_allowed:
|
||||
raise ValidationError(f"已禁止向合作伙伴/客户超量发货,请更换“补货原因”或将“可超量发货”设置为“是”。")
|
||||
elif float_compare(sum_product_uom_qty, self.product_uom_qty,
|
||||
precision_rounding=self.product_id.uom_id.rounding) == 1:
|
||||
precision_rounding=self.product_id.uom_id.rounding) == 1:
|
||||
return {
|
||||
'name': _('需求计划'),
|
||||
'type': 'ir.actions.act_window',
|
||||
@@ -246,11 +248,12 @@ class SfDemandPlan(models.Model):
|
||||
else:
|
||||
for demand_plan_line_id in line_ids:
|
||||
demand_plan_line_id.action_confirm()
|
||||
#需求要求取值格式是来源+来源明细行ID,但是来源明细行ID取得就是product_id.name得最后一位,所以这里也直接截取product_id.name
|
||||
|
||||
# 需求要求取值格式是来源+来源明细行ID,但是来源明细行ID取得就是product_id.name得最后一位,所以这里也直接截取product_id.name
|
||||
@api.depends('product_id.name')
|
||||
def _compute_demand_plan_number(self):
|
||||
for line in self:
|
||||
product_name = line.product_id.name or ''
|
||||
product_name = line.product_id.name or ''
|
||||
plan_no = None
|
||||
if line.product_id:
|
||||
# 使用正则表达式匹配P-后面的所有字符
|
||||
@@ -259,4 +262,4 @@ class SfDemandPlan(models.Model):
|
||||
plan_no = match.group(1)
|
||||
line.demand_plan_number = plan_no
|
||||
else:
|
||||
line.demand_plan_number = None
|
||||
line.demand_plan_number = None
|
||||
|
||||
@@ -14,10 +14,10 @@ class SfProductionDemandPlan(models.Model):
|
||||
_description = 'sf_production_demand_plan'
|
||||
|
||||
def get_location_id(self):
|
||||
stock_location = self.env['stock.location'].sudo().search([('name', '=', '客户')], limit=1)
|
||||
return stock_location.id
|
||||
customer_location_id = self.env['ir.model.data']._xmlid_to_res_id('stock.stock_location_customers')
|
||||
return customer_location_id
|
||||
|
||||
priority = fields.Selection(related='demand_plan_id.priority', string='优先级')
|
||||
priority = fields.Selection(related='demand_plan_id.priority', string='优先级', store=True)
|
||||
status = fields.Selection([
|
||||
('10', '草稿'),
|
||||
('20', '待确认'),
|
||||
@@ -34,7 +34,7 @@ class SfProductionDemandPlan(models.Model):
|
||||
company_id = fields.Many2one(
|
||||
related='sale_order_id.company_id',
|
||||
store=True, index=True, precompute=True)
|
||||
customer_name = fields.Char('客户', related='sale_order_id.customer_name')
|
||||
customer_name = fields.Char('客户', related='sale_order_id.customer_name', store=True)
|
||||
order_remark = fields.Text(related='sale_order_id.remark',
|
||||
string="订单备注", store=True)
|
||||
glb_url = fields.Char(related='sale_order_line_id.glb_url', string='glb文件地址')
|
||||
@@ -81,8 +81,9 @@ class SfProductionDemandPlan(models.Model):
|
||||
related='product_id.blank_type')
|
||||
blank_precision = fields.Selection([('精坯', '精坯'), ('粗坯', '粗坯')], string='坯料类型',
|
||||
related='product_id.blank_precision')
|
||||
unit_number = fields.Float('单件用量', digits=(16, 3), related='product_id.unit_number')
|
||||
embryo_long = fields.Char('坯料尺寸(mm)', related='demand_plan_id.embryo_long')
|
||||
materials_id = fields.Char('材料', related='demand_plan_id.materials_id')
|
||||
materials_id = fields.Char('材料', related='demand_plan_id.materials_id', store=True)
|
||||
model_machining_precision = fields.Selection(related='product_id.model_machining_precision', string='精度')
|
||||
model_process_parameters_ids = fields.Many2many(related='demand_plan_id.model_process_parameters_ids',
|
||||
string='表面工艺', )
|
||||
@@ -126,6 +127,12 @@ class SfProductionDemandPlan(models.Model):
|
||||
string='字段自制类型只读'
|
||||
)
|
||||
|
||||
is_processing = fields.Boolean(
|
||||
string='正在处理中',
|
||||
default=False,
|
||||
help='用于防止重复点击按钮'
|
||||
)
|
||||
|
||||
# hide_action_open_mrp_production = fields.Boolean(
|
||||
# string='显示待工艺确认按钮',
|
||||
# compute='_compute_hid_button',
|
||||
@@ -169,22 +176,30 @@ class SfProductionDemandPlan(models.Model):
|
||||
finished_product_arrival_date = fields.Date('采购计划到货(成品)')
|
||||
bom_id = fields.Many2one('mrp.bom', string="BOM", readonly=True)
|
||||
location_id = fields.Many2one('stock.location', string='需求位置', default=get_location_id, readonly=True)
|
||||
manual_quotation = fields.Boolean('人工编程',related='product_id.manual_quotation',default=False)
|
||||
manual_quotation = fields.Boolean('人工编程', related='product_id.manual_quotation', default=False)
|
||||
|
||||
@api.constrains('plan_uom_qty')
|
||||
def _check_plan_uom_qty(self):
|
||||
line_ids = self.filtered(lambda p: p.plan_uom_qty == 0 or p.plan_uom_qty < 0)
|
||||
if line_ids:
|
||||
raise ValidationError(_("计划量不能小于等于0"))
|
||||
|
||||
@api.constrains('new_supply_method')
|
||||
def _check_new_supply_method(self):
|
||||
@api.constrains('supply_method')
|
||||
def _check_supply_method(self):
|
||||
product_name = []
|
||||
product = []
|
||||
for line in self:
|
||||
if line.new_supply_method == 'purchase' and line.is_incoming_material:
|
||||
if line.supply_method == 'purchase' and line.is_incoming_material:
|
||||
product_name.append(line.product_id.display_name)
|
||||
if line.supply_method == 'automation' and line.manual_quotation:
|
||||
product.append(line.product_id.display_name)
|
||||
|
||||
if product_name:
|
||||
unique_product_names = list(set(product_name))
|
||||
raise UserError('当前(%s)产品为客供料,不能选择外购' % ','.join(unique_product_names))
|
||||
if product:
|
||||
unique_product = list(set(product))
|
||||
raise UserError('当前(%s)产品为人工编程,不能选择自动化产线加工' % ','.join(unique_product))
|
||||
|
||||
@api.depends('new_supply_method')
|
||||
def _compute_custom_made_type(self):
|
||||
@@ -346,7 +361,8 @@ class SfProductionDemandPlan(models.Model):
|
||||
def update_sale_order_state(self):
|
||||
# demand_plan = self.env['sf.demand.plan'].sudo().search([('sale_order_id', '=', self.sale_order_id.id)])
|
||||
# demand_plan_state = demand_plan.filtered(lambda line: line.state != '40')
|
||||
production_demand_plan = self.env['sf.production.demand.plan'].sudo().search([('sale_order_id', '=', self.sale_order_id.id)])
|
||||
production_demand_plan = self.env['sf.production.demand.plan'].sudo().search(
|
||||
[('sale_order_id', '=', self.sale_order_id.id)])
|
||||
production_demand_plan_state = production_demand_plan.filtered(lambda line: line.status in ('10', '20', '30'))
|
||||
if not production_demand_plan_state:
|
||||
# 修改销售订单为加工中
|
||||
@@ -597,14 +613,14 @@ class SfProductionDemandPlan(models.Model):
|
||||
filtered_plan = self.filtered(lambda mo: mo.status == '30')
|
||||
if not filtered_plan:
|
||||
raise UserError(_("没有需要下达的计划!"))
|
||||
check_overdelivery_allowed = False
|
||||
if not self.demand_plan_id.overdelivery_allowed:
|
||||
customer_location_id = self.env['ir.model.data']._xmlid_to_res_id('stock.stock_location_customers')
|
||||
if self.location_id.id == customer_location_id:
|
||||
check_overdelivery_allowed = True
|
||||
# 按产品分组并计算总数
|
||||
product_data = {}
|
||||
for plan in filtered_plan:
|
||||
check_overdelivery_allowed = False
|
||||
if not plan.demand_plan_id.overdelivery_allowed:
|
||||
customer_location_id = self.env['ir.model.data']._xmlid_to_res_id('stock.stock_location_customers')
|
||||
if plan.location_id.id == customer_location_id:
|
||||
check_overdelivery_allowed = True
|
||||
if plan.product_id not in product_data:
|
||||
# 初始化产品数据,从产品上获取需求量
|
||||
product_data[plan.product_id] = {
|
||||
@@ -614,17 +630,22 @@ class SfProductionDemandPlan(models.Model):
|
||||
|
||||
# 累加计划数量
|
||||
product_data[plan.product_id]['plan_uom_qty'] += plan.plan_uom_qty
|
||||
product_data[plan.product_id]['overdelivery_allowed'] = check_overdelivery_allowed
|
||||
# 检查需求超过计划数量的产品
|
||||
warning_messages = []
|
||||
error_messages = []
|
||||
for product, data in product_data.items():
|
||||
if float_compare(data['plan_uom_qty'], data['product_uom_qty'],
|
||||
precision_rounding=product.uom_id.rounding) == 1:
|
||||
if data['overdelivery_allowed'] and float_compare(data['plan_uom_qty'], data['product_uom_qty'],precision_rounding=product.uom_id.rounding) == 1:
|
||||
error_messages.append(f"您正在下达的产品 {product.display_name},已禁止向合作伙伴/客户超量发货,请更换“补货原因”或将“可超量发货”设置为“是”。")
|
||||
elif float_compare(data['plan_uom_qty'], data['product_uom_qty'],
|
||||
precision_rounding=product.uom_id.rounding) == 1:
|
||||
warning_messages.append(
|
||||
_("您正在下达的产品 %s,计划量%s,需求数量为%s,已超过需求数量") %
|
||||
(product.display_name, data['plan_uom_qty'], data['product_uom_qty'])
|
||||
)
|
||||
if warning_messages and check_overdelivery_allowed:
|
||||
raise ValidationError(f"已禁止向合作伙伴/客户超量发货,请更换“补货原因”或将“可超量发货”设置为“是”。")
|
||||
if error_messages:
|
||||
error_message = "\n".join(error_messages)
|
||||
raise ValidationError(error_message)
|
||||
elif warning_messages:
|
||||
warning_message = "\n".join(warning_messages)
|
||||
return {
|
||||
@@ -639,22 +660,26 @@ class SfProductionDemandPlan(models.Model):
|
||||
'default_demand_plan_line_id': self.ids,
|
||||
'default_release_message': warning_message,
|
||||
}}
|
||||
else:
|
||||
for demand_plan_line_id in filtered_plan:
|
||||
demand_plan_line_id.action_confirm()
|
||||
|
||||
def button_release_plan(self):
|
||||
self.ensure_one()
|
||||
if not self.new_supply_method:
|
||||
raise ValidationError(f"供货方式不能为空!")
|
||||
if self.product_id.manual_quotation and self.custom_made_type == 'automation':
|
||||
raise ValidationError(f"产品{self.product_id.name}为人工编程,不能选择自动化产线加工")
|
||||
if self.is_processing:
|
||||
return
|
||||
self.is_processing = True
|
||||
check_overdelivery_allowed = False
|
||||
if not self.demand_plan_id.overdelivery_allowed:
|
||||
customer_location_id = self.env['ir.model.data']._xmlid_to_res_id('stock.stock_location_customers')
|
||||
if self.location_id.id == customer_location_id:
|
||||
check_overdelivery_allowed = True
|
||||
if check_overdelivery_allowed:
|
||||
if float_compare(self.plan_uom_qty, self.product_uom_qty,precision_rounding=self.product_id.uom_id.rounding) == 1:
|
||||
if float_compare(self.plan_uom_qty, self.product_uom_qty,
|
||||
precision_rounding=self.product_id.uom_id.rounding) == 1:
|
||||
raise ValidationError(f"已禁止向合作伙伴/客户超量发货,请更换“补货原因”或将“可超量发货”设置为“是”。")
|
||||
elif float_compare(self.plan_uom_qty, self.product_uom_qty,precision_rounding=self.product_id.uom_id.rounding) == 1:
|
||||
elif float_compare(self.plan_uom_qty, self.product_uom_qty,
|
||||
precision_rounding=self.product_id.uom_id.rounding) == 1:
|
||||
return {
|
||||
'name': _('需求计划'),
|
||||
'type': 'ir.actions.act_window',
|
||||
@@ -683,18 +708,6 @@ class SfProductionDemandPlan(models.Model):
|
||||
self.update_sale_order_state()
|
||||
|
||||
def mrp_bom_create(self):
|
||||
if self.supply_method in ('automation', 'manual'):
|
||||
line_ids = self.demand_plan_id.line_ids.filtered(
|
||||
lambda p: p.supply_method in ('automation', 'manual') and p.status in ('50', '60'))
|
||||
if line_ids:
|
||||
self.bom_id = line_ids[0].bom_id.id
|
||||
return
|
||||
elif self.supply_method == 'outsourcing':
|
||||
line_ids = self.demand_plan_id.line_ids.filtered(
|
||||
lambda p: p.supply_method == 'outsourcing' and p.status == '60')
|
||||
if line_ids:
|
||||
self.bom_id = line_ids[0].bom_id.id
|
||||
return
|
||||
bom_type = ''
|
||||
# 根据供货方式修改成品模板
|
||||
if self.supply_method == 'automation':
|
||||
@@ -714,6 +727,18 @@ class SfProductionDemandPlan(models.Model):
|
||||
|
||||
# 复制成品模板上的属性
|
||||
self.product_id.product_tmpl_id.copy_template(product_template_id)
|
||||
if self.supply_method in ('automation', 'manual'):
|
||||
line_ids = self.demand_plan_id.line_ids.filtered(
|
||||
lambda p: p.supply_method in ('automation', 'manual') and p.status in ('50', '60'))
|
||||
if line_ids:
|
||||
self.bom_id = line_ids[0].bom_id.id
|
||||
return
|
||||
elif self.supply_method == 'outsourcing':
|
||||
line_ids = self.demand_plan_id.line_ids.filtered(
|
||||
lambda p: p.supply_method == 'outsourcing' and p.status == '60')
|
||||
if line_ids:
|
||||
self.bom_id = line_ids[0].bom_id.id
|
||||
return
|
||||
future_time = datetime.now() + timedelta(hours=8)
|
||||
# 生成BOM单据编码
|
||||
code = f"{self.product_id.default_code}-{bom_type}-{future_time.strftime('%Y%m%d%H%M%S')}"
|
||||
@@ -893,3 +918,6 @@ class SfProductionDemandPlan(models.Model):
|
||||
'demand_plan_line_id': self.id
|
||||
}
|
||||
return values
|
||||
|
||||
def button_plan_detail(self):
|
||||
pass
|
||||
|
||||
59
sf_demand_plan/static/src/js/custom_button.js
Normal file
59
sf_demand_plan/static/src/js/custom_button.js
Normal file
@@ -0,0 +1,59 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
import { ListRenderer } from "@web/views/list/list_renderer";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { useEffect } from "@odoo/owl";
|
||||
|
||||
export class CustomDemandPlanListRenderer extends ListRenderer {
|
||||
setup() {
|
||||
super.setup();
|
||||
this.orm = useService("orm");
|
||||
this.notification = useService("notification");
|
||||
console.log('setup', this.props);
|
||||
|
||||
// 监听selection属性的变化
|
||||
useEffect(() => {
|
||||
this.updateButtonState();
|
||||
}, () => [this.props.list.selection]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新按钮状态
|
||||
*/
|
||||
async updateButtonState() {
|
||||
const selectedRecords = this.props.list.selection;
|
||||
const isStatus30 = selectedRecords.some(record => record.data.status != "30");
|
||||
const button = $(this.__owl__.parent.bdom.parentEl).find('button[name="button_batch_release_plan"]');
|
||||
console.log('isStatus30', isStatus30, button);
|
||||
if (isStatus30) {
|
||||
// 禁用按钮
|
||||
button.attr('disabled', true);
|
||||
} else {
|
||||
button.attr('disabled', false);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 使用setTimeout延迟注册,避免在模块加载时立即执行
|
||||
setTimeout(() => {
|
||||
const registerCustomRenderer = () => {
|
||||
try {
|
||||
const listView = registry.category("views").get("list");
|
||||
if (listView) {
|
||||
registry.category("views").add("custom_demand_plan_list", {
|
||||
...listView,
|
||||
Renderer: CustomDemandPlanListRenderer,
|
||||
});
|
||||
console.log("Custom demand plan list renderer registered successfully");
|
||||
} else {
|
||||
console.warn("List view not found, retrying...");
|
||||
// 如果还没找到,再等一段时间
|
||||
setTimeout(registerCustomRenderer, 1000);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error registering custom renderer:", error);
|
||||
}
|
||||
};
|
||||
|
||||
registerCustomRenderer();
|
||||
}, 1000);
|
||||
@@ -4,7 +4,8 @@
|
||||
<field name="model">sf.production.demand.plan</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="需求计划" default_order="sequence desc,id desc" editable="bottom"
|
||||
class="demand_plan_tree freeze-columns-before-part_number" create="false" delete="false">
|
||||
class="demand_plan_tree freeze-columns-before-part_number" create="false" delete="false"
|
||||
js_class="custom_demand_plan_list">
|
||||
<header>
|
||||
<button string="打印" name="button_action_print" type="object"
|
||||
class="btn-primary"/>
|
||||
@@ -39,6 +40,7 @@
|
||||
<field name="blank_type" optional="hide"/>
|
||||
<field name="blank_precision"/>
|
||||
<field name="embryo_long"/>
|
||||
<field name="unit_number" optional="hide"/>
|
||||
<field name="materials_id"/>
|
||||
<field name="model_machining_precision"/>
|
||||
<field name="model_process_parameters_ids" widget="many2many_tags"/>
|
||||
|
||||
@@ -108,6 +108,9 @@
|
||||
class="btn-primary"
|
||||
attrs="{'invisible': [('hide_release_production_order', '=', False)]}"
|
||||
/>
|
||||
<button string="详情" name="button_plan_detail" type="object"
|
||||
class="btn-primary"
|
||||
/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
|
||||
@@ -37,7 +37,7 @@ class SfDemandPlanPrintWizard(models.TransientModel):
|
||||
if pdf_data:
|
||||
try:
|
||||
# 执行打印
|
||||
self.env['jikimo.printing'].sudo().print_pdf(pdf_data)
|
||||
# self.env['jikimo.printing'].sudo().print_pdf(pdf_data)
|
||||
record.status = 'success'
|
||||
production_demand_plan_id = self.env['sf.production.demand.plan'].sudo().search(
|
||||
[('model_id', '=', record.model_id)])
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
from odoo import models, fields, api, _
|
||||
from werkzeug.exceptions import InternalServerError
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -17,4 +18,10 @@ class SfReleasePlanWizard(models.TransientModel):
|
||||
def confirm(self):
|
||||
if self.demand_plan_line_id:
|
||||
for demand_plan_line_id in self.demand_plan_line_id:
|
||||
demand_plan_line_id.action_confirm()
|
||||
try:
|
||||
demand_plan_line_id.action_confirm()
|
||||
except Exception as e:
|
||||
self.env.cr.rollback()
|
||||
demand_plan_line_id.write({'is_processing': False})
|
||||
self.env.cr.commit()
|
||||
raise InternalServerError('操作失败', e)
|
||||
|
||||
@@ -513,112 +513,168 @@
|
||||
</notebook>
|
||||
</page>
|
||||
<page string="夹具物料参数" attrs="{'invisible': [('categ_type', '!=', '夹具')]}">
|
||||
<group>
|
||||
<group>
|
||||
<field name="brand_id" placeholder="请选择" options="{'no_create': True}"/>
|
||||
<field name="multi_mounting_type_id" placeholder="请选择" options="{'no_create': True}"
|
||||
attrs="{'required': [('categ_type', '=', '夹具')]}"/>
|
||||
<field name="length" string="长度(mm)"/>
|
||||
<field name="width" string="宽度(mm)"/>
|
||||
<field name="height" string="高度(mm)"/>
|
||||
<field name="height_tolerance_value"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸夹具'])]}"/>
|
||||
<field name="diameter"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘', '零点托盘', '三爪卡盘'])]}"/>
|
||||
<field name="weight"/>
|
||||
<field name="chucking_power_max"
|
||||
attrs="{'invisible': [('fixture_material_type', '=','磁吸夹具')]}"/>
|
||||
<field name="carrying_capacity_max"/>
|
||||
<field name="rigidity"/>
|
||||
<group>
|
||||
<field name="brand_id" placeholder="请选择" options="{'no_create': True}"/>
|
||||
<field name="multi_mounting_type_id" placeholder="请选择" options="{'no_create': True}"
|
||||
attrs="{'required': [('categ_type', '=', '夹具')]}"/>
|
||||
<field name="length" string="长度(mm)"/>
|
||||
<field name="width" string="宽度(mm)"/>
|
||||
<field name="height" string="高度(mm)"/>
|
||||
<field name="height_tolerance_value"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸夹具'])]}"/>
|
||||
<field name="diameter"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘', '零点托盘', '三爪卡盘', '磁吸托盘', '气吸托盘'])]}"/>
|
||||
<field name="weight"/>
|
||||
<field name="chucking_power_max"
|
||||
attrs="{'invisible': [('fixture_material_type', '=','磁吸夹具')]}"/>
|
||||
<field name="carrying_capacity_max"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸夹具'])]}"/>
|
||||
<field name="rigidity"/>
|
||||
</group>
|
||||
<group>
|
||||
<!-- 夹持工件尺寸 -->
|
||||
<label for="gripper_length_min" string="夹持工件最小尺寸"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}"/>
|
||||
<div class="o_address_format"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}">
|
||||
<label for="gripper_length_min" string="长"/>
|
||||
<field name="gripper_length_min" class="o_address_zip"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="gripper_width_min" string="宽"/>
|
||||
<field name="gripper_width_min" class="o_address_zip"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="gripper_height_min" string="高"/>
|
||||
<field name="gripper_height_min" class="o_address_zip"/>
|
||||
</div>
|
||||
<label for="gripper_length_max" string="夹持工件最大尺寸"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}"/>
|
||||
<div class="o_address_format"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}">
|
||||
<label for="gripper_length_max" string="长"/>
|
||||
<field name="gripper_length_max" class="o_address_zip"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="gripper_width_max" string="宽"/>
|
||||
<field name="gripper_width_max" class="o_address_zip"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="gripper_height_max" string="高"/>
|
||||
<field name="gripper_height_max" class="o_address_zip"/>
|
||||
</div>
|
||||
|
||||
<field name="gripper_diameter_min" string="夹持工件最小直径(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}"/>
|
||||
<field name="gripper_diameter_max" string="夹持工件最大直径(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}"/>
|
||||
<field name="clamping_diameter" string="装夹直径(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘','零点托盘'])]}"/>
|
||||
<field name="clamping_num" placeholder="请选择" string="装夹单元数"
|
||||
attrs="{'invisible': [('fixture_material_type', '!=', '零点卡盘')]}"/>
|
||||
<field name="repeated_positioning_accuracy" placeholder="请输入重复定位孔精度"
|
||||
string="重复定位精度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘','零点托盘'])]}"/>
|
||||
<field name="orientation_dish_diameter" string="定位盘直径(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘'])]}"/>
|
||||
<field name="boolean_transposing_hole" string="是否有转位孔"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘'])]}"/>
|
||||
<field name="connector_diameter" placeholder="请选择" string="连接头直径(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点托盘'])]}"/>
|
||||
<field name="way_to_install" placeholder="请选择" string="安装方式"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点托盘','气吸托盘'])]}"/>
|
||||
<field name="rated_air_pressure" string="额定气压(Mpa)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具'])]}"/>
|
||||
|
||||
<field name="transverse_groove" string="横向配合槽n(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['虎钳夹具'])]}"/>
|
||||
<field name="longitudinal_fitting_groove" string="纵向配合槽l(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['虎钳夹具'])]}"/>
|
||||
|
||||
<field name="rated_adsorption_force" string="额定吸附力(N/cm²)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸夹具'])]}"/>
|
||||
<field name="magnetic_field_height" string="磁场高度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸夹具'])]}"/>
|
||||
<field name="magnetic_pole_plate_grinding_allowance" string="磁极板磨削余量(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸夹具'])]}"/>
|
||||
|
||||
<!-- 磁吸托盘字段 -->
|
||||
<field name="magnet_tray_length" string="磁吸托盘长度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸托盘'])]}"/>
|
||||
<field name="magnet_tray_width" string="磁吸托盘宽度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸托盘'])]}"/>
|
||||
<field name="magnet_tray_height" string="磁吸托盘厚度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸托盘'])]}"/>
|
||||
<field name="magnet_tray_diameter" string="磁吸托盘直径(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸托盘'])]}"/>
|
||||
<field name="magnet_tray_weight" string="磁吸托盘重量(kg)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸托盘'])]}"/>
|
||||
|
||||
<field name="magnet_max_adsorp_length" string="磁吸托盘最大吸附长度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸托盘'])]}"/>
|
||||
<field name="magnet_max_adsorp_width" string="磁吸托盘最大吸附宽度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸托盘'])]}"/>
|
||||
<field name="magnet_max_adsorp_height" string="磁吸托盘最大吸附厚度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸托盘'])]}"/>
|
||||
<field name="magnet_max_adsorp_diameter" string="磁吸托盘最大吸附直径(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸托盘'])]}"/>
|
||||
<field name="magnet_max_adsorp_force" string="磁吸托盘最大吸附力(N)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸托盘'])]}"/>
|
||||
|
||||
<field name="magnet_unlocking_method" string="磁吸托盘锁紧方式"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸托盘'])]}"/>
|
||||
<field name="magnet_flatness" string="磁吸托盘平面精度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸托盘'])]}"/>
|
||||
<field name="magnet_max_load" string="磁吸托盘最大负载(kg)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸托盘'])]}"/>
|
||||
|
||||
<!-- 气吸托盘字段 -->
|
||||
<field name="air_tray_length" string="气吸托盘长度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气吸托盘'])]}"/>
|
||||
<field name="air_tray_width" string="气吸托盘宽度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气吸托盘'])]}"/>
|
||||
<field name="air_tray_height" string="气吸托盘高度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气吸托盘'])]}"/>
|
||||
<field name="air_tray_diameter" string="气吸托盘直径(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气吸托盘'])]}"/>
|
||||
<field name="air_tray_weight" string="气吸托盘重量(kg)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气吸托盘'])]}"/>
|
||||
|
||||
<field name="air_max_adsorp_length" string="气吸托盘最大吸附长度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气吸托盘'])]}"/>
|
||||
<field name="air_max_adsorp_width" string="气吸托盘最大吸附宽度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气吸托盘'])]}"/>
|
||||
<field name="air_max_adsorp_height" string="气吸托盘最大吸附高度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气吸托盘'])]}"/>
|
||||
<field name="air_max_adsorp_diameter" string="气吸托盘最大吸附直径(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气吸托盘'])]}"/>
|
||||
<field name="air_max_adsorp_force" string="气吸托盘最大吸附力(N)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气吸托盘'])]}"/>
|
||||
|
||||
<field name="air_unlocking_method" string="气吸托盘锁紧方式"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气吸托盘'])]}"/>
|
||||
<field name="air_flatness" string="气吸托盘平面精度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气吸托盘'])]}"/>
|
||||
<field name="air_max_load" string="气吸托盘最大负载(kg)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气吸托盘'])]}"/>
|
||||
<field name="air_boolean_chip_blowing_function" string="气吸托盘是否有吹屑功能"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气吸托盘'])]}"/>
|
||||
<field name="air_way_to_install" string="气吸托盘安装方式"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气吸托盘'])]}"/>
|
||||
|
||||
<field name="boolean_chip_blowing_function" string="是否有吹屑功能"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘','零点托盘','气吸托盘'])]}"/>
|
||||
<field name="materials_model_id" placeholder="请选择" options="{'no_create': True}"/>
|
||||
<field name="interface_materials_model_id" placeholder="请选择" string="接口类型"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具'])]}"/>
|
||||
<field name="type_of_drive" placeholder="请选择" string="驱动方式"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点托盘','气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}"/>
|
||||
<field name="unlocking_method" string="解锁方式" placeholder="请选择"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘','气吸托盘', '磁吸托盘'])]}"/>
|
||||
<field name="machine_tool_type_id" string="适用机床型号" placeholder="请选择"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘'])]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<label for="gripper_length_min" string="夹持工件最小尺寸"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}"/>
|
||||
<div class="o_address_format"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}">
|
||||
<label for="gripper_length_min" string="长"/>
|
||||
<field name="gripper_length_min" class="o_address_zip"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="gripper_width_min" string="宽"/>
|
||||
<field name="gripper_width_min" class="o_address_zip"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="gripper_height_min" string="高"/>
|
||||
<field name="gripper_height_min" class="o_address_zip"/>
|
||||
</div>
|
||||
<label for="gripper_length_max" string="夹持工件最大尺寸"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}"/>
|
||||
<div class="o_address_format"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}">
|
||||
<label for="gripper_length_max" string="长"/>
|
||||
<field name="gripper_length_max" class="o_address_zip"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="gripper_width_max" string="宽"/>
|
||||
<field name="gripper_width_max" class="o_address_zip"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="gripper_width_max" string="高"/>
|
||||
<field name="gripper_width_max" class="o_address_zip"/>
|
||||
</div>
|
||||
<field name="gripper_diameter_min" string="夹持工件最小直径(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}"/>
|
||||
<field name="gripper_diameter_max" string="夹持工件最大直径(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}"/>
|
||||
<field name="clamping_diameter" string="装夹直径(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘','零点托盘'])]}"/>
|
||||
<field name="clamping_num" placeholder="请选择" string="装夹单元数"
|
||||
attrs="{'invisible': [('fixture_material_type', '!=', '零点卡盘')]}"/>
|
||||
<field name="repeated_positioning_accuracy" placeholder="请输入重复定位孔精度"
|
||||
string="重复定位精度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘','零点托盘'])]}"/>
|
||||
<field name="orientation_dish_diameter" string="定位盘直径(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘'])]}"/>
|
||||
<field name="boolean_transposing_hole" string="是否有转位孔"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘'])]}"/>
|
||||
<field name="connector_diameter" placeholder="请选择" string="连接头直径(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点托盘'])]}"/>
|
||||
<field name="way_to_install" placeholder="请选择" string="安装方式"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点托盘'])]}"/>
|
||||
<field name="rated_air_pressure" string="额定气压(Mpa)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具'])]}"/>
|
||||
|
||||
<field name="transverse_groove" string="横向配合槽n(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['虎钳夹具'])]}"/>
|
||||
<field name="longitudinal_fitting_groove" string="纵向配合槽l(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['虎钳夹具'])]}"/>
|
||||
|
||||
<field name="rated_adsorption_force" string="额定吸附力(N/cm²)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸夹具'])]}"/>
|
||||
<field name="magnetic_field_height" string="磁场高度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸夹具'])]}"/>
|
||||
<field name="magnetic_pole_plate_grinding_allowance" string="磁极板磨削余量(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸夹具'])]}"/>
|
||||
|
||||
<field name="screw_size" string="螺牙大小(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['转接板(锁板)夹具'])]}"/>
|
||||
<field name="via_hole_diameter" string="过孔直径(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['转接板(锁板)夹具'])]}"/>
|
||||
|
||||
<field name="mounting_hole_depth" string="安装孔深度(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['三爪卡盘'])]}"/>
|
||||
<field name="centering_diameter" string="定心直径(mm)"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['三爪卡盘'])]}"/>
|
||||
|
||||
<field name="boolean_chip_blowing_function" string="是否有吹屑功能"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘','零点托盘'])]}"/>
|
||||
<field name="materials_model_id" placeholder="请选择" options="{'no_create': True}"/>
|
||||
<field name="interface_materials_model_id" placeholder="请选择" string="接口类型"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具'])]}"/>
|
||||
<field name="type_of_drive" placeholder="请选择" string="驱动方式"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点托盘','气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}"/>
|
||||
<field name="unlocking_method" string="解锁方式" placeholder="请选择"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘'])]}"/>
|
||||
<field name="machine_tool_type_id" string="适用机床型号" placeholder="请选择"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘'])]}"/>
|
||||
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['sf_base', 'sf_maintenance', 'web_widget_model_viewer', 'sf_warehouse', 'jikimo_attachment_viewer',
|
||||
'jikimo_sale_multiple_supply_methods', 'product'],
|
||||
'jikimo_sale_multiple_supply_methods', 'product', 'jikimo_tree_header_buttons_always_visible'],
|
||||
'data': [
|
||||
'data/cron_data.xml',
|
||||
'data/stock_data.xml',
|
||||
|
||||
@@ -1215,6 +1215,51 @@ class ResProductFixture(models.Model):
|
||||
mounting_hole_depth = fields.Float('安装孔深度(mm)', digits=(16, 2))
|
||||
centering_diameter = fields.Float('定心直径(mm)', digits=(16, 2))
|
||||
|
||||
# ‘磁吸托盘’ 字段
|
||||
magnet_tray_length = fields.Float('磁吸托盘长度(mm)', digits=(16, 2))
|
||||
magnet_tray_width = fields.Float('磁吸托盘宽度(mm)', digits=(16, 2))
|
||||
magnet_tray_height = fields.Float('磁吸托盘厚度(mm)', digits=(16, 2))
|
||||
magnet_tray_diameter = fields.Float('磁吸托盘直径(mm)', digits=(16, 2))
|
||||
magnet_tray_weight = fields.Float('磁吸托盘重量(kg)', digits=(16, 2))
|
||||
|
||||
magnet_max_adsorp_length = fields.Float('磁吸托盘最大吸附长度(mm)', digits=(16, 2))
|
||||
magnet_max_adsorp_width = fields.Float('磁吸托盘最大吸附宽度(mm)', digits=(16, 2))
|
||||
magnet_max_adsorp_height = fields.Float('磁吸托盘最大吸附厚度(mm)', digits=(16, 2))
|
||||
magnet_max_adsorp_diameter = fields.Float('磁吸托盘最大吸附直径(mm)', digits=(16, 2))
|
||||
magnet_max_adsorp_force = fields.Float('磁吸托盘最大吸附力(N)', digits=(16, 2))
|
||||
|
||||
magnet_unlocking_method = fields.Selection(
|
||||
[('手动', '手动'), ('气动', '气动'), ('液压', '液压'), ('电动', '电动'), ('其他', '其他')],
|
||||
string='磁吸托盘锁紧方式'
|
||||
)
|
||||
magnet_flatness = fields.Char('磁吸托盘平面精度(mm)', size=20)
|
||||
magnet_max_load = fields.Float('磁吸托盘最大负载(kg)', digits=(16, 2))
|
||||
|
||||
# ‘气吸托盘’ 字段
|
||||
air_tray_length = fields.Float('气吸托盘长度(mm)', digits=(16, 2))
|
||||
air_tray_width = fields.Float('气吸托盘宽度(mm)', digits=(16, 2))
|
||||
air_tray_height = fields.Float('气吸托盘高度(mm)', digits=(16, 2))
|
||||
air_tray_diameter = fields.Float('气吸托盘直径(mm)', digits=(16, 2))
|
||||
air_tray_weight = fields.Float('气吸托盘重量(kg)', digits=(16, 2))
|
||||
|
||||
air_max_adsorp_length = fields.Float('气吸托盘最大吸附长度(mm)', digits=(16, 2))
|
||||
air_max_adsorp_width = fields.Float('气吸托盘最大吸附宽度(mm)', digits=(16, 2))
|
||||
air_max_adsorp_height = fields.Float('气吸托盘最大吸附厚度(mm)', digits=(16, 2))
|
||||
air_max_adsorp_diameter = fields.Float('气吸托盘最大吸附直径(mm)', digits=(16, 2))
|
||||
air_max_adsorp_force = fields.Float('气吸托盘最大吸附力(N)', digits=(16, 2))
|
||||
|
||||
air_unlocking_method = fields.Selection(
|
||||
[('手动', '手动'), ('气动', '气动'), ('液压', '液压'), ('电动', '电动'), ('其他', '其他')],
|
||||
string='气吸托盘锁紧方式'
|
||||
)
|
||||
air_flatness = fields.Char('气吸托盘平面精度(mm)', size=20)
|
||||
air_max_load = fields.Float('气吸托盘最大负载(kg)', digits=(16, 2))
|
||||
air_boolean_chip_blowing_function = fields.Boolean('气吸托盘是否有吹屑功能')
|
||||
air_way_to_install = fields.Selection(
|
||||
[('接口式', '接口式'), ('螺栓固定', '螺栓固定'), ('磁吸式', '磁吸式'), ('其他', '其他')],
|
||||
string='气吸托盘安装方式'
|
||||
)
|
||||
|
||||
@api.onchange('specification_fixture_id')
|
||||
def _onchange_specification_fixture_id(self):
|
||||
if self.specification_fixture_id:
|
||||
|
||||
@@ -9,6 +9,7 @@ from odoo import models
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.addons.sf_base.commons.common import Common
|
||||
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -178,6 +179,7 @@ class sfMaterialModel(models.Model):
|
||||
materials_model.mf_materia_post = item['mf_materia_post']
|
||||
materials_model.materials_id = materials.id
|
||||
materials_model.need_h = item['need_h']
|
||||
materials_model.need_m = item['need_m']
|
||||
materials_model.density = item['density']
|
||||
materials_model.active = item['active']
|
||||
else:
|
||||
@@ -192,6 +194,7 @@ class sfMaterialModel(models.Model):
|
||||
"active": item['active'],
|
||||
"materials_id": materials.id,
|
||||
"need_h": item['need_h'],
|
||||
"need_m": item['need_m'],
|
||||
"mf_materia_post": item['mf_materia_post'],
|
||||
"density": item['density'],
|
||||
})
|
||||
@@ -228,6 +231,7 @@ class sfMaterialModel(models.Model):
|
||||
"standards_id": self.env['sf.international.standards'].search(
|
||||
[("name", '=', item['standards_id'])]).id,
|
||||
"need_h": item['need_h'],
|
||||
"need_m": item['need_m'],
|
||||
"alloy_code": item['alloy_code'],
|
||||
"mf_materia_post": item['mf_materia_post'],
|
||||
"density": item['density'],
|
||||
@@ -248,6 +252,7 @@ class sfMaterialModel(models.Model):
|
||||
materials_model.mf_materia_post = item['mf_materia_post']
|
||||
materials_model.materials_id = materials.id
|
||||
materials_model.need_h = item['need_h']
|
||||
materials_model.need_m = item['need_m']
|
||||
materials_model.density = item['density']
|
||||
materials_model.active = item['active']
|
||||
materials_model.materials_code= item['materials_code']
|
||||
@@ -1610,6 +1615,10 @@ class SyncfixtureMaterialsBasicParameters(models.Model):
|
||||
self._write_or_create(all_list.get('adapter_board_yesterday_list'), '转接板(锁板)夹具')
|
||||
if all_list.get('scroll_chuck_all_list'):
|
||||
self._write_or_create(all_list.get('scroll_chuck_yesterday_list'), '三爪卡盘')
|
||||
if all_list.get('air_blow_tray_all_list'):
|
||||
self._write_or_create(all_list.get('air_tray_yesterday_list'), '气吸托盘')
|
||||
if all_list.get('magnet_tray_all_list'):
|
||||
self._write_or_create(all_list.get('magnet_tray_yesterday_list'), '磁吸托盘')
|
||||
else:
|
||||
raise ValidationError("夹具型号基本参数认证未通过")
|
||||
|
||||
@@ -1638,6 +1647,10 @@ class SyncfixtureMaterialsBasicParameters(models.Model):
|
||||
self._write_or_create(all_list.get('adapter_board_all_list'), '转接板(锁板)夹具')
|
||||
if all_list.get('scroll_chuck_all_list'):
|
||||
self._write_or_create(all_list.get('scroll_chuck_all_list'), '三爪卡盘')
|
||||
if all_list.get('air_blow_tray_all_list'):
|
||||
self._write_or_create(all_list.get('air_tray_all_list'), '气吸托盘')
|
||||
if all_list.get('magnet_tray_all_list'):
|
||||
self._write_or_create(all_list.get('magnet_tray_all_list'), '磁吸托盘')
|
||||
else:
|
||||
raise ValidationError("夹具型号基本参数认证未通过")
|
||||
|
||||
@@ -3230,4 +3243,4 @@ class EmbryoRedundancySync(models.Model):
|
||||
"height": item['height'],
|
||||
"active": item['active'],
|
||||
"remark": item['remark'],
|
||||
})
|
||||
})
|
||||
|
||||
@@ -45759,6 +45759,11 @@ msgstr ""
|
||||
msgid "热处理"
|
||||
msgstr ""
|
||||
|
||||
#. module: sf_base
|
||||
#: model:ir.model.fields,field_description:sf_base.field_sf_materials_model__need_m
|
||||
msgid "是否磁吸"
|
||||
msgstr ""
|
||||
|
||||
#. module: sf_base
|
||||
#: model:ir.model.fields,field_description:sf_base.field_sf_materials_model__mf_materia_post
|
||||
msgid "热处理后密度"
|
||||
|
||||
@@ -155,7 +155,7 @@ class ReSaleOrder(models.Model):
|
||||
'glb_url': item['glb_url'],
|
||||
'remark': item.get('remark'),
|
||||
'embryo_redundancy_id': item.get('embryo_redundancy_id'),
|
||||
'is_incoming_material': True if item.get('embryo_redundancy_id') else False,
|
||||
'is_incoming_material': True if item.get('incoming_size') else False,
|
||||
'manual_quotation': item.get('manual_quotation'),
|
||||
'model_id': item['model_id'],
|
||||
'delivery_end_date': item['delivery_end_date']
|
||||
@@ -287,7 +287,7 @@ class ResaleOrderLine(models.Model):
|
||||
check_status = fields.Selection(related='order_id.check_status')
|
||||
remark = fields.Char('备注')
|
||||
|
||||
is_incoming_material = fields.Boolean('客供料', compute='_compute_is_incoming_material', store=True)
|
||||
is_incoming_material = fields.Boolean('客供料', store=True)
|
||||
embryo_redundancy_id = fields.Many2one('sf.embryo.redundancy', '坯料冗余')
|
||||
manual_quotation = fields.Boolean('人工编程', default=False)
|
||||
model_url = fields.Char('模型文件地址')
|
||||
|
||||
Reference in New Issue
Block a user