<commit_before><?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

    <record id="view_repair_order_tree" model="ir.ui.view">
        <field name="name">mrp.repair.tree</field>
        <field name="model">mrp.repair</field>
        <field name="arch" type="xml">
            <tree string="Repairs order" colors="gray:state in ('done','cancel');black:state not in ('done','cancel');blue:state=='draft'">
                <field name="name" />
                <field name="product_id" />
                <field name="move_id"/>
                <field name="partner_id"/>
                <field name="address_id"/>
                <field name="location_id" groups="stock.group_locations"/>
                <field name="location_dest_id" groups="stock.group_locations"/>
                <field name="company_id" groups="base.group_multi_company" invisible="1"/>
                <field name="guarantee_limit"/>
                <field name="state"/>
            </tree>
        </field>
    </record>

    <record id="view_repair_order_form" model="ir.ui.view">
        <field name="name">mrp.repair.form</field>
        <field name="model">mrp.repair</field>
        <field name="arch" type="xml">
            <form string="Repair Order" version="7.0">
               <header>
                   <button name="repair_confirm" states="draft" string="Confirm Repair" class="oe_highlight"/>
                   <button name="repair_ready" states="confirmed,ready" string="Start Repair" class="oe_highlight"/>
                   <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
                   <button name="action_repair_end" states="under_repair" string="End Repair" class="oe_highlight"/>
                   <button name="action_invoice_create" states="2binvoiced" string="Make Invoice" class="oe_highlight"/>
                   <button name="invoice_recreate" states="invoice_except" string="Recreate Invoice"/>
                   <button name="invoice_corrected" states="invoice_except" string="Invoice Corrected"/>
                   <button name="action_cancel" string="Cancel Repair" type="object" attrs="{'invisible':['|',('invoice_method','!=','none'), ('state', 'not in',('confirmed','2binvoiced','ready','under_repair', 'invoice_except'))]}"/>
                   <button name="cancel" states="draft" string="Cancel Repair"/>
                   <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done"/>
               </header>
               <sheet string="Repairs order">
                    <h1>
                        Repair Order <field name="name" class="oe_inline"/>
                    </h1>
                    <group>
                        <group>
                            <field name="product_id" on_change="onchange_product_id(product_id)" domain="[('type','!=','service')]"/>
                            <field name="partner_id" on_change="onchange_partner_id(partner_id,address_id)" attrs="{'required':[('invoice_method','!=','none')]}"/>
                            <field name="address_id"  attrs="{'readonly':[('deliver_bool','=', False)]}" groups="sale.group_delivery_invoice_address"/>
                            <field name="move_id" on_change="onchange_move_id(product_id, move_id)" context="{'default_product_id':product_id}"/>
                            <field name="location_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}" groups="stock.group_locations"/>
                            <field name="prodlot_id" on_change="onchange_lot_id(prodlot_id,product_id)" groups="stock.group_production_lot" string="Serial Number"/>
                        </group>
                        <group>
                            <field name="guarantee_limit"/>
                            <field name="deliver_bool"/>
                            <field name="repaired" groups="base.group_no_one"/>
                            <field name="invoiced" groups="base.group_no_one"/>
                        </group>
                    </group>
                <notebook>
                    <page string="Operations">
                        <field name="operations">
                            <form string="Operations" version="7.0">
                                <notebook>
                                    <page string="Repair Line">
                                        <group col="4">
                                            <field name="name"/>
                                            <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
                                            <label for="product_uom_qty"/>
                                            <div>
                                                <field name="product_uom_qty" class="oe_inline"/>
                                                <field name="product_uom" class="oe_inline" groups="product.group_uom"/>
                                            </div>
                                            <field name="price_unit"/>
                                            <field name="price_subtotal"/>
                                            <field name="type"  on_change="onchange_operation_type(type,parent.guarantee_limit,parent.company_id,context)"/>
                                            <field name="to_invoice"/>
                                            <field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
                                            <field name="invoiced"/>
                                            <field name='prodlot_id' groups="stock.group_production_lot" string="Serial Number"/>
                                            <field name="location_id" groups="stock.group_locations"/>
                                            <field name="location_dest_id" groups="stock.group_locations"/>
                                        </group>
                                    </page>
                                    <page string="History">
                                        <group>
                                            <field name="move_id" />
                                            <field name="invoice_line_id"/>
                                        </group>
                                    </page>
                                 </notebook>
                            </form>
                            <tree string="Operations" editable="bottom">
                                <field name="type" on_change="onchange_operation_type(type,parent.guarantee_limit,parent.company_id,context)"/>
                                <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
                                <field name='name'/>
                                <field name="prodlot_id" groups="stock.group_production_lot" string="Serial Number"/>
                                <field name="location_id" groups="stock.group_locations"/>
                                <field name="location_dest_id" groups="stock.group_locations"/>
                                <field name="product_uom_qty" string="Quantity"/>
                                <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
                                <field name="price_unit"/>
                                <field name="tax_id" widget="many2many_tags"/>
                                <field name="to_invoice"/>
                                <field name="price_subtotal"/>
                            </tree>
                        </field>
                        <group class="oe_subtotal_footer oe_right">
                            <field name="amount_untaxed" sum="Untaxed amount"/>
                            <field name="amount_tax"/>
                            <field name="amount_total" sum="Total amount" class="oe_subtotal_footer_separator"/>
                        </group>
                        <button name="button_dummy" states="draft" string="Compute" type="object" icon="terp-stock_format-scientific"/>
                        <div class="oe_clear"/>
                    </page>
                    <page string="Invoicing">
                        <group col="4">
                            <field name="invoice_method"/>
                            <field name="partner_invoice_id" attrs="{'readonly':[('invoice_method','=', 'none')],'required':[('invoice_method','!=','none')]}" groups="sale.group_delivery_invoice_address"/>
                            <field
                                name="pricelist_id" groups="product.group_sale_pricelist" context="{'product_id':product_id}"
                                attrs="{'readonly':[('invoice_method','=', 'none')]}"/>
                        </group>
                        <!-- <field name="invoice_id"/> -->
                        <field name="fees_lines">
                            <form string="Fees" version="7.0">
                                <label for="name" class="oe_edit_only"/>
                                <h2>
                                    <field name="name"/>
                                </h2>
                                <group string="Product Information">
                                    <group>
                                        <field name="to_invoice"/>
                                        <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id,parent.guarantee_limit)"/>
                                        <label for="product_uom_qty"/>
                                        <div>
                                            <field name="product_uom_qty" string="Quantity" class="oe_inline"/>
                                            <field name="product_uom" groups="product.group_uom" class="oe_inline"/>
                                        </div>
                                    </group>
                                    <group>
                                        <field name="price_unit"/>
                                        <field widget="many2many_tags" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
                                        <field name="price_subtotal"/>
                                    </group>
                                </group>
                                <group string="History">
                                    <group>
                                        <field name="invoiced"/>
                                    </group>
                                    <group>
                                        <field name="invoice_line_id" />
                                    </group>
                                </group>
                            </form>
                            <tree string="Fees" editable="bottom">
                                <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id,parent.guarantee_limit)"/>
                                <field name='name'/>
                                <field name="product_uom_qty" string="Quantity"/>
                                <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
                                <field name="price_unit"/>
                                <field name="to_invoice"/>
                                <field name="price_subtotal"/>
                            </tree>
                        </field>
                    </page>
                    <page string="Extra Info">
                        <group>
                            <group>
                                <field name="picking_id"/>
                                <field name="invoice_id"/>
                                <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                            </group>
                            <group>
                                <field name="location_dest_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}" groups="stock.group_locations"/>
                            </group>
                        </group>
                    </page>
                    <page string="Notes">
                        <field name="internal_notes" placeholder="Add internal notes..."/>
                        <field name="quotation_notes" placeholder="Add quotation notes..."/>
                    </page>
                </notebook>
                </sheet>
                <div class="oe_chatter">
                    <field name="message_follower_ids" widget="mail_followers"/>
                    <field name="message_ids" widget="mail_thread"/>
                </div>
            </form>
        </field>
    </record>



    <record id="view_repair_order_form_filter" model="ir.ui.view">
          <field name="name">mrp.repair.select</field>
          <field name="model">mrp.repair</field>
          <field name="arch" type="xml">
              <search string="Search Reair Orders">
                  <field name="name" string="Reair Orders"/>
                  <field name="state"/>
                  <filter icon="terp-document-new" string="Quotations" domain="[('state','=','draft')]"/>
                  <filter icon="terp-check" string="Confirmed" domain="[('state','=','confirmed')]" name="current" />
                  <filter icon="terp-emblem-important" string="Ready To Repair" domain="[('state','=','ready')]"/>
                  <separator/>
                  <filter icon="terp-dolar" string="Invoiced" domain="[('invoiced','=',True)]"/>
                  <field name="product_id"/>
                  <field name="partner_id"/>
                  <group expand="0" string="Group By...">
                      <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
                      <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
                      <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
                      <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'guarantee_limit'}" help="Guarantee limit"/>
                      <filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
                  </group>
              </search>
          </field>
    </record>



         <record id="action_repair_order_tree" model="ir.actions.act_window">
            <field name="name">Repair Orders</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">mrp.repair</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="search_view_id" ref="view_repair_order_form_filter"/>
            <field name="help" type="html">
              <p class="oe_view_nocontent_create">
                Click to create a reparation order. 
              </p><p>
                In a repair order, you can detail the components you remove,
                add or replace and record the time you spent on the different
                operations.
              </p><p>
                The repair order uses the warranty date on the Serial Number in
                order to know if whether the repair should be invoiced to the
                customer or not.
              </p>
            </field>
        </record>

        <menuitem action="action_repair_order_tree" id="menu_repair_order" parent="mrp.menu_mrp_manufacturing" groups="mrp.group_mrp_user" name="Repair Orders" sequence="50"/>

    </data>
</openerp>
<commit_msg>[IMP]compute button in repair set as like po/so<commit_after><?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

    <record id="view_repair_order_tree" model="ir.ui.view">
        <field name="name">mrp.repair.tree</field>
        <field name="model">mrp.repair</field>
        <field name="arch" type="xml">
            <tree string="Repairs order" colors="gray:state in ('done','cancel');black:state not in ('done','cancel');blue:state=='draft'">
                <field name="name" />
                <field name="product_id" />
                <field name="move_id"/>
                <field name="partner_id"/>
                <field name="address_id"/>
                <field name="location_id" groups="stock.group_locations"/>
                <field name="location_dest_id" groups="stock.group_locations"/>
                <field name="company_id" groups="base.group_multi_company" invisible="1"/>
                <field name="guarantee_limit"/>
                <field name="state"/>
            </tree>
        </field>
    </record>

    <record id="view_repair_order_form" model="ir.ui.view">
        <field name="name">mrp.repair.form</field>
        <field name="model">mrp.repair</field>
        <field name="arch" type="xml">
            <form string="Repair Order" version="7.0">
               <header>
                   <button name="repair_confirm" states="draft" string="Confirm Repair" class="oe_highlight"/>
                   <button name="repair_ready" states="confirmed,ready" string="Start Repair" class="oe_highlight"/>
                   <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
                   <button name="action_repair_end" states="under_repair" string="End Repair" class="oe_highlight"/>
                   <button name="action_invoice_create" states="2binvoiced" string="Make Invoice" class="oe_highlight"/>
                   <button name="invoice_recreate" states="invoice_except" string="Recreate Invoice"/>
                   <button name="invoice_corrected" states="invoice_except" string="Invoice Corrected"/>
                   <button name="action_cancel" string="Cancel Repair" type="object" attrs="{'invisible':['|',('invoice_method','!=','none'), ('state', 'not in',('confirmed','2binvoiced','ready','under_repair', 'invoice_except'))]}"/>
                   <button name="cancel" states="draft" string="Cancel Repair"/>
                   <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done"/>
               </header>
               <sheet string="Repairs order">
                    <h1>
                        Repair Order <field name="name" class="oe_inline"/>
                    </h1>
                    <group>
                        <group>
                            <field name="product_id" on_change="onchange_product_id(product_id)" domain="[('type','!=','service')]"/>
                            <field name="partner_id" on_change="onchange_partner_id(partner_id,address_id)" attrs="{'required':[('invoice_method','!=','none')]}"/>
                            <field name="address_id"  attrs="{'readonly':[('deliver_bool','=', False)]}" groups="sale.group_delivery_invoice_address"/>
                            <field name="move_id" on_change="onchange_move_id(product_id, move_id)" context="{'default_product_id':product_id}"/>
                            <field name="location_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}" groups="stock.group_locations"/>
                            <field name="prodlot_id" on_change="onchange_lot_id(prodlot_id,product_id)" groups="stock.group_production_lot" string="Serial Number"/>
                        </group>
                        <group>
                            <field name="guarantee_limit"/>
                            <field name="deliver_bool"/>
                            <field name="repaired" groups="base.group_no_one"/>
                            <field name="invoiced" groups="base.group_no_one"/>
                        </group>
                    </group>
                <notebook>
                    <page string="Operations">
                        <field name="operations">
                            <form string="Operations" version="7.0">
                                <notebook>
                                    <page string="Repair Line">
                                        <group col="4">
                                            <field name="name"/>
                                            <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
                                            <label for="product_uom_qty"/>
                                            <div>
                                                <field name="product_uom_qty" class="oe_inline"/>
                                                <field name="product_uom" class="oe_inline" groups="product.group_uom"/>
                                            </div>
                                            <field name="price_unit"/>
                                            <field name="price_subtotal"/>
                                            <field name="type"  on_change="onchange_operation_type(type,parent.guarantee_limit,parent.company_id,context)"/>
                                            <field name="to_invoice"/>
                                            <field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
                                            <field name="invoiced"/>
                                            <field name='prodlot_id' groups="stock.group_production_lot" string="Serial Number"/>
                                            <field name="location_id" groups="stock.group_locations"/>
                                            <field name="location_dest_id" groups="stock.group_locations"/>
                                        </group>
                                    </page>
                                    <page string="History">
                                        <group>
                                            <field name="move_id" />
                                            <field name="invoice_line_id"/>
                                        </group>
                                    </page>
                                 </notebook>
                            </form>
                            <tree string="Operations" editable="bottom">
                                <field name="type" on_change="onchange_operation_type(type,parent.guarantee_limit,parent.company_id,context)"/>
                                <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
                                <field name='name'/>
                                <field name="prodlot_id" groups="stock.group_production_lot" string="Serial Number"/>
                                <field name="location_id" groups="stock.group_locations"/>
                                <field name="location_dest_id" groups="stock.group_locations"/>
                                <field name="product_uom_qty" string="Quantity"/>
                                <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
                                <field name="price_unit"/>
                                <field name="tax_id" widget="many2many_tags"/>
                                <field name="to_invoice"/>
                                <field name="price_subtotal"/>
                            </tree>
                        </field>
                        <group class="oe_subtotal_footer oe_right">
                            <field name="amount_untaxed" sum="Untaxed amount"/>
                            <field name="amount_tax"/>
                            <div class="oe_subtotal_footer_separator oe_inline">
                                <label for="amount_total" />
                                <button name="button_dummy"
                                    states="draft" string="(update)" type="object" class="oe_edit_only oe_link"/>
                            </div>
                            <field name="amount_total" nolabel="1" sum="Total amount" class="oe_subtotal_footer_separator"/>
                        </group>
                        <div class="oe_clear"/>
                    </page>
                    <page string="Invoicing">
                        <group col="4">
                            <field name="invoice_method"/>
                            <field name="partner_invoice_id" attrs="{'readonly':[('invoice_method','=', 'none')],'required':[('invoice_method','!=','none')]}" groups="sale.group_delivery_invoice_address"/>
                            <field
                                name="pricelist_id" groups="product.group_sale_pricelist" context="{'product_id':product_id}"
                                attrs="{'readonly':[('invoice_method','=', 'none')]}"/>
                        </group>
                        <!-- <field name="invoice_id"/> -->
                        <field name="fees_lines">
                            <form string="Fees" version="7.0">
                                <label for="name" class="oe_edit_only"/>
                                <h2>
                                    <field name="name"/>
                                </h2>
                                <group string="Product Information">
                                    <group>
                                        <field name="to_invoice"/>
                                        <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id,parent.guarantee_limit)"/>
                                        <label for="product_uom_qty"/>
                                        <div>
                                            <field name="product_uom_qty" string="Quantity" class="oe_inline"/>
                                            <field name="product_uom" groups="product.group_uom" class="oe_inline"/>
                                        </div>
                                    </group>
                                    <group>
                                        <field name="price_unit"/>
                                        <field widget="many2many_tags" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
                                        <field name="price_subtotal"/>
                                    </group>
                                </group>
                                <group string="History">
                                    <group>
                                        <field name="invoiced"/>
                                    </group>
                                    <group>
                                        <field name="invoice_line_id" />
                                    </group>
                                </group>
                            </form>
                            <tree string="Fees" editable="bottom">
                                <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id,parent.guarantee_limit)"/>
                                <field name='name'/>
                                <field name="product_uom_qty" string="Quantity"/>
                                <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
                                <field name="price_unit"/>
                                <field name="to_invoice"/>
                                <field name="price_subtotal"/>
                            </tree>
                        </field>
                    </page>
                    <page string="Extra Info">
                        <group>
                            <group>
                                <field name="picking_id"/>
                                <field name="invoice_id"/>
                                <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                            </group>
                            <group>
                                <field name="location_dest_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}" groups="stock.group_locations"/>
                            </group>
                        </group>
                    </page>
                    <page string="Notes">
                        <field name="internal_notes" placeholder="Add internal notes..."/>
                        <field name="quotation_notes" placeholder="Add quotation notes..."/>
                    </page>
                </notebook>
                </sheet>
                <div class="oe_chatter">
                    <field name="message_follower_ids" widget="mail_followers"/>
                    <field name="message_ids" widget="mail_thread"/>
                </div>
            </form>
        </field>
    </record>



    <record id="view_repair_order_form_filter" model="ir.ui.view">
          <field name="name">mrp.repair.select</field>
          <field name="model">mrp.repair</field>
          <field name="arch" type="xml">
              <search string="Search Reair Orders">
                  <field name="name" string="Reair Orders"/>
                  <field name="state"/>
                  <filter icon="terp-document-new" string="Quotations" domain="[('state','=','draft')]"/>
                  <filter icon="terp-check" string="Confirmed" domain="[('state','=','confirmed')]" name="current" />
                  <filter icon="terp-emblem-important" string="Ready To Repair" domain="[('state','=','ready')]"/>
                  <separator/>
                  <filter icon="terp-dolar" string="Invoiced" domain="[('invoiced','=',True)]"/>
                  <field name="product_id"/>
                  <field name="partner_id"/>
                  <group expand="0" string="Group By...">
                      <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
                      <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
                      <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
                      <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'guarantee_limit'}" help="Guarantee limit"/>
                      <filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
                  </group>
              </search>
          </field>
    </record>



         <record id="action_repair_order_tree" model="ir.actions.act_window">
            <field name="name">Repair Orders</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">mrp.repair</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="search_view_id" ref="view_repair_order_form_filter"/>
            <field name="help" type="html">
              <p class="oe_view_nocontent_create">
                Click to create a reparation order. 
              </p><p>
                In a repair order, you can detail the components you remove,
                add or replace and record the time you spent on the different
                operations.
              </p><p>
                The repair order uses the warranty date on the Serial Number in
                order to know if whether the repair should be invoiced to the
                customer or not.
              </p>
            </field>
        </record>

        <menuitem action="action_repair_order_tree" id="menu_repair_order" parent="mrp.menu_mrp_manufacturing" groups="mrp.group_mrp_user" name="Repair Orders" sequence="50"/>

    </data>
</openerp>

{'fraction_non_alphanumeric': 0.13070851632320873, 'fraction_numerical': 0.0015048677866158903, 'mean_word_length': 1.3754012255617158, 'pattern_counts': {'":': 0, '<': 492, '<?xml version=': 2, '>': 492, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 137, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7374880', 'n_tokens_mistral': 8056, 'n_tokens_neox': 7640, 'n_words': 1319}