Files
odoo_source/addons/hr/models/hr_plan.py
T
Kevin Baptiste 78d964b29d [IMP] hr: simplify signature requests on Plan
Having both an activity type "Request Signature" and "Signature
Request" on the plan were confusing and misleading for the users.

Related odoo/enterprise#25511
Related odoo/upgrade#3398

closes odoo/odoo#87082

Taskid: 2796407
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-04-04 17:48:29 +02:00

25 lines
806 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class HrPlan(models.Model):
_name = 'hr.plan'
_description = 'plan'
name = fields.Char('Name', required=True)
company_id = fields.Many2one(
'res.company', default=lambda self: self.env.company)
plan_activity_type_ids = fields.One2many(
'hr.plan.activity.type', 'plan_id',
string='Activities',
domain="[('company_id', '=', company_id)]")
active = fields.Boolean(default=True)
steps_count = fields.Integer(compute='_compute_steps_count')
@api.depends('plan_activity_type_ids')
def _compute_steps_count(self):
for plan in self:
plan.steps_count = len(plan.plan_activity_type_ids)