<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
    <data>
        <!--加工工艺-->
        <record model="ir.ui.view" id="sf_processing_technology_form">
            <field name="model">sf.processing.technology</field>
            <field name="arch" type="xml">
                <form string="加工工艺">
                    <group>
                        <group>
                            <field name="process_encode" readonly="1"/>
                        </group>
                        <group>
                            <field name="name" required="1"/>
                        </group>
                    </group>
                    <group>
                        <field name="remark"/>
                    </group>
                </form>
            </field>
        </record>
        <record model="ir.ui.view" id="sf_processing_technology_tree">
            <field name="model">sf.processing.technology</field>
            <field name="arch" type="xml">
                <tree string="加工工艺">
                    <field name="process_encode"/>
                    <field name="name"/>
                </tree>
            </field>
        </record>
        <record model="ir.ui.view" id="search_sf_processing_technology_view">
            <field name="name">search.sf.processing.technology.type</field>
            <field name="model">sf.processing.technology</field>
            <field name="arch" type="xml">
                <search>
                    <field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
                    <field name="process_encode" string="编码搜索" filter_domain="[('process_encode','ilike',self)]"/>
                </search>
            </field>
        </record>
        <!--表面工艺-->
        <record model="ir.ui.view" id="sf_production_process_tree">
            <field name="model">sf.production.process</field>
            <field name="arch" type="xml">
                <tree string="表面工艺">
                    <field name="process_encode" readonly="1"/>
                    <field name="name" readonly="1"/>
                    <field name="remark"/>
                </tree>
            </field>
        </record>

        <record model="ir.ui.view" id="sf_production_process_form">
            <field name="model">sf.production.process</field>
            <field name="arch" type="xml">
                <form string="表面工艺">
                    <group>
                        <field name="process_encode" readonly="1"/>
                        <field name="name" required="1"/>
                    </group>

                    <notebook>
                        <page string="工序">
                            <field name='processing_order_ids' options="{'no_create':True}" widget="one2many">
                                <tree editable='bottom'>
                                    <field name="sequence" widget="handle"/>
                                    <field name="processing_technology_ids" widget="many2many_tags">
                                    </field>
                                </tree>
                                <form>
                                    <field name="processing_technology_ids" widget="many2many">
                                    </field>
                                </form>
                            </field>
                        </page>
                    </notebook>
                    <group>
                        <field name="remark"/>
                    </group>
                </form>
            </field>
        </record>
        <record model="ir.ui.view" id="search_sf_production_process_view">
            <field name="name">search.sf.production.process.type</field>
            <field name="model">sf.production.process</field>
            <field name="arch" type="xml">
                <search>
                    <field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
                    <field name="process_encode" string="编码搜索" filter_domain="[('process_encode','ilike',self)]"/>
                </search>
            </field>
        </record>
        <!--材料型号-->
        <record model="ir.ui.view" id="sf_materials_model_form">
            <field name="model">sf.materials.model</field>
            <field name="arch" type="xml">
                <form string="材料型号">
                    <group>
                        <group>
                            <field name="materials_no" readonly="1"/>
                            <field name="name" required="1"/>
                            <field name="gain_way" required="1"/>
                        </group>
                        <group>
                            <field name="density" required="1"/>
                            <field name="need_h" default="false"/>
                            <field name="mf_materia_post" attrs="{'invisible':[('need_h','=',False)]} "/>
                        </group>
                        <group>
                            <field name='materials_id' default="default" invisible="1"/>
                        </group>
                    </group>
                    <group>
                        <field name='supplier_ids'>
                            <tree editable='bottom'>
                                <field name="sequence" widget="handle" string="序号"/>
                                <field name="partner_id" string="名称"/>
                            </tree>
                        </field>
                    </group>
                    <group>
                        <field name="remark"/>
                    </group>
                </form>
            </field>
        </record>
        <record model="ir.ui.view" id="sf_materials_model_tree">
            <field name="model">sf.materials.model</field>
            <field name="arch" type="xml">
                <tree string="材料型号">
                    <field name="materials_no"/>
                    <field name="name"/>
                    <field name="need_h"/>
                    <field name="density"/>
                    <field name='materials_id' invisible="1"/>
                </tree>
            </field>
        </record>
        <record model="ir.ui.view" id="search_sf_materials_model_type_view">
            <field name="name">search.sf.materials.model.type</field>
            <field name="model">sf.materials.model</field>
            <field name="arch" type="xml">
                <search>
                    <field name="name" string="型号名搜索" filter_domain="[('name','ilike',self)]"/>
                    <field name="materials_no" string="编码搜索" filter_domain="[('materials_no','ilike',self)]"/>
                    <searchpanel class="account_root">
                        <field name="materials_id" icon="fa-filter"/>
                    </searchpanel>

                </search>
            </field>
        </record>
        <!--材料-->
        <record model="ir.ui.view" id="sf_production_materials_form">
            <field name="model">sf.production.materials</field>
            <field name="arch" type="xml">
                <form string="材料">

                    <group string="详情">
                        <group>
                            <field name="materials_no" readonly="1" default="编码"/>
                        </group>
                        <group>
                            <field name="name" required="1"/>
                        </group>
                        <field name="materials_model_ids" widget="ony2many">
                            <tree string="材料型号">
                                <field name="materials_no"/>
                                <field name="name"/>
                                <field name="need_h"/>
                                <field name="mf_materia_post"/>
                                <field name="density"/>
                                <field name='materials_id' default="default" invisible="1"/>
                            </tree>
                        </field>

                    </group>
                    <group>
                        <field name="remark"/>
                    </group>
                </form>
            </field>
        </record>
        <record model="ir.ui.view" id="sf_production_materials_tree">
            <field name="model">sf.production.materials</field>
            <field name="arch" type="xml">
                <tree string="材料">
                    <field name="materials_no" readonly="1"/>
                    <field name="name" readonly="1"/>

                </tree>
            </field>
        </record>
        <record model="ir.ui.view" id="search_sf_production_materials_view">
            <field name="name">search.sf.production.materials.type</field>
            <field name="model">sf.production.materials</field>
            <field name="arch" type="xml">
                <search>
                    <field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
                    <field name="materials_no" string="编码搜索" filter_domain="[('materials_no','ilike',self)]"/>
                </search>
            </field>
        </record>

        <!--        <record model="ir.ui.view" id="sf_production_materials_form">-->
        <!--            <field name="model">sf.production.materials</field>-->
        <!--            <field name="arch" type="xml">-->
        <!--                <form string="材料">-->

        <!--                    <group string="详情">-->
        <!--                        <group>-->
        <!--                            <field name="materials_no" required="1" default="编码"/>-->
        <!--                        </group>-->
        <!--                        <group>-->
        <!--                            <field name="name" required="1"/>-->
        <!--                        </group>-->
        <!--                        <field name="materials_model_ids">-->

        <!--                        </field>-->
        <!--                    </group>-->
        <!--                </form>-->
        <!--            </field>-->
        <!--        </record>-->

        <record id="sf_production_materials" model="ir.actions.act_window">
            <field name="name">材料</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">sf.production.materials</field>
            <field name="view_mode">tree,form</field>
            <field name="help" type="html">
                <p class="o_view_nocontent_smiling_face">
                    材料！
                </p>
            </field>
        </record>
        <record id="sf_production_process" model="ir.actions.act_window">
            <field name="name">表面工艺</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">sf.production.process</field>
            <field name="view_mode">tree,form</field>
            <field name="help" type="html">
                <p class="o_view_nocontent_smiling_face">
                    表面工艺！
                </p>
            </field>
        </record>
        <record id="sf_materials_model" model="ir.actions.act_window">
            <field name="name">材料型号</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">sf.materials.model</field>
            <field name="view_mode">tree,form</field>
            <field name="help" type="html">
                <p class="o_view_nocontent_smiling_face">
                    材料型号！
                </p>
            </field>
        </record>
        <record id="sf_processing_technology" model="ir.actions.act_window">
            <field name="name">加工工艺</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">sf.processing.technology</field>
            <field name="view_mode">tree,form</field>
            <field name="help" type="html">

                <p class="o_view_nocontent_smiling_face">
                    加工工艺！
                </p>
            </field>
        </record>

        #------------------托盘------------------
        <record id="action_sf_tray" model="ir.actions.act_window">
            <field name="name">托盘</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">sf.tray</field>
            <field name="view_mode">tree,form</field>
            <field name="help" type="html">
                <p class="o_view_nocontent_smiling_face">
                    创建托盘吧
                </p>
            </field>
        </record>

        <record id="view_sf_tray_search" model="ir.ui.view">
            <field name="name">sf.tray.search</field>
            <field name="model">sf.tray</field>
            <field name="arch" type="xml">
                <search string="托盘">
                    <field name="name" string="名称" filter_domain="[('name','ilike',self)]"/>
                    <field name="code" string="编码" filter_domain="[('code','ilike',self)]"/>
                    <group string="分组">
                        <filter name="state" string="状态" domain="[]" context="{'group_by': 'state'}"/>
                    </group>
                </search>

            </field>
        </record>

        <record model="ir.ui.view" id="tree_sf_tray_view">
            <field name="name">sf.tray.tree</field>
            <field name="model">sf.tray</field>
            <field name="arch" type="xml">
                <tree string="托盘">
                    <field name="code"/>
                    <field name="name"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>

        <record model="ir.ui.view" id="sf_tray_form">
            <field name="name">sf.tray.form</field>
            <field name="model">sf.tray</field>
            <field name="arch" type="xml">
                <form string="托盘">
                    <header>
                        <field name='state' widget="radio" options="{'horizontal': True}"/>
                    </header>
                    <group string="基本信息" name="group1">
                        <group>
                            <field name="code" required="1"/>
                        </group>
                        <group>
                            <field name="name" required="1"/>
                        </group>
                    </group>
                </form>
            </field>
        </record>
    </data>
</odoo>