osbzr/gooderp_addons

View on GitHub
warehouse/view/production_view.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <!-- 物料清单 -->
        <record id='wh_bom_tree' model='ir.ui.view'>
            <field name='name'>wh.bom.tree</field>
            <field name='model'>wh.bom</field>
            <field name='arch' type='xml'>
                <tree string='物料清单'>
                    <field name='name' />
                    <field name='type' />
                    <field name='line_parent_ids' widget='relation_sublist' options="{'field': 'goods_id'}" string='组合件' />
                    <field name='line_parent_ids' widget='relation_sublist' options="{'field': 'goods_qty'}" string='组合件数量' />
                    <field name='line_child_ids' widget='relation_sublist' options="{'field': 'goods_id'}" string='子件' />
                    <field name='line_child_ids' widget='relation_sublist' options="{'field': 'goods_qty'}" string='子件数量' />
                    <field name='active'  invisible='1'/>
                </tree>
            </field>
        </record>

        <record id='wh_bom_form' model='ir.ui.view'>
            <field name='name'>wh.bom.form</field>
            <field name='model'>wh.bom</field>
            <field name='arch' type='xml'>
                <form string='物料清单'>
                    <sheet>
                        <group>
                            <group>
                                <field name='name' required='1' />
                            </group>
                            <group>
                                <field name='type' required='1' />
                            </group>
                        </group>

                        <group string='组合件'>
                            <field name='line_parent_ids' nolabel='1' >
                                <tree editable='bottom'>
                                    <field name='goods_id' required='1' />
                                    <field name='attribute_id' domain="[('goods_id', '=', goods_id)]"/>
                                    <field name='goods_qty' required='1' />
                                </tree>
                            </field>
                        </group>

                        <group string='子件'>
                            <field name='line_child_ids' nolabel='1'>
                                <tree editable='bottom'>
                                    <field name='goods_id' required='1' />
                                     <field name='attribute_id' domain="[('goods_id', '=', goods_id)]"/>
                                    <field name='goods_qty' required='1' />
                                </tree>
                            </field>
                        </group>
                    </sheet>
                </form>
            </field>
        </record>

        <record id="wh_bom_search" model="ir.ui.view">
            <field name="name">wh.bom.search</field>
            <field name="model">wh.bom</field>
            <field name="arch" type="xml">
                <search string="物料清单">
                    <field name="name"/>
                    <field name="type"/>
                    <field name="goods_id"/>
                    <filter name="assembly" string="组装单" domain="[('type','=','assembly')]"/>
                    <filter name="disassembly" string="拆卸单" domain="[('type','=','disassembly')]"/>
                </search>
            </field>
        </record>

        <record id='wh_assembly_tree' model='ir.ui.view'>
            <field name='name'>wh.assembly.tree</field>
            <field name='model'>wh.assembly</field>
            <field name='arch' type='xml'>
                <tree string='组装单' colors='blue:state == "draft";lightgray:state == "cancel"'>
                    <field name='date' />
                    <field name='name' />
                    <field name='line_in_ids' widget='relation_sublist' options="{'field': 'goods_id'}" string='组合件' />
                    <field name='line_in_ids' widget='relation_sublist' options="{'field': 'goods_qty'}" string='组合件数量' />
                    <field name='line_in_ids' widget='relation_sublist' options="{'field': 'uom_id'}" string='组合件单位' />
                    <field name='line_in_ids' widget='relation_sublist' options="{'field': 'cost'}" string='组合件成本' />

                    <field name='line_out_ids' widget='relation_sublist' options="{'field': 'goods_id'}" string='子件' />
                    <field name='line_out_ids' widget='relation_sublist' options="{'field': 'goods_qty'}" string='子件数量' />
                    <field name='line_out_ids' widget='relation_sublist' options="{'field': 'uom_id'}" string='子件单位' />
                    <field name='line_out_ids' widget='relation_sublist' options="{'field': 'cost'}" string='子件成本' />
                    <field name='warehouse_id' />
                    <field name='state' />
                    <field name="_approve_state"/>
                </tree>
            </field>
        </record>

        <record id='wh_assembly_form' model='ir.ui.view'>
            <field name='name'>wh.assembly.form</field>
            <field name='model'>wh.assembly</field>
            <field name='arch' type='xml'>
                <form string='组装单' >
                    <header>
                        <button name='approve_feeding' type='object' string='发料' class='oe_highlight'
                                attrs="{'invisible': [('all_line_done', '=', True)]}"/>
                        <button name='approve_order' type='object' string='成品入库' class='oe_highlight'
                                attrs="{'invisible': ['|', ('all_line_done', '=', False), '&amp;', ('all_line_done', '=', True), ('state', '=', 'done')]}"/>
                        <button name='cancel_approved_order' type='object' string='撤销入库' states='done' />
                        <button name='update_bom' type='object' string='存为物料清单' />
                        <button name="action_cancel" states="draft" string="作废" type="object"/>
                        <field name='state' widget='statusbar' statusbar_visible="draft,feeding,done"/>
                    </header>
                    <sheet>
                        <group>
                            <group>
                                <field name='date' required='1' attrs="{'readonly': [('state', '=', 'done')]}" />
                                <field name='warehouse_id'/>
                                <field name='bom_id' options="{'no_create': 1}"/>
                                <field name='goods_id' options="{'no_create': 1}" attrs="{'invisible': [('is_many_to_many_combinations', '=', True)]}" />
                                <field name='lot'
                                       groups='goods.batch_groups'
                                       attrs="{'invisible': [('is_many_to_many_combinations', '=', True)]}" />
                                <field name='goods_qty' options="{'no_create': 1}" attrs="{'invisible': [('is_many_to_many_combinations', '=', True)]}" />
                                <field name='user_id'
                                       options="{'no_open': True, 'no_create': True}"/>
                            </group>
                            <group>
                                <field name='fee'/>
                                <field name='warehouse_dest_id' />
                                <field name='is_many_to_many_combinations' />
                                <field name='voucher_id' readonly='1'/>
                                <field name='out_voucher_id' readonly='1'/>
                                <field name='finance_category_id' invisible="1"/>
                                <field name='all_line_done' invisible="1"/>
                            </group>
                        </group>

                        <group string='组合件' attrs="{'invisible': [('is_many_to_many_combinations', '!=', True)]}">
                            <field nolabel='1' name='line_in_ids'
                                context="{'type': 'in'}"
                                attrs="{'readonly': [('state', '=', 'done')]}" >
                                  <tree string='库存调拨' editable='bottom'>
                                    <field name='goods_id' required='1' attrs="{'readonly': [('state', '=', 'done')]}"/>
                                    <field name='attribute_id'
                                        domain="[('goods_id', '=', goods_id)]"
                                        attrs="{'required': [('using_attribute', '=', True)], 'readonly': ['|', ('using_attribute', '=', False), ('state', '=', 'done')]}"
                                        groups='goods.multi_attrs_groups' />
                                    <field name='lot'
                                        groups='goods.batch_groups'
                                        attrs="{'readonly': ['|', ('using_batch', '=', False), ('state', '=', 'done')], 'required': [('using_batch', '=', True)]}" />
                                    <field name='goods_uos_qty'
                                        groups='goods.auxiliary_unit_groups' sum='1'
                                        attrs="{'readonly': [('state', '=', 'done')]}"/>
                                    <field name='uos_id' groups='goods.auxiliary_unit_groups'
                                        attrs="{'readonly': [('state', '=', 'done')]}"/>
                                    <field name='goods_qty' attrs="{'readonly': ['|', ('force_batch_one', '=', True), ('state', '=', 'done')]}" sum='1' />
                                    <field name='uom_id' required='1' attrs="{'readonly': [('state', '=', 'done')]}"/>
                                    <field name='cost_unit' string='入库单位成本' readonly='1' />
                                    <field name='cost' string='入库金额' readonly='1' sum='1' />
                                      <field name='expiration_date' groups='warehouse.group_expiration_date' />
                                      <field name="scrap"/>
                                    <field name='note' string='备注' />
                                    <field name='using_batch' invisible='1' />
                                    <field name='force_batch_one' invisible='1' />
                                    <field name='using_attribute' invisible='1' />
                                    <field name='type' invisible='1'/>
                                    <field name='state' invisible='1'/>
                                </tree>
                            </field>
                        </group>

                        <group string='子件'>
                            <field nolabel='1' name='line_out_ids' context="{'lot': True,
                                'type': 'out',
                                'default_warehouse_id': warehouse_id,
                            }" attrs="{'readonly': [('state', '=', 'done')]}" >
                                 <tree string='库存调拨' editable='bottom'>
                                        <field name='goods_id' required='1' attrs="{'readonly': [('state', '=', 'done')]}"/>
                                        <field name='attribute_id'
                                            domain="[('goods_id', '=', goods_id)]"
                                            attrs="{'required': [('using_attribute', '=', True)], 'readonly': ['|', ('using_attribute', '=', False), ('state', '=', 'done')]}"
                                            groups='goods.multi_attrs_groups'/>
                                        <field name='lot_id'
                                            groups='goods.batch_groups'
                                            attrs="{'readonly': ['|', ('using_batch', '=', False), ('state', '=', 'done')], 'required': [('using_batch', '=', True)]}"
                                            domain="[('goods_id', '=', goods_id), ('state', '=', 'done'), ('lot', '!=', False), ('qty_remaining', '>', 0), ('warehouse_dest_id', '=', parent.warehouse_id)]"
                                            context="{'lot': True}"
                                            options="{'no_open': True, 'no_create': True}" />
                                        <field name='goods_uos_qty' sum='1'
                                            groups='goods.auxiliary_unit_groups'
                                            attrs="{'readonly': [('state', '=', 'done')]}"/>
                                        <field name='uos_id' groups='goods.auxiliary_unit_groups'
                                            attrs="{'readonly': [('state', '=', 'done')]}"/>
                                        <field name='goods_qty' sum='1'
                                            attrs="{'readonly': ['|', ('force_batch_one', '=', True), ('state', '=', 'done')]}" />
                                        <field name='uom_id' required='1' attrs="{'readonly': [('state', '=', 'done')]}"/>
                                        <field name='cost_unit' string='出库单位成本' readonly='1' />
                                        <field name='cost' string='出库成本' readonly='1' sum='1' />
                                        <field name='expiration_date'
                                               readonly='1'
                                               groups='warehouse.group_expiration_date' />
                                        <field name='note' string='备注' />
                                        <field name='using_attribute' invisible='1' />
                                        <field name='using_batch' invisible='1' />
                                        <field name='force_batch_one' invisible='1' />
                                        <field name='lot_qty' invisible='1' />
                                        <field name='lot_uos_qty' invisible='1' />
                                        <field name='lot' invisible='1'/>
                                        <field name='type' invisible='1'/>
                                        <field name='state' invisible='1'/>
                                    </tree>
                            </field>
                        </group>

                        <group>
                            <field name='note' nolabel='1' placeholder='备注...' />
                        </group>
                        <group>
                            <field name='qc_result' widget='pdf_viewer'
                                   attrs="{'readonly': [('state', '=', 'done')]}"
                                   groups='warehouse.group_qc'
                            />
                        </group>

                        <group col='6'>
                            <group colspan='2'>
                                <field name='create_uid' string='制单人' readonly='1' />
                                <field name='create_date' string='录单时间' readonly='1' />
                            </group>
                            <group colspan='2'>
                                <field name='write_uid' string='最后修改人' readonly='1' />
                                <field name='write_date' string='最后修改时间' readonly='1' />
                            </group>
                            <group colspan='2'>
                                <field name='approve_uid' readonly='1' />
                                <field name='approve_date' readonly='1' />
                            </group>
                        </group>
                    </sheet>
                    <div class="oe_chatter">
                        <field name="message_follower_ids" widget="mail_followers"/>
                        <field name="_to_approver_ids" widget="goodprocess" readonly="1"/>
                        <field name="message_ids" widget="mail_thread"/>
                    </div>
                </form>
            </field>
        </record>

        <record id="wh_assembly_search" model="ir.ui.view">
            <field name="name">wh.assembly.search</field>
            <field name="model">wh.assembly</field>
            <field name="arch" type="xml">
                <search string="组装单">
                    <field name="name"/>
                    <field name='warehouse_id'/>
                    <field name="state"/>
                    <group expand="0" string="分组">
                        <filter string="调出仓库" domain="[]" context="{'group_by':'warehouse_id'}"/>
                        <filter string="单据日期" domain="[]" context="{'group_by':'date:day'}"/>
                    </group>
                </search>
            </field>
        </record>

        <record id='outsource_tree' model='ir.ui.view'>
            <field name='name'>outsource.tree</field>
            <field name='model'>outsource</field>
            <field name='arch' type='xml'>
                <tree string='委外加工单' colors='blue:state == "draft";lightgray:state == "cancel"'>
                    <field name="outsource_partner_id"/>
                    <field name='date'/>
                    <field name='name'/>
                    <field name='outsource_fee'/>
                    <field name='line_in_ids' widget='relation_sublist' options="{'field': 'goods_id'}" string='组合件'/>
                    <field name='line_in_ids' widget='relation_sublist' options="{'field': 'goods_qty'}" string='组合件数量'/>
                    <field name='line_in_ids' widget='relation_sublist' options="{'field': 'uom_id'}" string='组合件单位'/>
                    <field name='line_in_ids' widget='relation_sublist' options="{'field': 'cost'}" string='组合件成本'/>

                    <field name='line_out_ids' widget='relation_sublist' options="{'field': 'goods_id'}" string='子件'/>
                    <field name='line_out_ids' widget='relation_sublist' options="{'field': 'goods_qty'}" string='子件数量'/>
                    <field name='line_out_ids' widget='relation_sublist' options="{'field': 'uom_id'}" string='子件单位'/>
                    <field name='line_out_ids' widget='relation_sublist' options="{'field': 'cost'}" string='子件成本'/>
                    <field name='warehouse_id'/>
                    <field name='state'/>
                    <field name="_approve_state"/>
                </tree>
            </field>
        </record>

        <record id='outsource_form' model='ir.ui.view'>
            <field name='name'>outsource.form</field>
            <field name='model'>outsource</field>
            <field name='arch' type='xml'>
                <form string='委外加工单'>
                    <header>
                        <button name='approve_feeding' type='object' string='发料' class='oe_highlight'
                                attrs="{'invisible': [('all_line_done', '=', True)]}"/>
                        <button name='approve_order' type='object' string='成品入库' class='oe_highlight'
                                attrs="{'invisible': ['|', ('all_line_done', '=', False), '&amp;', ('all_line_done', '=', True), ('state', '=', 'done')]}"/>
                        <button name='cancel_approved_order' type='object' string='撤销入库' states='done'/>
                        <button name="action_cancel" states="draft" string="作废" type="object"/>
                        <field name='state' widget='statusbar' statusbar_visible="draft,feeding,done"/>
                    </header>
                    <sheet>
                        <group>
                            <group>
                                <field name='outsource_partner_id' domain="[('s_category_id', '!=', False)]" context="{'form_view_ref': 'core.supplier_address_form'}"/>
                                <field name='date' required='1' attrs="{'readonly': [('state', '=', 'done')]}"/>
                                <field name='warehouse_id'/>
                                <field name='bom_id' options="{'no_create': 1}"/>
                                <field name='goods_id' options="{'no_create': 1}" attrs="{'invisible': [('is_many_to_many_combinations', '=', True)]}"/>
                                <field name='lot'
                                       groups='goods.batch_groups'
                                       attrs="{'invisible': [('is_many_to_many_combinations', '=', True)]}" />
                                <field name='goods_qty' options="{'no_create': 1}" attrs="{'invisible': [('is_many_to_many_combinations', '=', True)]}"/>
                                <field name='user_id'
                                       options="{'no_open': True, 'no_create': True}"/>
                            </group>
                            <group>
                                <field name='outsource_fee'/>
                                <field name='wh_assembly_id' options="{'no_create': True}"/>
                                <field name='warehouse_dest_id'/>
                                <field name='is_many_to_many_combinations'/>
                                <field name='invoice_id' readonly='1' options="{'no_create': True}"/>
                                <field name='voucher_id' readonly='1'/>
                                <field name='out_voucher_id' readonly='1'/>
                                <field name='finance_category_id' invisible="1"/>
                                <field name='all_line_done' invisible="1"/>
                            </group>
                        </group>

                        <group string='组合件' attrs="{'invisible': [('is_many_to_many_combinations', '!=', True)]}">
                            <field nolabel='1' name='line_in_ids' context="{'type': 'in',}"
                                attrs="{'readonly': [('state', '=', 'done')]}">
                                <tree string='库存调拨' editable='bottom'>
                                    <field name='goods_id'
                                        required='1'
                                        attrs="{'readonly': [('state', '=', 'done')]}"/>
                                    <field name='attribute_id'
                                        domain="[('goods_id', '=', goods_id)]"
                                        attrs="{'required': [('using_attribute', '=', True)], 'readonly': ['|', ('using_attribute', '=', False), ('state', '=', 'done')]}"
                                        groups='goods.multi_attrs_groups' />
                                    <field name='lot'
                                        groups='goods.batch_groups'
                                        attrs="{'readonly': ['|', ('using_batch', '=', False), ('state', '=', 'done')], 'required': [('using_batch', '=', True)]}"/>
                                    <field name='goods_uos_qty'
                                        groups='goods.auxiliary_unit_groups'
                                        sum='1'
                                        attrs="{'readonly': [('state', '=', 'done')]}"/>
                                    <field name='uos_id'
                                        groups='goods.auxiliary_unit_groups'
                                        attrs="{'readonly': [('state', '=', 'done')]}"/>
                                    <field name='goods_qty'
                                        attrs="{'readonly': ['|', ('force_batch_one', '=', True), ('state', '=', 'done')]}"
                                        sum='1'/>
                                    <field name='uom_id'
                                        required='1'
                                        attrs="{'readonly': [('state', '=', 'done')]}"/>
                                    <field name='cost_unit' string='入库单位成本' readonly='1'/>
                                    <field name='cost' string='入库金额' readonly='1' sum='1'/>
                                    <field name='expiration_date' groups='warehouse.group_expiration_date' />
                                    <field name="scrap"/>
                                    <field name='note' string='备注'/>
                                    <field name='using_batch' invisible='1'/>
                                    <field name='force_batch_one' invisible='1'/>
                                    <field name='using_attribute' invisible='1'/>
                                    <field name='type' invisible='1'/>
                                    <field name='state' invisible='1'/>
                                </tree>
                            </field>
                        </group>

                        <group string='子件'>
                            <field nolabel='1' name='line_out_ids' context="{'lot': True,
                                'type': 'out',
                                'default_warehouse_id': warehouse_id,
                            }" attrs="{'readonly': [('state', '=', 'done')]}">
                                 <tree string='库存调拨' editable='bottom'>
                                    <field name='state' invisible="1"/>
                                    <field name='goods_id'
                                        required='1'
                                        attrs="{'readonly': [('state', '=', 'done')]}"/>
                                    <field name='attribute_id'
                                        domain="[('goods_id', '=', goods_id)]"
                                        attrs="{'required': [('using_attribute', '=', True)], 'readonly': ['|',('using_attribute', '=', False),('state', '=', 'done')]}"
                                        groups='goods.multi_attrs_groups'/>
                                    <field name='lot_id'
                                        groups='goods.batch_groups'
                                        attrs="{'readonly': ['|', ('using_batch', '=', False), ('state', '=', 'done')], 'required': [('using_batch', '=', True)]}"
                                        domain="[('goods_id', '=', goods_id), ('state', '=', 'done'), ('lot', '!=', False), ('qty_remaining', '>', 0), ('warehouse_dest_id', '=', parent.warehouse_id)]"
                                        context="{'lot': True}"
                                        options="{'no_open': True, 'no_create': True}"/>
                                    <field name='goods_uos_qty'
                                        sum='1'
                                        groups='goods.auxiliary_unit_groups'
                                        attrs="{'readonly': [('state', '=', 'done')]}"/>
                                    <field name='uos_id'
                                        groups='goods.auxiliary_unit_groups'
                                        attrs="{'readonly': [('state', '=', 'done')]}"/>
                                    <field name='goods_qty'
                                        sum='1'
                                        attrs="{'readonly': ['|', ('force_batch_one', '=', True), ('state', '=', 'done')]}"/>
                                    <field name='uom_id'
                                        required='1'
                                        attrs="{'readonly': [('state', '=', 'done')]}" />
                                    <field name='cost_unit' string='出库单位成本' readonly='1' />
                                    <field name='cost' string='出库成本' readonly='1' sum='1' />
                                    <field name='expiration_date'
                                           readonly='1'
                                           groups='warehouse.group_expiration_date' />
                                    <field name='note' string='备注' />
                                    <field name='using_attribute' invisible='1' />
                                    <field name='using_batch' invisible='1' />
                                    <field name='force_batch_one' invisible='1' />
                                    <field name='lot_qty' invisible='1' />
                                    <field name='lot_uos_qty' invisible='1' />
                                    <field name='lot' invisible='1'/>
                                    <field name='type' invisible='1'/>
                                    <field name='state' invisible='1'/>
                                </tree>
                            </field>
                        </group>

                        <group>
                            <field name='note' nolabel='1' placeholder='备注...' />
                        </group>
                        <group>
                            <field name='qc_result' widget='pdf_viewer'
                                   attrs="{'readonly': [('state', '=', 'done')]}"
                                   groups='warehouse.group_qc'
                            />
                        </group>

                        <group col='6'>
                            <group colspan='2'>
                                <field name='create_uid' string='制单人' readonly='1' />
                                <field name='create_date' string='录单时间' readonly='1' />
                            </group>
                            <group colspan='2'>
                                <field name='write_uid' string='最后修改人' readonly='1' />
                                <field name='write_date' string='最后修改时间' readonly='1' />
                            </group>
                            <group colspan='2'>
                                <field name='approve_uid' readonly='1' />
                                <field name='approve_date' readonly='1' />
                            </group>
                        </group>
                    </sheet>
                    <div class="oe_chatter">
                        <field name="message_follower_ids" widget="mail_followers"/>
                        <field name="_to_approver_ids" widget="goodprocess" readonly="1"/>
                        <field name="message_ids" widget="mail_thread"/>
                    </div>
                </form>
            </field>
        </record>

        <record id='wh_disassembly_tree' model='ir.ui.view'>
            <field name='name'>wh.disassembly.tree</field>
            <field name='model'>wh.disassembly</field>
            <field name='arch' type='xml'>
                <tree string='拆卸单' colors='blue:state == "draft";lightgray:state == "cancel"'>
                    <field name='date' />
                    <field name='name' />
                    <field name='line_out_ids' widget='relation_sublist' options="{'field': 'goods_id'}" string='组合件' />
                    <field name='line_out_ids' widget='relation_sublist' options="{'field': 'goods_qty'}" string='组合件数量' />
                    <field name='line_out_ids' widget='relation_sublist' options="{'field': 'uom_id'}" string='组合件单位' />
                    <field name='line_out_ids' widget='relation_sublist' options="{'field': 'cost'}" string='组合件成本' />

                    <field name='line_in_ids' widget='relation_sublist' options="{'field': 'goods_id'}" string='子件' />
                    <field name='line_in_ids' widget='relation_sublist' options="{'field': 'goods_qty'}" string='子件数量' />
                    <field name='line_in_ids' widget='relation_sublist' options="{'field': 'uom_id'}" string='子件单位' />
                    <field name='line_in_ids' widget='relation_sublist' options="{'field': 'cost'}" string='子件成本' />
                    <field name='warehouse_id' />
                    <field name='state' />
                    <field name="_approve_state"/>
                </tree>
            </field>
        </record>

        <record id='wh_disassembly_form' model='ir.ui.view'>
            <field name='name'>wh.disassembly.form</field>
            <field name='model'>wh.disassembly</field>
            <field name='arch' type='xml'>
                <form string='拆卸单' >
                    <header>
                        <button name='approve_feeding' type='object' string='发料' class='oe_highlight'
                                attrs="{'invisible': [('all_line_done', '=', True)]}"/>
                        <button name='approve_order' type='object' string='成品入库' class='oe_highlight'
                                attrs="{'invisible': ['|', ('all_line_done', '=', False), '&amp;', ('all_line_done', '=', True), ('state', '=', 'done')]}"/>
                        <button name='cancel_approved_order' type='object' string='撤销入库' states='done' />
                        <button name='update_bom' type='object' string='存为物料清单' />
                        <button name="action_cancel" states="draft" string="作废" type="object"/>
                        <field name='state' widget='statusbar' statusbar_visible="draft,feeding,done"/>
                    </header>
                    <sheet>
                        <group>
                            <group>
                                <field name='date' required='1' attrs="{'readonly': [('state', '=', 'done')]}" />
                                <field name='warehouse_id' />
                                <field name='bom_id' options="{'no_create': 1}" />
                                <field name='goods_id' options="{'no_create': 1}" attrs="{'invisible': [('is_many_to_many_combinations', '=', True)]}" />
                                <field name='lot_id'
                                       groups='goods.batch_groups'
                                       domain="[('goods_id', '=', goods_id), ('state', '=', 'done'), ('lot', '!=', False), ('qty_remaining', '>', 0), ('warehouse_dest_id', '=', warehouse_id)]"
                                       attrs="{'invisible': [('is_many_to_many_combinations', '=', True)]}" />
                                <field name='goods_qty' options="{'no_create': 1}" attrs="{'invisible': [('is_many_to_many_combinations', '=', True)]}" />
                                <field name='user_id'
                                       options="{'no_open': True, 'no_create': True}"/>
                            </group>
                            <group>
                                <field name='fee' />
                                <field name='warehouse_dest_id' />
                                <field name='is_many_to_many_combinations' />
                                <field name='voucher_id' readonly='1'/>
                                <field name='out_voucher_id' readonly='1'/>
                                <field name='finance_category_id' invisible="1"/>
                                <field name='all_line_done' invisible="1"/>
                            </group>
                        </group>

                        <group string='组合件' attrs="{'invisible':[('is_many_to_many_combinations','!=',True)]}">
                            <field nolabel='1' name='line_out_ids' context="{
                                'lot': True,
                                'type': 'out',
                                'default_warehouse_id': warehouse_id,
                            }" attrs="{'readonly': [('state', '=', 'done')]}" >
                                <tree string='库存调拨' editable='bottom'>
                                    <field name='goods_id' required='1' attrs="{'readonly': [('state', '=', 'done')]}" />
                                    <field name='attribute_id'
                                        domain="[('goods_id', '=', goods_id)]"
                                        attrs="{'required': [('using_attribute', '=', True)], 'readonly': ['|', ('using_attribute', '=', False), ('state', '=', 'done')]}"
                                        groups='goods.multi_attrs_groups'/>
                                    <field name='lot_id'
                                        groups='goods.batch_groups'
                                        attrs="{'readonly': ['|', ('using_batch', '=', False), ('state', '=', 'done')], 'required': [('using_batch', '=', True)]}"
                                        domain="[('goods_id', '=', goods_id), ('state', '=', 'done'), ('lot', '!=', False), ('qty_remaining', '>', 0), ('warehouse_dest_id', '=', parent.warehouse_id)]"
                                        context="{'lot': True}"
                                        options="{'no_open': True, 'no_create': True}" />
                                    <field name='goods_uos_qty'
                                        sum='1'
                                        attrs="{'readonly': [('state', '=', 'done')]}"
                                        groups='goods.auxiliary_unit_groups'/>
                                    <field name='uos_id'
                                        groups='goods.auxiliary_unit_groups'
                                        attrs="{'readonly': [('state', '=', 'done')]}"  />
                                    <field name='goods_qty' sum='1'
                                        attrs="{'readonly': ['|', ('force_batch_one', '=', True), ('state', '=', 'done')]}" />
                                    <field name='uom_id'
                                        required='1'
                                        attrs="{'readonly': [('state', '=', 'done')]}" />
                                    <field name='cost_unit' string='出库单位成本' readonly='1' />
                                    <field name='cost' string='出库成本' readonly='1' sum='1' />
                                    <field name='expiration_date'
                                           readonly='1'
                                           groups='warehouse.group_expiration_date' />
                                    <field name='note' string='备注' />
                                    <field name='using_attribute' invisible='1' />
                                    <field name='using_batch' invisible='1' />
                                    <field name='force_batch_one' invisible='1' />
                                    <field name='lot_qty' invisible='1' />
                                    <field name='lot_uos_qty' invisible='1' />
                                    <field name='type' invisible='1'/>
                                    <field name='state' invisible='1'/>
                                </tree>
                            </field>
                        </group>

                        <group string='子件'>
                            <field nolabel='1' name='line_in_ids'
                                context="{'type': 'in'}"
                                attrs="{'readonly': [('state', '=', 'done')]}" >
                                  <tree string='库存调拨' editable='bottom'>
                                        <field name='goods_id'
                                            required='1'
                                            attrs="{'readonly': [('state', '=', 'done')]}"/>
                                        <field name='attribute_id'
                                            domain="[('goods_id', '=', goods_id)]"
                                            attrs="{'required': [('using_attribute', '=', True)], 'readonly': ['|', ('using_attribute', '=', False), ('state', '=', 'done')]}"
                                            groups='goods.multi_attrs_groups' />
                                        <field name='lot'
                                            groups='goods.batch_groups'
                                            attrs="{'readonly': ['|', ('using_batch', '=', False), ('state', '=', 'done')], 'required': [('using_batch', '=', True)]}" />
                                        <field name='goods_uos_qty'
                                            groups='goods.auxiliary_unit_groups'
                                            sum='1'
                                            attrs="{'readonly': [('state', '=', 'done')]}"/>
                                        <field name='uos_id'
                                            groups='goods.auxiliary_unit_groups'
                                            attrs="{'readonly': [('state', '=', 'done')]}"/>
                                        <field name='goods_qty'
                                            attrs="{'readonly': ['|', ('force_batch_one', '=', True), ('state', '=', 'done')]}"
                                            sum='1' />
                                        <field name='uom_id'
                                            required='1'
                                            attrs="{'readonly': [('state', '=', 'done')]}" />
                                        <field name='cost_unit' string='入库单位成本' readonly='1' />
                                        <field name='cost' string='入库金额' readonly='1' sum='1' />
                                        <field name='expiration_date' groups='warehouse.group_expiration_date' />
                                        <field name="scrap"/>
                                        <field name='note' string='备注' />
                                        <field name='using_batch' invisible='1' />
                                        <field name='force_batch_one' invisible='1' />
                                        <field name='using_attribute' invisible='1' />
                                        <field name='type' invisible='1'/>
                                        <field name='state' invisible='1'/>
                                    </tree>
                            </field>
                        </group>

                        <group>
                            <field name='note' nolabel='1' placeholder='备注...' />
                        </group>
                        <group>
                            <field name='qc_result' widget='pdf_viewer'
                                   attrs="{'readonly': [('state', '=', 'done')]}"
                                   groups='warehouse.group_qc'
                            />
                        </group>

                        <group col='6'>
                            <group colspan='2'>
                                <field name='create_uid' string='制单人' readonly='1' />
                                <field name='create_date' string='录单时间' readonly='1' />
                            </group>
                            <group colspan='2'>
                                <field name='write_uid' string='最后修改人' readonly='1' />
                                <field name='write_date' string='最后修改时间' readonly='1' />
                            </group>
                            <group colspan='2'>
                                <field name='approve_uid' readonly='1' />
                                <field name='approve_date' readonly='1' />
                            </group>
                        </group>
                    </sheet>
                    <div class="oe_chatter">
                        <field name="message_follower_ids" widget="mail_followers"/>
                        <field name="_to_approver_ids" widget="goodprocess" readonly="1"/>
                        <field name="message_ids" widget="mail_thread"/>
                    </div>
                </form>
            </field>
        </record>

        <record id="wh_disassembly_search" model="ir.ui.view">
            <field name="name">wh.disassembly.search</field>
            <field name="model">wh.disassembly</field>
            <field name="arch" type="xml">
                <search string="拆卸单">
                    <field name="name"/>
                    <field name='warehouse_id'/>
                    <field name="state"/>
                    <group expand="0" string="分组">
                        <filter string="调出仓库" domain="[]" context="{'group_by':'warehouse_id'}"/>
                        <filter string="单据日期" domain="[]" context="{'group_by':'date:day'}"/>
                    </group>
                </search>
            </field>
        </record>
    </data>
</openerp>