Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造代码优化
# Conflicts: # odoo.conf
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
""",
|
""",
|
||||||
'category': 'sf',
|
'category': 'sf',
|
||||||
'website': 'https://www.sf.jikimo.com',
|
'website': 'https://www.sf.jikimo.com',
|
||||||
'depends': ['account', 'base', 'mrp_workorder', 'sale', 'purchase', 'sales_team'],
|
'depends': ['base', 'mrp_workorder', 'sale', 'purchase', 'sales_team'],
|
||||||
'data': [
|
'data': [
|
||||||
'security/group_security.xml',
|
'security/group_security.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
|
|||||||
@@ -42,11 +42,53 @@
|
|||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
<page name="inventory" position="attributes">
|
<page name="inventory" position="attributes">
|
||||||
<attribute name="groups">stock.group_stock_user,product.group_stock_packaging</attribute>
|
<attribute name="groups">
|
||||||
|
stock.group_stock_user,product.group_stock_packaging,sf_base.group_sale_salemanager,sf_base.group_sale_director,sf_base.group_purchase,sf_base.group_purchase_director
|
||||||
|
</attribute>
|
||||||
</page>
|
</page>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="product_template_form_view_procurement_button_inherit_sf" model="ir.ui.view">
|
||||||
|
<field name="name">product.template_procurement.form.inherit.sf</field>
|
||||||
|
<field name="model">product.template</field>
|
||||||
|
<field name="inherit_id" ref="stock.product_template_form_view_procurement_button"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//button[@name='action_open_quants']" position="attributes">
|
||||||
|
<attribute name="groups">
|
||||||
|
stock.group_stock_user,sf_base.group_sale_salemanager,sf_base.group_sale_director,sf_base.group_purchase,sf_base.group_purchase_director
|
||||||
|
</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//button[@name='action_product_tmpl_forecast_report']" position="attributes">
|
||||||
|
<attribute name="groups">
|
||||||
|
stock.group_stock_user,sf_base.group_sale_salemanager,sf_base.group_sale_director,sf_base.group_purchase,sf_base.group_purchase_director
|
||||||
|
</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//button[@name='action_view_stock_move_lines']" position="attributes">
|
||||||
|
<attribute name="groups">
|
||||||
|
stock.group_stock_user,sf_base.group_sale_salemanager,sf_base.group_sale_director,sf_base.group_purchase,sf_base.group_purchase_director
|
||||||
|
</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//button[@name='action_view_orderpoints']" position="attributes">
|
||||||
|
<attribute name="groups">
|
||||||
|
stock.group_stock_user,sf_base.group_sale_salemanager,sf_base.group_sale_director,sf_base.group_purchase,sf_base.group_purchase_director
|
||||||
|
</attribute>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
<xpath expr="//button[@name='action_view_related_putaway_rules']" position="attributes">
|
||||||
|
<attribute name="groups">
|
||||||
|
stock.group_stock_user,sf_base.group_sale_salemanager,sf_base.group_sale_director,sf_base.group_purchase,sf_base.group_purchase_director
|
||||||
|
</attribute>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
<!-- <xpath expr="//button[@name='action_view_orderpoints']" position="attributes">-->
|
||||||
|
<!-- <attribute name="groups">-->
|
||||||
|
<!-- stock.group_stock_user,sf_base.group_sale_salemanager,sf_base.group_sale_director,sf_base.group_purchase,sf_base.group_purchase_director-->
|
||||||
|
<!-- </attribute>-->
|
||||||
|
<!-- </xpath>-->
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<record id="view_mrp_bom_form_inherit_sf" model="ir.ui.view">
|
<record id="view_mrp_bom_form_inherit_sf" model="ir.ui.view">
|
||||||
<field name="name">mrp.bom.form.inherit.sf</field>
|
<field name="name">mrp.bom.form.inherit.sf</field>
|
||||||
<field name="model">mrp.bom</field>
|
<field name="model">mrp.bom</field>
|
||||||
@@ -80,5 +122,6 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -14,6 +14,14 @@
|
|||||||
<field name="company_id" ref="base.main_company"/>
|
<field name="company_id" ref="base.main_company"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="stock_location_tool_assembly" model="stock.location">
|
||||||
|
<field name="name">刀具组装位置</field>
|
||||||
|
<field name="usage">internal</field>
|
||||||
|
<field name="barcode">DJZZ</field>
|
||||||
|
<field name="active">true</field>
|
||||||
|
<field name="company_id" ref="base.main_company"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
<record id="after_assembly_picking_in" model="stock.picking.type">
|
<record id="after_assembly_picking_in" model="stock.picking.type">
|
||||||
<field name="name">刀具组装入库</field>
|
<field name="name">刀具组装入库</field>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<field name="inherit_id" ref="sf_sale.view_product_template_form_inherit_sf"/>
|
<field name="inherit_id" ref="sf_sale.view_product_template_form_inherit_sf"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="invoice_policy" position="after">
|
<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='is_bfm' invisible="1"/>
|
||||||
<field name='categ_type' invisible="1"/>
|
<field name='categ_type' invisible="1"/>
|
||||||
<field name="upload_model_file"
|
<field name="upload_model_file"
|
||||||
@@ -18,28 +18,32 @@
|
|||||||
<field name='cutting_tool_type' invisible="1"/>
|
<field name='cutting_tool_type' invisible="1"/>
|
||||||
<field name="fixture_material_type" invisible="1"/>
|
<field name="fixture_material_type" invisible="1"/>
|
||||||
<field name="embryo_model_type_id" string="模型类型"
|
<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="请选择"
|
<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="请选择"
|
<field name="materials_type_id" string="型号" placeholder="请选择"
|
||||||
domain="[('materials_id', '=', materials_id)]"
|
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="表面工艺参数"
|
<field name="server_product_process_parameters_id" string="表面工艺参数"
|
||||||
options="{'no_create': True}"
|
options="{'no_create': True}"
|
||||||
attrs="{'invisible': ['|',('categ_type', '!=', '表面工艺'),('categ_type', '=', False)]}"/>
|
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="请选择"/>
|
placeholder="请选择"/>
|
||||||
<field name="cutting_tool_model_id" 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)]"/>
|
domain="[('cutting_tool_material_id','=',cutting_tool_material_id)]"/>
|
||||||
<field name="specification_id" placeholder="请选择" options='{"limit": 1}'
|
<field name="specification_id" placeholder="请选择"
|
||||||
attrs="{'invisible': [('categ_type', '!=', '刀具')]}"
|
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('categ_id', '!=', False)]}"
|
||||||
domain="[('standard_library_id','=',cutting_tool_model_id)]"/>
|
domain="[('standard_library_id','=',cutting_tool_model_id)]"/>
|
||||||
<field name="fixture_material_id" attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
<field name="fixture_material_id" attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||||
placeholder="请选择"/>
|
placeholder="请选择"/>
|
||||||
<field name="fixture_model_id" string="型号" placeholder="请选择"
|
<field name="fixture_model_id" string="型号" placeholder="请选择"
|
||||||
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||||
domain="[('fixture_material_id','=',fixture_material_id)]"/>
|
domain="[('fixture_material_id','=',fixture_material_id)]"/>
|
||||||
|
<field name="name" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': [('categ_id', '!=', False)]}</attribute>
|
||||||
|
</field>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<xpath expr="//label[@for='volume']" position="before">
|
<xpath expr="//label[@for='volume']" position="before">
|
||||||
@@ -98,41 +102,44 @@
|
|||||||
<field name='default_code' invisible="1"/>
|
<field name='default_code' invisible="1"/>
|
||||||
</field>
|
</field>
|
||||||
<xpath expr="//page[@name='variants']" position="before">
|
<xpath expr="//page[@name='variants']" position="before">
|
||||||
<page string="刀具物料参数" attrs="{'invisible': [('categ_type', '!=', '刀具')]}">
|
<page string="刀具物料参数"
|
||||||
|
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('categ_type', '=', '刀具')]}">
|
||||||
<group>
|
<group>
|
||||||
<group attrs="{'invisible': [('categ_type', '!=', '刀具')]}" col="1">
|
<group attrs="{'invisible': [('categ_type', '!=', '刀具')]}" col="1">
|
||||||
<field name="cutting_tool_type_id" options="{'no_create': True}"
|
<field name="cutting_tool_type_id" options="{'no_create': True}"
|
||||||
placeholder="请选择"/>
|
placeholder="请选择" attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<field name="brand_id" options="{'no_create': True}" placeholder="请选择"/>
|
<field name="brand_id" options="{'no_create': True}" placeholder="请选择"
|
||||||
|
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<field name="cutting_tool_total_length"
|
<field name="cutting_tool_total_length"
|
||||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','夹头','刀柄'))]}"/>
|
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','夹头','刀柄'))],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<field name="tool_hardness" string="硬度(hrc)"/>
|
<field name="tool_hardness" string="硬度(hrc)"
|
||||||
|
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<label for="cutting_tool_run_out_accuracy_min" string="端跳精度"
|
<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"
|
<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="最小"/>
|
<label for="cutting_tool_run_out_accuracy_min" string="最小"/>
|
||||||
<field name="cutting_tool_run_out_accuracy_min" class="o_address_zip"
|
<field name="cutting_tool_run_out_accuracy_min" class="o_address_zip"
|
||||||
options="{'format': false}"
|
options="{'format': false}"
|
||||||
attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}"/>
|
attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<span>(mm)&nbsp;</span>
|
<span>(mm)&nbsp;</span>
|
||||||
<label for="cutting_tool_run_out_accuracy_max" string="最大"/>
|
<label for="cutting_tool_run_out_accuracy_max" string="最大"/>
|
||||||
<field name="cutting_tool_run_out_accuracy_max" class="o_address_zip"
|
<field name="cutting_tool_run_out_accuracy_max" class="o_address_zip"
|
||||||
options="{'format': false}"
|
options="{'format': false}"
|
||||||
attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}"/>
|
attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<span>(mm)&nbsp;</span>
|
<span>(mm)&nbsp;</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<field name="tool_width"
|
<field name="tool_width"
|
||||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<field name="tool_height"
|
<field name="tool_height"
|
||||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<field name="cutting_tool_flange_length"
|
<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"
|
<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"
|
<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="刀具材质"-->
|
<!-- <field name="materials_type_id" options="{'no_create': True}" string="刀具材质"-->
|
||||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"-->
|
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"-->
|
||||||
@@ -151,58 +158,61 @@
|
|||||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>-->
|
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>-->
|
||||||
|
|
||||||
<field name="cutting_tool_blade_diameter" string="刃部直径(mm)" class="diameter"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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="请选择"
|
<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"
|
<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"
|
<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="刀尖锥度(°)"
|
<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)"
|
<label for="tool_length" string="尺寸(mm)"
|
||||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<div class="test_model"
|
<div class="test_model"
|
||||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}">
|
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}">
|
||||||
<label for="tool_length" string="长"/>
|
<label for="tool_length" string="长"/>
|
||||||
<field name="tool_length" class="o_address_zip"
|
<field name="tool_length" class="o_address_zip"
|
||||||
options="{'format': false}"/>
|
options="{'format': false}"
|
||||||
|
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<label for="tool_thickness" string="厚"/>
|
<label for="tool_thickness" string="厚"/>
|
||||||
<field name="tool_thickness" class="o_address_zip"
|
<field name="tool_thickness" class="o_address_zip"
|
||||||
options="{'format': false}"/>
|
options="{'format': false}"
|
||||||
|
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<label for="tool_width" string="宽"/>
|
<label for="tool_width" string="宽"/>
|
||||||
<field name="tool_width" class="o_address_zip"
|
<field name="tool_width" class="o_address_zip"
|
||||||
options="{'format': false}"/>
|
options="{'format': false}"
|
||||||
|
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
</div>
|
</div>
|
||||||
<field name="cutting_tool_cut_blade_length"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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="刃数"
|
<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="刃宽"
|
<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)"
|
<label for="cutting_tool_knife_head_length" string="刀头尺寸(mm)"
|
||||||
@@ -211,35 +221,38 @@
|
|||||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}">
|
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}">
|
||||||
<label for="cutting_tool_knife_head_length" string="长"/>
|
<label for="cutting_tool_knife_head_length" string="长"/>
|
||||||
<field name="cutting_tool_knife_head_length" class="o_address_zip"
|
<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="宽"/>
|
<label for="cutting_tool_knife_head_width" string="宽"/>
|
||||||
<field name="cutting_tool_knife_head_width" class="o_address_zip"
|
<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="高"/>
|
<label for="cutting_tool_knife_head_height" string="高"/>
|
||||||
<field name="cutting_tool_knife_head_height" class="o_address_zip"
|
<field name="cutting_tool_knife_head_height" class="o_address_zip"
|
||||||
options="{'format': false}"/>
|
options="{'format': false}"
|
||||||
|
attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
</div>
|
</div>
|
||||||
<field name="cutting_tool_blade_diameter" string="刃部直径(mm)" class="diameter"
|
<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"
|
<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"
|
<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)"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"
|
<field name="cutting_tool_clamping_length"
|
||||||
@@ -253,177 +266,185 @@
|
|||||||
<label for="cutting_tool_clamping_diameter_min" string="最小"/>
|
<label for="cutting_tool_clamping_diameter_min" string="最小"/>
|
||||||
<field name="cutting_tool_clamping_diameter_min" class="o_address_zip diameter"
|
<field name="cutting_tool_clamping_diameter_min" class="o_address_zip diameter"
|
||||||
options="{'format': false}"
|
options="{'format': false}"
|
||||||
attrs="{'required': [('cutting_tool_type','not in',('夹头','刀柄'))]}"/>
|
attrs="{'required': [('cutting_tool_type','not in',('夹头','刀柄'))],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<span>(mm)&nbsp;</span>
|
<span>(mm)&nbsp;</span>
|
||||||
<label for="cutting_tool_clamping_diameter_max" string="最大"/>
|
<label for="cutting_tool_clamping_diameter_max" string="最大"/>
|
||||||
<field name="cutting_tool_clamping_diameter_max" class="o_address_zip diameter"
|
<field name="cutting_tool_clamping_diameter_max" class="o_address_zip diameter"
|
||||||
options="{'format': false}"
|
options="{'format': false}"
|
||||||
attrs="{'required': [('cutting_tool_type','not in',('夹头','刀柄'))]}"/>
|
attrs="{'required': [('cutting_tool_type','not in',('夹头','刀柄'))],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<span>(mm)&nbsp;</span>
|
<span>(mm)&nbsp;</span>
|
||||||
</div>
|
</div>
|
||||||
<field name="cutting_tool_clamping_way"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"
|
<field name="cutting_tool_cooling_type"
|
||||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
</group>
|
</group>
|
||||||
<group attrs="{'invisible': [('categ_type', '!=', '刀具')]}">
|
<group attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('categ_type', '=', '刀具')]}">
|
||||||
<field name="materials_type_id" options="{'no_create': True}" placeholder="请选择"
|
<field name="materials_type_id" options="{'no_create': True}" placeholder="请选择"
|
||||||
string="材质"/>
|
string="材质" attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<field name="coating_material"/>
|
<field name="coating_material" attrs="{'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<field name="cutting_tool_blade_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="请选择"
|
<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"
|
<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"
|
<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"
|
<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)"
|
<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"
|
<field name="cutting_tool_cut_depth"
|
||||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<field name="cutting_tool_pitch"
|
<field name="cutting_tool_pitch"
|
||||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<field name="tool_weight"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"-->
|
<!-- <field name="cutting_tool_front_angle"-->
|
||||||
<!-- attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>-->
|
<!-- attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>-->
|
||||||
<field name="cutting_tool_top_angle"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"
|
<field name="cutting_tool_cutter_bar_ids" widget="many2many_tags"
|
||||||
options="{'no_create': True}"
|
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"
|
<field name="cutting_tool_cutter_pad_ids" widget="many2many_tags"
|
||||||
options="{'no_create': True}"
|
options="{'no_create': True}"
|
||||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<!--刀柄-->
|
<!--刀柄-->
|
||||||
<field name="cutting_tool_is_rough_finish"
|
<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"
|
<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"
|
<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"
|
<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="有无安全锁"
|
<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)"
|
<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"
|
<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"
|
<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"
|
<field name="cutting_tool_handle_ids" widget="many2many_tags"
|
||||||
options="{'no_create': True}"
|
options="{'no_create': True}"
|
||||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<field name="cooling_suit_type_ids"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"
|
<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"
|
<field name="cutting_tool_pressing_plate"
|
||||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')],'readonly': [('categ_type', '=', '刀具')]}"/>
|
||||||
<field name="cutting_tool_screw"
|
<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"
|
<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"
|
<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"
|
<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>
|
</group>
|
||||||
<group string="适配刀片形状"
|
<group string="适配刀片形状"
|
||||||
attrs="{'invisible': [('cutting_tool_type', 'in', ('刀柄','夹头','整体式刀具',False))]}">
|
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>
|
||||||
<group string="适合加工方式"
|
<group string="适合加工方式"
|
||||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||||
<field name="suitable_machining_method_ids" string=""
|
<field name="suitable_machining_method_ids" string=""
|
||||||
|
attrs="{'readonly': [('categ_type', '=', '刀具')]}"
|
||||||
widget="custom_many2many_checkboxes"/>
|
widget="custom_many2many_checkboxes"/>
|
||||||
</group>
|
</group>
|
||||||
<group string="刀尖特征"
|
<group string="刀尖特征"
|
||||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||||
<field name="blade_tip_characteristics_id" string=""
|
<field name="blade_tip_characteristics_id" string=""
|
||||||
|
attrs="{'readonly': [('categ_type', '=', '刀具')]}"
|
||||||
widget="many2one_radio"/>
|
widget="many2one_radio"/>
|
||||||
</group>
|
</group>
|
||||||
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||||
<group string="柄部类型"
|
<group string="柄部类型"
|
||||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
|
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>
|
||||||
<group string="压紧方式"
|
<group string="压紧方式"
|
||||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}">
|
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>
|
</group>
|
||||||
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||||
<group string="走刀方向">
|
<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>
|
||||||
<group string="适合冷却液">
|
<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>
|
||||||
</group>
|
</group>
|
||||||
<notebook>
|
<notebook>
|
||||||
<page string="切削速度Vc"
|
<page string="切削速度Vc"
|
||||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}">
|
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">
|
<tree editable="bottom">
|
||||||
<!-- <field name="order"/>-->
|
<!-- <field name="order"/>-->
|
||||||
<field name="execution_standard_id"/>
|
<field name="execution_standard_id"/>
|
||||||
@@ -444,8 +465,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</page>
|
</page>
|
||||||
<page string="每齿走刀量fz"
|
<page string="每齿走刀量fz"
|
||||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}">
|
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))],'readonly': [('categ_type', '=', '刀具')]}">
|
||||||
<field name="feed_per_tooth_ids" string="" widget="one2many">
|
<field name="feed_per_tooth_ids" string="" widget="one2many"
|
||||||
|
attrs="{'readonly': [('categ_type', '=', '刀具')]}">
|
||||||
<tree editable="bottom">
|
<tree editable="bottom">
|
||||||
<field name="cutting_speed"
|
<field name="cutting_speed"
|
||||||
attrs="{'readonly': [('materials_type_id','!=',False)]}"/>
|
attrs="{'readonly': [('materials_type_id','!=',False)]}"/>
|
||||||
|
|||||||
@@ -201,6 +201,7 @@ class StockRule(models.Model):
|
|||||||
|
|
||||||
sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
|
sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
|
||||||
if sale_order:
|
if sale_order:
|
||||||
|
sale_order.write({'schedule_status': 'to schedule'})
|
||||||
self.env['sf.production.plan'].sudo().with_company(company_id). \
|
self.env['sf.production.plan'].sudo().with_company(company_id). \
|
||||||
create({
|
create({
|
||||||
'name': production.name,
|
'name': production.name,
|
||||||
|
|||||||
@@ -53,8 +53,13 @@ access_product_template_group_equipment_manager,product_template_group_equipment
|
|||||||
access_quality_alert_stage_group_quality,quality_alert_stage_group_quality,quality.model_quality_alert_stage,sf_base.group_quality,1,0,0,0
|
access_quality_alert_stage_group_quality,quality_alert_stage_group_quality,quality.model_quality_alert_stage,sf_base.group_quality,1,0,0,0
|
||||||
access_quality_alert_stage_group_quality_director,quality_alert_stage_group_quality_director,quality.model_quality_alert_stage,sf_base.group_quality_director,1,0,0,0
|
access_quality_alert_stage_group_quality_director,quality_alert_stage_group_quality_director,quality.model_quality_alert_stage,sf_base.group_quality_director,1,0,0,0
|
||||||
|
|
||||||
|
access_quality_point_test_type_group_quality,quality_point_test_type_group_quality,quality.model_quality_point_test_type,sf_base.group_quality,1,0,0,0
|
||||||
|
access_quality_point_test_type_group_quality_director,quality_point_test_type_group_quality_director,quality.model_quality_point_test_type,sf_base.group_quality_director,1,0,0,0
|
||||||
|
|
||||||
|
access_quality_point_test_type_group_quality,quality_point_test_type_group_quality,quality.model_quality_point_test_type,sf_base.group_quality,1,0,0,0
|
||||||
|
access_quality_point_test_type_group_quality_director,quality_point_test_type_group_quality_director,quality.model_quality_point_test_type,sf_base.group_quality_director,1,0,0,0
|
||||||
|
|
||||||
|
|
||||||
access_quality_alert_stage,quality.alert.stage,quality.model_quality_alert_stage,sf_base.group_plan_dispatch,1,0,0,0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
|
@@ -10,13 +10,15 @@
|
|||||||
""",
|
""",
|
||||||
'category': 'sf',
|
'category': 'sf',
|
||||||
'website': 'https://www.sf.jikimo.com',
|
'website': 'https://www.sf.jikimo.com',
|
||||||
'depends': ['sale', 'sale_management', 'web_widget_model_viewer', 'sf_base'],
|
'depends': ['sale', 'sale_management', 'web_widget_model_viewer', 'sf_base', 'account', 'purchase'],
|
||||||
'data': [
|
'data': [
|
||||||
'security/group_security.xml',
|
'security/group_security.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
'wizard/sale_order_wizard_views.xml',
|
'wizard/sale_order_wizard_views.xml',
|
||||||
|
'wizard/purchase_order_wizard_views.xml',
|
||||||
'views/sale_team.xml',
|
'views/sale_team.xml',
|
||||||
'views/sale_order_view.xml',
|
'views/sale_order_view.xml',
|
||||||
|
'views/res_partner_view.xml',
|
||||||
'views/purchase_order_view.xml',
|
'views/purchase_order_view.xml',
|
||||||
'views/quick_easy_order_view.xml'
|
'views/quick_easy_order_view.xml'
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import base64
|
import base64
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api, _
|
||||||
from odoo.osv import expression
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
|
|
||||||
class ReSaleOrder(models.Model):
|
class ReSaleOrder(models.Model):
|
||||||
@@ -13,14 +13,18 @@ class ReSaleOrder(models.Model):
|
|||||||
address_of_delivery = fields.Char('交货人地址')
|
address_of_delivery = fields.Char('交货人地址')
|
||||||
payments_way = fields.Selection([('现结', '现结'), ('月结', '月结')], '结算方式', default='现结', tracking=True)
|
payments_way = fields.Selection([('现结', '现结'), ('月结', '月结')], '结算方式', default='现结', tracking=True)
|
||||||
pay_way = fields.Selection([('转账', '转账'), ('微信', '微信'), ('支付宝', '支付宝')], '支付方式')
|
pay_way = fields.Selection([('转账', '转账'), ('微信', '微信'), ('支付宝', '支付宝')], '支付方式')
|
||||||
check_status = fields.Selection([('unchecked', '未审核'), ('checked', '已审核')], '审核状态', default='unchecked')
|
check_status = fields.Selection([('pending', '待审核'), ('approved', '已审核'), ('fail', '不通过')], '审核状态')
|
||||||
|
schedule_status = fields.Selection(
|
||||||
|
[('to schedule', '待排程'), ('to process', '待加工'), ('to deliver', '待发货'), ('to receive', '待收货'),
|
||||||
|
('received', '已收货')],
|
||||||
|
'进度状态')
|
||||||
payment_term_id = fields.Many2one(
|
payment_term_id = fields.Many2one(
|
||||||
comodel_name='account.payment.term',
|
comodel_name='account.payment.term',
|
||||||
string="交付条件",
|
string="交付条件",
|
||||||
compute='_compute_payment_term_id',
|
compute='_compute_payment_term_id',
|
||||||
store=True, readonly=False, precompute=True, check_company=True, tracking=True,
|
store=True, readonly=False, precompute=True, check_company=True, tracking=True,
|
||||||
domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]")
|
domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]")
|
||||||
|
remark = fields.Text('备注')
|
||||||
|
|
||||||
# 业务平台分配工厂后在智能工厂先创建销售订单
|
# 业务平台分配工厂后在智能工厂先创建销售订单
|
||||||
def sale_order_create(self, company_id, delivery_name, delivery_telephone, delivery_address,
|
def sale_order_create(self, company_id, delivery_name, delivery_telephone, delivery_address,
|
||||||
@@ -32,7 +36,7 @@ class ReSaleOrder(models.Model):
|
|||||||
'date_order': now_time,
|
'date_order': now_time,
|
||||||
'name': self.env['ir.sequence'].next_by_code('sale.order', sequence_date=now_time),
|
'name': self.env['ir.sequence'].next_by_code('sale.order', sequence_date=now_time),
|
||||||
'partner_id': partner.id,
|
'partner_id': partner.id,
|
||||||
'check_status': 'checked',
|
'check_status': 'approved',
|
||||||
'state': 'draft',
|
'state': 'draft',
|
||||||
'person_of_delivery': delivery_name,
|
'person_of_delivery': delivery_name,
|
||||||
'telephone_of_delivery': delivery_telephone,
|
'telephone_of_delivery': delivery_telephone,
|
||||||
@@ -43,9 +47,16 @@ class ReSaleOrder(models.Model):
|
|||||||
})
|
})
|
||||||
return order_id
|
return order_id
|
||||||
|
|
||||||
# 审核
|
def write(self, vals):
|
||||||
def action_check(self):
|
if self.env.user.has_group('sf_base.group_sale_director'):
|
||||||
self.check_status = 'checked'
|
if vals.get('check_status'):
|
||||||
|
if vals['check_status'] in ('pending', False):
|
||||||
|
vals['check_status'] = 'approved'
|
||||||
|
return super().write(vals)
|
||||||
|
|
||||||
|
# 提交
|
||||||
|
def submit(self):
|
||||||
|
self.check_status = 'pending'
|
||||||
|
|
||||||
def get_customer(self):
|
def get_customer(self):
|
||||||
customer = self.env['res.partner'].search([('name', '=', '业务平台')])
|
customer = self.env['res.partner'].search([('name', '=', '业务平台')])
|
||||||
@@ -80,18 +91,89 @@ class ResaleOrderLine(models.Model):
|
|||||||
class RePurchaseOrder(models.Model):
|
class RePurchaseOrder(models.Model):
|
||||||
_inherit = 'purchase.order'
|
_inherit = 'purchase.order'
|
||||||
|
|
||||||
check_status = fields.Selection([('unchecked', '未审核'), ('checked', '已审核')], '审核状态', default='unchecked')
|
check_status = fields.Selection([('pending', '待审核'), ('approved', '已审核'), ('fail', '不通过')], '审核状态')
|
||||||
|
remark = fields.Text('备注')
|
||||||
|
|
||||||
|
def write(self, vals):
|
||||||
|
if self.env.user.has_group('sf_base.group_purchase_director'):
|
||||||
|
if vals.get('check_status'):
|
||||||
|
if vals['check_status'] in ('pending', False):
|
||||||
|
vals['check_status'] = 'approved'
|
||||||
|
return super().write(vals)
|
||||||
|
|
||||||
|
def button_confirm(self):
|
||||||
|
self.check_status = 'pending'
|
||||||
|
return super().button_confirm()
|
||||||
|
|
||||||
|
|
||||||
class ResPartnerToSale(models.Model):
|
class ResPartnerToSale(models.Model):
|
||||||
_inherit = 'res.partner'
|
_inherit = 'res.partner'
|
||||||
|
|
||||||
|
purchase_user_id = fields.Many2one('res.users', '采购员')
|
||||||
|
|
||||||
|
@api.constrains('name')
|
||||||
|
def _check_name(self):
|
||||||
|
obj = self.sudo().search([('name', '=', self.name), ('id', '!=', self.id)])
|
||||||
|
if obj:
|
||||||
|
raise UserError('该名称已存在,请重新输入')
|
||||||
|
|
||||||
|
@api.constrains('vat')
|
||||||
|
def _check_vat(self):
|
||||||
|
obj = self.sudo().search([('vat', '=', self.vat), ('id', '!=', self.id)])
|
||||||
|
if obj:
|
||||||
|
raise UserError('该税ID已存在,请重新输入')
|
||||||
|
|
||||||
|
@api.constrains('email')
|
||||||
|
def _check_email(self):
|
||||||
|
if self.customer_rank > 0:
|
||||||
|
obj = self.sudo().search([('email', '=', self.email), ('id', '!=', self.id)])
|
||||||
|
if obj:
|
||||||
|
raise UserError('该邮箱已存在,请重新输入')
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None):
|
def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None):
|
||||||
if self._context.get('is_customer'):
|
if self._context.get('is_customer'):
|
||||||
if self.env.user.has_group('sf_base.group_sale_director'):
|
if self.env.user.has_group('sf_base.group_sale_director'):
|
||||||
domain = [('customer_rank', '=', 1)]
|
domain = [('customer_rank', '>', 0)]
|
||||||
else:
|
elif self.env.user.has_group('sf_base.group_sale_salemanager'):
|
||||||
domain = [('user_id', '=', self.env.user.id)]
|
customer = self.env['res.partner'].search(
|
||||||
|
[('customer_rank', '>', 0), ('user_id', '=', self.env.user.id)])
|
||||||
|
if customer:
|
||||||
|
ids = [t.id for t in customer]
|
||||||
|
domain = [('id', 'in', ids)]
|
||||||
|
return self._search(domain, limit=limit, access_rights_uid=name_get_uid)
|
||||||
|
return super()._name_search(name, args, operator, limit, name_get_uid)
|
||||||
|
|
||||||
|
@api.onchange('user_id')
|
||||||
|
def _get_salesman(self):
|
||||||
|
if self.customer_rank > 0:
|
||||||
|
self.user_id = self.env.user.id
|
||||||
|
|
||||||
|
@api.onchange('purchase_user_id')
|
||||||
|
def _get_purchaseman(self):
|
||||||
|
if self.supplier_rank > 0:
|
||||||
|
self.purchase_user_id = self.env.user.id
|
||||||
|
|
||||||
|
|
||||||
|
class ResUserToSale(models.Model):
|
||||||
|
_inherit = 'res.users'
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None):
|
||||||
|
if self._context.get('is_sale'):
|
||||||
|
if self.env.user.has_group('sf_base.group_sale_director'):
|
||||||
|
domain = []
|
||||||
|
elif self.env.user.has_group('sf_base.group_sale_salemanager'):
|
||||||
|
domain = [('id', '=', self.env.user.id)]
|
||||||
|
return self._search(domain, limit=limit, access_rights_uid=name_get_uid)
|
||||||
|
elif self._context.get('supplier_rank'):
|
||||||
|
if self.env.user.has_group('sf_base.group_purchase_director'):
|
||||||
|
domain = [('supplier_rank', '>', 0)]
|
||||||
|
elif self.env.user.has_group('sf_base.group_purchase'):
|
||||||
|
supplier = self.env['res.partner'].search(
|
||||||
|
[('supplier_rank', '>', 0), ('purchase_user_id', '=', self.env.user.id)])
|
||||||
|
if supplier:
|
||||||
|
ids = [t.id for t in supplier]
|
||||||
|
domain = [('id', 'in', ids)]
|
||||||
return self._search(domain, limit=limit, access_rights_uid=name_get_uid)
|
return self._search(domain, limit=limit, access_rights_uid=name_get_uid)
|
||||||
return super()._name_search(name, args, operator, limit, name_get_uid)
|
return super()._name_search(name, args, operator, limit, name_get_uid)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.rule" id="crm_team_rule_director">
|
<record model="ir.rule" id="crm_team_rule_director">
|
||||||
<field name="name">销售总监查看所有的订单</field>
|
<field name="name">销售总监查看所有团队</field>
|
||||||
<field name="model_id" ref="sales_team.model_crm_team"/>
|
<field name="model_id" ref="sales_team.model_crm_team"/>
|
||||||
<field name="domain_force">[(1,'=',1)]</field>
|
<field name="domain_force">[(1,'=',1)]</field>
|
||||||
<field name="groups" eval="[(4, ref('sf_base.group_sale_director'))]"/>
|
<field name="groups" eval="[(4, ref('sf_base.group_sale_director'))]"/>
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
<record model="ir.rule" id="sale_customer_rule_director">
|
<record model="ir.rule" id="sale_customer_rule_director">
|
||||||
<field name="name">销售总监查看所有客户</field>
|
<field name="name">销售总监查看所有客户</field>
|
||||||
<field name="model_id" ref="base.model_res_partner"/>
|
<field name="model_id" ref="base.model_res_partner"/>
|
||||||
<field name="domain_force">[(1,'=',1),('customer_rank','=',1)]</field>
|
<field name="domain_force">[(1,'=',1),('customer_rank','>',0)]</field>
|
||||||
<field name="groups" eval="[(4, ref('sf_base.group_sale_director'))]"/>
|
<field name="groups" eval="[(4, ref('sf_base.group_sale_director'))]"/>
|
||||||
<field name="perm_read" eval="1"/>
|
<field name="perm_read" eval="1"/>
|
||||||
<field name="perm_write" eval="1"/>
|
<field name="perm_write" eval="1"/>
|
||||||
@@ -32,7 +32,8 @@
|
|||||||
<record model="ir.rule" id="sale_customer_rule_my">
|
<record model="ir.rule" id="sale_customer_rule_my">
|
||||||
<field name="name">销售经理查看自己的客户</field>
|
<field name="name">销售经理查看自己的客户</field>
|
||||||
<field name="model_id" ref="base.model_res_partner"/>
|
<field name="model_id" ref="base.model_res_partner"/>
|
||||||
<field name="domain_force">['|',('user_id','=',user.id),('create_uid', '=',user.id)]</field>
|
<field name="domain_force">[('user_id','=',user.id),('customer_rank','>',0)]
|
||||||
|
</field>
|
||||||
<field name="groups" eval="[(4, ref('sf_base.group_sale_salemanager'))]"/>
|
<field name="groups" eval="[(4, ref('sf_base.group_sale_salemanager'))]"/>
|
||||||
<field name="perm_read" eval="1"/>
|
<field name="perm_read" eval="1"/>
|
||||||
<field name="perm_write" eval="1"/>
|
<field name="perm_write" eval="1"/>
|
||||||
@@ -40,11 +41,11 @@
|
|||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
<record model="ir.rule" id="sale_order_rule_salemanager">
|
<record model="ir.rule" id="sale_order_rule_director">
|
||||||
<field name="name">销售经理查看自己的订单</field>
|
<field name="name">销售总监查看所有订单</field>
|
||||||
<field name="model_id" ref="model_sale_order"/>
|
<field name="model_id" ref="model_sale_order"/>
|
||||||
<field name="domain_force">[('user_id', '=',user.id)]</field>
|
<field name="domain_force">[(1,'=',1)]</field>
|
||||||
<field name="groups" eval="[(4, ref('sf_base.group_sale_salemanager'))]"/>
|
<field name="groups" eval="[(4, ref('sf_base.group_sale_director'))]"/>
|
||||||
<field name="perm_read" eval="1"/>
|
<field name="perm_read" eval="1"/>
|
||||||
<field name="perm_write" eval="1"/>
|
<field name="perm_write" eval="1"/>
|
||||||
<field name="perm_create" eval="1"/>
|
<field name="perm_create" eval="1"/>
|
||||||
@@ -53,7 +54,7 @@
|
|||||||
<record model="ir.rule" id="inventory_purchase_order_rule_director">
|
<record model="ir.rule" id="inventory_purchase_order_rule_director">
|
||||||
<field name="name">采购总监查看所有的订单</field>
|
<field name="name">采购总监查看所有的订单</field>
|
||||||
<field name="model_id" ref="purchase.model_purchase_order"/>
|
<field name="model_id" ref="purchase.model_purchase_order"/>
|
||||||
<field name="domain_force">[(1,'=',1)]</field>
|
<field name="domain_force">[(1,'=',1),('check_status','!=', False]</field>
|
||||||
<field name="groups" eval="[(4, ref('sf_base.group_purchase_director'))]"/>
|
<field name="groups" eval="[(4, ref('sf_base.group_purchase_director'))]"/>
|
||||||
<field name="perm_read" eval="1"/>
|
<field name="perm_read" eval="1"/>
|
||||||
<field name="perm_write" eval="1"/>
|
<field name="perm_write" eval="1"/>
|
||||||
@@ -65,7 +66,7 @@
|
|||||||
<field name="domain_force">['|',('user_id','=',user.id),('create_uid', '=',user.id)]</field>
|
<field name="domain_force">['|',('user_id','=',user.id),('create_uid', '=',user.id)]</field>
|
||||||
<field name="groups" eval="[(4, ref('sf_base.group_purchase'))]"/>
|
<field name="groups" eval="[(4, ref('sf_base.group_purchase'))]"/>
|
||||||
<field name="perm_read" eval="1"/>
|
<field name="perm_read" eval="1"/>
|
||||||
<field name="perm_write" eval="1"/>
|
<field name="perm_write" eval="0"/>
|
||||||
<field name="perm_create" eval="1"/>
|
<field name="perm_create" eval="1"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
@@ -73,7 +74,7 @@
|
|||||||
<record model="ir.rule" id="purchase_supplier_rule_director">
|
<record model="ir.rule" id="purchase_supplier_rule_director">
|
||||||
<field name="name">采购总监查看所有供应商</field>
|
<field name="name">采购总监查看所有供应商</field>
|
||||||
<field name="model_id" ref="base.model_res_partner"/>
|
<field name="model_id" ref="base.model_res_partner"/>
|
||||||
<field name="domain_force">[(1,'=',1)]</field>
|
<field name="domain_force">[(1,'=',1),('supplier_rank','>', 0)]</field>
|
||||||
<field name="groups" eval="[(4, ref('sf_base.group_purchase_director'))]"/>
|
<field name="groups" eval="[(4, ref('sf_base.group_purchase_director'))]"/>
|
||||||
<field name="perm_read" eval="1"/>
|
<field name="perm_read" eval="1"/>
|
||||||
<field name="perm_write" eval="1"/>
|
<field name="perm_write" eval="1"/>
|
||||||
@@ -82,7 +83,7 @@
|
|||||||
<record model="ir.rule" id="purchase_supplier_rule_my">
|
<record model="ir.rule" id="purchase_supplier_rule_my">
|
||||||
<field name="name">采购岗查看自己的供应商</field>
|
<field name="name">采购岗查看自己的供应商</field>
|
||||||
<field name="model_id" ref="base.model_res_partner"/>
|
<field name="model_id" ref="base.model_res_partner"/>
|
||||||
<field name="domain_force">['|',('user_id','=',user.id),('create_uid', '=',user.id)]</field>
|
<field name="domain_force">[('user_id','=',user.id),('supplier_rank','>', 0)]</field>
|
||||||
<field name="groups" eval="[(4, ref('sf_base.group_purchase'))]"/>
|
<field name="groups" eval="[(4, ref('sf_base.group_purchase'))]"/>
|
||||||
<field name="perm_read" eval="1"/>
|
<field name="perm_read" eval="1"/>
|
||||||
<field name="perm_write" eval="1"/>
|
<field name="perm_write" eval="1"/>
|
||||||
|
|||||||
@@ -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_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_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_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,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_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_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
|
access_stock_picking_group_purchase,stock_picking_group_purchase,stock.model_stock_picking,sf_base.group_purchase,1,0,0,0
|
||||||
@@ -38,13 +40,36 @@ access_uom_category_group_purchase_director,uom_category_group_purchase_director
|
|||||||
access_sale_order_check_wizard_group_sale_salemanager,sale_order_check_wizard_group_sale_salemanager,model_sale_order_check_wizard,sf_base.group_sale_salemanager,1,1,1,0
|
access_sale_order_check_wizard_group_sale_salemanager,sale_order_check_wizard_group_sale_salemanager,model_sale_order_check_wizard,sf_base.group_sale_salemanager,1,1,1,0
|
||||||
access_sale_order_check_wizard_group_sale_director,sale_order_check_wizard_group_sale_director,model_sale_order_check_wizard,sf_base.group_sale_director,1,1,1,0
|
access_sale_order_check_wizard_group_sale_director,sale_order_check_wizard_group_sale_director,model_sale_order_check_wizard,sf_base.group_sale_director,1,1,1,0
|
||||||
|
|
||||||
|
access_account_move_line_group_purchase,account_move_line_group_purchase,account.model_account_move_line,sf_base.group_purchase,1,1,1,0
|
||||||
|
access_account_move_line_group_purchase_director,account_move_line_group_purchase_director,account.model_account_move_line,sf_base.group_purchase_director,1,1,1,0
|
||||||
|
|
||||||
|
access_res_users_group_purchase,res_user_group_purchase,model_res_users,sf_base.group_purchase,1,1,1,0
|
||||||
|
access_res_users_group_purchase_director,res_users_group_purchase_director,model_res_users,sf_base.group_purchase_director,1,1,1,0
|
||||||
|
access_res_users_group_sale_salemanager,res_users_group_sale_salemanager,model_res_users,sf_base.group_sale_salemanager,1,0,0,0
|
||||||
|
access_res_users_group_sale_director,res_users_group_sale_director,model_res_users,sf_base.group_sale_director,1,1,1,0
|
||||||
|
|
||||||
|
access_mrp_bom_byproduct_group_purchase,mrp_bom_byproduct_group_purchase,mrp.model_mrp_bom_byproduct,sf_base.group_purchase,1,1,1,0
|
||||||
|
access_mrp_bom_byproduct_group_purchase_director,mrp_bom_byproduct_group_purchase_director,mrp.model_mrp_bom_byproduct,sf_base.group_purchase_director,1,1,1,0
|
||||||
|
access_mrp_bom_byproduct_group_sale_salemanager,mrp_bom_byproduct_group_sale_salemanager,mrp.model_mrp_bom_byproduct,sf_base.group_sale_salemanager,1,0,0,0
|
||||||
|
access_mrp_bom_byproduct_group_sale_director,mrp_bom_byproduct_group_sale_director,mrp.model_mrp_bom_byproduct,sf_base.group_sale_director,1,1,1,0
|
||||||
|
|
||||||
|
access_purchase_order_group_purchase,purchase_order_group_purchase,purchase.model_purchase_order,sf_base.group_purchase,1,1,1,0
|
||||||
|
access_purchase_order_group_purchase_director,purchase_order_group_purchase_director,purchase.model_purchase_order,sf_base.group_purchase_director,1,1,1,0
|
||||||
|
|
||||||
|
access_purchase_order_line_group_purchase,purchase_order_line_group_purchase,purchase_stock.model_purchase_order_line,sf_base.group_purchase,1,1,1,0
|
||||||
|
access_purchase_order_line_group_purchase_director,purchase_order_line_group_purchase_director,purchase_stock.model_purchase_order_line,sf_base.group_purchase_director,1,1,1,0
|
||||||
|
access_purchase_order_line_group_sale_salemanager,purchase_order_line_group_sale_salemanager,purchase_stock.model_purchase_order_line,sf_base.group_sale_salemanager,1,0,0,0
|
||||||
|
access_purchase_order_line_group_sale_director,purchase_order_line_group_sale_director,purchase_stock.model_purchase_order_line,sf_base.group_sale_director,1,1,1,0
|
||||||
|
|
||||||
|
access_purchase_order_wizard_group_purchase,purchase_order_wizard_group_purchase,model_purchase_order_wizard,sf_base.group_purchase,1,1,1,0
|
||||||
|
access_purchase_order_wizard_group_purchase_director,purchase_order_wizard_group_purchase_director,model_purchase_order_wizard,sf_base.group_purchase_director,1,1,1,0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
access_sale_order,sale_order,model_sale_order,sf_base.group_plan_dispatch,1,0,0,0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
|
@@ -6,62 +6,137 @@
|
|||||||
<field name="model">purchase.order</field>
|
<field name="model">purchase.order</field>
|
||||||
<field name="inherit_id" ref="purchase.purchase_order_form"/>
|
<field name="inherit_id" ref="purchase.purchase_order_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<!-- <xpath expr="//form/header/button[@name='button_confirm[1]']" position="after">-->
|
<field name="currency_id" position="after">
|
||||||
<!-- <field name="check_status" invisible="1"/>-->
|
<field name="check_status" invisible="1"/>
|
||||||
<!-- <button name="action_check" string="审核" type="object"-->
|
<!-- <field name="state"/>-->
|
||||||
<!-- attrs="{'invisible': [('check_status','=', 'checked')]}"-->
|
<field name="remark" attrs="{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||||
<!-- class="oe_highlight"/>-->
|
['pending','approved'])]}"/>
|
||||||
<!-- </xpath>-->
|
</field>
|
||||||
<!-- <xpath expr="//form/header/button[@name='button_confirm'][2]" position="attributes">-->
|
<xpath expr="//form/header/button[@name='action_rfq_send'][1]" position="after">
|
||||||
<!-- <attribute name="attrs">{'invisible': [('check_status', '=', 'unchecked'),('state', 'in',-->
|
<button name="sf_sale.action_purchase_order_check_wizard" string="审核" type="action"
|
||||||
<!-- ['draft'])]}-->
|
context="{'default_order_id':active_id}" groups="sf_base.group_purchase_director"
|
||||||
<!-- </attribute>-->
|
attrs="{'invisible': ['&',('check_status','in', ['approved']),('state', 'in', ['draft','send','purchase'])]}"
|
||||||
<!-- </xpath>-->
|
class="oe_highlight"/>
|
||||||
<!-- <xpath expr="//form/header/button[@name='button_confirm[2]']" position="after">-->
|
</xpath>
|
||||||
<!-- <field name="check_status" invisible="1"/>-->
|
<xpath expr="//form/header/button[@name='button_confirm'][2]" position="replace">
|
||||||
<!-- <button name="action_check" string="审核" type="object"-->
|
<button name="button_confirm" type="object" context="{'validate_analytic': True}"
|
||||||
<!-- attrs="{'invisible': [('check_status','=', 'checked')]}"-->
|
string="确认订单" id="draft_confirm"
|
||||||
<!-- class="oe_highlight"/>-->
|
attrs="{'invisible': ['|','&',('check_status','in', ['approved','fail','pending']),('state', 'in', ['draft','purchase']),('state', 'in', ['purchase'])]}"
|
||||||
<!-- </xpath>-->
|
/>
|
||||||
<!-- <xpath expr="//form/header/button[@name='action_rfq_send[1]']" position="attributes">-->
|
|
||||||
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
|
||||||
<!-- </xpath>-->
|
|
||||||
<!-- <xpath expr="//form/header/button[@name='action_rfq_send[2]']" position="attributes">-->
|
|
||||||
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
|
||||||
<!-- </xpath>-->
|
|
||||||
<!-- <xpath expr="//form/header/button[@name='print_quotation[1]']" position="attributes">-->
|
|
||||||
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
|
||||||
<!-- </xpath>-->
|
|
||||||
<!-- <xpath expr="//form/header/button[@name='print_quotation[2]']" position="attributes">-->
|
|
||||||
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
|
||||||
<!-- </xpath>-->
|
|
||||||
<xpath expr="//form/header/button[@name='button_approve']" position="attributes">
|
|
||||||
<attribute name="groups">sf_base.group_purchase</attribute>
|
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<!-- <xpath expr="//form/header/button[@name='action_create_invoice[1]']" position="attributes">-->
|
<!-- <xpath expr="//form/header/button[@name='action_rfq_send[1]']" position="attributes">-->
|
||||||
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
<!-- <attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>-->
|
||||||
<!-- </xpath>-->
|
<!-- </xpath>-->
|
||||||
<!-- <xpath expr="//form/header/button[@name='action_create_invoice[2]']" position="attributes">-->
|
<!-- <xpath expr="//form/header/button[@name='action_rfq_send[2]']" position="attributes">-->
|
||||||
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
<!-- <attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>-->
|
||||||
<!-- </xpath>-->
|
<!-- </xpath>-->
|
||||||
|
<!-- <xpath expr="//form/header/button[@name='print_quotation[1]']" position="attributes">-->
|
||||||
|
<!-- <attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>-->
|
||||||
|
<!-- </xpath>-->
|
||||||
|
<!-- <xpath expr="//form/header/button[@name='print_quotation[2]']" position="attributes">-->
|
||||||
|
<!-- <attribute name="groups">sf_base.group_purchase</attribute>-->
|
||||||
|
<!-- </xpath>-->
|
||||||
|
<xpath expr="//form/header/button[@name='button_approve']" position="attributes">
|
||||||
|
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
<!-- <xpath expr="//form/header/button[@name='action_create_invoice[1]']" position="attributes">-->
|
||||||
|
<!-- <attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>-->
|
||||||
|
<!-- </xpath>-->
|
||||||
|
<!-- <xpath expr="//form/header/button[@name='action_create_invoice[2]']" position="attributes">-->
|
||||||
|
<!-- <attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>-->
|
||||||
|
<!-- </xpath>-->
|
||||||
<xpath expr="//form/header/button[@name='confirm_reminder_mail']" position="attributes">
|
<xpath expr="//form/header/button[@name='confirm_reminder_mail']" position="attributes">
|
||||||
<attribute name="groups">sf_base.group_purchase</attribute>
|
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<xpath expr="//form/header/button[@name='button_draft']" position="attributes">
|
<xpath expr="//form/header/button[@name='button_draft']" position="attributes">
|
||||||
<attribute name="groups">sf_base.group_purchase</attribute>
|
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//form/header/button[@name='button_cancel']" position="attributes">
|
<xpath expr="//form/header/button[@name='button_cancel']" position="attributes">
|
||||||
<attribute name="groups">sf_base.group_purchase</attribute>
|
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<xpath expr="//form/header/button[@name='button_unlock']" position="attributes">
|
<xpath expr="//form/header/button[@name='button_unlock']" position="attributes">
|
||||||
<attribute name="groups">sf_base.group_purchase</attribute>
|
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//form/header/button[@name='button_done']" position="attributes">
|
<xpath expr="//form/header/button[@name='button_done']" position="attributes">
|
||||||
<attribute name="groups">sf_base.group_purchase</attribute>
|
<attribute name="groups">sf_base.group_purchase,sf_base.group_purchase_director</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='order_line']" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||||
|
['pending','approved'])]}
|
||||||
|
</attribute>
|
||||||
|
</xpath>
|
||||||
|
<field name="partner_ref" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||||
|
['pending','approved'])]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="date_planned" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||||
|
['pending','approved'])]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="receipt_reminder_email" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||||
|
['pending','approved'])]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="user_id" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||||
|
['pending','approved'])]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="origin" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||||
|
['pending','approved'])]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="payment_term_id" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||||
|
['pending','approved'])]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="fiscal_position_id" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||||
|
['pending','approved'])]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
<record id="purchase_stock_order_view_form_inherit_sf" model="ir.ui.view">
|
||||||
|
<field name="name">purchase.stock.order.form.inherit.sf</field>
|
||||||
|
<field name="model">purchase.order</field>
|
||||||
|
<field name="inherit_id" ref="purchase_stock.purchase_order_view_form_inherit"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="incoterm_id" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||||
|
['pending','approved'])]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="incoterm_location" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||||
|
['pending','approved'])]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_purchase_order_kpis_tree_inherit_sf" model="ir.ui.view">
|
||||||
|
<field name="name">purchase.order.tree.inherit.sf</field>
|
||||||
|
<field name="model">purchase.order</field>
|
||||||
|
<field name="inherit_id" ref="purchase.purchase_order_kpis_tree"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="state" position="after">
|
||||||
|
<field name="check_status" widget="badge"
|
||||||
|
decoration-success="check_status == 'approved'"
|
||||||
|
decoration-warning="check_status == 'pending'"
|
||||||
|
decoration-danger="check_status == 'fail'"/>
|
||||||
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
87
sf_sale/views/res_partner_view.xml
Normal file
87
sf_sale/views/res_partner_view.xml
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<record model="ir.ui.view" id="view_partner_form_inherit_sf">
|
||||||
|
<field name="name">res.partner.form.inherit.sf</field>
|
||||||
|
<field name="model">res.partner</field>
|
||||||
|
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="vat" position="after">
|
||||||
|
<field name="customer_rank" invisible="1"/>
|
||||||
|
<field name="supplier_rank" invisible="1"/>
|
||||||
|
</field>
|
||||||
|
<field name="vat" position="attributes">
|
||||||
|
<attribute name="required">1</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="email" position="replace">
|
||||||
|
<field name="email" attrs="{'required' : [('customer_rank','>', 0)]}"/>
|
||||||
|
</field>
|
||||||
|
<field name="mobile" position="attributes">
|
||||||
|
<attribute name="attrs">{'required': [('phone', '=', False)]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="phone" position="attributes">
|
||||||
|
<attribute name="attrs">{'required': [('mobile', '=', False)]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="street" position="attributes">
|
||||||
|
<attribute name="attrs">{'required': [('supplier_rank','>', 0)]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="street2" position="attributes">
|
||||||
|
<attribute name="attrs">{'required': [('supplier_rank','>', 0)]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="city" position="attributes">
|
||||||
|
<attribute name="attrs">{'required': [('supplier_rank','>', 0)]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="country_id" position="attributes">
|
||||||
|
<attribute name="attrs">{'required': [('supplier_rank','>', 0)]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<xpath expr="//group[@name='sale']/field[@name='user_id']" position="replace">
|
||||||
|
<field name="user_id" widget="many2one_avatar_user" context="{'is_sale': True }"
|
||||||
|
attrs="{'required' : [('customer_rank','>', 0)],'readonly': [('supplier_rank','>', 0)]}"/>
|
||||||
|
</xpath>
|
||||||
|
<field name="category_id" position="attributes">
|
||||||
|
<attribute name="required">1</attribute>
|
||||||
|
<!-- <attribute name="attrs">{'required': ['|',('customer_rank','>', 0),('supplier_rank','>', 0)]}</attribute>-->
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="view_partner_property_form_inherit_sf">
|
||||||
|
<field name="name">res.partner.property.form.inherit.sf</field>
|
||||||
|
<field name="model">res.partner</field>
|
||||||
|
<field name="inherit_id" ref="account.view_partner_property_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="property_supplier_payment_term_id" position="before">
|
||||||
|
<field name="purchase_user_id" context="{'supplier_rank': supplier_rank }"
|
||||||
|
widget="many2one_avatar_user"
|
||||||
|
attrs="{'required' : [('supplier_rank','>', 0)],'readonly': [('customer_rank','>', 0)]}"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="view_partner_property_form_inherit_sf">
|
||||||
|
<field name="name">res.partner.property.form.inherit.sf</field>
|
||||||
|
<field name="model">res.partner</field>
|
||||||
|
<field name="inherit_id" ref="base.view_partner_tree"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="function" position="before">
|
||||||
|
<field name="customer_rank" invisible="1"/>
|
||||||
|
<field name="supplier_rank" invisible="1"/>
|
||||||
|
</field>
|
||||||
|
<field name="user_id" position="attributes">
|
||||||
|
<attribute name="attrs">{'invisible': [('customer_rank','=', 0)]}
|
||||||
|
</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="user_id" position="before">
|
||||||
|
<field name="purchase_user_id" widget="many2one_avatar_user"
|
||||||
|
attrs="{'invisible' : [('supplier_rank','=', 0)]}"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
@@ -1,65 +1,117 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<!-- <record id="sale_order_view_search_inherit_quotation_inherit_sf" model="ir.ui.view">-->
|
|
||||||
<!-- <field name="name">sale.order.search.quotation.inherit.sf</field>-->
|
|
||||||
<!-- <field name="model">sale.order</field>-->
|
|
||||||
<!-- <!– <field name="inherit_id" ref="sale.view_sales_order_filter"/>–>-->
|
|
||||||
|
|
||||||
<!-- <field name="inherit_id" ref="sale.sale_order_view_search_inherit_quotation"/>-->
|
|
||||||
<!-- <field name="arch" type="xml">-->
|
|
||||||
<!-- <xpath expr="//filter[@name='my_sale_orders_filter']" position="replace">-->
|
|
||||||
<!-- <!– <field name="campaign_id"/>–>-->
|
|
||||||
<!-- <!– <separator/>–>-->
|
|
||||||
<!-- <!– <filter string="Quotations" name="draft" domain="[('state','in',('draft', 'sent'))]"/>–>-->
|
|
||||||
<!-- <!– <filter string="Sales Orders" name="sales" domain="[('state','in',('sale','done'))]"/>–>-->
|
|
||||||
<!-- <!– <separator/>–>-->
|
|
||||||
<!-- <filter string="Create Date" name="filter_create_date" date="create_date"/>-->
|
|
||||||
<!-- </xpath>-->
|
|
||||||
<!-- </field>-->
|
|
||||||
<!-- </record>-->
|
|
||||||
|
|
||||||
|
|
||||||
<record model="ir.ui.view" id="view_sale_order_form_inherit_sf">
|
<record model="ir.ui.view" id="view_sale_order_form_inherit_sf">
|
||||||
<field name="name">sale.order.form.inherit.sf</field>
|
<field name="name">sale.order.form.inherit.sf</field>
|
||||||
<field name="model">sale.order</field>
|
<field name="model">sale.order</field>
|
||||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//form/header/button[@name='action_quotation_send'][1]" position="replace">
|
||||||
|
<button name="action_quotation_send" string="通过EMAIL发送" type="object"
|
||||||
|
class="btn-primary" data-hotkey="g" context="{'validate_analytic': True}"
|
||||||
|
attrs="{'invisible': ['|','&',('check_status', '!=', 'approved'),('state', 'in', ['draft','cancel']),'&',('check_status', '=', 'approved'),('state', 'in', ['sale','cancel'])]}"/>
|
||||||
|
</xpath>
|
||||||
<xpath expr="//form/header/button[@name='action_confirm']" position="after">
|
<xpath expr="//form/header/button[@name='action_confirm']" position="after">
|
||||||
<field name="check_status" invisible="1"/>
|
<button name="submit" string="提交" type="object"
|
||||||
<button name="sf_sale.action_sale_order_check_wizard" string="审核" type="action"
|
|
||||||
context="{'default_order_id':active_id}"
|
context="{'default_order_id':active_id}"
|
||||||
attrs="{'invisible': [('check_status','=', 'checked')]}"
|
attrs="{'invisible': [('check_status','!=', False)]}"
|
||||||
class="oe_highlight"/>
|
class="oe_highlight"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//form/header/button[@name='action_confirm'][1]" position="attributes">
|
<xpath expr="//form/header/button[@name='action_confirm']" position="after">
|
||||||
<attribute name="attrs">{'invisible': [('check_status', '=', 'unchecked'),('state', 'not in',
|
<field name="check_status" invisible="1"/>
|
||||||
['sent'])]}
|
<field name="schedule_status" invisible="1"/>
|
||||||
|
<button name="sf_sale.action_sale_order_check_wizard" string="审核" type="action"
|
||||||
|
context="{'default_order_id':active_id}" groups="sf_base.group_sale_director"
|
||||||
|
attrs="{'invisible': ['|',('check_status','in', ['approved',False]),('state', 'in', ['cancel'])]}"
|
||||||
|
class="oe_highlight"/>
|
||||||
|
</xpath>
|
||||||
|
<!-- <xpath expr="//form/header/button[@name='action_confirm'][1]" position="attributes">-->
|
||||||
|
<!-- <attribute name="attrs">{'invisible': [('check_status', '!=', 'approved'),('state', 'not in',-->
|
||||||
|
<!-- ['sent'])]}-->
|
||||||
|
<!-- </attribute>-->
|
||||||
|
<!-- </xpath>-->
|
||||||
|
<xpath expr="//form/header/button[@name='action_confirm'][2]" position="replace">
|
||||||
|
<button name="action_confirm" data-hotkey="v"
|
||||||
|
string="确认" type="object" context="{'validate_analytic': True}"
|
||||||
|
attrs="{'invisible': ['|','&',('check_status', '!=', 'approved'),('state', 'in', ['draft','cancel']),'&',('check_status', '=', 'approved'),('state', 'in', ['sale','cancel'])]}"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//form/header/button[@name='action_cancel']" position="attributes">
|
||||||
|
<attribute name="attrs">{'invisible': ['|',('check_status', '!=', 'approved'),('schedule_status',
|
||||||
|
'not in', ['to schedule',False])]}
|
||||||
</attribute>
|
</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//form/header/button[@name='action_confirm'][2]" position="attributes">
|
<xpath expr="//form/header/button[@name='action_draft']" position="attributes">
|
||||||
<attribute name="attrs">{'invisible': [('check_status', '=', 'unchecked'),('state', 'in',
|
<attribute name="invisible">1</attribute>
|
||||||
['draft'])]}
|
|
||||||
</attribute>
|
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<!-- <xpath expr="//form/header/button[@name='action_draft']" position="replace">-->
|
||||||
|
<!-- <button name="action_draft" states="cancel" type="object" string="设为报价" data-hotkey="w"-->
|
||||||
|
<!-- invisible="1"/>-->
|
||||||
|
<!-- </xpath>-->
|
||||||
<field name="partner_id" position="replace">
|
<field name="partner_id" position="replace">
|
||||||
<field name="partner_id" widget="res_partner_many2one" context="{'is_customer': True }"
|
<field name="partner_id" widget="res_partner_many2one" context="{'is_customer': True }"
|
||||||
options='{"always_reload": True}'/>
|
options='{"always_reload": True}'/>
|
||||||
</field>
|
</field>
|
||||||
|
<field name="payment_term_id" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||||
|
</field>
|
||||||
<field name="payment_term_id" position="after">
|
<field name="payment_term_id" position="after">
|
||||||
<field name="deadline_of_delivery"/>
|
<field name="deadline_of_delivery" attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
|
||||||
<field name="payments_way"/>
|
<field name="payments_way" attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
|
||||||
<field name="pay_way"/>
|
<field name="pay_way" attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
|
||||||
|
<field name="schedule_status" readonly="1"
|
||||||
|
attrs="{'invisible': [('state', 'in', ('sale','cancel'))]}"/>
|
||||||
</field>
|
</field>
|
||||||
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="before">
|
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="before">
|
||||||
<field name="model_glb_file" widget="Viewer3D" optional="show"
|
<field name="model_glb_file" widget="Viewer3D" optional="show"
|
||||||
string="模型文件"/>
|
string="模型文件"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='order_line']" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||||
|
</xpath>
|
||||||
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="replace">
|
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="replace">
|
||||||
<field name="name" widget="section_and_note_text" optional="show"
|
<field name="name" widget="section_and_note_text" optional="show"
|
||||||
string="参数说明(长/宽/高/体积/精度/材质)"/>
|
string="参数说明(长/宽/高/体积/精度/材质)"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<field name="user_id" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="team_id" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="fiscal_position_id" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="client_order_ref" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field name="tag_ids" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="commitment_date" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="origin" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="campaign_id" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="medium_id" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="source_id" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="signed_by" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="signed_on" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="signature" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||||
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
@@ -73,16 +125,13 @@
|
|||||||
<attribute name="string">下单日期</attribute>
|
<attribute name="string">下单日期</attribute>
|
||||||
</field>
|
</field>
|
||||||
<field name="sale_order_template_id" position="after">
|
<field name="sale_order_template_id" position="after">
|
||||||
<!-- <label for="person_of_delivery" string="交货信息"/>-->
|
<field name="person_of_delivery" string="交货人"
|
||||||
<!-- <div>-->
|
attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
|
||||||
<field name="person_of_delivery" string="交货人"/>
|
<field name="telephone_of_delivery" string="交货人联系方式"
|
||||||
<!-- <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
|
attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
|
||||||
<!-- </span>-->
|
<field name="address_of_delivery" string="交货人地址"
|
||||||
<field name="telephone_of_delivery" string="交货人联系方式"/>
|
attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
|
||||||
<!-- <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
|
<field name="remark" attrs="{'readonly': [('state', 'in', ('sale','cancel'))]}"/>
|
||||||
<!-- </span>-->
|
|
||||||
<field name="address_of_delivery" string="交货人地址"/>
|
|
||||||
<!-- </div>-->
|
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -102,8 +151,10 @@
|
|||||||
<attribute name="string">下单时间</attribute>
|
<attribute name="string">下单时间</attribute>
|
||||||
</field>
|
</field>
|
||||||
<field name="state" position="after">
|
<field name="state" position="after">
|
||||||
<field name="check_status" widget="label_selection"
|
<field name="check_status" widget="badge"
|
||||||
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
|
decoration-success="check_status == 'approved'"
|
||||||
|
decoration-warning="check_status == 'pending'"
|
||||||
|
decoration-danger="check_status == 'fail'"/>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -113,9 +164,20 @@
|
|||||||
<field name="model">sale.order</field>
|
<field name="model">sale.order</field>
|
||||||
<field name="inherit_id" ref="sale.view_order_tree"/>
|
<field name="inherit_id" ref="sale.view_order_tree"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
|
<tree position="attributes">
|
||||||
|
<attribute name="create">False</attribute>
|
||||||
|
</tree>
|
||||||
<field name="name" position="attributes">
|
<field name="name" position="attributes">
|
||||||
<attribute name="string">订单号</attribute>
|
<attribute name="string">订单号</attribute>
|
||||||
</field>
|
</field>
|
||||||
|
<field name="amount_total" position="after">
|
||||||
|
<field name="schedule_status" widget="badge"
|
||||||
|
decoration-success="schedule_status == 'received'"
|
||||||
|
decoration-warning="schedule_status == 'to process'"
|
||||||
|
decoration-danger="schedule_status == 'to receive'"
|
||||||
|
decoration-muted="schedule_status == 'to process'"
|
||||||
|
decoration-info="schedule_status == 'to schedule'"/>
|
||||||
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
from . import sale_order_wizard
|
from . import sale_order_wizard
|
||||||
|
from . import purchase_order_wizard
|
||||||
|
|||||||
25
sf_sale/wizard/purchase_order_wizard.py
Normal file
25
sf_sale/wizard/purchase_order_wizard.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from odoo import models, api, fields
|
||||||
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
|
|
||||||
|
class PurchaseOrderWizard(models.TransientModel):
|
||||||
|
_name = 'purchase.order.wizard'
|
||||||
|
_description = '采购向导'
|
||||||
|
|
||||||
|
order_id = fields.Many2one('purchase.order')
|
||||||
|
# check_state = fields.Selection([('pass', '通过'), ('back', '退回')], '处理意见', default='pass')
|
||||||
|
check_audit = fields.Text('审核意见')
|
||||||
|
|
||||||
|
def submit(self):
|
||||||
|
self.order_id.check_status = 'approved'
|
||||||
|
self.order_id.remark = self.check_audit
|
||||||
|
|
||||||
|
def back(self):
|
||||||
|
if not self.check_audit:
|
||||||
|
raise UserError('请输入原因')
|
||||||
|
else:
|
||||||
|
self.order_id.write({'check_status': 'fail', 'remark': self.check_audit})
|
||||||
|
|
||||||
|
def confirm(self):
|
||||||
|
self.order_id.check_status = 'pending'
|
||||||
54
sf_sale/wizard/purchase_order_wizard_views.xml
Normal file
54
sf_sale/wizard/purchase_order_wizard_views.xml
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<record model="ir.ui.view" id="purchase_order_check_wizard_form_view">
|
||||||
|
<field name="name">purchase.order.check.wizard.form.view</field>
|
||||||
|
<field name="model">purchase.order.wizard</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form>
|
||||||
|
<field name="order_id" invisible="True"/>
|
||||||
|
<group>
|
||||||
|
<!-- <field name="check_state" widget="radio" options="{'horizontal': true}" required="True" string=""/>-->
|
||||||
|
<field name="check_audit" placeholder="原因.." nolabel="1" colspan="2"/>
|
||||||
|
</group>
|
||||||
|
<footer>
|
||||||
|
<button string="通过" name="submit" type="object" class="oe_highlight"/>
|
||||||
|
<button string="退回" name="back" type="object" class="btn btn-secondary"/>
|
||||||
|
<!-- <button string="提交" name="submit" type="object" class="oe_highlight"/>-->
|
||||||
|
<!-- <button string="取消" class="btn btn-secondary" special="cancel"/>-->
|
||||||
|
</footer>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="action_purchase_order_check_wizard" model="ir.actions.act_window">
|
||||||
|
<field name="name">审核</field>
|
||||||
|
<field name="res_model">purchase.order.wizard</field>
|
||||||
|
<field name="view_mode">form</field>
|
||||||
|
<field name="target">new</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="purchase_order_submit_wizard_form_view">
|
||||||
|
<field name="name">purchase.order.submit.wizard.form.view</field>
|
||||||
|
<field name="model">purchase.order.wizard</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form>
|
||||||
|
<field name="order_id" invisible="True"/>
|
||||||
|
<div>
|
||||||
|
提交后不可更改,是否确定提交?
|
||||||
|
</div>
|
||||||
|
<footer>
|
||||||
|
<button string="确认" name="confirm" type="object" class="oe_highlight"/>
|
||||||
|
<button string="取消" class="btn btn-secondary" special="cancel"/>
|
||||||
|
</footer>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="action_purchase_order_submit_wizard" model="ir.actions.act_window">
|
||||||
|
<field name="name">提交</field>
|
||||||
|
<field name="res_model">purchase.order.wizard</field>
|
||||||
|
<field name="view_mode">form</field>
|
||||||
|
<field name="target">new</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from odoo import models, api, fields
|
from odoo import models, api, fields
|
||||||
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
|
|
||||||
class saleOrderCheckWizard(models.TransientModel):
|
class saleOrderCheckWizard(models.TransientModel):
|
||||||
@@ -8,9 +9,15 @@ class saleOrderCheckWizard(models.TransientModel):
|
|||||||
_description = '报价/销售订单审核向导'
|
_description = '报价/销售订单审核向导'
|
||||||
|
|
||||||
order_id = fields.Many2one('sale.order')
|
order_id = fields.Many2one('sale.order')
|
||||||
check_state = fields.Selection([('pass', '通过'), ('back', '退回')], '审核状态', default='pass')
|
# check_state = fields.Selection([('pass', '通过'), ('back', '退回')], '处理意见', default='pass')
|
||||||
check_audit = fields.Text('审核意见')
|
check_audit = fields.Text('审核意见')
|
||||||
|
|
||||||
def submit(self):
|
def submit(self):
|
||||||
self.order_id.check_status = 'unchecked' if not self.check_state == 'pass' else 'checked'
|
self.order_id.check_status = 'approved'
|
||||||
self.order_id.message_ids = '1'
|
self.order_id.remark = self.check_audit
|
||||||
|
|
||||||
|
def back(self):
|
||||||
|
if not self.check_audit:
|
||||||
|
raise UserError('请输入原因')
|
||||||
|
else:
|
||||||
|
self.order_id.write({'check_status': 'fail', 'remark': self.check_audit})
|
||||||
|
|||||||
@@ -7,19 +7,21 @@
|
|||||||
<form>
|
<form>
|
||||||
<field name="order_id" invisible="True"/>
|
<field name="order_id" invisible="True"/>
|
||||||
<group>
|
<group>
|
||||||
<field name="check_state" required="True"/>
|
<!-- <field name="check_state" widget="radio" options="{'horizontal': true}" required="True" string=""/>-->
|
||||||
<field name="check_audit" attrs="{'required': [('check_state', '=', 'back')]}"/>
|
<field name="check_audit" placeholder="原因.." nolabel="1" colspan="2"/>
|
||||||
</group>
|
</group>
|
||||||
<footer>
|
<footer>
|
||||||
<button string="提交" name="submit" type="object" class="oe_highlight"/>
|
<button string="通过" name="submit" type="object" class="oe_highlight"/>
|
||||||
<button string="取消" class="btn btn-secondary" special="cancel"/>
|
<button string="退回" name="back" type="object" class="btn btn-secondary" />
|
||||||
|
<!-- <button string="提交" name="submit" type="object" class="oe_highlight"/>-->
|
||||||
|
<!-- <button string="取消" class="btn btn-secondary" special="cancel"/>-->
|
||||||
</footer>
|
</footer>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_sale_order_check_wizard" model="ir.actions.act_window">
|
<record id="action_sale_order_check_wizard" model="ir.actions.act_window">
|
||||||
<field name="name">销售订单审核向导</field>
|
<field name="name">审核</field>
|
||||||
<field name="res_model">sale.order.check.wizard</field>
|
<field name="res_model">sale.order.check.wizard</field>
|
||||||
<field name="view_mode">form</field>
|
<field name="view_mode">form</field>
|
||||||
<field name="target">new</field>
|
<field name="target">new</field>
|
||||||
|
|||||||
@@ -293,24 +293,69 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
|||||||
'sf_functional_cutting_tool_entity_ref',
|
'sf_functional_cutting_tool_entity_ref',
|
||||||
string='功能刀具列表信息', readonly=True)
|
string='功能刀具列表信息', readonly=True)
|
||||||
|
|
||||||
|
sf_functional_tool_assembly_ids = fields.Many2many('sf.functional.tool.assembly', 'sf_functional_tool_assembly_ref',
|
||||||
|
'功能刀具组装单', readonly=True)
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _read_mrs_cutting_tool_type_ids(self, categories, domain, order):
|
def _read_mrs_cutting_tool_type_ids(self, categories, domain, order):
|
||||||
mrs_cutting_tool_type_ids = categories._search([], order=order, access_rights_uid=SUPERUSER_ID)
|
mrs_cutting_tool_type_ids = categories._search([], order=order, access_rights_uid=SUPERUSER_ID)
|
||||||
return categories.browse(mrs_cutting_tool_type_ids)
|
return categories.browse(mrs_cutting_tool_type_ids)
|
||||||
|
|
||||||
@api.depends('sf_functional_cutting_tool_entity_ids')
|
@api.depends('sf_functional_cutting_tool_entity_ids', 'min_stock_num', 'max_stock_num')
|
||||||
def _compute_batch_replenishment_num(self):
|
def _compute_batch_replenishment_num(self):
|
||||||
for tool in self:
|
for tool in self:
|
||||||
if tool:
|
if tool:
|
||||||
|
# 判断功能刀具组装单是否已经完成
|
||||||
|
tool.estimate_functional_tool_assembly_ids(tool)
|
||||||
tool.get_stock_num(tool)
|
tool.get_stock_num(tool)
|
||||||
# 计算当前库存量
|
# 计算当前库存量
|
||||||
tool.tool_stock_total = tool.tool_stock_num + tool.side_shelf_num + tool.on_tool_stock_num
|
tool.tool_stock_total = tool.tool_stock_num + tool.side_shelf_num + tool.on_tool_stock_num
|
||||||
# 如果当前库存量小于最低库存量,计算批次补货量
|
# 如果当前库存量小于最低库存量,计算批次补货量
|
||||||
|
tool.open_batch_replenishment_num(tool)
|
||||||
|
|
||||||
|
def open_batch_replenishment_num(self, tool):
|
||||||
|
"""
|
||||||
|
计算批次补货量
|
||||||
|
"""
|
||||||
if tool.tool_stock_total < tool.min_stock_num:
|
if tool.tool_stock_total < tool.min_stock_num:
|
||||||
tool.batch_replenishment_num = tool.max_stock_num - tool.tool_stock_total
|
tool.batch_replenishment_num = tool.max_stock_num - tool.tool_stock_total
|
||||||
|
# 根据判断创建功能刀具组装单
|
||||||
|
if not tool.sf_functional_tool_assembly_ids:
|
||||||
|
for i in range(tool.batch_replenishment_num):
|
||||||
|
tool.create_functional_tool_assembly()
|
||||||
|
print(i, ": ", tool.sf_functional_tool_assembly_ids)
|
||||||
else:
|
else:
|
||||||
tool.batch_replenishment_num = 0
|
tool.batch_replenishment_num = 0
|
||||||
|
|
||||||
|
|
||||||
|
def create_functional_tool_assembly(self):
|
||||||
|
"""
|
||||||
|
创建功能刀具组装单
|
||||||
|
"""
|
||||||
|
functional_tool_assembly = self.env['sf.functional.tool.assembly'].sudo().create({
|
||||||
|
'functional_tool_name': self.name,
|
||||||
|
'functional_tool_type_id': self.sf_cutting_tool_type_id.id,
|
||||||
|
'functional_tool_diameter': self.diameter,
|
||||||
|
'knife_tip_r_angle': self.knife_tip_r_angle,
|
||||||
|
'coarse_middle_thin': self.coarse_middle_thin,
|
||||||
|
'loading_task_source': '2',
|
||||||
|
'use_tool_time': fields.Datetime.now() + timedelta(hours=4),
|
||||||
|
'applicant': '系统自动',
|
||||||
|
'apply_time': fields.Datetime.now(),
|
||||||
|
'whether_standard_knife': self.whether_standard_knife,
|
||||||
|
'reason_for_applying': '安全库存',
|
||||||
|
})
|
||||||
|
self.sf_functional_tool_assembly_ids = [(4, functional_tool_assembly.id)]
|
||||||
|
|
||||||
|
def estimate_functional_tool_assembly_ids(self, tool):
|
||||||
|
"""
|
||||||
|
判断功能刀具组装单是否完成,如果全部完成清空sf_functional_tool_assembly_ids的数据
|
||||||
|
"""
|
||||||
|
for sf_functional_tool_assembly_id in tool.sf_functional_tool_assembly_ids:
|
||||||
|
if sf_functional_tool_assembly_id.assemble_status == '0':
|
||||||
|
return False
|
||||||
|
tool.sf_functional_tool_assembly_ids = []
|
||||||
|
|
||||||
def get_stock_num(self, tool):
|
def get_stock_num(self, tool):
|
||||||
"""
|
"""
|
||||||
计算刀具房数量、线边刀库数量、机内刀库数量
|
计算刀具房数量、线边刀库数量、机内刀库数量
|
||||||
@@ -494,6 +539,9 @@ class MachineTableToolChangingApply(models.Model):
|
|||||||
[('name', '=', self.name.id)]).write({'status': '0'})
|
[('name', '=', self.name.id)]).write({'status': '0'})
|
||||||
|
|
||||||
def create_tool_change_application(self):
|
def create_tool_change_application(self):
|
||||||
|
"""
|
||||||
|
根据已有机床刀位创建机台换刀申请记录
|
||||||
|
"""
|
||||||
maintenance_equipment_ids = self.env['maintenance.equipment'].sudo().search(
|
maintenance_equipment_ids = self.env['maintenance.equipment'].sudo().search(
|
||||||
[('product_template_ids', '!=', False)])
|
[('product_template_ids', '!=', False)])
|
||||||
tool_changing_apply = self.env['sf.machine.table.tool.changing.apply']
|
tool_changing_apply = self.env['sf.machine.table.tool.changing.apply']
|
||||||
|
|||||||
@@ -25,8 +25,8 @@
|
|||||||
<field name="used_value"/>
|
<field name="used_value"/>
|
||||||
<field name="functional_tool_status"/>
|
<field name="functional_tool_status"/>
|
||||||
|
|
||||||
<field name="current_location_id" invisible="True"/>
|
<field name="current_location_id" optional="hide"/>
|
||||||
<field name="current_location" invisible="True"/>
|
<field name="current_location" optional="hide"/>
|
||||||
<field name="sf_cutting_tool_type_id" invisible="True"/>
|
<field name="sf_cutting_tool_type_id" invisible="True"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
@@ -366,7 +366,7 @@
|
|||||||
<field name="barcode_id"/>
|
<field name="barcode_id"/>
|
||||||
<field name="functional_tool_name_id"/>
|
<field name="functional_tool_name_id"/>
|
||||||
<field name="new_former"/>
|
<field name="new_former"/>
|
||||||
<field name="tool_loading_length"/>
|
<field name="tool_loading_length" string="总长度"/>
|
||||||
<field name="functional_tool_length"/>
|
<field name="functional_tool_length"/>
|
||||||
<field name="effective_length"/>
|
<field name="effective_length"/>
|
||||||
<field name="max_lifetime_value"/>
|
<field name="max_lifetime_value"/>
|
||||||
@@ -1158,10 +1158,11 @@
|
|||||||
<field name="applicant"/>
|
<field name="applicant"/>
|
||||||
<field name="apply_time"/>
|
<field name="apply_time"/>
|
||||||
<field name="functional_tool_type_id"/>
|
<field name="functional_tool_type_id"/>
|
||||||
<field name="assemble_status"/>
|
<filter name="no_assemble_status" string="未组装" domain="[('assemble_status', '=', '0')]"/>
|
||||||
|
<filter name="yes_assemble_status" string="已组装" domain="[('assemble_status', '=', '1')]"/>
|
||||||
<searchpanel>
|
<searchpanel>
|
||||||
<field name="functional_tool_type_id" enable_counters="1" icon="fa-filter"/>
|
<field name="functional_tool_type_id" enable_counters="1" icon="fa-filter"/>
|
||||||
<field name="assemble_status" enable_counters="1" icon="fa-filter"/>
|
<!-- <field name="assemble_status" enable_counters="1" icon="fa-filter"/>-->
|
||||||
</searchpanel>
|
</searchpanel>
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
@@ -1172,6 +1173,9 @@
|
|||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">sf.functional.tool.assembly</field>
|
<field name="res_model">sf.functional.tool.assembly</field>
|
||||||
<field name="view_mode">tree,form,search</field>
|
<field name="view_mode">tree,form,search</field>
|
||||||
|
<!-- <field name="view_id" ref="sf_functional_tool_assembly_tree"/>-->
|
||||||
|
<field name="search_view_id" ref="sf_functional_tool_assembly_search"/>
|
||||||
|
<field name="context">{'search_default_no_assemble_status':1}</field>
|
||||||
</record>
|
</record>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
Reference in New Issue
Block a user