<?xml version="1.0"?>
<odoo>
    <record id="compensation_view" model="ir.ui.view">
        <field name="name">compensation</field>
        <field name="model">mrp.workorder</field>
        <field name="inherit_id" ref="sf_manufacturing.view_mrp_production_workorder_tray_form_inherit_sf"/>
        <field name="arch" type="xml">
                <xpath expr="//page//field[@name='cnc_ids']" position="before">
                    <group>
                        <group>
                            <field name="compensation_value_x"/>
                            <field name="compensation_value_y"/>
                        </group>
                        <div>
                            <div>
                                <field name="button_compensation_state" attrs='{"invisible": ["|",
                                    ("state","!=","progress"),("user_permissions","=",False)]}'/>
                                <button string="一键补偿" name="compensation" type="object" confirm="是否确认下发补偿"
                                    class="btn-primary" attrs='{"invisible": ["|",
                                    ("state","!=","progress"),("user_permissions","=",False)]}'/>
                                <span>&#32;</span>
<!--                                <field name="button_up_all_state" attrs='{"invisible": ["|",-->
<!--                                    ("state","!=","progress"),("user_permissions","=",False)]}'/>-->
                                <button string="一键下发" name="up_all" type="object" style="text-align: right;" confirm="是否确认一键下发"
                                    class="btn-primary" context="{'default_workorder_id': id}"  attrs='{"invisible": ["|",
                                    ("state","!=","progress"),("user_permissions","=",False)]}'/>
                                <span>&#32;</span>
                                <button string="合并下发" id="action_up_select" name="%(sf_machine_connect.action_up_select)d"
                                type="action" class="btn-primary" context="{'default_workorder_id': id}"  attrs='{"invisible": ["|",
                                    ("state","!=","progress"),("user_permissions","=",False)]}'/>
                            </div>
                        </div>
                    </group>
                </xpath>

        </field>
    </record>
</odoo>