-
Notifications
You must be signed in to change notification settings - Fork 24
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
[MIG] okr_management: Migration to 17.0 #165
base: 17.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
'name': 'Okr', | ||
'version': "17.0.1.0.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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'application': True |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import okr_management | ||
from . import okr_key_result |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from odoo import models, fields, api | ||
from odoo.exceptions import UserError | ||
|
||
class OkrKeyResult(models.Model): | ||
_name = 'okr.key.result' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. usar "." cuando es un submodelo, "_" cuando es parte del nombre (por ej "key_result") |
||
_description = 'Okr Key Result' | ||
|
||
name = fields.Char() | ||
description = fields.Text() | ||
objective =fields.Text() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. El objective, deberia ser un objective_id relacionado al modelo okr.objective |
||
user_ids = fields.Many2one( | ||
'res.users', | ||
) | ||
progress= fields.Integer( | ||
compute='_compute_okr_progress', | ||
store = False, | ||
) | ||
Comment on lines
+14
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aca son necesarios 3 campos: |
||
importance = fields.Integer()#importancia dentro del kr | ||
target = fields.Integer()#objetivo esperado | ||
|
||
@api.depends('peso', 'target') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Faltan dependencias a resultado (campo que no existe) La dependdencia a peso esta bien pero el campo no existe |
||
def _compute_okr_progress(self): | ||
#mejorar codigo | ||
prog = 0 | ||
for rec in self: | ||
if rec.importance and rec.target: | ||
prog = rec.importance | ||
Comment on lines
+22
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revisar formula del excel para implementar aca |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from odoo import models, fields, api | ||
from odoo.exceptions import UserError | ||
|
||
class OkrManagement(models.Model): | ||
_name = 'okr.management' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Esto tendira que ser el modelo okr.objective |
||
_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, | ||
) | ||
okr_type = fields.Selection( | ||
selection=[ | ||
('commitment', 'Commitment'), | ||
('inspiracional', 'Inspiracional'), | ||
], | ||
) | ||
result = fields.Float() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Result deberia ser computado y tener en cuenta el progreso que tienen los key result |
||
action_plan = fields.Text() | ||
comments = fields.Text() |
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 | ||
access_okr_key_result,access_okr_key_result,model_okr_key_result,base.group_user,1,1,1,1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?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"/> | ||
<field name="okr_type"/> | ||
</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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agregar dependencia minimo a modulo 'base'