<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <record id="product_set_supplier_wiz_form" model="ir.ui.view">
            <field name="name">product.set.supplier.wiz.form</field>
            <field name="model">product.set.supplier.wiz</field>
            <field name="arch" type="xml">
                <form string="Set Supplier">
                    <group>
                        <group><field name="name" options="{'no_create': True, 'no_open':True}"/></group>
                        <group><field name="create_uid" readonly="1"/></group>
                    </group>
                    <group>
                        <group>
                            <field name="min_qty"/>
                            <field name="price"/>
                        </group>
                        <group>
                            <label for="date_start" string="Validity From"/>
                            <newline/>
                            <field name="date_start" nolabel="1" class="oe_inline"/> 至 <field name="date_end" nolabel="1" class="oe_inline"/>
                            <!--<field name="delay"/>-->
                        </group>
                    </group>
                    <!--<separator string="要设置供应商的补货单(仅对采购类型，且异常的补货单生效)"/>-->
                    <separator string="Procurement list to setup supplier for the product"/>
                    <group>
                        <field name="p_ids" nolabel="1" widget="many2many_tags"/>
                    </group>
                    <footer>
                        <button name="set_supplier" type="object" string="Set supplier and run Scheduler" class="btn-primary"/>
                        <!--<button name="set_supplier" type="object" string="设定供应商并执行自动采购策略" class="btn-primary"/>-->
                        <button string="Cancel" class="btn-default" special="cancel"/>
                        <field name="view_po" nolabel="1" class="oe_inline" style="margin-left:50px"/>
                        <label for="view_po"/>
                    </footer>
                </form>
            </field>
        </record>

        <record model="ir.actions.act_window" id="product_set_supplier_action">
            <field name="name">Set Supplier</field>
            <field name="res_model">product.set.supplier.wiz</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="view_id" ref="product_set_supplier_wiz_form"/>
            <field name="target">new</field>
        </record>

        <act_window id="action_product_set_supplier"
                    multi="True"
                    key2="client_action_multi" name="Set Supplier"
                    res_model="product.set.supplier.wiz" src_model="procurement.order"
                    view_mode="form" target="new" view_type="form"
        />
    </data>
</odoo>
