-
Notifications
You must be signed in to change notification settings - Fork 30
[MIG] okr: Migration to 17.0 #154
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
Open
pablohmontenegro
wants to merge
1
commit into
ingadhoc:17.0
Choose a base branch
from
adhoc-dev:17.0-t-34208-pam
base: 17.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 @@ | ||
| notas.txt | ||
pablohmontenegro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or 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 hidden or 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,24 @@ | ||
| { | ||
| 'name': "OKR", | ||
| 'version': "17.0.1.0.0", | ||
| 'category': 'OKR', | ||
| 'summary': "Gestión de OKR", | ||
| 'license': 'LGPL-3', | ||
| 'description': """ | ||
| Gestión de OKR | ||
| """, | ||
| 'author': "Pablo Montenegro", | ||
| 'depends': ['base', 'hr'], | ||
| 'data': ['data/ir_module_category_data.xml', | ||
|
Contributor
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. estructurar data segun buenas practicas
Contributor
Author
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. Mati, cuáles serían las buenas prácticas? |
||
| 'security/ir.model.access.csv', | ||
| 'views/okr_key_result.xml', | ||
| 'views/okr_objective.xml', | ||
| 'views/kr_ppal.xml', | ||
| ], | ||
| 'demo': [ | ||
| 'demo/kr_ppal_data.xml', | ||
| ], | ||
| 'application': True, | ||
| 'installable': True, | ||
| 'auto_install': False, | ||
| } | ||
This file contains hidden or 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,35 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
| <data> | ||
| <!-- categorias --> | ||
| <record model="ir.module.category" id="module_category_okr"> | ||
| <field name="name">OKR</field> | ||
| <field name="description">OKR</field> | ||
| <field name="sequence">1</field> | ||
| </record> | ||
| <record model="ir.module.category" id="module_okr_permisos"> | ||
| <field name="name">Permisos</field> | ||
| <field name="sequence">1</field> | ||
| <field name="parent_id" ref="okr.module_category_okr"/> | ||
| </record> | ||
| <!-- grupos --> | ||
| <record id="group_okr_user" model="res.groups"> | ||
| <field name="name">User</field> | ||
| <field name="users" eval="[Command.link(ref('base.user_root')), Command.link(ref('base.user_admin'))]"/> | ||
| <field name="category_id" ref="module_okr_permisos"/> | ||
| <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/> | ||
| </record> | ||
| <record id="group_okr_manager" model="res.groups"> | ||
| <field name="name">Manager</field> | ||
| <field name="users" eval="[Command.link(ref('base.user_root')), Command.link(ref('base.user_admin'))]"/> | ||
| <field name="category_id" ref="module_okr_permisos"/> | ||
| <field name="implied_ids" eval="[(4, ref('okr.group_okr_user'))]"/> | ||
| </record> | ||
| <record id="okr_manager_objectives_rule" model="ir.rule"> | ||
| <field name="name">OKR manager can modify all key results</field> | ||
| <field name="model_id" ref="model_okr_key_result"/> | ||
| <field name="domain_force">[(1, '=', 1)]</field> | ||
| <field name="groups" eval="[(4, ref('okr.group_okr_manager'))]"/> | ||
| </record> | ||
| </data> | ||
| </odoo> |
This file contains hidden or 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,29 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <odoo noupdate="1"> | ||
|
|
||
| <record model='kr.ppal' id='kr_1'> | ||
| <field name='code'>01</field> | ||
| <field name='description'>Crecer</field> | ||
| </record> | ||
|
|
||
| <record model='kr.ppal' id='kr_2'> | ||
| <field name='code'>02</field> | ||
| <field name='description'>Internacionalizar</field> | ||
| </record> | ||
|
|
||
| <record model='kr.ppal' id='kr_3'> | ||
| <field name='code'>03</field> | ||
| <field name='description'>Agregar valor al cliente</field> | ||
| </record> | ||
|
|
||
| <record model='kr.ppal' id='kr_4'> | ||
| <field name='code'>04</field> | ||
| <field name='description'>Producto robusto</field> | ||
| </record> | ||
|
|
||
| <record model='kr.ppal' id='kr_5'> | ||
| <field name='code'>05</field> | ||
| <field name='description'>Equipo motivado y feliz</field> | ||
| </record> | ||
|
|
||
| </odoo> |
This file contains hidden or 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 @@ | ||
| from . import kr_ppal | ||
| from . import okr_key_result | ||
| from . import okr_objective |
This file contains hidden or 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,10 @@ | ||
| from odoo import models, fields | ||
|
|
||
|
|
||
| class KrPPal(models.Model): | ||
| _name = "kr.ppal" | ||
| _description = "Kr ppal" | ||
| _rec_name = 'description' | ||
|
|
||
| code = fields.Char(required=True) | ||
| description = fields.Char(required=True) |
This file contains hidden or 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,22 @@ | ||
| from odoo import models, api, fields, _ | ||
| from odoo.exceptions import ValidationError | ||
|
|
||
|
|
||
| class OkrObjetivoLine(models.Model): | ||
| _name = "okr.key_result" | ||
| _description = "OKR key result" | ||
| _check_company_auto = True | ||
|
|
||
| name = fields.Char(required=True) | ||
| description = fields.Char(required=True) | ||
| progress = fields.Integer(default=0, store=True) | ||
| weight = fields.Integer() | ||
| comments = fields.Char() | ||
| objective = fields.Many2one('okr.objective') | ||
| target = fields.Integer() | ||
| result = fields.Integer() | ||
| user_id = fields.Many2one('res.users', string="Responsible") | ||
| plan_de_accion = fields.Char() | ||
| interdependencies = fields.Many2many('hr.department') | ||
| realizado_en_el_q = fields.Char() | ||
| notas_proximo_q = fields.Char() |
This file contains hidden or 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,35 @@ | ||
| from odoo import models, api, fields | ||
| import time | ||
| from odoo.exceptions import UserError | ||
|
|
||
|
|
||
| class OkrObjetivo(models.Model): | ||
| _name = "okr.objective" | ||
| _description = "OKR Objective" | ||
| _inherit = ['mail.thread', 'mail.activity.mixin'] | ||
| _check_company_auto = True | ||
| _rec_name = 'name' | ||
|
|
||
| name = fields.Many2one('kr.ppal', required=True) | ||
| description = fields.Char(required=True) | ||
| department_id = fields.Many2one('hr.department') | ||
| progress = fields.Integer(compute='_compute_progress',help="Progress from zero knowledge (0%) to fully mastered (100%).", default=0, store=True) | ||
| weight = fields.Selection([('inspiracional', 'Inspiracional'), ('commitment', 'Commitment')]) | ||
| comments = fields.Char() | ||
| key_result_ids = fields.One2many('okr.key_result', 'objective') | ||
| period = fields.Selection([('q1', 'Q1'), ('q2', 'Q2'), ('q3', 'Q3'), ('q4', 'Q4')], required=True) | ||
| year = fields.Char( | ||
| required=True, | ||
| default=time.strftime('%Y'), | ||
| ) | ||
| user_id = fields.Many2one('res.users', string="Responsible") | ||
| company_id = fields.Many2one( | ||
| 'res.company', default=lambda self: self.env.company, | ||
| help="Company for whose invoices the mandate can be used.") | ||
|
|
||
| @api.depends('key_result_ids') | ||
| def _compute_progress(self): | ||
| sumatory = sum(self.key_result_ids.mapped('progress')) or 0 | ||
| self.progress = sumatory | ||
| if sumatory > 100: | ||
| raise UserError("The sum of the objectives progress can´t be higher than 100") |
This file contains hidden or 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,7 @@ | ||
| id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
| access_kr_ppal_user,access_kr_ppal_user,model_kr_ppal,group_okr_user,1,1,1,1 | ||
| access_kr_ppal_manager,access_kr_ppal_manager,model_kr_ppal,group_okr_manager,1,1,1,1 | ||
| access_okr_key_result_user,access_okr_key_result_user,model_okr_key_result,group_okr_user,1,1,0,0 | ||
| access_okr_key_result_manager,access_okr_key_result_manager,model_okr_key_result,group_okr_manager,1,1,1,1 | ||
| access_okr_objective_user,access_okr_objective_user,model_okr_objective,group_okr_user,1,1,0,0 | ||
| access_okr_objective_manager,access_okr_objective_manager,model_okr_objective,group_okr_manager,1,1,1,1 |
This file contains hidden or 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,35 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
|
|
||
| <record id="kr_ppal_view_tree" model="ir.ui.view"> | ||
| <field name="name">kr.principales.tree</field> | ||
| <field name="model">kr.ppal</field> | ||
| <field name="arch" type="xml"> | ||
| <tree> | ||
| <field name="code"/> | ||
| <field name="description"/> | ||
| </tree> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="kr_ppal_view_form" model="ir.ui.view"> | ||
| <field name="name">kr.principales.form</field> | ||
| <field name="model">kr.ppal</field> | ||
| <field name="arch" type="xml"> | ||
| <form> | ||
| <field name="code"/> | ||
| <field name="description"/> | ||
| </form> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record model="ir.actions.act_window" id="action_kr_ppal"> | ||
| <field name="name">KR ppales</field> | ||
| <field name="res_model">kr.ppal</field> | ||
| <field name="view_mode">tree,form</field> | ||
| </record> | ||
|
|
||
| <menuitem id="menu_okr_config" name="Objetivos ppales" parent="okr.objetivo_base_menu" sequence="5"/> | ||
| <menuitem action="action_kr_ppal" id="menu_kr_ppal" sequence="7" parent="okr.menu_okr_config"/> | ||
|
|
||
| </odoo> |
This file contains hidden or 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,26 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
|
|
||
| <record id="objective_line_view_tree" model="ir.ui.view"> | ||
| <field name="name">Objetivo</field> | ||
| <field name="model">okr.key_result</field> | ||
| <field name="arch" type="xml"> | ||
| <tree> | ||
| <field name="name"/> | ||
| <field name="description"/> | ||
| <field name="progress"/> | ||
| <field name="weight"/> | ||
| <field name="comments"/> | ||
| <field name="target"/> | ||
| <field name="result"/> | ||
| <field name="user_id"/> | ||
| <field name="plan_de_accion"/> | ||
| <field name="comments"/> | ||
| <field name="interdependencies" string="Interdependencies" widget="many2many_tags"/> | ||
| <field name="realizado_en_el_q"/> | ||
| <field name="notas_proximo_q"/> | ||
| </tree> | ||
| </field> | ||
| </record> | ||
|
|
||
| </odoo> |
This file contains hidden or 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,101 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
|
|
||
| <record id="objetivo_view_form" model="ir.ui.view"> | ||
| <field name="name">Objetivo</field> | ||
| <field name="model">okr.objective</field> | ||
| <field name="arch" type="xml"> | ||
| <form> | ||
| <sheet> | ||
| <group> | ||
| <group> | ||
| <field name="name"/> | ||
| <field name="description"/> | ||
| <field name="user_id"/> | ||
| <field name="progress"/> | ||
| <field name="weight"/> | ||
| <field name="comments"/> | ||
| <field name="department_id"/> | ||
| </group> | ||
| <group> | ||
| <field name="period"/> | ||
| <field name="year"/> | ||
| <field name="company_id" groups="base.group_multi_company" required="1"/> | ||
| </group> | ||
| </group> | ||
| <notebook> | ||
| <page id="line_tab" | ||
| name="line_tab" | ||
| string="Okr Lines"> | ||
| <field name="key_result_ids"> | ||
| <tree editable="bottom" string="Okr Lines" default_order="progress"> | ||
| <field name="name"/> | ||
| <field name="description"/> | ||
| <field name="progress"/> | ||
| <field name="weight"/> | ||
| <field name="comments"/> | ||
| <field name="objective"/> | ||
| <field name="target"/> | ||
| <field name="result"/> | ||
| <field name="user_id"/> | ||
| <field name="plan_de_accion"/> | ||
| <field name="realizado_en_el_q"/> | ||
| <field name="notas_proximo_q"/> | ||
| <field name="interdependencies" widget="many2many_tags"/> | ||
| </tree> | ||
| </field> | ||
| </page> | ||
| </notebook> | ||
| </sheet> | ||
| <div class="oe_chatter"> | ||
| <field name="message_follower_ids" widget="mail_followers"/> | ||
| <field name="activity_ids" widget="mail_activity"/> | ||
| <field name="message_ids" widget="mail_thread"/> | ||
| </div> | ||
| </form> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="objetivo_view_tree" model="ir.ui.view"> | ||
| <field name="name">Objetivo</field> | ||
| <field name="model">okr.objective</field> | ||
| <field name="arch" type="xml"> | ||
| <tree default_order="progress"> | ||
| <field name="name"/> | ||
| <field name="description"/> | ||
| <field name="user_id"/> | ||
| <field name="progress"/> | ||
| <field name="weight"/> | ||
| <field name="comments"/> | ||
| <field name="department_id"/> | ||
| <field name="period"/> | ||
| <field name="year"/> | ||
| <field name="company_id" groups="base.group_multi_company" required="1"/> | ||
| </tree> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record model="ir.ui.view" id="view_objetive_search"> | ||
| <field name="name">okr.objective.search</field> | ||
| <field name="model">okr.objective</field> | ||
| <field name="arch" type="xml"> | ||
| <search> | ||
| <field name="department_id"/> | ||
| <filter name="group_by_department_id" string="Group by department_id" context="{'group_by': 'department_id'}"/> | ||
| </search> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id='objective_book_action' model="ir.actions.act_window"> | ||
| <field name="name">Objective</field> | ||
| <field name="res_model">okr.objective</field> | ||
| <field name="view_mode">tree,form</field> | ||
| <field name="search_view_id" ref="view_objetive_search"/> | ||
| <field name="context">{'search_default_group_by_department_id': True}</field> | ||
| </record> | ||
|
|
||
| <menuitem name="OKR" id="objetivo_base_menu" sequence="0"/> | ||
pablohmontenegro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <menuitem name="Objetivo" id="objetivo_principal_menu" | ||
| parent="objetivo_base_menu" action="objective_book_action" sequence="2"/> | ||
|
|
||
| </odoo> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.