-
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.
- Loading branch information
1 parent
0fe7eb2
commit 5cc95c7
Showing
16 changed files
with
222 additions
and
199 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 @@ | ||
notas.txt |
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
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,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data> | ||
<record model="ir.module.category" id="module_category_okr"> | ||
<field name="name">OKR</field> | ||
<field name="description">OKR</field> | ||
<field name="sequence">1</field> | ||
</record> | ||
<record model="ir.module.category" id="module_okr_permisos"> | ||
<field name="name">Permisos</field> | ||
<field name="sequence">1</field> | ||
<field name="parent_id" ref="okr.module_category_okr"/> | ||
</record> | ||
<record id="group_okr_user" model="res.groups"> | ||
<field name="name">User</field> | ||
<field name="users" eval="[(4, ref('base.user_root'))]"/> | ||
<field name="category_id" ref="module_okr_permisos"/> | ||
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/> | ||
</record> | ||
<record id="group_okr_manager" model="res.groups"> | ||
<field name="name">Manager</field> | ||
<field name="users" eval="[(4, ref('base.user_root'))]"/> | ||
<field name="category_id" ref="module_okr_permisos"/> | ||
<field name="implied_ids" eval="[(4, ref('okr.group_okr_user'))]"/> | ||
</record> | ||
</data> | ||
</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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from . import kr_ppal | ||
from . import objetivo | ||
from . import objetivo_line | ||
from . import okr_key_result | ||
from . import okr_objective |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,21 @@ | ||
from odoo import models, api, fields, _ | ||
from odoo.exceptions import ValidationError | ||
|
||
|
||
class OkrObjetivoLine(models.Model): | ||
_name = "okr.key_result" | ||
_description = "OKR key result" | ||
|
||
name = fields.Char(required=True) | ||
description = fields.Char(required=True) | ||
progress = fields.Integer(string="Progress", default=0, store=True) | ||
weight = fields.Integer() | ||
comments = fields.Char() | ||
objective = fields.Many2one('okr.objective') | ||
target = fields.Integer(string="Target") | ||
result = fields.Integer() | ||
user_id = fields.Many2one('res.users', string="Responsible") | ||
plan_de_accion = fields.Char() | ||
interdependencias = fields.Char() | ||
realizado_en_el_q = fields.Char() | ||
notas_proximo_q = fields.Char() |
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 @@ | ||
from odoo import models, api, fields | ||
import time | ||
from odoo.exceptions import UserError | ||
|
||
|
||
class OkrObjetivo(models.Model): | ||
_name = "okr.objective" | ||
_description = "OKR Objective" | ||
_rec_name = 'name' | ||
|
||
name = fields.Many2one('kr.ppal', required=True) | ||
description = fields.Char(required=True) | ||
department_id = fields.Many2one('hr.department') | ||
progress = fields.Integer(string="Progress", compute='_compute_progress',help="Progress from zero knowledge (0%) to fully mastered (100%).", default=0) | ||
weight = fields.Selection([('inspiracional', 'Inspiracional'), ('commitment', 'Commitment')]) | ||
comments = fields.Char() | ||
key_result_ids = fields.One2many('okr.key_result', 'objective') | ||
period = fields.Selection([('q1', 'Q1'), ('q2', 'Q2'), ('q3', 'Q3'), ('q4', 'Q4')], required=True) | ||
year = fields.Char( | ||
required=True, | ||
default=time.strftime('%Y'), | ||
) | ||
|
||
@api.depends('key_result_ids') | ||
def _compute_progress(self): | ||
sumatory = sum(self.key_result_ids.mapped('progress')) or 0 | ||
self.progress = sumatory | ||
if sumatory > 100: | ||
raise UserError("The sum of the objectives progress can´t be higher than 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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
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 | ||
access_kr_ppal_user,access_kr_ppal_user,model_kr_ppal,group_okr_user,1,1,1,1 | ||
access_kr_ppal_manager,access_kr_ppal_manager,model_kr_ppal,group_okr_manager,1,1,1,1 | ||
access_okr_key_result_user,access_okr_key_result_user,model_okr_key_result,group_okr_user,1,0,0,0 | ||
access_okr_key_result_manager,access_okr_key_result_manager,model_okr_key_result,group_okr_manager,1,1,1,1 | ||
access_okr_objective_user,access_okr_objective_user,model_okr_objective,group_okr_user,1,0,0,0 | ||
access_okr_objective_manager,access_okr_objective_manager,model_okr_objective,group_okr_manager,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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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="objective_line_view_tree" model="ir.ui.view"> | ||
<field name="name">Objetivo</field> | ||
<field name="model">okr.key_result</field> | ||
<field name="arch" type="xml"> | ||
<tree> | ||
<field name="name"/> | ||
<field name="description"/> | ||
<field name="progress"/> | ||
<field name="weight"/> | ||
<field name="comments"/> | ||
<field name="target"/> | ||
<field name="result"/> | ||
<field name="user_id"/> | ||
<field name="plan_de_accion"/> | ||
<field name="comments"/> | ||
<field name="interdependencias"/> | ||
<field name="realizado_en_el_q"/> | ||
<field name="notas_proximo_q"/> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
</odoo> |
Oops, something went wrong.