Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW]okr_management: new module #172

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
17 changes: 17 additions & 0 deletions okr_management/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
'name': 'OKR Management',
'version': '17.0.1.0',
'description': 'Module destined for Adhoc OKR Management',
'author': 'Alexis Lopez',
'license': 'LGPL-3',
'depends': [
'base','hr',
],
'data': [
'security/ir.model.access.csv',
'views/okr_management.xml',
],
'auto_install': False,
'installable': True,
'application': True,
}
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 -->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

faltarian las vistas tree form y search

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

y las del otro modelo tmb mas los menus


</data>


</odoo>