-
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.
Task: 34208
- Loading branch information
Showing
7 changed files
with
104 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,21 @@ | ||
{ | ||
'name': 'Okr', | ||
'version': "16.0.1.1.0", | ||
'category': 'Projects & Services', | ||
'sequence': 14, | ||
'summary': '', | ||
'author': 'ADHOC SA', | ||
'website': 'www.adhoc.com.ar', | ||
'license': 'AGPL-3', | ||
'images': [ | ||
], | ||
'depends': [ | ||
], | ||
'data': [ | ||
'security/ir.model.access.csv', | ||
'views/okr_management_views.xml', | ||
], | ||
'installable': True, | ||
'auto_install': False, | ||
'application': 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_management | ||
from . import okr_key_result |
Empty file.
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,31 @@ | ||
from odoo import models, fields, api | ||
from odoo.exceptions import UserError | ||
|
||
class OkrManagement(models.Model): | ||
_name = 'okr.management' | ||
_description = 'Okr management' | ||
|
||
name = fields.Char() | ||
description = fields.Text() | ||
user_ids = fields.Many2many( | ||
comodel_name='res.users', | ||
) | ||
progress= fields.Integer( | ||
compute='_compute_okr_progress', | ||
store = False, | ||
) | ||
result = fields.Float() | ||
action_plan = fields.Text() | ||
comments = fields.Text() | ||
|
||
def _compute_okr_progress(self): | ||
for okr in self: | ||
if not okr.progress: | ||
prog = 0 | ||
elif okr.progress: | ||
okr.progress = okr.progress | ||
elif self.progress < 0 or self.progress > 100: | ||
raise UserError('Valor de progreso invalido') | ||
else: | ||
prog = 0 | ||
okr.progress = prog |
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 | ||
access_okr_management,access_okr_management,model_okr_management,base.group_user,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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<record id="view_okr_management_tree" model="ir.ui.view"> | ||
<field name="name">okr.management.tree</field> | ||
<field name="model">okr.management</field> | ||
<field name="arch" type="xml"> | ||
<tree> | ||
<field name="name"/> | ||
<field name="progress"/> | ||
<field name="action_plan" /> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
<record id="view_okr_management_form" model="ir.ui.view"> | ||
<field name="name">okr.management.form</field> | ||
<field name="model">okr.management</field> | ||
<field name="arch" type="xml"> | ||
<form> | ||
<field name="name"/> | ||
<field name="progress"/> | ||
<field name="action_plan" /> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<record id="view_okr_management_search" model="ir.ui.view"> | ||
<field name="name">okr.management.search</field> | ||
<field name="model">okr.management</field> | ||
<field name="arch" type="xml"> | ||
<search> | ||
<field name="name"/> | ||
</search> | ||
</field> | ||
</record> | ||
|
||
<record id="action_okr_management" model="ir.actions.act_window"> | ||
<field name="name">okr management</field> | ||
<field name="res_model">okr.management</field> | ||
<!-- <field name="target">current</field> --> | ||
<field name='view_mode'>tree,form</field> | ||
</record> | ||
|
||
<menuitem id="menu_okr_management" sequence="100" action="action_okr_management"/> | ||
|
||
</odoo> |