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

        <record id="action_vnt_cobros_act_window" model="ir.actions.act_window">
            <field name="type">ir.actions.act_window</field>
            <field name="name">Cobros</field>
            <field name="res_model">vnt.cobros</field>
            <field name="view_mode">tree,form</field>
            <field name="view_type">form</field>
            <field name="target">current</field>
        </record>
        
        <record id="view_vnt_cobros_tree" model="ir.ui.view">
            <field name="name">Cobros</field>
            <field name="model">vnt.cobros</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="co_cliente" />
                    <field name="co_total_deuda"/>
                    <field name="co_total_interes" />
                    <field name="co_total" />
                </tree>                
            </field>
        </record>

        <record id="view_vnt_cobros_form" model="ir.ui.view">
            <field name="name">Cobros</field>
            <field name="model">vnt.cobros</field>
            <field name="type">form</field>
            <field name="mode">primary</field>
            <field name="priority" eval="16" />
            <field name="active" eval="True" />
            <field name="arch" type="xml">
                <form> 
                    <!--<sheet>-->
                        <header>
                        <button type="object" class="oe_highlight" name="traer_ld" string="Cargar Deudas" attrs="{ 'invisible' : ['|',('co_deucarg','=',True),('co_cliente','=',False)]}" /> 
                        <button name="procesar_deuda" string="Confirmar Deuda" type="object" class='btn btn-primary' attrs="{'invisible':['|',('co_estado','in',['p','a','pr','c']),('co_deucarg','=',False)]}" />
                        <button name="procesar_notas" string="Procesar Cobro" type="object" class='btn btn-primary' attrs="{'invisible':[('co_estado','in',['pr','b','p','c'])]}"/>
                        <button name="pagar_deuda" string="Cobrar Todo" type="object" class='btn btn-primary' attrs="{'invisible':[('co_estado','in',['b','a','p','c'])]}"/>
                        <button name="cancelar" string="Cancelar" type="object" class='btn btn-primary' attrs="{'invisible':[('co_estado','in',['b','a','c','pr'])]}"/>
                        <button name="volver_borrador" string="Volver a Borrador" type="object" class='btn btn-primary' attrs="{'invisible':[('co_estado','in',['b','p','c'])]}"/>

                        <field name="co_estado" widget="statusbar"/>
                        <field invisible="1" name="co_deucarg" />
                        </header>
                        <group>
                            <field name="co_usuario_cancelacion" attrs="{'invisible':[('co_estado','not in',['c'])]}"/>
                        </group>
                        <group col="2" string="Cliente y resumen"> 
                          <field colspan="1" nolabel="1" name="co_cliente" attrs="{ 'readonly' : [('co_deucarg','=',True),('co_estado','in',['p','c','pr'])]}" />
                          <div colspan="1"></div>
                          <field colspan="1" nolabel="1"  name="co_resumen" attrs="{ 'readonly' : [('co_deucarg','=',True),('co_estado','in',['p','c'])]}" />
                        </group>
                        <notebook colspan="4">
                        <page string="Deudas">
                            <field name="co_modo_elegido" />
                            <button type="object" class="btn btn-info" style="margin:5px;" name="seleccionar_todo" string="Seleccionar todo" attrs="{'invisible':[('co_estado','in',['a','p','pr','c']),('co_modo_elegido','=',True)], 'readonly':[('co_estado','in',['p','c'])]}" /> 
                            <button type="object" class="btn btn-primary" style="margin:5px;" name="cobrar_todo" string="Cobrar Todo" attrs="{'invisible':[('co_modo_elegido','=',True)]}" /> 
                            <button type="object" class="btn btn-primary" style="margin:5px;" name="cobrar_negociado" string="Cobro Negociado" attrs="{'invisible':[('co_modo_elegido','=',True)]}" /> 
                            <button type="object" class="btn btn-primary" style="margin:5px;" name="interes_perdido" string="Interés Perdido" attrs="{'invisible':[('co_modo_elegido','=',True)]}" /> 
                          <field nolabel="1" name="co_lin_deuda">
                            <tree create="0" edit="1" editable="1">
                                <field name="ld_factura" readonly="1"  />
                                <field name="ld_fecha_vto" readonly="1" />
                                <field name="ld_estado" readonly="1" />
                                <field name="ld_total" readonly="1"/>
                                <field name="ld_comp_adeudado" readonly="1"/>
                                <field name="ld_interes" readonly="1"/>
                                <field name="ld_fecha_calculo" readonly="1"/>
                                <field name="ld_co_estado" invisible="1"/>
                                <!-- <field name="ld_fecha_vto" editable="0" readonly="1" />
                                <field name="ld_estado" editable="0" readonly="1" />
                                <field name="ld_total" readonly="1" /> -->
                                <field name="ld_cobro" readonly="1"/>
                                <field name="ld_select" attrs="{'readonly':[('ld_co_estado','in',['a','p','c'])]}"/>
                                <field name="ld_nd" readonly="1" attrs="{'invisible':[('ld_co_estado','in',['a','b','c'])]}"/>
                            </tree>
                          </field>
                        </page>
                        <page string="Comprobantes">
                            <field name="co_facturas" readonly="1" />
                        </page>
                       
                        </notebook>
                        <group name='total' class="oe_subtotal_footer oe_right" attrs="{'invisible':[('co_estado','in',['p','c'])]}">
                          <field name="co_total_deuda"  readonly="1" />
                          <field name="co_total_interes"  readonly="1" />
                          <field name="co_total"  readonly="1" />
                        </group>
                                  
                    <!--</sheet>-->
                </form>                
            </field>
        </record>
        
    </data>
</odoo>