Skip to content
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: Migration to 17.0 #170

Open
wants to merge 2 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions okr/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
.. |company| replace:: ADHOC SA

.. |company_logo| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-logo.png
:alt: ADHOC SA
:target: https://www.adhoc.com.ar

.. |icon| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-icon.png

.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: https://www.gnu.org/licenses/agpl
:alt: License: AGPL-3

===
OKR
===

* This module ...

Installation
============

To install this module, you need to:

#. Just install the module.

Configuration
=============

To configure this module, you need to:

#. ...


Usage
=====

To use this module, you need to:

#. ...

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: http://runbot.adhoc.com.ar/

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/ingadhoc/miscellaneous/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.

Credits
=======

Images
------

* |company| |icon|

Contributors
------------

Maintainer
----------

|company_logo|

This module is maintained by the |company|.

To contribute to this module, please visit https://www.adhoc.com.ar.
1 change: 1 addition & 0 deletions okr/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions okr/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

{
'name': 'OKR',
'version': "17.0.1.0.0",
'depends': ['base'],
'application': True,
'data': [
'security/ir.model.access.csv',
'views/okr_views.xml',
'views/okr_menu.xml',
'views/okr_results_views.xml',
],
'license': 'LGPL-3',
}
2 changes: 2 additions & 0 deletions okr/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import okr
from . import okr_results
18 changes: 18 additions & 0 deletions okr/models/okr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from odoo import models,fields


class Okr(models.Model):
_name = 'okr'
_description= 'Gestión de Okrs'
_order = "id desc"

name= fields.Char(required=True,)
description = fields.Text()
area = fields.Selection([('i+d', 'I+D'),('aministracion','Administración'),('rrhh', 'Recursos Humanos'), ('ventas', 'Ventas'),('consultoria', 'Consultoria'),('mdea','Mesa de Ayuda'), ('adhoc','Adhoc')])
number_q = fields.Integer(string='Número de Q')
progress = fields.Float(compute="_compute_progress")
type = fields.Selection([('commitment', 'Commitment'), ('inspiring', 'Inspiring')])
weight = fields.Float()
responsible = fields.Many2one('res.users')
target = fields.Integer(required=True, default=0)
users_id = fields.Many2one('res.users')
27 changes: 27 additions & 0 deletions okr/models/okr_results.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from odoo import api, models,fields


class OkrResults(models.Model):
_name = 'okr.results'
_description= 'Resultados Okr'
_order = "id desc"

name= fields.Char(required=True,)
description = fields.Text()
area = fields.Selection([('i+d', 'I+D'),('aministracion','Administración'),('rrhh', 'Recursos Humanos'), ('ventas', 'Ventas'),('consultoria', 'Consultoria'),('mdea','Mesa de Ayuda'), ('adhoc','Adhoc')])
number_q = fields.Integer(string='Número de Q')
progress = fields.Float(compute="_compute_progress")
type = fields.Selection([('commitment', 'Commitment'), ('inspiring', 'Inspiring')])
weight = fields.Float()
responsible = fields.Many2one('res.users')
target = fields.Integer(required=True, default=0)
users_id = fields.Many2one('res.users')
results = fields.Integer()

@api.depends('results', 'target')
def _compute_progress(self):
for rec in self:
if rec.results and rec.target:
rec.progress = (rec.results / rec.target)*100
else:
rec.progress = 0
4 changes: 4 additions & 0 deletions okr/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink

okr.access_okr,access_okr,okr.model_okr,base.group_user,1,1,1,1
access_okr_results,okr_results,model_okr_results,base.group_user,1,1,1,1
Binary file added okr/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions okr/views/okr_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<odoo>
<data>
<menuitem name="Okr"
id="okr_menu"
web_icon="okr,static/description/icon.png"/>
<menuitem id="okr_area" name="OKR" parent="okr_menu"/>
<menuitem id="okr_objetivos" name="Objetivos" action="okr_action" parent="okr_area"/>
<menuitem id="okr_results" name="Resultados" sequence="100" action="okr_results_action" parent="okr_menu"/>
</data>
</odoo>
62 changes: 62 additions & 0 deletions okr/views/okr_results_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<data>
<!-- Accion de venta -->
<record id="okr_results_action" model="ir.actions.act_window">
<field name="name">Okr Results</field>
<field name="res_model">okr.results</field>
</record>

<!-- Vista tree-->
<!-- <record id="okr_view_tree" model="ir.ui.view">
<field name="name">okr.view.tree</field>
<field name="model">okr</field>
<field name="arch" type="xml">
<tree>
<field name="name" string="Title"/>
<field name="description"/>
<field name="area"/>
</tree>
</field>
</record> -->

<!-- Vista form-->
<record id="okr_view_form" model="ir.ui.view">
<field name="name">okir.view.form</field>
<field name="model">okr.results</field>
<field name="arch" type="xml">
<form>
<sheet string="Resultados Okr">
<group>
<group>
<field name="name"/>
</group>
</group>
<group>
<field name="description" />
</group>
<group>
<group>
<field name="area"/>
<field name="progress"/>
<field name="weight"/>
<field name="target"/>
<field name="results"/>
</group>
<group>
<field name="number_q"/>
<field name="type"/>
<field name="responsible" can_create="True" can_write="True"/>
<field name="users_id" can_create="True" can_write="True"/>
</group>
</group>
<group>
<separator/>
</group>
</sheet>
</form>
</field>
</record>

</data>
</odoo>
57 changes: 57 additions & 0 deletions okr/views/okr_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<!-- Accion de venta -->
<record id="okr_action" model="ir.actions.act_window">
<field name="name">Okr</field>
<field name="res_model">okr</field>
</record>

<!-- Vista tree-->
<record id="okr_view_tree" model="ir.ui.view">
<field name="name">okr.view.tree</field>
<field name="model">okr</field>
<field name="arch" type="xml">
<tree>
<field name="name" string="Title"/>
<field name="description"/>
<field name="area"/>
</tree>
</field>
</record>

<!-- Vista form-->
<record id="okr_view_form" model="ir.ui.view">
<field name="name">okir.view.form</field>
<field name="model">okr</field>
<field name="arch" type="xml">
<form>
<sheet string="Gestión de Okrs">
<group>
<group>
<field name="name" help="Resumen del Objetivo / KR"/>
</group>
</group>
<group>
<field name="description" help="pDescripcion ampliada del Objetivo / KR"/>
</group>
<group>
<group>
<field name="area" />
<field name="progress" />
<field name="weight" />
</group>
<group>
<field name="number_q"/>
<field name="type" />
<field name="users_id" can_create="True" can_write="True" />
</group>
</group>
<group>
<separator/>
</group>
</sheet>
</form>
</field>
</record>

</odoo>