Skip to content

Commit

Permalink
agregar campo interdependencias en los key results, se puede elegir v…
Browse files Browse the repository at this point in the history
…arios departamentos
  • Loading branch information
pablohmontenegro committed Jan 11, 2024
1 parent 6532432 commit 94e7427
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion okr/models/okr_key_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
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)
Expand All @@ -16,6 +17,6 @@ class OkrObjetivoLine(models.Model):
result = fields.Integer()
user_id = fields.Many2one('res.users', string="Responsible")
plan_de_accion = fields.Char()
interdependencies = fields.Many2many('hr.objective')
interdependencies = fields.Many2many('hr.department')
realizado_en_el_q = fields.Char()
notas_proximo_q = fields.Char()
4 changes: 4 additions & 0 deletions okr/models/okr_objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ 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)
Expand All @@ -22,6 +23,9 @@ class OkrObjetivo(models.Model):
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):
Expand Down
7 changes: 4 additions & 3 deletions okr/views/okr_objective.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@
<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"
widget="section_and_note_one2many"
mode="tree,kanban">
<field name="key_result_ids">
<tree editable="bottom" string="Okr Lines" default_order="progress">
<field name="name"/>
<field name="description"/>
Expand All @@ -42,6 +41,7 @@
<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>
Expand Down Expand Up @@ -70,6 +70,7 @@
<field name="department_id"/>
<field name="period"/>
<field name="year"/>
<field name="company_id" groups="base.group_multi_company" required="1"/>
</tree>
</field>
</record>
Expand Down

0 comments on commit 94e7427

Please sign in to comment.