Skip to content

Commit

Permalink
[NEW]okr_management: new module
Browse files Browse the repository at this point in the history
  • Loading branch information
ALopez-Adhoc committed Feb 5, 2024
1 parent 25bf652 commit f9ce579
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 0 deletions.
1 change: 1 addition & 0 deletions okr_management/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
23 changes: 23 additions & 0 deletions okr_management/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
'name': 'OKR Management',
'version': '17.0.1.0',
'description': 'Module destined for Adhoc OKR Management',
'summary': '',
'author': 'Alexis Lopez',
'website': '',
'license': 'LGPL-3',
'category': '',
'depends': [
'base','hr'
],
'data': [
'security/ir.model.access.csv',
'views/okr_management.xml'
],
'demo': [
''
],
'auto_install': False,
'installable': True,
'application': False,
}
2 changes: 2 additions & 0 deletions okr_management/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import okr_management
from . import okr_objective
23 changes: 23 additions & 0 deletions okr_management/models/okr_management.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from odoo import fields, models, api
from odoo.exceptions import UserError

class OkrManagement(models.Model):
_name = 'okr.management'
_description = 'Management of Adhoc okr'

name = fields.Char()
objective = fields.Text()
user_ids = fields.Many2many(comodel_name='res.users')
okr_type = fields.Selection(selection=[('insp', 'Inspirational'),('comm','Commitment')])
progress = fields.Integer(compute='_compute_okr_progress', store=False)
target = fields.Integer()
result = fields.Float()
action_plan = fields.Text()
comments = fields.Text()

def _compute_okr_progress(self):
for rec in self:
if rec.result and rec.target and rec.target != 0:
rec.progress = (rec.result / rec.target) * 100
else:
rec.progress = 0
11 changes: 11 additions & 0 deletions okr_management/models/okr_objective.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from odoo import api, fields, models

class OkrObjective(models.Model):
_name = 'okr.objective'
_description = 'Okr objectives for current Q'

name = fields.Char()
description = fields.Char()
date_start = fields.Date()
date_end = fields.Date()
teams_ids = fields.Many2one('hr.department')
3 changes: 3 additions & 0 deletions okr_management/security/ir.model.access.csv
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
access_okr_objective,access_okr_objective,model_okr_objective,base.group_user,1,1,1,1
access_okr_management,access_okr_management,model_okr_management,base.group_user,1,1,1,1
11 changes: 11 additions & 0 deletions okr_management/views/okr_management.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<data>

<!-- TODO: completar las vistas -->

</data>


</odoo>

0 comments on commit f9ce579

Please sign in to comment.