Skip to content

Commit 8217187

Browse files
[MIG] gestion_okr: Migration to 17.0
1 parent 507adc8 commit 8217187

11 files changed

+190
-1
lines changed

gestion_okr/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
'name': 'Gestion OKR',
3-
'version': "16.0.1.0.0",
3+
'version': "17.0.1.0.0",
44
'category': 'Base',
55
'sequence': 14,
66
'summary': '',

okr/README.rst

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
.. |company| replace:: ADHOC SA
2+
3+
.. |company_logo| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-logo.png
4+
:alt: ADHOC SA
5+
:target: https://www.adhoc.com.ar
6+
7+
.. |icon| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-icon.png
8+
9+
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png
10+
:target: https://www.gnu.org/licenses/agpl
11+
:alt: License: AGPL-3
12+
13+
===
14+
OKR
15+
===
16+
17+
Este módulo realiza el manejo de la gestion de OKRs de Adhoc sa.
18+
19+
Installation
20+
============
21+
22+
Only install the module.
23+
24+
Configuration
25+
=============
26+
27+
There is nothing to configure.
28+
29+
Usage
30+
=====
31+
32+
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
33+
:alt: Try me on Runbot
34+
:target: http://runbot.adhoc.com.ar/
35+
36+
Bug Tracker
37+
===========
38+
39+
Bugs are tracked on `GitHub Issues
40+
<https://github.com/ingadhoc/miscellaneous/issues>`_. In case of trouble, please
41+
check there if your issue has already been reported. If you spotted it first,
42+
help us smashing it by providing a detailed and welcomed feedback.
43+
44+
Credits
45+
=======
46+
47+
Images
48+
------
49+
50+
* |company| |icon|
51+
52+
Contributors
53+
------------
54+
55+
Maintainer
56+
----------
57+
58+
|company_logo|
59+
60+
This module is maintained by the |company|.
61+
62+
To contribute to this module, please visit https://www.adhoc.com.ar.

okr/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
##############################################################################
2+
# For copyright and license notices, see __manifest__.py file in module root
3+
# directory
4+
##############################################################################
5+
from . import models

okr/__manifest__.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
'name': 'Gestion OKR',
3+
'version': "17.0.1.0.0",
4+
'category': 'Base',
5+
'sequence': 14,
6+
'summary': '',
7+
'author': 'ADHOC SA',
8+
'website': 'www.adhoc.com.ar',
9+
'license': 'AGPL-3',
10+
'depends': [
11+
'hr',
12+
],
13+
'data': [
14+
'security/ir.model.access.csv',
15+
'views/okr_objetive_views.xml',
16+
'views/okr_kr_views.xml',
17+
'views/okr_views.xml',
18+
],
19+
'installable': True,
20+
'auto_install': False,
21+
'application': False,
22+
}

okr/models/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import okr_objetive
2+
from . import okr_kr

okr/models/okr_kr.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from odoo import api, models, fields
2+
3+
4+
class OkrKR(models.Model):
5+
_name = 'okr.kr'
6+
_description = "key results"
7+
8+
name = fields.Char(required=True, copy=False)
9+
objective_id = fields.Many2one('okr.objetives', required=True)
10+
progress = fields.Float(compute="_compute_progress")
11+
weight = fields.Integer(required=True)
12+
target = fields.Integer(required=True)
13+
result = fields.Integer()
14+
user_id = fields.Many2one('res.users', required=True)
15+
user_ids = fields.Many2many('res.users')
16+
action_plan = fields.Char()
17+
comments = fields.Char()
18+
dependency_ids = fields.Many2many('hr.department')
19+
made_in_q = fields.Char()
20+
notes_next_q = fields.Char()
21+
22+
@api.depends('result', 'target')
23+
def _compute_progress(self):
24+
for rec in self:
25+
if rec.result and rec.target:
26+
rec.progress = (rec.result / rec.target)*100
27+
else:
28+
rec.progress = False

okr/models/okr_objetive.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from odoo import api, models, fields
2+
3+
4+
class OkrObjetives(models.Model):
5+
_name = 'okr.objetives'
6+
_description = "Objetives"
7+
8+
name = fields.Char(required=True, copy=False)
9+
description = fields.Char()
10+
date_start = fields.Date(help="Fecha de inicio del objetivo.")
11+
date_stop = fields.Date(help="Fecha de fin del objetivo.")
12+
dependency_ids = fields.Many2one('hr.department')

okr/security/ir.model.access.csv

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2+
access_okr_objetives,okr_objetives,model_okr_objetives,base.group_user,1,1,1,1
3+
access_okr_kr,okr_kr,model_okr_kr,base.group_user,1,1,1,1

okr/views/okr_kr_views.xml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo>
3+
<data>
4+
<record id="open_view_okr_kr" model="ir.actions.act_window">
5+
<field name="name">KRs</field>
6+
<field name="res_model">okr.kr</field>
7+
<field name="view_mode">tree,kanban,form,activity</field>
8+
<field name="domain">[]</field>
9+
<field name="context">{}</field>
10+
<field name="view_id" eval="False"/>
11+
</record>
12+
</data>
13+
</odoo>

okr/views/okr_objetive_views.xml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo>
3+
<data>
4+
<record id="open_view_okr_objetives" model="ir.actions.act_window">
5+
<field name="name">Objetivos</field>
6+
<field name="res_model">okr.objetives</field>
7+
<field name="view_mode">tree,kanban,form,activity</field>
8+
<field name="domain">[]</field>
9+
<field name="context">{}</field>
10+
<field name="view_id" eval="False"/>
11+
</record>
12+
</data>
13+
</odoo>

okr/views/okr_views.xml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo>
3+
<data>
4+
5+
<menuitem
6+
id="menu_okr"
7+
name="OKRs"
8+
groups="base.group_user"
9+
sequence="20"/>
10+
<!-- agregar un web icon -->
11+
12+
<menuitem
13+
id="menu_okr_objetives"
14+
name="Objetivos"
15+
parent="menu_okr"
16+
groups="base.group_user"
17+
action="open_view_okr_objetives"
18+
sequence="1"/>
19+
20+
<menuitem
21+
id="menu_okr_kr"
22+
name="KRs"
23+
parent="menu_okr"
24+
groups="base.group_user"
25+
action="open_view_okr_kr"
26+
sequence="2"/>
27+
28+
</data>
29+
</odoo>

0 commit comments

Comments
 (0)