-
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
Showing
9 changed files
with
193 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,19 @@ | ||
{ | ||
'name': 'okr', | ||
'version' : '16.0.1.0', | ||
'author' : 'ced', | ||
'license' : 'AGPL-3', | ||
'depends': ['base', 'hr'], | ||
'data': [ | ||
'security/ir.model.access.csv', | ||
'views/okr_objective_views.xml', | ||
'views/okr_key_result_views.xml', | ||
'views/okr_menu.xml', | ||
], | ||
'demo': [], | ||
'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,2 @@ | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from odoo import models, fields, api | ||
|
||
class OkrKeyResult(models.Model): | ||
_name = 'okr.key_result' | ||
_description = 'OKR Key Result' | ||
|
||
name = fields.Char(required=True) | ||
description = fields.Text(required=True) | ||
department_id = fields.Many2one('hr.department') | ||
user_id = fields.Many2one('res.users', string= 'Responsible') | ||
objective_id = fields.Many2one('okr.objective') | ||
weight = fields.Integer() | ||
target = fields.Integer() | ||
result = fields.Integer() | ||
progress = fields.Float(compute = 'compute_progress', store=True, default=0) | ||
# state? | ||
# interdependencias | ||
# plan de acción | ||
# comentarios | ||
|
||
@api.depends('result','target') | ||
def _compute_progress(self): | ||
for rec in self: | ||
if rec.target !=0: | ||
rec.progress = (rec.result)/(rec.target)*100 | ||
else: | ||
rec.progress = 0.0 | ||
|
||
|
||
|
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, fields | ||
|
||
class OkrObjective(models.Model): | ||
_name = 'okr.objective' | ||
_description = 'OKR Objectives' | ||
|
||
name = fields.Char(required=True) | ||
description = fields.Text(required=True) | ||
user_id = fields.Many2one('res.users', string= 'Responsible') | ||
progress = fields.Integer(default = 0) | ||
type = fields.Selection([('commitment', 'Commitment'),('inspirational', 'Inspirational')]) | ||
quarter = fields.Selection([('q1', 'Q1'),('q2', 'Q2'),('q3', 'Q3'),('q4', 'Q4')]) | ||
department_id = fields.Many2one('hr.department', required=True) | ||
key_result_ids = fields.One2many('okr.key_result', 'objective_id') | ||
notes = fields.Text() | ||
# state | ||
#compute = 'compute_progress' | ||
|
||
|
||
|
||
|
||
|
||
|
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 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
okr.access_okr_objective,access_okr_objective,okr.model_okr_objective,base.group_user,1,1,1,0 | ||
okr.access_okr_key_result,access_okr_key_result,okr.model_okr_key_result,base.group_user,1,1,1,0 |
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,49 @@ | ||
<odoo> | ||
<record id="view_okr_key_result_tree" model="ir.ui.view"> | ||
<field name="name">okr.key_result.tree</field> | ||
<field name="model">okr.key_result</field> | ||
<field name="arch" type="xml"> | ||
<tree> | ||
<field name="name"/> | ||
<field name="description"/> | ||
<field name="department_id"/> | ||
<field name="user_id"/> | ||
<field name="objective_id"/> | ||
<field name="progress"/> | ||
<field name="weight"/> | ||
<field name="target"/> | ||
<field name="result"/> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
<record id="view_okr_key_result_form" model="ir.ui.view"> | ||
<field name="name">okr.key_result.form</field> | ||
<field name="model">okr.key_result</field> | ||
<field name="arch" type="xml"> | ||
<form> | ||
<sheet> | ||
<group> | ||
<field name="name"/> | ||
<field name="description"/> | ||
<field name="department_id"/> | ||
<field name="user_id"/> | ||
<field name="objective_id"/> | ||
<field name="progress"/> | ||
<field name="weight"/> | ||
<field name="target"/> | ||
<field name="result"/> | ||
</group> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<record id="okr_key_result_action" model="ir.actions.act_window"> | ||
<field name="name">OKR Key Result</field> | ||
<field name="res_model">okr.key_result</field> | ||
<field name='view_mode'>tree,form</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,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
|
||
<menuitem id="okr_menu" name="OKR Management"/> | ||
<!-- groups="group_okr_objective" --> | ||
<menuitem id="okr_objective_menu" name="OKR Objectives" action="okr_objective_action" parent="okr_menu"/> | ||
<!-- groups="group_okr_key_result" --> | ||
<!-- web_icon="fa fa-info,#f1c40f,#34495e" --> | ||
<menuitem id="okr_key_result_menu" name="OKR Key Results" action="okr_key_result_action" parent = "okr_menu"/> | ||
|
||
</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,54 @@ | ||
<odoo> | ||
<record id="view_okr_objective_tree" model="ir.ui.view"> | ||
<field name="name">okr.objective.tree</field> | ||
<field name="model">okr.objective</field> | ||
<field name="arch" type="xml"> | ||
<tree> | ||
<field name="name"/> | ||
<field name="description"/> | ||
<field name="department_id"/> | ||
<field name="user_id"/> | ||
<field name="type"/> | ||
<field name="progress"/> | ||
<field name="quarter"/> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
<record id="view_okr_objective_form" model="ir.ui.view"> | ||
<field name="name">okr.objective.form</field> | ||
<field name="model">okr.objective</field> | ||
<field name="arch" type="xml"> | ||
<form> | ||
<sheet> | ||
<group> | ||
<field name="name"/> | ||
<field name="description"/> | ||
<field name="department_id"/> | ||
<field name="user_id"/> | ||
<field name="type"/> | ||
<field name="progress"/> | ||
<field name="quarter"/> | ||
</group> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<record id="view_okr_objective_search" model="ir.ui.view"> | ||
<field name="name">okr.objective.search</field> | ||
<field name="model">okr.objective</field> | ||
<field name="arch" type="xml"> | ||
<search> | ||
<field name="name" /> | ||
</search> | ||
</field> | ||
</record> | ||
|
||
<record id="okr_objective_action" model="ir.actions.act_window"> | ||
<field name="name">OKR Objective</field> | ||
<field name="res_model">okr.objective</field> | ||
<field name='view_mode'>tree,form</field> | ||
</record> | ||
|
||
</odoo> |