1.产品新增计划岗权限,页面部分字段新增只读控制2.采购优化确认订单按钮

This commit is contained in:
jinling.yang
2023-12-25 15:15:35 +08:00
parent 6d93d5ef87
commit 97e36c249b
4 changed files with 167 additions and 156 deletions

View File

@@ -7,7 +7,7 @@
<field name="inherit_id" ref="sf_sale.view_product_template_form_inherit_sf"/>
<field name="arch" type="xml">
<field name="invoice_policy" position="after">
<field name='categ_id'/>
<field name='categ_id' attrs="{'readonly': [('categ_id', '!=', False)]}"/>
<field name='is_bfm' invisible="1"/>
<field name='categ_type' invisible="1"/>
<field name="upload_model_file"
@@ -18,28 +18,32 @@
<field name='cutting_tool_type' invisible="1"/>
<field name="fixture_material_type" invisible="1"/>
<field name="embryo_model_type_id" string="模型类型"
attrs="{'invisible': ['|',('categ_type', '!=', '坯料'),('categ_type', '=', False)]}"/>
attrs="{'invisible': ['|',('categ_type', '!=', '坯料'),('categ_type', '=', False)],'readonly': [('categ_id', '!=', False)]}"/>
<field name="materials_id" string="材料" placeholder="请选择"
attrs="{'invisible': [('categ_type', 'not in', ['成品','坯料', '原材料'])]}"/>
attrs="{'invisible': [('categ_type', 'not in', ['成品','坯料', '原材料'])],'readonly': [('categ_id', '!=', False)]}"/>
<field name="materials_type_id" string="型号" placeholder="请选择"
domain="[('materials_id', '=', materials_id)]"
attrs="{'invisible': [('categ_type', 'not in', ['成品','坯料', '原材料'])]}"/>
attrs="{'invisible': [('categ_type', 'not in', ['成品','坯料', '原材料'])],'readonly': [('categ_id', '!=', False)]}"/>
<field name="server_product_process_parameters_id" string="表面工艺参数"
options="{'no_create': True}"
attrs="{'invisible': ['|',('categ_type', '!=', '表面工艺'),('categ_type', '=', False)]}"/>
<field name="cutting_tool_material_id" attrs="{'invisible': [('categ_type', '!=', '刀具')]}"
<field name="cutting_tool_material_id"
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('categ_id', '!=', False)]}"
placeholder="请选择"/>
<field name="cutting_tool_model_id" placeholder="请选择"
attrs="{'invisible': [('categ_type', '!=', '刀具')]}"
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('categ_id', '!=', False)]}"
domain="[('cutting_tool_material_id','=',cutting_tool_material_id)]"/>
<field name="specification_id" placeholder="请选择" options='{"limit": 1}'
attrs="{'invisible': [('categ_type', '!=', '刀具')]}"
<field name="specification_id" placeholder="请选择"
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('categ_id', '!=', False)]}"
domain="[('standard_library_id','=',cutting_tool_model_id)]"/>
<field name="fixture_material_id" attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
placeholder="请选择"/>
<field name="fixture_model_id" string="型号" placeholder="请选择"
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
domain="[('fixture_material_id','=',fixture_material_id)]"/>
<field name="name" position="attributes">
<attribute name="attrs">{'readonly': [('categ_id', '!=', False)]}</attribute>
</field>
</field>
<xpath expr="//label[@for='volume']" position="before">
@@ -91,48 +95,51 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<field name="barcode" position="replace">
<field name="barcode" position="replace">
<field name='barcode' invisible="1"/>
</field>
<field name="default_code" position="replace">
<field name='default_code' invisible="1"/>
</field>
<xpath expr="//page[@name='variants']" position="before">
<page string="刀具物料参数" attrs="{'invisible': [('categ_type', '!=', '刀具')]}">
<page string="刀具物料参数"
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('categ_type', '=', '刀具')]}">
<group>
<group attrs="{'invisible': [('categ_type', '!=', '刀具')]}" col="1">
<field name="cutting_tool_type_id" options="{'no_create': True}"
placeholder="请选择"/>
<field name="brand_id" options="{'no_create': True}" placeholder="请选择"/>
placeholder="请选择" attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="brand_id" options="{'no_create': True}" placeholder="请选择"
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_total_length"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','夹头','刀柄'))]}"/>
<field name="tool_hardness" string="硬度(hrc)"/>
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','夹头','刀柄'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="tool_hardness" string="硬度(hrc)"
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
<label for="cutting_tool_run_out_accuracy_min" string="端跳精度"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<div class="o_address_format"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}">
<label for="cutting_tool_run_out_accuracy_min" string="最小"/>
<field name="cutting_tool_run_out_accuracy_min" class="o_address_zip"
options="{'format': false}"
attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<span>(mm)&amp;nbsp;</span>
<label for="cutting_tool_run_out_accuracy_max" string="最大"/>
<field name="cutting_tool_run_out_accuracy_max" class="o_address_zip"
options="{'format': false}"
attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<span>(mm)&amp;nbsp;</span>
</div>
<field name="tool_width"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="tool_height"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_flange_length"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_shank_outer_diameter"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_shank_inner_diameter"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('categ_type', '=', '刀具')]}"/>
<!-- <field name="materials_type_id" options="{'no_create': True}" string="刀具材质"-->
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"-->
@@ -151,58 +158,61 @@
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>-->
<field name="cutting_tool_blade_diameter" string="刃部直径(mm)" class="diameter"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_length"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_width"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_depth"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_helix_angle"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_number" placeholder="请选择"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_tip_working_size"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_tip_diameter" string="刀尖直径(mm)" class="diameter"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_tip_taper" string="刀尖锥度(°)"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<!--刀片-->
<label for="tool_length" string="尺寸(mm)"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<div class="test_model"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}">
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}">
<label for="tool_length" string="长"/>
<field name="tool_length" class="o_address_zip"
options="{'format': false}"/>
options="{'format': false}"
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
<label for="tool_thickness" string="厚"/>
<field name="tool_thickness" class="o_address_zip"
options="{'format': false}"/>
options="{'format': false}"
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
<label for="tool_width" string="宽"/>
<field name="tool_width" class="o_address_zip"
options="{'format': false}"/>
options="{'format': false}"
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
</div>
<field name="cutting_tool_cut_blade_length"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_tip_circular_arc_radius"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_tip_height_tolerance"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_inscribed_circle_diameter"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_inscribed_circle_tolerance"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_install_aperture_diameter"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_chip_breaker_groove"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_cut_depth_max"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_blade_number" string="刃数"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_width" string="刃宽"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<!--刀杆-->
<label for="cutting_tool_knife_head_length" string="刀头尺寸(mm)"
@@ -211,35 +221,38 @@
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}">
<label for="cutting_tool_knife_head_length" string="长"/>
<field name="cutting_tool_knife_head_length" class="o_address_zip"
options="{'format': false}"/>
options="{'format': false}"
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
<label for="cutting_tool_knife_head_width" string="宽"/>
<field name="cutting_tool_knife_head_width" class="o_address_zip"
options="{'format': false}"/>
options="{'format': false}"
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
<label for="cutting_tool_knife_head_height" string="高"/>
<field name="cutting_tool_knife_head_height" class="o_address_zip"
options="{'format': false}"/>
options="{'format': false}"
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
</div>
<field name="cutting_tool_blade_diameter" string="刃部直径(mm)" class="diameter"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_length"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_cutter_arbor_diameter"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_cut_blade_length" string="切削刃长度(mm)"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_cut_depth_max"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_min_machining_aperture"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_install_blade_tip_num"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')],'readonly': [('categ_type', '=', '刀具')]}"/>
<!--刀盘-->
<field name="cutting_tool_cutter_head_diameter"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_interface_diameter"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')],'readonly': [('categ_type', '=', '刀具')]}"/>
<!--夹头-->
<field name="cutting_tool_clamping_length"
@@ -253,177 +266,185 @@
<label for="cutting_tool_clamping_diameter_min" string="最小"/>
<field name="cutting_tool_clamping_diameter_min" class="o_address_zip diameter"
options="{'format': false}"
attrs="{'required': [('cutting_tool_type','not in',('夹头','刀柄'))]}"/>
attrs="{'required': [('cutting_tool_type','not in',('夹头','刀柄'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<span>(mm)&amp;nbsp;</span>
<label for="cutting_tool_clamping_diameter_max" string="最大"/>
<field name="cutting_tool_clamping_diameter_max" class="o_address_zip diameter"
options="{'format': false}"
attrs="{'required': [('cutting_tool_type','not in',('夹头','刀柄'))]}"/>
attrs="{'required': [('cutting_tool_type','not in',('夹头','刀柄'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<span>(mm)&amp;nbsp;</span>
</div>
<field name="cutting_tool_clamping_way"
attrs="{'invisible': [('cutting_tool_type','not in',('刀柄','夹头'))]}"/>
attrs="{'invisible': [('cutting_tool_type','not in',('刀柄','夹头'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_top_diameter" class="diameter"
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
attrs="{'invisible': [('cutting_tool_type','not in',('夹头'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_outer_diameter" class="diameter"
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
attrs="{'invisible': [('cutting_tool_type','not in',('夹头'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_inner_diameter" class="diameter"
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
attrs="{'invisible': [('cutting_tool_type','not in',('夹头'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<!--夹头-->
<field name="cutting_tool_standard_speed"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_speed_max"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_change_time"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_cooling_type"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('categ_type', '=', '刀具')]}"/>
</group>
<group attrs="{'invisible': [('categ_type', '!=', '刀具')]}">
<group attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('categ_type', '=', '刀具')]}">
<field name="materials_type_id" options="{'no_create': True}" placeholder="请选择"
string="材质"/>
<field name="coating_material"/>
string="材质" attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="coating_material" attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_type"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_coarse_medium_fine" string="粗/中/精" placeholder="请选择"
attrs="{'required': [('cutting_tool_type','=','整体式刀具')],'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
attrs="{'required': [('cutting_tool_type','=','整体式刀具')],'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<!--整体式刀具-->
<field name="cutting_tool_shank_diameter" string="柄部直径(mm)" class="diameter"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_shank_length"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_neck_diameter" string="颈部直径(mm)" class="diameter"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_neck_length" string="颈部长度(mm)"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_cut_depth"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_pitch"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="tool_weight"
attrs='{"invisible": [("cutting_tool_type","not in",("夹头","刀柄"))]}'/>
attrs='{"invisible": [("cutting_tool_type","not in",("夹头","刀柄"))],"readonly": [("categ_type", "=", "刀具")]}'/>
<field name="cutting_tool_taper"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头','刀柄'))]}"/>
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头','刀柄'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_jump_accuracy"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_rear_angle"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_main_included_angle"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片','刀杆'))]}"/>
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片','刀杆'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<!-- <field name="cutting_tool_front_angle"-->
<!-- attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>-->
<field name="cutting_tool_top_angle"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_tip_dip_angle"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_side_cutting_edge_angle"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_pitch"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_bladed_teeth_model"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_thickness_tolerance"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_thread_model"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_thread_num"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_cutter_bar_ids" widget="many2many_tags"
options="{'no_create': True}"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_cutter_pad_ids" widget="many2many_tags"
options="{'no_create': True}"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
<!--刀柄-->
<field name="cutting_tool_is_rough_finish"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_is_finish"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_is_drill_hole"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_is_high_speed_cutting"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_is_safety_lock" string="有无安全锁"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_jump_accuracy" string="跳动精度(mm)"
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_max_load_capacity"
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_er_size_model"
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_handle_ids" widget="many2many_tags"
options="{'no_create': True}"
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cooling_suit_type_ids"
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')],'readonly': [('categ_type', '=', '刀具')]}"/>
<!-- 刀杆 -->
<field name="cutting_tool_rear_angle"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_installing_structure"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_is_cooling_hole"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_locating_slot_code"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_ids" widget="many2many_tags"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_tool_shim"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_cotter_pin"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_pressing_plate"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_screw"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀柄'))]}"/>
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀柄'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_wrench"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀柄'))]}"/>
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀柄'))],'readonly': [('categ_type', '=', '刀具')]}"/>
<!-- 刀盘 -->
<field name="cutting_tool_blade_ids" widget="many2many_tags"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')],'readonly': [('categ_type', '=', '刀具')]}"/>
<field name="cutting_tool_blade_ids" widget="many2many_tags"
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}"/>
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')],'readonly': [('categ_type', '=', '刀具')]}"/>
</group>
</group>
<group string="适配刀片形状"
attrs="{'invisible': [('cutting_tool_type', 'in', ('刀柄','夹头','整体式刀具',False))]}">
<field name="fit_blade_shape_id" string="" widget="many2one_radio"/>
<field name="fit_blade_shape_id" string="" widget="many2one_radio"
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
</group>
<group string="适合加工方式"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
<field name="suitable_machining_method_ids" string=""
attrs="{'readonly': [('categ_type', '=', '刀具')]}"
widget="custom_many2many_checkboxes"/>
</group>
<group string="刀尖特征"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
<field name="blade_tip_characteristics_id" string=""
attrs="{'readonly': [('categ_type', '=', '刀具')]}"
widget="many2one_radio"/>
</group>
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
<group string="柄部类型"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
<field name="handle_type_id" string="" widget="many2one_radio"/>
<field name="handle_type_id" string="" widget="many2one_radio"
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
</group>
<group string="压紧方式"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}">
<field name="compaction_way_id" string="" widget="many2one_radio"/>
<field name="compaction_way_id" string="" widget="many2one_radio"
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
</group>
</group>
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
<group string="走刀方向">
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"/>
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
</group>
<group string="适合冷却液">
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"/>
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
</group>
</group>
<notebook>
<page string="切削速度Vc"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}">
<field name="cutting_speed_ids" string="" widget="one2many">
<field name="cutting_speed_ids" string="" widget="one2many"
attrs="{'readonly': [('categ_type', '=', '刀具')]}">
<tree editable="bottom">
<!-- <field name="order"/>-->
<field name="execution_standard_id"/>
@@ -444,8 +465,9 @@
</field>
</page>
<page string="每齿走刀量fz"
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}">
<field name="feed_per_tooth_ids" string="" widget="one2many">
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))],'readonly': [('categ_type', '=', '刀具')]}">
<field name="feed_per_tooth_ids" string="" widget="one2many"
attrs="{'readonly': [('categ_type', '=', '刀具')]}">
<tree editable="bottom">
<field name="cutting_speed"
attrs="{'readonly': [('materials_type_id','!=',False)]}"/>

View File

@@ -101,23 +101,9 @@ class RePurchaseOrder(models.Model):
vals['check_status'] = 'approved'
return super().write(vals)
# @api.model_create_multi
# def create(self, vals_list):
# # res = super().create(vals_list)
# if self.env.user.has_group('sf_base.group_purchase'):
# view = self.env.ref('sf_sale.action_purchase_order_submit_wizard')
# return {
# 'name': _('确认?'),
# 'type': 'ir.actions.act_window',
# 'view_mode': 'form',
# 'res_model': 'purchase.order.wizard',
# 'views': [(view.id, 'form')],
# 'view_id': view.id,
# 'target': 'new',
# 'context': dict(self.env.context),
# }
# res = super().create(vals_list)
# return res
def button_confirm(self):
self.check_status = 'pending'
return super().button_confirm()
class ResPartnerToSale(models.Model):

View File

@@ -9,9 +9,11 @@ access_crm_team_member_manager,crm_team_manager,sales_team.model_crm_team,sf_bas
access_crm_team_member_director,crm_team_member_director,sales_team.model_crm_team_member,sf_base.group_sale_director,1,1,1,0
access_res_users,res_users,base.model_res_users,sf_base.group_sale_director,1,1,1,0
access_product_template_group_sale_salemanager,product_template_group_sale_salemanager,product.model_product_template,sf_base.group_sale_salemanager,1,0,0,0
access_product_template_group_sale_director,product_template_group_sale_director,product.model_product_template,sf_base.group_sale_director,1,0,0,0
access_product_template_group_sale_director,product_template_group_sale_director,product.model_product_template,sf_base.group_sale_director,1,1,1,0
access_product_template_group_purchase,product_template_group_purchase,product.model_product_template,sf_base.group_purchase,1,0,0,0
access_product_template_group_purchase_director,product_template_group_purchase_director,product.model_product_template,sf_base.group_purchase_director,1,0,0,0
access_product_template_group_purchase_director,product_template_group_purchase_director,product.model_product_template,sf_base.group_purchase_director,1,1,1,0
access_product_template_group_plan_dispatch,product_template_group_plan_dispatch,product.model_product_template,sf_base.group_plan_dispatch,1,0,0,0
access_product_template_group_plan_director,product_template_group_plan_director,product.model_product_template,sf_base.group_plan_director,1,1,1,0
access_stock_picking_group_sale_salemanager,stock_picking_group_sale_salemanager,stock.model_stock_picking,sf_base.group_sale_salemanager,1,0,0,0
access_stock_picking_group_sale_director,stock_picking_group_sale_director,stock.model_stock_picking,sf_base.group_sale_director,1,0,0,0
access_stock_picking_group_purchase,stock_picking_group_purchase,stock.model_stock_picking,sf_base.group_purchase,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
9 access_crm_team_member_director crm_team_member_director sales_team.model_crm_team_member sf_base.group_sale_director 1 1 1 0
10 access_res_users res_users base.model_res_users sf_base.group_sale_director 1 1 1 0
11 access_product_template_group_sale_salemanager product_template_group_sale_salemanager product.model_product_template sf_base.group_sale_salemanager 1 0 0 0
12 access_product_template_group_sale_director product_template_group_sale_director product.model_product_template sf_base.group_sale_director 1 0 1 0 1 0
13 access_product_template_group_purchase product_template_group_purchase product.model_product_template sf_base.group_purchase 1 0 0 0
14 access_product_template_group_purchase_director product_template_group_purchase_director product.model_product_template sf_base.group_purchase_director 1 0 1 0 1 0
15 access_product_template_group_plan_dispatch product_template_group_plan_dispatch product.model_product_template sf_base.group_plan_dispatch 1 0 0 0
16 access_product_template_group_plan_director product_template_group_plan_director product.model_product_template sf_base.group_plan_director 1 1 1 0
17 access_stock_picking_group_sale_salemanager stock_picking_group_sale_salemanager stock.model_stock_picking sf_base.group_sale_salemanager 1 0 0 0
18 access_stock_picking_group_sale_director stock_picking_group_sale_director stock.model_stock_picking sf_base.group_sale_director 1 0 0 0
19 access_stock_picking_group_purchase stock_picking_group_purchase stock.model_stock_picking sf_base.group_purchase 1 0 0 0

View File

@@ -9,7 +9,8 @@
<field name="currency_id" position="after">
<field name="check_status" invisible="1"/>
<!-- <field name="state"/>-->
<field name="remark"/>
<field name="remark" attrs="{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['pending','approved'])]}"/>
</field>
<xpath expr="//form/header/button[@name='action_rfq_send'][1]" position="after">
<button name="sf_sale.action_purchase_order_check_wizard" string="审核" type="action"
@@ -20,7 +21,7 @@
<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;',('check_status','in', ['approved','fail']),('state', 'in', ['draft','purchase']),('check_status','=',False ),('state', 'in', ['purchase'])]}"
attrs="{'invisible': ['|','&amp;',('check_status','in', ['approved','fail','pending']),('state', 'in', ['draft','purchase']),('state', 'in', ['purchase'])]}"
/>
</xpath>
@@ -65,42 +66,42 @@
</xpath>
<xpath expr="//field[@name='order_line']" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['approved'])]}
['pending','approved'])]}
</attribute>
</xpath>
<field name="partner_ref" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['approved'])]}
['pending','approved'])]}
</attribute>
</field>
<field name="date_planned" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['approved'])]}
['pending','approved'])]}
</attribute>
</field>
<field name="receipt_reminder_email" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['approved'])]}
['pending','approved'])]}
</attribute>
</field>
<field name="user_id" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['approved'])]}
['pending','approved'])]}
</attribute>
</field>
<field name="origin" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['approved'])]}
['pending','approved'])]}
</attribute>
</field>
<field name="payment_term_id" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['approved'])]}
['pending','approved'])]}
</attribute>
</field>
<field name="fiscal_position_id" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['approved'])]}
['pending','approved'])]}
</attribute>
</field>
</field>
@@ -114,12 +115,12 @@
<field name="arch" type="xml">
<field name="incoterm_id" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['approved'])]}
['pending','approved'])]}
</attribute>
</field>
<field name="incoterm_location" position="attributes">
<attribute name="attrs">{'readonly': ['&amp;',('state', 'in', ['purchase']),('check_status','in',
['approved'])]}
['pending','approved'])]}
</attribute>
</field>
</field>