-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
268 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
'name': "OKR", | ||
'version': '16.0.1.0.0', | ||
'category': 'OKR', | ||
'summary': "Gestión de OKR", | ||
'license': 'LGPL-3', | ||
'description': """ | ||
Manage Library | ||
============== | ||
Description related to library. | ||
""", | ||
'author': "Pablo Montenegro", | ||
'depends': ['base'], | ||
'data': ['security/ir.model.access.csv', | ||
'data/kr_ppal_data.xml', | ||
'views/objetivo_line.xml', | ||
'views/objetivo.xml', | ||
'views/kr_ppal.xml',], | ||
'application': True, | ||
'installable': True, | ||
'auto_install': False, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<odoo noupdate="True"> | ||
|
||
<record model='kr.ppal' id='kr_1'> | ||
<field name='codigo'>01</field> | ||
<field name='descripcion'>Crecer</field> | ||
</record> | ||
|
||
<record model='kr.ppal' id='kr_2'> | ||
<field name='codigo'>02</field> | ||
<field name='descripcion'>Internacionalizar</field> | ||
</record> | ||
|
||
<record model='kr.ppal' id='kr_3'> | ||
<field name='codigo'>03</field> | ||
<field name='descripcion'>Agregar valor al cliente</field> | ||
</record> | ||
|
||
<record model='kr.ppal' id='kr_4'> | ||
<field name='codigo'>04</field> | ||
<field name='descripcion'>Producto robusto</field> | ||
</record> | ||
|
||
<record model='kr.ppal' id='kr_5'> | ||
<field name='codigo'>05</field> | ||
<field name='descripcion'>Equipo motivado y feliz</field> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from . import kr_ppal | ||
from . import objetivo | ||
from . import objetivo_line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from odoo import models, fields | ||
|
||
|
||
class KrPPal(models.Model): | ||
_name = "kr.ppal" | ||
_description = "Kr ppal" | ||
_rec_name = 'descripcion' | ||
|
||
codigo = fields.Char(required=True) | ||
descripcion = fields.Char(required=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from odoo import models, api, fields | ||
import time | ||
from odoo.exceptions import UserError | ||
|
||
|
||
class OkrObjetivo(models.Model): | ||
_name = "okr.objetivo" | ||
_description = "Objetivo" | ||
_rec_name = 'resumen_objetivo' | ||
|
||
resumen_objetivo = fields.Many2one('kr.ppal', string="KR ppal", required=True) | ||
descripcion_ampliada = fields.Char(string="Descripcion ampliada", required=True, readonly=False) | ||
progreso = fields.Integer(string="Progress", compute='_compute_progreso',help="Progress from zero knowledge (0%) to fully mastered (100%).", default=0) | ||
peso = fields.Selection([('inspiracional', 'Inspiracional'), ('commitment', 'Commitment')]) | ||
comentarios = fields.Char() | ||
okr_ids = fields.One2many('okr.objetivo.line', 'objetivo_padre') | ||
team = fields.Selection([('imasd', 'I+D'), ('administracion', 'Administración'), ('rechumanos', 'Recursos Humanos'), ('ventas', 'Ventas'), ('mdea', 'Mdea'), ('consultoria', 'Consultoria')], required=True) | ||
periodo = fields.Selection([('q1', 'Q1'), ('q2', 'Q2'), ('q3', 'Q3'), ('q4', 'Q4')], required=True) | ||
state = fields.Selection([('in_progress', 'En progreso'), ('cancel', 'Cancelado'), ('state', 'finalizado')]) | ||
year = fields.Char( | ||
required=True, | ||
default=time.strftime('%Y'), | ||
) | ||
|
||
@api.depends('okr_ids') | ||
def _compute_progreso(self): | ||
sumatory = sum(self.okr_ids.mapped('progreso')) or 0 | ||
self.progreso = sumatory | ||
if sumatory > 100: | ||
raise UserError("Revisar el progreso de los kr, no puede ser mayor a 100") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from odoo import models, api, fields, _ | ||
from odoo.exceptions import ValidationError | ||
|
||
|
||
class OkrObjetivoLine(models.Model): | ||
_name = "okr.objetivo.line" | ||
_description = "Objetivo line" | ||
|
||
kr = fields.Char(string="Descripción KR", required=True, readonly=False) | ||
descripcion_ampliada = fields.Char(string="Descripcion ampliada", required=True, readonly=False) | ||
progreso = fields.Integer(string="Progress", default=0, store=True, readonly=False) | ||
peso = fields.Integer(string="Peso") | ||
comentarios = fields.Char() | ||
objetivo_padre = fields.Many2one('okr.objetivo') | ||
target = fields.Integer(string="Target") | ||
resultado = fields.Integer(string="Resultado") | ||
responsable = fields.Char() | ||
plan_de_accion = fields.Char() | ||
comentarios = fields.Char() | ||
interdependencias = fields.Char() | ||
realizado_en_el_q = fields.Char() | ||
notas_proximo_q = fields.Char() | ||
team = fields.Selection(related='objetivo_padre.team') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_kr_ppal,access_kr_ppal,model_kr_ppal,base.group_user,1,1,1,1 | ||
access_okr_objetivo,access_okr_objetivo,model_okr_objetivo,base.group_user,1,1,1,1 | ||
access_okr_objetivo_line,access_okr_objetivo_line,model_okr_objetivo_line,base.group_user,1,1,1,1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
|
||
<record id="kr_ppal_view_tree" model="ir.ui.view"> | ||
<field name="name">Kr principales</field> | ||
<field name="model">kr.ppal</field> | ||
<field name="arch" type="xml"> | ||
<tree> | ||
<field name="codigo"/> | ||
<field name="descripcion"/> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.actions.act_window" id="action_kr_ppal"> | ||
<field name="name">KR ppales</field> | ||
<field name="res_model">kr.ppal</field> | ||
<field name="view_mode">tree</field> | ||
</record> | ||
|
||
<menuitem id="menu_okr_config" name="Objetivos ppales" parent="okr.objetivo_base_menu" sequence="5" groups="base.group_user"/> | ||
<menuitem action="action_kr_ppal" id="menu_kr_ppal" sequence="7" parent="okr.menu_okr_config"/> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
|
||
<record id="objetivo_view_form" model="ir.ui.view"> | ||
<field name="name">Objetivo</field> | ||
<field name="model">okr.objetivo</field> | ||
<field name="arch" type="xml"> | ||
<form> | ||
<group> | ||
<group> | ||
<field name="resumen_objetivo"/> | ||
<field name="descripcion_ampliada"/> | ||
<field name="progreso"/> | ||
<field name="peso"/> | ||
<field name="comentarios"/> | ||
<field name="team"/> | ||
</group> | ||
<group> | ||
<field name="periodo"/> | ||
<field name="year"/> | ||
<field name="state"/> | ||
</group> | ||
</group> | ||
<notebook> | ||
<page id="line_tab" | ||
name="line_tab" | ||
string="Okr Lines"> | ||
<field name="okr_ids" | ||
widget="section_and_note_one2many" | ||
mode="tree,kanban"> | ||
<tree editable="bottom" string="Okr Lines"> | ||
<field name="kr"/> | ||
<field name="descripcion_ampliada"/> | ||
<field name="progreso"/> | ||
<field name="peso"/> | ||
<field name="comentarios"/> | ||
<field name="objetivo_padre"/> | ||
<field name="target"/> | ||
<field name="resultado"/> | ||
<field name="responsable"/> | ||
<field name="plan_de_accion"/> | ||
<field name="comentarios"/> | ||
<field name="interdependencias"/> | ||
<field name="realizado_en_el_q"/> | ||
<field name="notas_proximo_q"/> | ||
<field name="team"/> | ||
</tree> | ||
</field> | ||
</page> | ||
</notebook> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<record id="objetivo_view_tree" model="ir.ui.view"> | ||
<field name="name">Objetivo</field> | ||
<field name="model">okr.objetivo</field> | ||
<field name="arch" type="xml"> | ||
<tree> | ||
<field name="resumen_objetivo"/> | ||
<field name="descripcion_ampliada"/> | ||
<field name="progreso"/> | ||
<field name="peso"/> | ||
<field name="comentarios"/> | ||
<field name="team"/> | ||
<field name="periodo"/> | ||
<field name="year"/> | ||
<field name="state"/> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.ui.view" id="view_objetivo_search"> | ||
<field name="name">okr.objetivo.search</field> | ||
<field name="model">okr.objetivo</field> | ||
<field name="arch" type="xml"> | ||
<search> | ||
<field name="team"/> | ||
<filter name="group_by_team" string="Group by team" context="{'group_by': 'team'}"/> | ||
</search> | ||
</field> | ||
</record> | ||
|
||
<record id='objetivo_book_action' model="ir.actions.act_window"> | ||
<field name="name">Objetivo</field> | ||
<field name="res_model">okr.objetivo</field> | ||
<field name="view_mode">tree,form</field> | ||
<field name="search_view_id" ref="view_objetivo_search"/> | ||
<field name="context">{'search_default_group_by_team': True}</field> | ||
</record> | ||
|
||
<menuitem name="OKR" id="objetivo_base_menu" sequence="0"/> | ||
<menuitem name="Objetivo" id="objetivo_principal_menu" | ||
parent="objetivo_base_menu" action="objetivo_book_action" sequence="2"/> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
|
||
<record id="objetivo_line_view_tree" model="ir.ui.view"> | ||
<field name="name">Objetivo</field> | ||
<field name="model">okr.objetivo.line</field> | ||
<field name="arch" type="xml"> | ||
<tree> | ||
<field name="kr"/> | ||
<field name="descripcion_ampliada"/> | ||
<field name="progreso"/> | ||
<field name="peso"/> | ||
<field name="comentarios"/> | ||
<field name="target"/> | ||
<field name="resultado"/> | ||
<field name="responsable"/> | ||
<field name="plan_de_accion"/> | ||
<field name="comentarios"/> | ||
<field name="interdependencias"/> | ||
<field name="realizado_en_el_q"/> | ||
<field name="notas_proximo_q"/> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
</odoo> |