Commit 45fda01b by Juan

Base cobro masivo

1 parent f97d79a4
......@@ -45,6 +45,7 @@
'views/comprobante.xml',
'views/referencia_compra.xml',
'views/menu_compras.xml',
'wizard/vista_cobro_discriminado.xml',
],
# only loaded in demonstration mode
'demo': [
......
from . import prod_pfinal
from . import corregir_nro_tal
from . import generar_nota
from . import cobro_discriminado
# -*- coding: utf-8 -*-
###############################################################################
# License, author and contributors information in: #
# __manifest__.py file at the root folder of this module. #
###############################################################################
from odoo import models, fields, api, _
from odoo.exceptions import UserError, ValidationError
import datetime
class hgt_cobro_multiple(models.TransientModel):
_name = 'hgt.cobro_multiple'
_description = 'Cobro multiple avanzado'
_inherit = ['asw.action.manager']
# Informacion pago
pcw_cliente = fields.Many2one(
comodel_name='asw.cliente',
string='Cliente'
)
pcw_referencia = fields.Char(
string=u'Referencia',
)
pcw_efectivo = fields.Monetary(
string='Efectivo',
currency_field='cli_moneda_empresa'
)
pcw_retencion_recibida = fields.Monetary(
string='Retención',
currency_field='cli_moneda_empresa'
)
pcw_cli_razon_social = fields.Char(
string='Razon Social',
related='pcw_cliente.cli_razon_social'
)
# Currency field
cli_moneda_empresa = fields.Many2one(
string=u'Moneda del saldo',
comodel_name='res.currency',
ondelete='set null',
related='pcw_cliente.create_uid.company_id.currency_id',
)
# Formas de pago
pcw_che_recibidos = fields.Many2many(
comodel_name='asw.cheque',
relation='pago_cliente_chq_recibido',
column1='asw_cheque_id',
column2='asw_cliente_id',
string='Cheques Recibidos'
)
pcw_chq_emitidos = fields.Many2many(
comodel_name='asw.cheque',
relation='pago_cliente_chq_emitido',
column1='asw_cheque_id',
column2='asw_cliente_id',
string='Cheques Emitidos'
)
pcw_transferencias_recibidas = fields.Many2many(
comodel_name='asw.valores',
relation='pago_cliente_transferencia_recibida',
column1='pago_cliente_id',
column2='asw_valores_id',
string='Transferencias Recibidas'
)
pcw_transferencias_emitidas = fields.Many2many(
comodel_name='asw.valores',
relation='pago_cliente_transferencia_emitida',
column1='pago_cliente_id',
column2='asw_valores_id',
string='Transferencias Emitidas'
)
pcw_tarjetas = fields.Many2many(
comodel_name='asw.valores',
relation='pago_cliente_tarjeta',
column1='pago_cliente_id',
column2='asw_valores_id',
string='Tarjetas'
)
# Total de pago
pcw_total = fields.Monetary(
string='Total Recibido',
compute='_calcular_total',
currency_field='cli_moneda_empresa'
)
pcw_recibo = fields.Many2one(
string='Recibo',
comodel_name='asw.comprobante'
)
@api.multi
def pago_facturas_masivo(self):
context = self.env.context
active_ids = context.get('active_ids')
facturas = self.env['asw.comprobante'].search([('id', 'in', active_ids)])
for factura in facturas:
if factura.comp_adeudado > 0:
factura.pago_rapido(self.forma_pago)
\ No newline at end of file
<odoo>
<data>
<record id="asw_pago_cliente_wizzard_form" model="ir.ui.view">
<field name="name">Pago cliente Avanzado</field>
<field name="model">hgt.cobro_multiple</field>
<field name="arch" type="xml">
<form>
<field name="pcw_cli_razon_social" invisible='1'/>
<group col="4">
<field name="pcw_cliente" colspan='4' domain="[('cli_es_cliente','=', True )]"/>
<field name="pcw_efectivo" colspan='2'/>
<field name="pcw_retencion_recibida" colspan="2"/>
<field name="pcw_referencia" />
<notebook colspan="4">
<page string="Cheques Recibidos">
<group col="4">
<field name="pcw_che_recibidos" colspan='4' nolabel='1' widget='one2many' context="{'default_val_razon_social' : pcw_cli_razon_social}">
<tree create="1" delete="1" edit="1" editable="bottom">
<field name="che_banco"/>
<field name="che_nro_cheque"/>
<field name="che_fecha_emision" required='1'/>
<field name="che_fecha_cobro" required='1'/>
<field name="che_fecha_vencimiento" required='1'/>
<field name="che_razon_social_emisor"/>
<field name="che_cuit_emisor"/>
<field name="che_monto"/>
</tree>
</field>
</group>
</page>
<page string="Transferencias Recibidas">
<group col="4">
<field name="pcw_transferencias_recibidas" colspan='4' nolabel='1' widget='one2many' >
<tree create="1" delete="1" edit="1" editable="bottom">
<field name="val_cuenta_bancaria"/>
<field name="val_fecha_emision"/>
<field name="val_nro_pago"/>
<field name="val_monto" required='1'/>
</tree>
</field>
</group>
</page>
<page string="Tarjetas">
<group col="4">
<field name="pcw_tarjetas" colspan='4' nolabel='1' widget='one2many' >
<tree create="1" delete="1" edit="1" editable="bottom">
<field name="val_tipo" domain="[('tv_tipo','=', 'ta' )]" string='Tarjeta' options="{'no_create': True, 'no_create_edit':True}"/>
<field name="val_nro_pago"/>
<field name="val_monto" required='1'/>
</tree>
</field>
</group>
</page>
</notebook>
<br/>
</group>
<group id='total' col='6'>
<field name="pcw_total" colspan='2'/>
</group>
<footer>
<button name="generar_recibo" string="Generar Recibo" type="object" class="oe_highlight btn-generar-recibo"/>
<button special="cancel" string="Cancel"/>
</footer>
</form>
</field>
</record>
<act_window id="hgt_cobro_masivo_avanzado_wizzard_action" name="Cobro masivo Avanzado" src_model="asw.comprobante" res_model="hgt.cobro_multiple" view_mode="form" target="new" multi="True"/>
</data>
</odoo>
\ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!