-
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?
Conversation
Task: 34208
e93c565
to
33939b5
Compare
33939b5
to
0afab6e
Compare
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 comment
The 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")
|
||
name = fields.Char() | ||
description = fields.Text() | ||
objective =fields.Text() |
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.
El objective, deberia ser un objective_id relacionado al modelo okr.objective
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Esto tendira que ser el modelo okr.objective
progress= fields.Integer( | ||
compute='_compute_okr_progress', | ||
store = False, | ||
) |
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.
Aca son necesarios 3 campos:
Target que es el puntaje a obtener (esta mas abajo, eso esta bien)
Resultado (es el resultado parcial, este falta)
Progress esta bien y es computado pero creo que lo estas usando como el campo anterior (Resultado)
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 comment
The 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 |
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.
Revisar formula del excel para implementar aca
('inspiracional', 'Inspiracional'), | ||
], | ||
) | ||
result = fields.Float() |
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.
Result deberia ser computado y tener en cuenta el progreso que tienen los key result
'license': 'AGPL-3', | ||
'images': [ | ||
], | ||
'depends': [ |
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'
], | ||
'installable': True, | ||
'auto_install': False, | ||
'application': False, |
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.
'application': True
Task: 34208