1.修复采购订单确认按钮显示问题2.修复涉及适合冷却方式字段的相关模型内该字段的过滤查询条件3.修改产品的适合刀柄型号字段类型4.修改销售订单的输入验证

This commit is contained in:
jinling.yang
2024-01-09 12:01:20 +08:00
parent 8239e53a76
commit 3c3ffa1ebc
8 changed files with 25 additions and 25 deletions

View File

@@ -89,8 +89,8 @@ class CuttingToolModel(models.Model):
'柄部类型', domain=[('type', '=', '柄部类型')])
cutting_direction_ids = fields.Many2many('maintenance.equipment.image', 'cutting_direction_library_rel',
'走刀方向', domain=[('type', '=', '走刀方向')])
suitable_coolant_ids = fields.Many2many('maintenance.equipment.image', 'suitable_coolant_library_rel',
'适合冷却', domain=[('type', '=', '冷却')])
suitable_coolant_ids = fields.Many2many('maintenance.equipment.image', 'suitable_coolants_library_rel',
'适合冷却方式', domain=[('type', '=', '冷却方式')])
compaction_way_id = fields.Many2one('maintenance.equipment.image',
'压紧方式', domain=[('type', '=', '压紧方式')])
integral_tool_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',

View File

@@ -338,7 +338,7 @@
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')],'readonly': [('id', '!=', False)]}"/>
<field name="cutting_tool_er_size_model"
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')],'readonly': [('id', '!=', False)]}"/>
<field name="cutting_tool_handle_ids" widget="many2many_tags"
<field name="cutting_tool_handle_id"
options="{'no_create': True}"
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')],'readonly': [('id', '!=', False)]}"/>
<field name="cooling_suit_type_ids"

View File

@@ -96,8 +96,8 @@ class ResProductMo(models.Model):
handle_type_id = fields.Many2one('maintenance.equipment.image', '柄部类型', domain=[('type', '=', '柄部类型')])
cutting_direction_ids = fields.Many2many('maintenance.equipment.image', 'rel_cutting_product_template',
'走刀方向', domain=[('type', '=', '走刀方向')])
suitable_coolant_ids = fields.Many2many('maintenance.equipment.image', 'rel_coolant_product_template',
'适合冷却', domain=[('type', '=', '冷却')])
suitable_coolant_ids = fields.Many2many('maintenance.equipment.image', 'rel_coolants_product_template',
'适合冷却方式', domain=[('type', '=', '冷却方式')])
compaction_way_id = fields.Many2one('maintenance.equipment.image',
'压紧方式', domain=[('type', '=', '压紧方式')])
@@ -201,7 +201,6 @@ class ResProductMo(models.Model):
self.feed_per_tooth_ids = self.cutting_tool_model_id.feed_per_tooth_ids.filtered(
lambda r: int(r.blade_diameter) == int(self.specification_id.blade_diameter))
elif self.cutting_tool_type == '夹头':
self.cutting_tool_clamping_tolerance = self.specification_id.clamping_tolerance
self.cutting_tool_clamping_diameter_min = self.specification_id.min_clamping_diameter
self.cutting_tool_clamping_diameter_min = self.specification_id.max_clamping_diameter
self.cutting_tool_clamping_way = self.specification_id.clamping_mode
@@ -212,7 +211,7 @@ class ResProductMo(models.Model):
self.cutting_tool_jump_accuracy = self.specification_id.run_out_accuracy
self.cutting_tool_max_load_capacity = self.specification_id.max_load_capacity
self.cutting_tool_er_size_model = self.specification_id.er_size_model
self.cutting_tool_handle_ids = self.cutting_tool_model_id.handle_ids
self.cutting_tool_handle_id = self.cutting_tool_model_id.handle_id.id
self.cooling_suit_type_ids = self.specification_id.cooling_jacket
elif self.cutting_tool_type == '刀片':
self.cutting_tool_total_length = self.specification_id.total_length
@@ -482,11 +481,17 @@ class ResProductMo(models.Model):
cooling_suit_type_ids = fields.Char('适用冷却套型号')
cutting_tool_max_load_capacity = fields.Float('最大负载能力(kg)')
cutting_tool_er_size_model = fields.Char('尺寸型号')
cutting_tool_handle_ids = fields.Many2many(
# cutting_tool_handle_ids = fields.Many2many(
# 'sf.cutting_tool.standard.library',
# relation='product_cutting_tool_library_chuck_handle_rel',
# column1='model_id_1',
# column2='model_id_2',
# domain="[('cutting_tool_type', '=', '刀柄')]",
# string='适用刀柄型号'
# )
cutting_tool_handle_id = fields.Many2one(
'sf.cutting_tool.standard.library',
relation='product_cutting_tool_library_chuck_handle_rel',
column1='model_id_1',
column2='model_id_2',
domain="[('cutting_tool_type', '=', '刀柄')]",
string='适用刀柄型号'
)
@@ -564,12 +569,6 @@ class ResProductMo(models.Model):
code_arr.append(i.code)
return code_arr
def _json_handle_item_code(self, item):
code_arr = []
for i in item.product_id.cutting_tool_handle_ids:
code_arr.append(i.code)
return code_arr
def _get_ids(self, param):
type_ids = []
if not param:

View File

@@ -97,7 +97,7 @@ class ReSaleOrder(models.Model):
raise UserError('请对【订单行】中的【计量单位】进行选择')
if line.price_unit == 0:
raise UserError('请对【订单行】中的【单价】进行输入')
if not line.taxes_id:
if not line.tax_id:
raise UserError('请对【订单行】中的【税】进行选择')

View File

@@ -11,7 +11,7 @@
</field>
<field name="currency_id" position="after">
<field name="check_status" invisible="1"/>
<!-- <field name="state"/>-->
<!-- <field name="state"/>-->
<field name="remark" attrs="{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['pending','approved'])]}"/>
</field>
@@ -25,9 +25,10 @@
<xpath expr="//form/header/button[@name='button_confirm'][2]" position="replace">
<button name="button_confirm" type="object" context="{'validate_analytic': True}"
string="确认订单" id="draft_confirm"
attrs="{'invisible': ['|','&amp;','&amp;', ('state', 'in', ['purchase']), ('check_status', 'in', ['approved']), ('date_approve', '!=', False),'&amp;', '&amp;',('state', 'in', ['purchase', 'draft']),('check_status', 'in', [False, 'pending', 'fail']),('date_approve', '=', False)]}"
/>
<button name="button_confirming" type="object"
string="确认"
string="确认订单"
attrs="{'invisible': ['&amp;',('check_status','!=', False),('state', 'not in', ['draft','send'])]}"
/>
</xpath>

View File

@@ -47,7 +47,7 @@
action="action_quotations_with_onboarding_inherit_sf"
groups="sales_team.group_sale_salesman,sf_base.group_sale_salemanager,sf_base.group_sale_director"
parent="sale.sale_order_menu"
sequence="10"/>
sequence="11"/>
<record model="ir.ui.view" id="view_sale_order_form_inherit_sf">
<field name="name">sale.order.form.inherit.sf</field>

View File

@@ -287,8 +287,8 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
'maintenance.equipment.image', 'rel_cutting_product_template_distribution', '走刀方向',
domain=[('type', '=', '走刀方向')], related='sf_functional_cutting_tool_entity_ids.cutting_direction_ids')
suitable_coolant_ids = fields.Many2many(
'maintenance.equipment.image', 'rel_coolant_product_template_distribution', '适合冷却方式',
domain=[('type', '=', '冷却')], related='sf_functional_cutting_tool_entity_ids.suitable_coolant_ids')
'maintenance.equipment.image', 'rel_coolants_product_template_distribution', '适合冷却方式',
domain=[('type', '=', '冷却方式')], related='sf_functional_cutting_tool_entity_ids.suitable_coolant_ids')
sf_functional_cutting_tool_entity_ids = fields.Many2many('sf.functional.cutting.tool.entity',
'sf_functional_cutting_tool_entity_ref',

View File

@@ -108,8 +108,8 @@ class SfToolMaterialSearch(models.Model):
'rel_cutting_product_template_material_search', '走刀方向',
domain=[('type', '=', '走刀方向')])
suitable_coolant_ids = fields.Many2many('maintenance.equipment.image',
'rel_coolant_product_template_material_search', '适合冷却',
domain=[('type', '=', '冷却')])
'rel_coolants_product_template_material_search', '适合冷却方式',
domain=[('type', '=', '冷却方式')])
cutting_speed_ids = fields.Many2many('sf.cutting.speed', string='切削速度Vc')
feed_per_tooth_ids = fields.Many2many('sf.feed.per.tooth', 'rel_feed_per_tooth_ids', '每齿走刀量fz')