vista_liquidaciones.xml 5.62 KB
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <data noupdate="0">

        <record id="action_liquidacionestareas_act_window" model="ir.actions.act_window">
            <field name="type">ir.actions.act_window</field>
            <field name="name">Liquidaciones de Tareas</field>
            <field name="res_model">hgt.liquidacionestareas</field>
            <field name="view_mode">tree,form</field>
            <field name="view_type">form</field>
            <field name="target">current</field>
        </record>

        <record id="view_liquidacionestareas_tree" model="ir.ui.view">
            <field name="name">>Liquidaciones de Tareas</field>
            <field name="model">hgt.liquidacionestareas</field>
            <field name="type">tree</field>
            <field name="mode">primary</field>
            <field name="priority" eval="16" />
            <field name="active" eval="True" />
        
            <field name="arch" type="xml">
                <tree>
                    <field name="nombre" />
                    <field name="desde" />
                    <field name="hasta" />
                    <field name="estado" />
                    <field name="total" />
                    <field name="abonado" />
                </tree>
            </field>
        </record>

        <record id="view_liquidacionestareas_form" model="ir.ui.view">
            <field name="name">Liquidaciones de Tareas</field>
            <field name="model">hgt.liquidacionestareas</field>
            <field name="type">form</field>
            
            <field name="arch" type="xml">
            
                <form>
                    <header>
                        <button name="aprobar_liquidaciones" class='btn btn-primary' string="Aprobar" type="object" attrs='{ "invisible" : [("estado", "!=", "borrador")] }' />       
                        <button name="abonar_liquidaciones" class='btn btn-success' string="Abonar" type="object" attrs='{ "invisible" : [("estado", "!=", "aprobado")] }' />                        
                        <button name="volver_borrador" string="Volver a Borrador" type="object" attrs='{ "invisible" : [("estado", "!=", "aprobado")] }'/>       
                        <field name="estado" widget="statusbar"/>
                    </header>
                    <sheet>
                        <group col="2">
                            <h2>Liquidación <field colspan="2" nolabel="1" name="nombre" /></h2>
                        </group>
                        <group col="2">
                            <field colspan="2" name="usuario" readonly="1" />
                        </group>
                        <group col="4">
                            <field colspan="2" name="desde" readonly="1" />
                            <field colspan="2" name="hasta" readonly="1" />
                        </group>
                        <group col="4">
                            <field colspan="2" name="total_aprobado"  readonly="1" />
                            <field colspan="2" name="aprobado"  readonly="1"/>
                            <field colspan="2" name="fecha_aprobado"  readonly="1"/>
                            <field colspan="2" name="aprobador"  readonly="1"/>
                        </group>
                        <group col="4">
                            <field colspan="2" name="total"  readonly="1" />
                            <field colspan="2" name="abonado"  readonly="1"/>
                            <field colspan="2" name="fecha_abonado"  readonly="1"/>
                            <field colspan="2" name="abonador"  readonly="1"/>
                        </group>
                        <group col="4" string="Tareas">
                            <field nolabel="1" widget="one2many" name="lineas_tareas" attrs='{ "readonly" : [("estado", "!=", "borrador")] }'>
                               
                                <tree create="1" edit="1" editable="bot">
                                       <field name="state" readonly="1" /> 
                                       <field name="name" readonly="1" /> 
                                       <field name="minutos_reales" sum='1' readonly="1" /> 
                                       <field name="minutos_a_liquidar" sum='1' readonly="1" /> 
                                       <field name="tipo_cargo" editable="1" readonly="0" /> 
                                       <field name="subtotal" sum='1' readonly="1" force_save="1" /> 
                                </tree>
                            </field>
                        </group>

                        <h2>Bitácora</h2>
                        <group col="3">
                            <field name="lt_texto"/>
                            <button name="CargarNotas" string="Archivar en la bitácora" type="object" class="oe_edit_only" />
                        </group>

                        <group col="1">
                            <field name="lt_notitas" nolabel="1" attrs="{'readonly': True}"/>
                        </group>
                        
                    </sheet>
                </form>
            </field>
        </record> 

        <record id="view_liquidacionestareas_search" model="ir.ui.view">
            <field name="name">Liquidaciones de Tareas</field>
            <field name="model">hgt.liquidacionestareas</field>
            <field name="arch" type="xml">
                <search>
                    <field name="nombre" />
                    <field name="desde" />
                    <field name="hasta" />
                    <field name="estado" />
                </search>
            </field>
        </record>
        

    </data>
</odoo>