Commit bbbc55a4 by Maria Agustina

234

0 parents
# -*- coding: utf-8 -*-
# from . import controllers
from . import models
\ No newline at end of file
# -*- coding: utf-8 -*-
{
'name': "hgt_liquidacion_tareas",
'summary': """
Modulo dependiente de TPV para procesar liquidaciones""",
'description': """
Modulo dependiente de TPV para procesar liquidaciones
""",
'author': 'ANAC SOFT',
'website': 'http://anacsoft.com',
# Categories can be used to filter modules in modules listing
# 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',
# any module necessary for this one to work correctly
'depends': [
'base',
'asw_tpv',
'hgt_pm',
],
# always loaded
'data': [
# 'security/ir.model.access.csv',
'views/vista_maestro.xml',
'views/vista_liquidaciones.xml',
'views/menu.xml',
# 'views/templates.xml',
],
# only loaded in demonstration mode
'demo': [
'demo/demo.xml',
],
'installable': True,
'application': True,
}
\ No newline at end of file
# -*- coding: utf-8 -*-
from . import controllers
\ No newline at end of file
# -*- coding: utf-8 -*-
from odoo import http
# class MyModule(http.Controller):
# @http.route('/my_module/my_module/', auth='public')
# def index(self, **kw):
# return "Hello, world"
# @http.route('/my_module/my_module/objects/', auth='public')
# def list(self, **kw):
# return http.request.render('my_module.listing', {
# 'root': '/my_module/my_module',
# 'objects': http.request.env['my_module.my_module'].search([]),
# })
# @http.route('/my_module/my_module/objects/<model("my_module.my_module"):obj>/', auth='public')
# def object(self, obj, **kw):
# return http.request.render('my_module.object', {
# 'object': obj
# })
\ No newline at end of file
<odoo>
<data>
<!-- -->
<!-- <record id="object0" model="my_module.my_module"> -->
<!-- <field name="name">Object 0</field> -->
<!-- <field name="value">0</field> -->
<!-- </record> -->
<!-- -->
<!-- <record id="object1" model="my_module.my_module"> -->
<!-- <field name="name">Object 1</field> -->
<!-- <field name="value">10</field> -->
<!-- </record> -->
<!-- -->
<!-- <record id="object2" model="my_module.my_module"> -->
<!-- <field name="name">Object 2</field> -->
<!-- <field name="value">20</field> -->
<!-- </record> -->
<!-- -->
<!-- <record id="object3" model="my_module.my_module"> -->
<!-- <field name="name">Object 3</field> -->
<!-- <field name="value">30</field> -->
<!-- </record> -->
<!-- -->
<!-- <record id="object4" model="my_module.my_module"> -->
<!-- <field name="name">Object 4</field> -->
<!-- <field name="value">40</field> -->
<!-- </record> -->
<!-- -->
</data>
</odoo>
\ No newline at end of file
# -*- coding: utf-8 -*-
from . import master
from . import liquidacionestareas
from . import tipocargo
from . import lineatarea
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
# -*- coding: utf-8 -*-
from odoo import models, fields, api
class hgt_linea_tarea(models.Model):
_name = 'hgt.linea_tarea'
liquidaciones = fields.Many2one(
string='Liquidaciones',
comodel_name='hgt.liquidacionestareas',
ondelete='restrict',
)
tarea = fields.Many2many(
string='Tareas',
comodel_name='hgt.tarea',
relation='tarea_lineatarea_rel',
column1='hgt_tarea_id',
column2='hgt_linea_tarea_id',
)
name = fields.Char(
related='tarea.name',
readonly=True,
store=True
)
inicio = fields.Datetime(
related='tarea.inicio',
readonly=True,
store=True
)
cierre = fields.Datetime(
related='tarea.cierre',
readonly=True,
store=True
)
minutos_reales = fields.Integer(
related='tarea.minutos_reales',
readonly=True,
store=True
)
tipo_cargo = fields.One2many(
string='Tipo de Cargo',
comodel_name='hgt.tipo_cargo',
inverse_name='linea_tarea',
)
subtotal = fields.Float(
string='Subtotal',
compute='obtener_subtotal',
)
def obtener_subtotal(self):
return 0
\ No newline at end of file
# -*- coding: utf-8 -*-
from odoo import models, fields, api
class hgt_liquidacionestareas(models.Model):
_name = 'hgt.liquidacionestareas'
nombre = fields.Char(
string='Nombre',
compute='obtener_nombre',
)
usuario = fields.Many2one(
string='Usuario',
comodel_name='res.users',
ondelete='restrict',
)
lineas_tareas = fields.One2many(
string='Tareas',
comodel_name='hgt.linea_tarea',
inverse_name='liquidaciones',
)
desde = fields.Date(
string='Desde',
default=fields.Date.context_today,
)
hasta = fields.Date(
string='Hasta',
default=fields.Date.context_today,
)
total = fields.Float(
string='Total',
)
abonado = fields.Boolean(
string='Abonado?',
)
estado = fields.Selection(
string='Estado',
selection=[('borrador', 'Borrador'), ('aprobado', 'Aprobado'), ('liquidado', 'Liquidado')],
default='borrador',
)
def obtener_nombre(self):
for record in self:
fecha = record.hasta
usuario = record.usuario.name
string = "{} - {}".format(fecha,usuario)
record.nombre = string
# -*- coding: utf-8 -*-
from odoo import models, fields, api
class hgt_masterliquidaciones(models.Model):
_name = 'hgt.masterliquidaciones'
titulo = fields.Char(
string=u'Título',
)
ejecutores = fields.Many2many(
string='Ejecutores',
comodel_name='res.users',
relation='user_masterliquidaciones_rel',
column1='res_users_id',
column2='hgt_masterliquidaciones_id',
)
liquidaciones = fields.Many2many(
string='Liquidaciones',
comodel_name='hgt.liquidacionestareas',
relation='liquidaciones_masterliquidaciones_rel',
column1='hgt_liquidacionestareas_id',
column2='hgt_masterliquidaciones_id',
)
desde = fields.Date(
string='Desde',
default=fields.Date.context_today,
)
hasta = fields.Date(
string='Desde',
default=fields.Date.context_today,
)
from odoo.exceptions import UserError, ValidationError, Warning
from datetime import datetime, timedelta
from odoo import models, fields, api
class hgt_tarea(models.Model):
_inherit = 'hgt.tarea'
\ No newline at end of file
# -*- coding: utf-8 -*-
from odoo import models, fields, api
class hgt_tipo_cargo(models.Model):
_name = 'hgt.tipo_cargo'
tipo = fields.Char(
string='field_name',
)
monto = fields.Float(
string='Monto por hora',
)
desde = fields.Date(
string='Desde',
default=fields.Date.context_today,
)
hasta = fields.Date(
string='Hasta',
default=fields.Date.context_today,
)
ejecutores = fields.Many2many(
string='Ejecutores',
comodel_name='res.users',
relation='user_tipocargo_rel',
column1='res_users_id',
column2='hgt_tipo_cargo_id',
)
linea_tarea = fields.Many2one(
string='Linea de Tarea',
comodel_name='hgt.linea_tarea',
ondelete='restrict',
)
\ No newline at end of file
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_my_module_my_module,my_module.my_module,model_my_module_my_module,,1,0,0,0
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data noupdate="0">
<menuitem name="Personal" id="finanzas_personal" parent="asw_tpv.asw_tpv_cheque_root_menu"/>
<menuitem name="Maestro de Liquidaciones" id="finanzas_personal_personal" parent="finanzas_personal" action="action_maestro_act_window"/>
<menuitem name="Liquidación de Tareas" id="finanzas_personal_liquidaciones" parent="finanzas_personal" action="action_liquidacionestareas_act_window"/>
</data>
</odoo>
<odoo>
<data>
<!-- <template id="listing"> -->
<!-- <ul> -->
<!-- <li t-foreach="objects" t-as="object"> -->
<!-- <a t-attf-href="#{ root }/objects/#{ object.id }"> -->
<!-- <t t-esc="object.display_name"/> -->
<!-- </a> -->
<!-- </li> -->
<!-- </ul> -->
<!-- </template> -->
<!-- <template id="object"> -->
<!-- <h1><t t-esc="object.display_name"/></h1> -->
<!-- <dl> -->
<!-- <t t-foreach="object._fields" t-as="field"> -->
<!-- <dt><t t-esc="field"/></dt> -->
<!-- <dd><t t-esc="object[field]"/></dd> -->
<!-- </t> -->
<!-- </dl> -->
<!-- </template> -->
</data>
</odoo>
\ No newline at end of file
<?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>
<field name="estado" widget="statusbar"/>
</header>
<sheet>
<group col="2">
<field colspan="2" name="nombre" />
</group>
<group col="2">
<field colspan="2" name="usuario" />
</group>
<group col="4">
<field colspan="2" name="desde" />
<field colspan="2" name="hasta" />
</group>
<group col="4">
<field colspan="2" name="total" />
<field colspan="2" name="abonado" />
</group>
<group col="4" string="Tareas">
<field nolabel="1" name="lineas_tareas">
<tree>
<field name="name" />
<field name="inicio" />
<field name="cierre" />
<field name="minutos_reales" sum='1'/>
<field name="tipo_cargo" />
<field name="subtotal" sum='1' />
</tree>
</field>
</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>
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data noupdate="0">
<record id="action_maestro_act_window" model="ir.actions.act_window">
<field name="type">ir.actions.act_window</field>
<field name="name">Maestro de Liquidaciones</field>
<field name="res_model">hgt.masterliquidaciones</field>
<field name="view_mode">tree,form</field>
<field name="view_type">form</field>
<field name="target">current</field>
</record>
<record id="view_maestro_tree" model="ir.ui.view">
<field name="name">>Maestro de Liquidaciones</field>
<field name="model">hgt.masterliquidaciones</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="titulo" />
<field name="desde" />
<field name="hasta" />
</tree>
</field>
</record>
<record id="view_maestro_form" model="ir.ui.view">
<field name="name">>Maestro de Liquidaciones</field>
<field name="model">hgt.masterliquidaciones</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form>
<group col="2">
<field colspan="2" name="titulo" />
</group>
<group col="4">
<field colspan="2" name="desde" />
<field colspan="2" name="hasta" />
</group>
<group col="2" string="Ejecutores">
<field colspan="2" nolabel="1" name="ejecutores" />
</group>
<group col="2" string="Liquidaciones">
<field colspan="2" nolabel="1" name="liquidaciones" />
</group>
</form>
</field>
</record>
<record id="view_maestro_search" model="ir.ui.view">
<field name="name">Maestro de Liquidaciones</field>
<field name="model">hgt.masterliquidaciones</field>
<field name="arch" type="xml">
<search>
<field name="titulo" />
<field name="desde" />
<field name="hasta" />
</search>
</field>
</record>
</data>
</odoo>
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!