Commit 542549e4 by Maria Agustina

casi terminada liquid

1 parent 121bfba0
......@@ -2,3 +2,4 @@
# from . import controllers
from . import models
from . import wizards
\ No newline at end of file
......@@ -3,10 +3,10 @@
'name': "hgt_liquidacion_tareas",
'summary': """
Modulo dependiente de TPV para procesar liquidaciones""",
Modulo dependiente de TPV y PM para procesar liquidaciones""",
'description': """
Modulo dependiente de TPV para procesar liquidaciones
Modulo dependiente de TPV y PM para procesar liquidaciones
""",
'author': 'ANAC SOFT',
......@@ -18,7 +18,7 @@
# Check https://github.com/odoo/odoo/blob/master/odoo/addons/base/module/module_data.xml
# for the full list
'category': 'Uncategorized',
'version': '0.20.12.09',
'version': '0.21.08.18',
# any module necessary for this one to work correctly
'depends': [
......@@ -35,6 +35,7 @@
'views/vista_liquidaciones.xml',
'views/vista_tipocargo.xml',
'views/vista_tareas.xml',
'wizards/wizard_liquidacion_comprobante_view.xml',
'views/menu.xml',
# 'views/templates.xml',
],
......
......@@ -5,3 +5,4 @@ from . import liquidacionestareas
from . import tipocargo
from . import lineatarea
from . import tareas
......@@ -157,7 +157,22 @@ class hdgt_liquidacionestareas(models.Model):
tar.tarea.horas_liquidadas += tar.minutos_a_liquidar
self.estado = 'liquidado'
self.abonado = True
return(True)
datos = {
'liquidacion': self.id,
}
wizard = self.env['hgt.liquidacion_comprobante'].create(datos)
return {
'type': 'ir.actions.act_window',
'res_model': 'hgt.liquidacion_comprobante',
'view_mode': 'form',
'view_type': 'form',
'res_id': wizard.id,
'views': [(False, 'form')],
'target': 'new',
}
def volver_borrador(self):
self.estado = 'borrador'
......
from . import wizard_liquidacion_comprobante
\ No newline at end of file
No preview for this file type
from odoo import models, fields, api
from datetime import datetime
class hgt_liquidacion_comprobante(models.TransientModel):
_name = "hgt.liquidacion_comprobante"
proovedor = fields.Many2one(
string='Proovedor',
comodel_name='asw.cliente',
ondelete='restrict',
)
liquidacion = fields.Many2one(
string=u'Liquidación',
comodel_name='hgt.liquidacionestareas',
ondelete='restrict',
)
total_liquidacion = fields.Float(
string='Total Abonado',
related = 'liquidacion.total',
)
cta_corriente = fields.Many2many(
string='Cuenta Corriente Proovedor',
comodel_name = 'asw.cta_cte',
)
@api.onchange('proovedor')
def onchange_cta_corrienet(self):
result = {}
result['domain'] = []
cta_ctes = self.env['asw.cta_cte'].search([])
ids = cta_ctes.filtered(lambda l: l.cc_cliente.id == self.proovedor.id)
self.cta_corriente = ids
result['domain'] = {'campo': [('id', 'in', ids)]}
return result
def generar_comprobante_compra(self):
#fx para generar c de c
<odoo>
<data>
<record id="action_liquidacion_comprobante_act_window" model="ir.actions.act_window">
<field name="type">ir.actions.act_window</field>
<field name="name">Generar Comprobante de Compra</field>
<field name="res_model">hgt.liquidacion_comprobante</field>
<field name="view_mode">tree,form</field>
<field name="view_type">form</field>
<field name="target">new</field>
</record>
<record id="view_liquidacion_comprobante_form" model="ir.ui.view">
<field name="name">Generar Comprobante de Compra</field>
<field name="model">hgt.liquidacion_comprobante</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form>
<sheet>
<group col="2">
<field name="proovedor"/>
<field name="total_liquidacion"/>
</group>
<group col="4" string="Cuenta Corriente Proovedor">
<field nolabel="1" widget="one2many" name="cta_corriente" />
</group>
</sheet>
<footer>
<button name="generar_comprobante_compra" class='btn btn-primary' string="Generar Comprobante de Compra" type="object" />
<button string="Cancelar" class="btn-default" special="cancel"/>
</footer>
</form>
</field>
</record>
</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!