Compare commits
10 Commits
feature/72
...
cdb3cc7c03
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cdb3cc7c03 | ||
|
|
19417dd569 | ||
|
|
20415d0d3f | ||
|
|
4d959eab59 | ||
|
|
5a98b20988 | ||
|
|
7eea5a0ff2 | ||
|
|
0c3407572f | ||
|
|
e5404efb60 | ||
|
|
46f60028aa | ||
|
|
bfc071debd |
@@ -67,77 +67,6 @@ class BasicParametersFixture(models.Model):
|
|||||||
mounting_hole_depth = fields.Float('安装孔深度(mm)', digits=(16, 2))
|
mounting_hole_depth = fields.Float('安装孔深度(mm)', digits=(16, 2))
|
||||||
centering_diameter = 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))
|
|
||||||
|
|
||||||
# --- 定位隔板字段 ---
|
|
||||||
partition_length_outer = fields.Float('外框长度(mm)', digits=(16, 2))
|
|
||||||
partition_width_outer = fields.Float('外框宽度(mm)', digits=(16, 2))
|
|
||||||
partition_length_inner = fields.Float('内框长度(mm)', digits=(16, 2))
|
|
||||||
partition_width_inner = fields.Float('内框宽度(mm)', digits=(16, 2))
|
|
||||||
partition_left_margin = fields.Float('左边距(mm)', digits=(16, 2))
|
|
||||||
partition_bottom_margin = fields.Float('下边距(mm)', digits=(16, 2))
|
|
||||||
partition_unit_length = fields.Float('定位单元长度(mm)', digits=(16, 2))
|
|
||||||
partition_unit_width = fields.Float('定位单元宽度(mm)', digits=(16, 2))
|
|
||||||
partition_unit_row_spacing = fields.Float('单元行间距(mm)', digits=(16, 2))
|
|
||||||
partition_unit_col_spacing = fields.Float('单元列间距(mm)', digits=(16, 2))
|
|
||||||
partition_unit_rows = fields.Integer('单元行数')
|
|
||||||
partition_unit_cols = fields.Integer('单元列数')
|
|
||||||
partition_base_unit_row_spacing = fields.Float('基准单元行间距(mm)', digits=(16, 2))
|
|
||||||
partition_base_unit_col_spacing = fields.Float('基准单元列间距(mm)', digits=(16, 2))
|
|
||||||
partition_offset_x = fields.Float('X方向偏移(mm)', digits=(16, 2))
|
|
||||||
partition_offset_y = fields.Float('Y方向偏移(mm)', digits=(16, 2))
|
|
||||||
partition_materials_model_id = fields.Many2one('sf.materials.model', '定位隔板材质')
|
|
||||||
partition_joint_type = fields.Selection([
|
|
||||||
('bolt', '螺栓连接'),
|
|
||||||
('magnet', '磁吸连接'),
|
|
||||||
('snap', '卡扣连接'),
|
|
||||||
], string='连接方式')
|
|
||||||
partition_partner_id = fields.Many2one('res.partner', string='供应商/客户')
|
|
||||||
|
|
||||||
# ‘气吸托盘’ 字段
|
|
||||||
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('编码')
|
code = fields.Char('编码')
|
||||||
active = fields.Boolean('有效', default=True)
|
active = fields.Boolean('有效', default=True)
|
||||||
|
|
||||||
@@ -156,12 +85,6 @@ class BasicParametersFixture(models.Model):
|
|||||||
return self._json_adapter_board_fixture_param(fixture_materials_data)
|
return self._json_adapter_board_fixture_param(fixture_materials_data)
|
||||||
elif fixture_materials_name == '三爪卡盘':
|
elif fixture_materials_name == '三爪卡盘':
|
||||||
return self._json_scroll_chuck_param(fixture_materials_data)
|
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_positioning_partition_param(fixture_materials_data)
|
|
||||||
elif fixture_materials_name == '气吸托盘':
|
|
||||||
return self._json_air_tray_param(fixture_materials_data)
|
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
def _json_zero_chuck_param(self, obj):
|
def _json_zero_chuck_param(self, obj):
|
||||||
@@ -361,90 +284,3 @@ class BasicParametersFixture(models.Model):
|
|||||||
'centering_diameter': obj['centering_diameter'],
|
'centering_diameter': obj['centering_diameter'],
|
||||||
'type_of_drive': obj['type_of_drive'],
|
'type_of_drive': obj['type_of_drive'],
|
||||||
'active': obj['active']}
|
'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_positioning_partition_param(self, obj):
|
|
||||||
"""定位隔板:将data数据转换成字段字典"""
|
|
||||||
return {
|
|
||||||
'code': obj.get('code'),
|
|
||||||
'fixture_model_id': self.env['sf.fixture.model'].sudo().search(
|
|
||||||
[('code', '=', obj.get('fixture_model_code'))], limit=1).id,
|
|
||||||
'name': obj.get('name'),
|
|
||||||
'partition_length_outer': obj.get('length_outer'),
|
|
||||||
'partition_width_outer': obj.get('width_outer'),
|
|
||||||
'partition_length_inner': obj.get('length_inner'),
|
|
||||||
'partition_width_inner': obj.get('width_inner'),
|
|
||||||
'partition_left_margin': obj.get('left_margin'),
|
|
||||||
'partition_bottom_margin': obj.get('bottom_margin'),
|
|
||||||
'partition_unit_length': obj.get('unit_length'),
|
|
||||||
'partition_unit_width': obj.get('unit_width'),
|
|
||||||
'partition_unit_row_spacing': obj.get('unit_row_spacing'),
|
|
||||||
'partition_unit_col_spacing': obj.get('unit_col_spacing'),
|
|
||||||
'partition_unit_rows': obj.get('unit_rows'),
|
|
||||||
'partition_unit_cols': obj.get('unit_cols'),
|
|
||||||
'partition_base_unit_row_spacing': obj.get('base_unit_row_spacing'),
|
|
||||||
'partition_base_unit_col_spacing': obj.get('base_unit_col_spacing'),
|
|
||||||
'partition_offset_x': obj.get('offset_x'),
|
|
||||||
'partition_offset_y': obj.get('offset_y'),
|
|
||||||
'partition_materials_model_id': self.env['sf.materials.model'].sudo().search(
|
|
||||||
[('materials_no', '=', obj.get('materials_model_id')), ('active', '=', True)], limit=1).id
|
|
||||||
if obj.get('materials_model_id') else False,
|
|
||||||
'partition_partner_id': self.env['res.partner'].sudo().search(
|
|
||||||
[('name', '=', obj.get('partner_name'))], limit=1).id
|
|
||||||
if obj.get('partner_name') else False,
|
|
||||||
'partition_joint_type': obj.get('joint_type'),
|
|
||||||
'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),
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ class FixtureModel(models.Model):
|
|||||||
glb_url = fields.Char(string="图片")
|
glb_url = fields.Char(string="图片")
|
||||||
status = fields.Boolean('状态')
|
status = fields.Boolean('状态')
|
||||||
active = fields.Boolean('有效', default=False)
|
active = fields.Boolean('有效', default=False)
|
||||||
code = fields.Char(string='编码', readonly=True)
|
|
||||||
|
|
||||||
zero_chuck_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
zero_chuck_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||||
string='零点卡盘基本参数')
|
string='零点卡盘基本参数')
|
||||||
@@ -47,16 +46,11 @@ class FixtureModel(models.Model):
|
|||||||
string='虎钳夹具基本参数')
|
string='虎钳夹具基本参数')
|
||||||
magnet_fixture_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
magnet_fixture_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||||
string='磁吸夹具基本参数')
|
string='磁吸夹具基本参数')
|
||||||
magnet_tray_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
|
||||||
string='磁吸托盘基本参数')
|
|
||||||
positioning_partition_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',
|
adapter_board_fixture_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||||
string='转接板(锁板)夹具基本参数')
|
string='转接板(锁板)夹具基本参数')
|
||||||
scroll_chuck_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
scroll_chuck_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||||
string='三爪卡盘基本参数')
|
string='三爪卡盘基本参数')
|
||||||
air_tray_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
code = fields.Char(string='编码', readonly=True)
|
||||||
string='气吸托盘基本参数')
|
|
||||||
|
|
||||||
# def _get_code(self, fixture_model_type_code):
|
# def _get_code(self, fixture_model_type_code):
|
||||||
# fixture_model = self.env['sf.fixture.model'].sudo().search(
|
# fixture_model = self.env['sf.fixture.model'].sudo().search(
|
||||||
|
|||||||
@@ -328,80 +328,6 @@
|
|||||||
<field name="type_of_drive"/>
|
<field name="type_of_drive"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</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="positioning_partition_ids"
|
|
||||||
attrs="{'invisible': [('fixture_material_type', '!=', '定位隔板')]}">
|
|
||||||
<tree editable="bottom" class="center" delete="0">
|
|
||||||
<field name="code" invisible="1"/>
|
|
||||||
<field name="name"/>
|
|
||||||
<field name="partition_length_outer"/>
|
|
||||||
<field name="partition_width_outer"/>
|
|
||||||
<field name="partition_length_inner"/>
|
|
||||||
<field name="partition_width_inner"/>
|
|
||||||
<field name="partition_left_margin"/>
|
|
||||||
<field name="partition_bottom_margin"/>
|
|
||||||
<field name="partition_unit_length"/>
|
|
||||||
<field name="partition_unit_width"/>
|
|
||||||
<field name="partition_unit_row_spacing"/>
|
|
||||||
<field name="partition_unit_col_spacing"/>
|
|
||||||
<field name="partition_unit_rows"/>
|
|
||||||
<field name="partition_unit_cols"/>
|
|
||||||
<field name="station_count" readonly="1"/>
|
|
||||||
<field name="partition_base_unit_row_spacing"/>
|
|
||||||
<field name="partition_base_unit_col_spacing"/>
|
|
||||||
<field name="partition_offset_x"/>
|
|
||||||
<field name="partition_offset_y"/>
|
|
||||||
<field name="partition_joint_type"/>
|
|
||||||
<field name="partition_partner_id" options="{'no_create': True}" placeholder="请选择"/>
|
|
||||||
<field name="partition_materials_model_id" options="{'no_create': True}" placeholder="请选择"/>
|
|
||||||
<field name="active" invisible="1"/>
|
|
||||||
</tree>
|
|
||||||
</field>
|
|
||||||
<field name="scroll_chuck_ids"
|
<field name="scroll_chuck_ids"
|
||||||
attrs="{'invisible': [('fixture_material_type', '!=', '三爪卡盘')]}">
|
attrs="{'invisible': [('fixture_material_type', '!=', '三爪卡盘')]}">
|
||||||
<tree editable="bottom" class="center" delete="0">
|
<tree editable="bottom" class="center" delete="0">
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
""",
|
""",
|
||||||
'category': 'sf',
|
'category': 'sf',
|
||||||
'website': 'https://www.sf.jikimo.com',
|
'website': 'https://www.sf.jikimo.com',
|
||||||
'depends': ['sf_plan','jikimo_printing'],
|
'depends': ['sf_plan', 'jikimo_printing', 'purchase_request', 'purchase_request_tier_validation'],
|
||||||
'data': [
|
'data': [
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
'data/stock_route_group.xml',
|
'data/stock_route_group.xml',
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
'views/sale_order_views.xml',
|
'views/sale_order_views.xml',
|
||||||
'wizard/sf_demand_plan_print_wizard_view.xml',
|
'wizard/sf_demand_plan_print_wizard_view.xml',
|
||||||
'wizard/sf_release_plan_wizard_views.xml',
|
'wizard/sf_release_plan_wizard_views.xml',
|
||||||
|
'wizard/sf_demand_plan_detail_wizard_view.xml',
|
||||||
'views/menu_view.xml',
|
'views/menu_view.xml',
|
||||||
],
|
],
|
||||||
'demo': [
|
'demo': [
|
||||||
@@ -30,6 +31,7 @@
|
|||||||
'web.assets_backend': [
|
'web.assets_backend': [
|
||||||
'sf_demand_plan/static/src/scss/style.css',
|
'sf_demand_plan/static/src/scss/style.css',
|
||||||
'sf_demand_plan/static/src/js/print_demand.js',
|
'sf_demand_plan/static/src/js/print_demand.js',
|
||||||
|
'sf_demand_plan/static/src/js/custom_button.js',
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
'license': 'LGPL-3',
|
'license': 'LGPL-3',
|
||||||
|
|||||||
@@ -9,3 +9,5 @@ from . import mrp_production
|
|||||||
from . import stock_rule
|
from . import stock_rule
|
||||||
from . import purchase_request
|
from . import purchase_request
|
||||||
from . import purchase_order
|
from . import purchase_order
|
||||||
|
from . import stock_move
|
||||||
|
from . import stock_picking
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class PurchaseOrderLine(models.Model):
|
|||||||
@api.model
|
@api.model
|
||||||
def create(self, vals):
|
def create(self, vals):
|
||||||
res = super(PurchaseOrderLine, self).create(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(',')]
|
origin = [origin.replace(' ', '') for origin in res.order_id.origin.split(',')]
|
||||||
if self.env.context.get('demand_plan_line_id'):
|
if self.env.context.get('demand_plan_line_id'):
|
||||||
res.demand_plan_line_id = self.env.context.get('demand_plan_line_id')
|
res.demand_plan_line_id = self.env.context.get('demand_plan_line_id')
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ class SfProductionDemandPlan(models.Model):
|
|||||||
_description = 'sf_production_demand_plan'
|
_description = 'sf_production_demand_plan'
|
||||||
|
|
||||||
def get_location_id(self):
|
def get_location_id(self):
|
||||||
stock_location = self.env['stock.location'].sudo().search([('name', '=', '客户')], limit=1)
|
customer_location_id = self.env['ir.model.data']._xmlid_to_res_id('stock.stock_location_customers')
|
||||||
return stock_location.id
|
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([
|
status = fields.Selection([
|
||||||
('10', '草稿'),
|
('10', '草稿'),
|
||||||
('20', '待确认'),
|
('20', '待确认'),
|
||||||
@@ -34,7 +34,7 @@ class SfProductionDemandPlan(models.Model):
|
|||||||
company_id = fields.Many2one(
|
company_id = fields.Many2one(
|
||||||
related='sale_order_id.company_id',
|
related='sale_order_id.company_id',
|
||||||
store=True, index=True, precompute=True)
|
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',
|
order_remark = fields.Text(related='sale_order_id.remark',
|
||||||
string="订单备注", store=True)
|
string="订单备注", store=True)
|
||||||
glb_url = fields.Char(related='sale_order_line_id.glb_url', string='glb文件地址')
|
glb_url = fields.Char(related='sale_order_line_id.glb_url', string='glb文件地址')
|
||||||
@@ -83,7 +83,7 @@ class SfProductionDemandPlan(models.Model):
|
|||||||
related='product_id.blank_precision')
|
related='product_id.blank_precision')
|
||||||
unit_number = fields.Float('单件用量', digits=(16, 3), related='product_id.unit_number')
|
unit_number = fields.Float('单件用量', digits=(16, 3), related='product_id.unit_number')
|
||||||
embryo_long = fields.Char('坯料尺寸(mm)', related='demand_plan_id.embryo_long')
|
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_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',
|
model_process_parameters_ids = fields.Many2many(related='demand_plan_id.model_process_parameters_ids',
|
||||||
string='表面工艺', )
|
string='表面工艺', )
|
||||||
@@ -127,6 +127,12 @@ class SfProductionDemandPlan(models.Model):
|
|||||||
string='字段自制类型只读'
|
string='字段自制类型只读'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
is_processing = fields.Boolean(
|
||||||
|
string='正在处理中',
|
||||||
|
default=False,
|
||||||
|
help='用于防止重复点击按钮'
|
||||||
|
)
|
||||||
|
|
||||||
# hide_action_open_mrp_production = fields.Boolean(
|
# hide_action_open_mrp_production = fields.Boolean(
|
||||||
# string='显示待工艺确认按钮',
|
# string='显示待工艺确认按钮',
|
||||||
# compute='_compute_hid_button',
|
# compute='_compute_hid_button',
|
||||||
@@ -615,11 +621,6 @@ class SfProductionDemandPlan(models.Model):
|
|||||||
# 按产品分组并计算总数
|
# 按产品分组并计算总数
|
||||||
product_data = {}
|
product_data = {}
|
||||||
for plan in filtered_plan:
|
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:
|
if plan.product_id not in product_data:
|
||||||
# 初始化产品数据,从产品上获取需求量
|
# 初始化产品数据,从产品上获取需求量
|
||||||
product_data[plan.product_id] = {
|
product_data[plan.product_id] = {
|
||||||
@@ -629,22 +630,17 @@ class SfProductionDemandPlan(models.Model):
|
|||||||
|
|
||||||
# 累加计划数量
|
# 累加计划数量
|
||||||
product_data[plan.product_id]['plan_uom_qty'] += plan.plan_uom_qty
|
product_data[plan.product_id]['plan_uom_qty'] += plan.plan_uom_qty
|
||||||
product_data[plan.product_id]['overdelivery_allowed'] = check_overdelivery_allowed
|
|
||||||
# 检查需求超过计划数量的产品
|
# 检查需求超过计划数量的产品
|
||||||
warning_messages = []
|
warning_messages = []
|
||||||
error_messages = []
|
|
||||||
for product, data in product_data.items():
|
for product, data in product_data.items():
|
||||||
if data['overdelivery_allowed'] and float_compare(data['plan_uom_qty'], data['product_uom_qty'],precision_rounding=product.uom_id.rounding) == 1:
|
if float_compare(data['plan_uom_qty'], data['product_uom_qty'],
|
||||||
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:
|
precision_rounding=product.uom_id.rounding) == 1:
|
||||||
warning_messages.append(
|
warning_messages.append(
|
||||||
_("您正在下达的产品 %s,计划量%s,需求数量为%s,已超过需求数量") %
|
_("您正在下达的产品 %s,计划量%s,需求数量为%s,已超过需求数量") %
|
||||||
(product.display_name, data['plan_uom_qty'], data['product_uom_qty'])
|
(product.display_name, data['plan_uom_qty'], data['product_uom_qty'])
|
||||||
)
|
)
|
||||||
if error_messages:
|
if warning_messages and check_overdelivery_allowed:
|
||||||
error_message = "\n".join(error_messages)
|
raise ValidationError(f"已禁止向合作伙伴/客户超量发货,请更换“补货原因”或将“可超量发货”设置为“是”。")
|
||||||
raise ValidationError(error_message)
|
|
||||||
elif warning_messages:
|
elif warning_messages:
|
||||||
warning_message = "\n".join(warning_messages)
|
warning_message = "\n".join(warning_messages)
|
||||||
return {
|
return {
|
||||||
@@ -662,6 +658,9 @@ class SfProductionDemandPlan(models.Model):
|
|||||||
|
|
||||||
def button_release_plan(self):
|
def button_release_plan(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
|
if self.is_processing:
|
||||||
|
return
|
||||||
|
self.is_processing = True
|
||||||
check_overdelivery_allowed = False
|
check_overdelivery_allowed = False
|
||||||
if not self.demand_plan_id.overdelivery_allowed:
|
if not self.demand_plan_id.overdelivery_allowed:
|
||||||
customer_location_id = self.env['ir.model.data']._xmlid_to_res_id('stock.stock_location_customers')
|
customer_location_id = self.env['ir.model.data']._xmlid_to_res_id('stock.stock_location_customers')
|
||||||
@@ -701,18 +700,6 @@ class SfProductionDemandPlan(models.Model):
|
|||||||
self.update_sale_order_state()
|
self.update_sale_order_state()
|
||||||
|
|
||||||
def mrp_bom_create(self):
|
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 = ''
|
bom_type = ''
|
||||||
# 根据供货方式修改成品模板
|
# 根据供货方式修改成品模板
|
||||||
if self.supply_method == 'automation':
|
if self.supply_method == 'automation':
|
||||||
@@ -732,6 +719,18 @@ class SfProductionDemandPlan(models.Model):
|
|||||||
|
|
||||||
# 复制成品模板上的属性
|
# 复制成品模板上的属性
|
||||||
self.product_id.product_tmpl_id.copy_template(product_template_id)
|
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)
|
future_time = datetime.now() + timedelta(hours=8)
|
||||||
# 生成BOM单据编码
|
# 生成BOM单据编码
|
||||||
code = f"{self.product_id.default_code}-{bom_type}-{future_time.strftime('%Y%m%d%H%M%S')}"
|
code = f"{self.product_id.default_code}-{bom_type}-{future_time.strftime('%Y%m%d%H%M%S')}"
|
||||||
@@ -911,3 +910,62 @@ class SfProductionDemandPlan(models.Model):
|
|||||||
'demand_plan_line_id': self.id
|
'demand_plan_line_id': self.id
|
||||||
}
|
}
|
||||||
return values
|
return values
|
||||||
|
|
||||||
|
def button_plan_detail(self):
|
||||||
|
self.ensure_one()
|
||||||
|
purchase_request_ids = self.env['purchase.request'].sudo().search(
|
||||||
|
[('line_ids.demand_plan_line_id', 'in', self.ids)])
|
||||||
|
purchase_order_ids = self.env['purchase.order'].sudo().search(
|
||||||
|
[('order_line.demand_plan_line_id', 'in', self.ids)])
|
||||||
|
picking_ids = self.env['stock.picking'].sudo().search(
|
||||||
|
[('demand_plan_line_ids', 'in', self.ids)])
|
||||||
|
return {
|
||||||
|
'name': _('详情'),
|
||||||
|
'type': 'ir.actions.act_window',
|
||||||
|
'view_mode': 'form',
|
||||||
|
'res_model': 'sf.demand.plan.detail.wizard',
|
||||||
|
'target': 'new',
|
||||||
|
'views': [(False, 'form')],
|
||||||
|
'context': {
|
||||||
|
'default_mrp_production_ids': self.mrp_production_ids.ids,
|
||||||
|
'default_purchase_request_ids': purchase_request_ids.ids,
|
||||||
|
'default_standard_purchase_order_ids': purchase_order_ids.filtered(
|
||||||
|
lambda o: o.purchase_type == 'standard'
|
||||||
|
).ids,
|
||||||
|
'default_consignment_purchase_order_ids': purchase_order_ids.filtered(
|
||||||
|
lambda o: o.purchase_type == 'consignment'
|
||||||
|
).ids,
|
||||||
|
'default_outsourcing_purchase_order_ids': purchase_order_ids.filtered(
|
||||||
|
lambda o: o.purchase_type == 'outsourcing'
|
||||||
|
).ids,
|
||||||
|
'default_outside_purchase_order_ids': purchase_order_ids.filtered(
|
||||||
|
lambda o: o.purchase_type == 'outside'
|
||||||
|
).ids,
|
||||||
|
'default_in_stock_picking_ids': picking_ids.filtered(
|
||||||
|
lambda o: o.picking_type_sequence_code == 'IN'
|
||||||
|
).ids,
|
||||||
|
'default_dl_stock_picking_ids': picking_ids.filtered(
|
||||||
|
lambda o: o.picking_type_sequence_code == 'DL'
|
||||||
|
).ids,
|
||||||
|
'default_int_stock_picking_ids': picking_ids.filtered(
|
||||||
|
lambda o: o.picking_type_sequence_code == 'INT'
|
||||||
|
).ids,
|
||||||
|
'default_pc_stock_picking_ids': picking_ids.filtered(
|
||||||
|
lambda o: o.picking_type_sequence_code == 'PC'
|
||||||
|
).ids,
|
||||||
|
'default_sfp_stock_picking_ids': picking_ids.filtered(
|
||||||
|
lambda o: o.picking_type_sequence_code == 'SFP'
|
||||||
|
).ids,
|
||||||
|
'default_onin_stock_picking_ids': picking_ids.filtered(
|
||||||
|
lambda o: o.picking_type_sequence_code == 'OCIN'
|
||||||
|
).ids,
|
||||||
|
'default_ocout_stock_picking_ids': picking_ids.filtered(
|
||||||
|
lambda o: o.picking_type_sequence_code == 'OCOUT'
|
||||||
|
).ids,
|
||||||
|
'default_out_stock_picking_ids': picking_ids.filtered(
|
||||||
|
lambda o: o.picking_type_sequence_code == 'OUT'
|
||||||
|
).ids,
|
||||||
|
'default_res_stock_picking_ids': picking_ids.filtered(
|
||||||
|
lambda o: o.picking_type_sequence_code == 'RES'
|
||||||
|
).ids,
|
||||||
|
}}
|
||||||
|
|||||||
37
sf_demand_plan/models/stock_move.py
Normal file
37
sf_demand_plan/models/stock_move.py
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
|
|
||||||
|
from odoo import api, fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class StockMove(models.Model):
|
||||||
|
_inherit = 'stock.move'
|
||||||
|
|
||||||
|
demand_plan_line_ids = fields.Many2many(comodel_name="sf.production.demand.plan",
|
||||||
|
string="需求计划明细", compute='_compute_demand_plan_line_ids', store=True)
|
||||||
|
|
||||||
|
@api.depends('origin', 'move_orig_ids')
|
||||||
|
def _compute_demand_plan_line_ids(self):
|
||||||
|
sorted_records = self.sorted(key=lambda r: -r.id)
|
||||||
|
for line in sorted_records:
|
||||||
|
origin = [origin.replace(' ', '') for origin in line.origin.split(',')]
|
||||||
|
if line.created_purchase_request_line_id:
|
||||||
|
line.demand_plan_line_ids = line.created_purchase_request_line_id.demand_plan_line_id.ids
|
||||||
|
elif line.origin and 'MO' in line.origin:
|
||||||
|
mp_ids = self.env['mrp.production'].sudo().search([('name', '=', origin[0])])
|
||||||
|
line.demand_plan_line_ids = mp_ids.demand_plan_line_id.ids if mp_ids else []
|
||||||
|
elif line.origin and 'P' in line.origin:
|
||||||
|
purchase_order_ids = self.env['purchase.order'].sudo().search([('name', '=', origin[0])])
|
||||||
|
if purchase_order_ids.order_line:
|
||||||
|
line.demand_plan_line_ids = purchase_order_ids.order_line.demand_plan_line_id.ids
|
||||||
|
elif line.move_orig_ids:
|
||||||
|
demand_plan_lines = self.env['sf.production.demand.plan']
|
||||||
|
for move_orig in line.move_orig_ids:
|
||||||
|
demand_plan_lines |= move_orig.demand_plan_line_ids
|
||||||
|
line.demand_plan_line_ids = demand_plan_lines.ids
|
||||||
|
else:
|
||||||
|
line.demand_plan_line_ids = []
|
||||||
|
|
||||||
|
if not line.demand_plan_line_ids and self.env.context.get('demand_plan_line_id'):
|
||||||
|
plan_ids = self.env.context['demand_plan_line_id']
|
||||||
|
line.demand_plan_line_ids = [plan_ids]
|
||||||
16
sf_demand_plan/models/stock_picking.py
Normal file
16
sf_demand_plan/models/stock_picking.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
from odoo import fields, api, models, _
|
||||||
|
|
||||||
|
|
||||||
|
class StockPicking(models.Model):
|
||||||
|
_inherit = "stock.picking"
|
||||||
|
|
||||||
|
demand_plan_line_ids = fields.Many2many(comodel_name="sf.production.demand.plan",
|
||||||
|
string="需求计划明细", compute='_compute_demand_plan_line_ids', store=True)
|
||||||
|
|
||||||
|
@api.depends('move_ids_without_package')
|
||||||
|
def _compute_demand_plan_line_ids(self):
|
||||||
|
for line in self:
|
||||||
|
demand_plan_lines = self.env['sf.production.demand.plan']
|
||||||
|
if line.move_ids_without_package and line.move_ids_without_package.demand_plan_line_ids:
|
||||||
|
demand_plan_lines |= line.move_ids_without_package.demand_plan_line_ids
|
||||||
|
line.demand_plan_line_ids = demand_plan_lines.ids
|
||||||
@@ -14,3 +14,6 @@ access_stock_route_group_dispatch,stock.route.group.dispatch,model_stock_route_g
|
|||||||
|
|
||||||
access_sf_release_plan_wizard,sf.release.plan.wizard,model_sf_release_plan_wizard,base.group_user,1,0,0,0
|
access_sf_release_plan_wizard,sf.release.plan.wizard,model_sf_release_plan_wizard,base.group_user,1,0,0,0
|
||||||
access_sf_release_plan_wizard_for_dispatch,sf.release.plan.wizard for dispatch,model_sf_release_plan_wizard,sf_base.group_plan_dispatch,1,1,1,1
|
access_sf_release_plan_wizard_for_dispatch,sf.release.plan.wizard for dispatch,model_sf_release_plan_wizard,sf_base.group_plan_dispatch,1,1,1,1
|
||||||
|
|
||||||
|
access_sf_demand_plan_detail_wizard,sf.demand.plan.detail.wizard,model_sf_demand_plan_detail_wizard,base.group_user,1,0,0,0
|
||||||
|
access_sf_demand_plan_detail_wizard_for_dispatch,sf.demand.plan.detail.wizard for dispatch,model_sf_demand_plan_detail_wizard,sf_base.group_plan_dispatch,1,1,1,1
|
||||||
|
58
sf_demand_plan/static/src/js/custom_button.js
Normal file
58
sf_demand_plan/static/src/js/custom_button.js
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
/** @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"]');
|
||||||
|
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="model">sf.production.demand.plan</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="需求计划" default_order="sequence desc,id desc" editable="bottom"
|
<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>
|
<header>
|
||||||
<button string="打印" name="button_action_print" type="object"
|
<button string="打印" name="button_action_print" type="object"
|
||||||
class="btn-primary"/>
|
class="btn-primary"/>
|
||||||
@@ -91,6 +92,10 @@
|
|||||||
attrs="{'invisible': [('hide_release_production_order', '=', False)]}"
|
attrs="{'invisible': [('hide_release_production_order', '=', False)]}"
|
||||||
/>
|
/>
|
||||||
<button name="edit_button" type="object" string="拆分" class="btn-primary"/>
|
<button name="edit_button" type="object" string="拆分" class="btn-primary"/>
|
||||||
|
<button string="详情" name="button_plan_detail" type="object"
|
||||||
|
class="btn-primary"
|
||||||
|
attrs="{'invisible': [('status', 'not in', ('50','60'))]}"
|
||||||
|
/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -108,6 +108,10 @@
|
|||||||
class="btn-primary"
|
class="btn-primary"
|
||||||
attrs="{'invisible': [('hide_release_production_order', '=', False)]}"
|
attrs="{'invisible': [('hide_release_production_order', '=', False)]}"
|
||||||
/>
|
/>
|
||||||
|
<button string="详情" name="button_plan_detail" type="object"
|
||||||
|
class="btn-primary"
|
||||||
|
attrs="{'invisible': [('status', 'not in', ('50','60'))]}"
|
||||||
|
/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</page>
|
</page>
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
from . import sf_demand_plan_print_wizard
|
from . import sf_demand_plan_print_wizard
|
||||||
from . import sf_release_plan_wizard
|
from . import sf_release_plan_wizard
|
||||||
|
from . import sf_demand_plan_detail_wizard
|
||||||
|
|||||||
74
sf_demand_plan/wizard/sf_demand_plan_detail_wizard.py
Normal file
74
sf_demand_plan/wizard/sf_demand_plan_detail_wizard.py
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import logging
|
||||||
|
from odoo import models, fields, api, _
|
||||||
|
|
||||||
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class SfDemandPlanDetailWizard(models.TransientModel):
|
||||||
|
_name = 'sf.demand.plan.detail.wizard'
|
||||||
|
_description = u'需求计划详情向导'
|
||||||
|
|
||||||
|
mrp_production_ids = fields.Many2many('mrp.production', string='关联制造订单', readonly=True)
|
||||||
|
purchase_request_ids = fields.Many2many('purchase.request', string='关联采购申请', readonly=True)
|
||||||
|
standard_purchase_order_ids = fields.Many2many('purchase.order', string='关联标准采购',
|
||||||
|
relation='standard_purchase_order_rel',
|
||||||
|
column1='plan_detail_wizard_id', column2='purchase_order_id',
|
||||||
|
readonly=True)
|
||||||
|
consignment_purchase_order_ids = fields.Many2many('purchase.order', string='关联工序外协采购',
|
||||||
|
relation='consignment_purchase_order_rel',
|
||||||
|
column1='plan_detail_wizard_id', column2='purchase_order_id',
|
||||||
|
readonly=True)
|
||||||
|
outsourcing_purchase_order_ids = fields.Many2many('purchase.order', string='关联委外加工采购',
|
||||||
|
relation='outsourcing_purchase_order_rel',
|
||||||
|
column1='plan_detail_wizard_id', column2='purchase_order_id',
|
||||||
|
readonly=True)
|
||||||
|
outside_purchase_order_ids = fields.Many2many('purchase.order', string='关联外购订单采购',
|
||||||
|
relation='outside_purchase_order_rel',
|
||||||
|
column1='plan_detail_wizard_id', column2='purchase_order_id',
|
||||||
|
readonly=True)
|
||||||
|
|
||||||
|
in_stock_picking_ids = fields.Many2many('stock.picking', string='关联收料入库调拨单',
|
||||||
|
relation='in_stock_picking_rel',
|
||||||
|
column1='plan_detail_wizard_id', column2='stock_picking_id',
|
||||||
|
readonly=True)
|
||||||
|
|
||||||
|
dl_stock_picking_ids = fields.Many2many('stock.picking', string='关联客供料入库调拨单',
|
||||||
|
relation='dl_stock_picking_rel',
|
||||||
|
column1='plan_detail_wizard_id', column2='stock_picking_id',
|
||||||
|
readonly=True)
|
||||||
|
|
||||||
|
int_stock_picking_ids = fields.Many2many('stock.picking', string='关联内部调拨',
|
||||||
|
relation='int_stock_picking_rel',
|
||||||
|
column1='plan_detail_wizard_id', column2='stock_picking_id',
|
||||||
|
readonly=True)
|
||||||
|
|
||||||
|
pc_stock_picking_ids = fields.Many2many('stock.picking', string='关联生产发料调拨单',
|
||||||
|
relation='pc_stock_picking_rel',
|
||||||
|
column1='plan_detail_wizard_id', column2='stock_picking_id',
|
||||||
|
readonly=True)
|
||||||
|
|
||||||
|
sfp_stock_picking_ids = fields.Many2many('stock.picking', string='关联生产入库调拨单',
|
||||||
|
relation='sfp_stock_picking_rel',
|
||||||
|
column1='plan_detail_wizard_id', column2='stock_picking_id',
|
||||||
|
readonly=True)
|
||||||
|
|
||||||
|
onin_stock_picking_ids = fields.Many2many('stock.picking', string='关联外协入库调拨单',
|
||||||
|
relation='onin_stock_picking_rel',
|
||||||
|
column1='plan_detail_wizard_id', column2='stock_picking_id',
|
||||||
|
readonly=True)
|
||||||
|
|
||||||
|
ocout_stock_picking_ids = fields.Many2many('stock.picking', string='关联外协出库调拨单',
|
||||||
|
relation='ocout_stock_picking_rel',
|
||||||
|
column1='plan_detail_wizard_id', column2='stock_picking_id',
|
||||||
|
readonly=True)
|
||||||
|
|
||||||
|
out_stock_picking_ids = fields.Many2many('stock.picking', string='关联发料出库调拨单',
|
||||||
|
relation='out_stock_picking_rel',
|
||||||
|
column1='plan_detail_wizard_id', column2='stock_picking_id',
|
||||||
|
readonly=True)
|
||||||
|
|
||||||
|
res_stock_picking_ids = fields.Many2many('stock.picking', string='关联委外发料调拨单',
|
||||||
|
relation='res_stock_picking_rel',
|
||||||
|
column1='plan_detail_wizard_id', column2='stock_picking_id',
|
||||||
|
readonly=True)
|
||||||
58
sf_demand_plan/wizard/sf_demand_plan_detail_wizard_view.xml
Normal file
58
sf_demand_plan/wizard/sf_demand_plan_detail_wizard_view.xml
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<odoo>
|
||||||
|
<record id="action_plan_detail_form" model="ir.ui.view">
|
||||||
|
<field name="name">sf.demand.plan.detail.wizard.form</field>
|
||||||
|
<field name="model">sf.demand.plan.detail.wizard</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form string="详情">
|
||||||
|
<notebook>
|
||||||
|
<page string="采购申请" attrs="{'invisible': [('purchase_request_ids', '=', [])]}">
|
||||||
|
<field name="purchase_request_ids" widget="many2many"/>
|
||||||
|
</page>
|
||||||
|
<page string="制造订单" attrs="{'invisible': [('mrp_production_ids', '=', [])]}">
|
||||||
|
<field name="mrp_production_ids" widget="many2many"/>
|
||||||
|
</page>
|
||||||
|
<page string="标准采购" attrs="{'invisible': [('standard_purchase_order_ids', '=', [])]}">
|
||||||
|
<field name="standard_purchase_order_ids" widget="many2many"/>
|
||||||
|
</page>
|
||||||
|
<page string="工序外协采购" attrs="{'invisible': [('consignment_purchase_order_ids', '=', [])]}">
|
||||||
|
<field name="consignment_purchase_order_ids" widget="many2many"/>
|
||||||
|
</page>
|
||||||
|
<page string="委外加工采购" attrs="{'invisible': [('outsourcing_purchase_order_ids', '=', [])]}">
|
||||||
|
<field name="outsourcing_purchase_order_ids" widget="many2many"/>
|
||||||
|
</page>
|
||||||
|
<page string="外购订单采购" attrs="{'invisible': [('outside_purchase_order_ids', '=', [])]}">
|
||||||
|
<field name="outside_purchase_order_ids" widget="many2many"/>
|
||||||
|
</page>
|
||||||
|
<page string="收料入库" attrs="{'invisible': [('in_stock_picking_ids', '=', [])]}">
|
||||||
|
<field name="in_stock_picking_ids" widget="many2many"/>
|
||||||
|
</page>
|
||||||
|
<page string="客供料入库" attrs="{'invisible': [('dl_stock_picking_ids', '=', [])]}">
|
||||||
|
<field name="dl_stock_picking_ids" widget="many2many"/>
|
||||||
|
</page>
|
||||||
|
<page string="内部调拨" attrs="{'invisible': [('int_stock_picking_ids', '=', [])]}">
|
||||||
|
<field name="int_stock_picking_ids" widget="many2many"/>
|
||||||
|
</page>
|
||||||
|
<page string="生产发料" attrs="{'invisible': [('pc_stock_picking_ids', '=', [])]}">
|
||||||
|
<field name="pc_stock_picking_ids" widget="many2many"/>
|
||||||
|
</page>
|
||||||
|
<page string="生产入库" attrs="{'invisible': [('sfp_stock_picking_ids', '=', [])]}">
|
||||||
|
<field name="sfp_stock_picking_ids" widget="many2many"/>
|
||||||
|
</page>
|
||||||
|
<page string="外协入库" attrs="{'invisible': [('onin_stock_picking_ids', '=', [])]}">
|
||||||
|
<field name="onin_stock_picking_ids" widget="many2many"/>
|
||||||
|
</page>
|
||||||
|
<page string="外协出库" attrs="{'invisible': [('ocout_stock_picking_ids', '=', [])]}">
|
||||||
|
<field name="ocout_stock_picking_ids" widget="many2many"/>
|
||||||
|
</page>
|
||||||
|
<page string="发料出库" attrs="{'invisible': [('out_stock_picking_ids', '=', [])]}">
|
||||||
|
<field name="out_stock_picking_ids" widget="many2many"/>
|
||||||
|
</page>
|
||||||
|
<page string="委外发料" attrs="{'invisible': [('res_stock_picking_ids', '=', [])]}">
|
||||||
|
<field name="res_stock_picking_ids" widget="many2many"/>
|
||||||
|
</page>
|
||||||
|
</notebook>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
@@ -5,7 +5,7 @@ from odoo import models, fields, api, _
|
|||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class SfDemandPlanPrintWizard(models.TransientModel):
|
class SfDemandPlanPrintWizard(models.Model):
|
||||||
_name = 'sf.demand.plan.print.wizard'
|
_name = 'sf.demand.plan.print.wizard'
|
||||||
_description = u'打印向导'
|
_description = u'打印向导'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import logging
|
import logging
|
||||||
from odoo import models, fields, api, _
|
from odoo import models, fields, api, _
|
||||||
|
from werkzeug.exceptions import InternalServerError
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -17,4 +18,10 @@ class SfReleasePlanWizard(models.TransientModel):
|
|||||||
def confirm(self):
|
def confirm(self):
|
||||||
if self.demand_plan_line_id:
|
if self.demand_plan_line_id:
|
||||||
for demand_plan_line_id in 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,191 +513,112 @@
|
|||||||
</notebook>
|
</notebook>
|
||||||
</page>
|
</page>
|
||||||
<page string="夹具物料参数" attrs="{'invisible': [('categ_type', '!=', '夹具')]}">
|
<page string="夹具物料参数" attrs="{'invisible': [('categ_type', '!=', '夹具')]}">
|
||||||
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<field name="brand_id" placeholder="请选择" options="{'no_create': True}"/>
|
||||||
<field name="brand_id" placeholder="请选择" options="{'no_create': True}"/>
|
<field name="multi_mounting_type_id" placeholder="请选择" options="{'no_create': True}"
|
||||||
<field name="multi_mounting_type_id" placeholder="请选择" options="{'no_create': True}"
|
attrs="{'required': [('categ_type', '=', '夹具')]}"/>
|
||||||
attrs="{'required': [('categ_type', '=', '夹具')]}"/>
|
<field name="length" string="长度(mm)"/>
|
||||||
<field name="length" string="长度(mm)"/>
|
<field name="width" string="宽度(mm)"/>
|
||||||
<field name="width" string="宽度(mm)"/>
|
<field name="height" string="高度(mm)"/>
|
||||||
<field name="height" string="高度(mm)"/>
|
<field name="height_tolerance_value"
|
||||||
<field name="height_tolerance_value"
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸夹具'])]}"/>
|
||||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸夹具'])]}"/>
|
<field name="diameter"
|
||||||
<field name="diameter"
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘', '零点托盘', '三爪卡盘'])]}"/>
|
||||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘', '零点托盘', '三爪卡盘', '磁吸托盘', '气吸托盘'])]}"/>
|
<field name="weight"/>
|
||||||
<field name="weight"/>
|
<field name="chucking_power_max"
|
||||||
<field name="chucking_power_max"
|
attrs="{'invisible': [('fixture_material_type', '=','磁吸夹具')]}"/>
|
||||||
attrs="{'invisible': [('fixture_material_type', '=','磁吸夹具')]}"/>
|
<field name="carrying_capacity_max"/>
|
||||||
<field name="carrying_capacity_max"
|
<field name="rigidity"/>
|
||||||
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="length_outer" string="外框长(mm)"
|
|
||||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['定位隔板'])]}"/>
|
|
||||||
<field name="width_outer" string="外框宽(mm)"
|
|
||||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['定位隔板'])]}"/>
|
|
||||||
<field name="length_inner" string="内框长(mm)"
|
|
||||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['定位隔板'])]}"/>
|
|
||||||
<field name="width_inner" string="内框宽(mm)"
|
|
||||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['定位隔板'])]}"/>
|
|
||||||
<field name="thickness" string="厚度(mm)"
|
|
||||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['定位隔板'])]}"/>
|
|
||||||
<field name="unit_location" string="定位单元位置"
|
|
||||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['定位隔板'])]}"/>
|
|
||||||
<field name="offset_x" string="X方向偏移(mm)"
|
|
||||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['定位隔板'])]}"/>
|
|
||||||
<field name="offset_y" string="Y方向偏移(mm)"
|
|
||||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['定位隔板'])]}"/>
|
|
||||||
<field name="materials_model_id_positioning" string="材质"
|
|
||||||
placeholder="请选择" options="{'no_create': True}"
|
|
||||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['定位隔板'])]}"/>
|
|
||||||
<field name="station_count" string="定位单元数"
|
|
||||||
attrs="{'readonly': True, '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>
|
||||||
</page>
|
<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>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -1215,69 +1215,9 @@ class ResProductFixture(models.Model):
|
|||||||
mounting_hole_depth = fields.Float('安装孔深度(mm)', digits=(16, 2))
|
mounting_hole_depth = fields.Float('安装孔深度(mm)', digits=(16, 2))
|
||||||
centering_diameter = 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))
|
|
||||||
|
|
||||||
# 定位隔板字段
|
|
||||||
length_outer = fields.Float('外框长(mm)', digits=(16, 2))
|
|
||||||
width_outer = fields.Float('外框宽(mm)', digits=(16, 2))
|
|
||||||
length_inner = fields.Float('内框长(mm)', digits=(16, 2))
|
|
||||||
width_inner = fields.Float('内框宽(mm)', digits=(16, 2))
|
|
||||||
thickness = fields.Float('厚度(mm)', digits=(16, 2))
|
|
||||||
|
|
||||||
unit_location = fields.Char('定位单元位置')
|
|
||||||
offset_x = fields.Float('X方向偏移(mm)', digits=(16, 2))
|
|
||||||
offset_y = fields.Float('Y方向偏移(mm)', digits=(16, 2))
|
|
||||||
|
|
||||||
materials_model_id_positioning = fields.Many2one(
|
|
||||||
'sf.materials.model', string='材质', ondelete='set null', index=True)
|
|
||||||
station_count = fields.Integer('定位单元数', readonly=True)
|
|
||||||
|
|
||||||
# ‘气吸托盘’ 字段
|
|
||||||
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')
|
@api.onchange('specification_fixture_id')
|
||||||
def _onchange_specification_fixture_id(self):
|
def _onchange_specification_fixture_id(self):
|
||||||
if self.specification_fixture_id:
|
if self.specification_fixture_id:
|
||||||
self.length = self.specification_fixture_id.length
|
self.length = self.specification_fixture_id.length
|
||||||
self.width = self.specification_fixture_id.width
|
self.width = self.specification_fixture_id.width
|
||||||
self.height = self.specification_fixture_id.height
|
self.height = self.specification_fixture_id.height
|
||||||
@@ -1318,46 +1258,7 @@ class ResProductFixture(models.Model):
|
|||||||
self.via_hole_diameter = self.specification_fixture_id.via_hole_diameter
|
self.via_hole_diameter = self.specification_fixture_id.via_hole_diameter
|
||||||
self.mounting_hole_depth = self.specification_fixture_id.mounting_hole_depth
|
self.mounting_hole_depth = self.specification_fixture_id.mounting_hole_depth
|
||||||
self.centering_diameter = self.specification_fixture_id.centering_diameter
|
self.centering_diameter = self.specification_fixture_id.centering_diameter
|
||||||
self.magnet_tray_length = self.specification_fixture_id.magnet_tray_length
|
|
||||||
self.magnet_tray_width = self.specification_fixture_id.magnet_tray_width
|
|
||||||
self.magnet_tray_height = self.specification_fixture_id.magnet_tray_height
|
|
||||||
self.magnet_tray_diameter = self.specification_fixture_id.magnet_tray_diameter
|
|
||||||
self.magnet_tray_weight = self.specification_fixture_id.magnet_tray_weight
|
|
||||||
self.magnet_max_adsorp_length = self.specification_fixture_id.magnet_max_adsorp_length
|
|
||||||
self.magnet_max_adsorp_width = self.specification_fixture_id.magnet_max_adsorp_width
|
|
||||||
self.magnet_max_adsorp_height = self.specification_fixture_id.magnet_max_adsorp_height
|
|
||||||
self.magnet_max_adsorp_diameter = self.specification_fixture_id.magnet_max_adsorp_diameter
|
|
||||||
self.magnet_max_adsorp_force = self.specification_fixture_id.magnet_max_adsorp_force
|
|
||||||
self.magnet_unlocking_method = self.specification_fixture_id.magnet_unlocking_method
|
|
||||||
self.magnet_flatness = self.specification_fixture_id.magnet_flatness
|
|
||||||
self.magnet_max_load = self.specification_fixture_id.magnet_max_load
|
|
||||||
# 定位隔板字段
|
|
||||||
self.length_outer = self.specification_fixture_id.length_outer
|
|
||||||
self.width_outer = self.specification_fixture_id.width_outer
|
|
||||||
self.length_inner = self.specification_fixture_id.length_inner
|
|
||||||
self.width_inner = self.specification_fixture_id.width_inner
|
|
||||||
self.thickness = self.specification_fixture_id.thickness
|
|
||||||
self.unit_location = self.specification_fixture_id.unit_location
|
|
||||||
self.offset_x = self.specification_fixture_id.offset_x
|
|
||||||
self.offset_y = self.specification_fixture_id.offset_y
|
|
||||||
self.materials_model_id_positioning = self.specification_fixture_id.materials_model_id_positioning
|
|
||||||
self.station_count = self.specification_fixture_id.station_count
|
|
||||||
# 气吸托盘字段
|
|
||||||
self.air_tray_length = self.specification_fixture_id.air_tray_length
|
|
||||||
self.air_tray_width = self.specification_fixture_id.air_tray_width
|
|
||||||
self.air_tray_height = self.specification_fixture_id.air_tray_height
|
|
||||||
self.air_tray_diameter = self.specification_fixture_id.air_tray_diameter
|
|
||||||
self.air_tray_weight = self.specification_fixture_id.air_tray_weight
|
|
||||||
self.air_max_adsorp_length = self.specification_fixture_id.air_max_adsorp_length
|
|
||||||
self.air_max_adsorp_width = self.specification_fixture_id.air_max_adsorp_width
|
|
||||||
self.air_max_adsorp_height = self.specification_fixture_id.air_max_adsorp_height
|
|
||||||
self.air_max_adsorp_diameter = self.specification_fixture_id.air_max_adsorp_diameter
|
|
||||||
self.air_max_adsorp_force = self.specification_fixture_id.air_max_adsorp_force
|
|
||||||
self.air_unlocking_method = self.specification_fixture_id.air_unlocking_method
|
|
||||||
self.air_flatness = self.specification_fixture_id.air_flatness
|
|
||||||
self.air_max_load = self.specification_fixture_id.air_max_load
|
|
||||||
self.air_boolean_chip_blowing_function = self.specification_fixture_id.air_boolean_chip_blowing_function
|
|
||||||
self.air_way_to_install = self.specification_fixture_id.air_way_to_install
|
|
||||||
|
|
||||||
class SfMaintenanceEquipmentAndProductTemplate(models.Model):
|
class SfMaintenanceEquipmentAndProductTemplate(models.Model):
|
||||||
_inherit = 'maintenance.equipment'
|
_inherit = 'maintenance.equipment'
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ from odoo import models
|
|||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
from odoo.addons.sf_base.commons.common import Common
|
from odoo.addons.sf_base.commons.common import Common
|
||||||
|
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@@ -1611,12 +1610,6 @@ class SyncfixtureMaterialsBasicParameters(models.Model):
|
|||||||
self._write_or_create(all_list.get('adapter_board_yesterday_list'), '转接板(锁板)夹具')
|
self._write_or_create(all_list.get('adapter_board_yesterday_list'), '转接板(锁板)夹具')
|
||||||
if all_list.get('scroll_chuck_all_list'):
|
if all_list.get('scroll_chuck_all_list'):
|
||||||
self._write_or_create(all_list.get('scroll_chuck_yesterday_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'), '磁吸托盘')
|
|
||||||
if all_list.get('positioning_partition_all_list'):
|
|
||||||
self._write_or_create(all_list.get('positioning_partition_all_list'), '定位隔板')
|
|
||||||
else:
|
else:
|
||||||
raise ValidationError("夹具型号基本参数认证未通过")
|
raise ValidationError("夹具型号基本参数认证未通过")
|
||||||
|
|
||||||
@@ -1645,12 +1638,6 @@ class SyncfixtureMaterialsBasicParameters(models.Model):
|
|||||||
self._write_or_create(all_list.get('adapter_board_all_list'), '转接板(锁板)夹具')
|
self._write_or_create(all_list.get('adapter_board_all_list'), '转接板(锁板)夹具')
|
||||||
if all_list.get('scroll_chuck_all_list'):
|
if all_list.get('scroll_chuck_all_list'):
|
||||||
self._write_or_create(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'), '磁吸托盘')
|
|
||||||
if all_list.get('positioning_partition_all_list'):
|
|
||||||
self._write_or_create(all_list.get('positioning_partition_all_list'), '定位隔板')
|
|
||||||
else:
|
else:
|
||||||
raise ValidationError("夹具型号基本参数认证未通过")
|
raise ValidationError("夹具型号基本参数认证未通过")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user