[FIX] hr: allow onboarding plan access for officers
taskID 2969653 closes odoo/odoo#99407 Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
@@ -12,7 +12,7 @@ access_hr_plan_activity_type_employee,access_hr_plan_activity_type,model_hr_plan
|
||||
access_hr_plan_employee,access_hr_plan_employee,model_hr_plan,base.group_user,1,0,0,0
|
||||
access_hr_plan_activity_type_hr_user,access_hr_plan_activity_type,model_hr_plan_activity_type,group_hr_user,1,1,1,1
|
||||
access_hr_plan_hr_user,access_hr_plan_hr_user,model_hr_plan,group_hr_user,1,1,1,1
|
||||
access_hr_plan_wizard,access.hr.plan.wizard,model_hr_plan_wizard,hr.group_hr_manager,1,1,1,0
|
||||
access_hr_plan_wizard,access.hr.plan.wizard,model_hr_plan_wizard,hr.group_hr_user,1,1,1,0
|
||||
access_hr_departure_wizard,access.hr.departure.wizard,model_hr_departure_wizard,hr.group_hr_user,1,1,1,0
|
||||
access_hr_work_location_user,access_hr_work_location_user,model_hr_work_location,base.group_user,1,0,0,0
|
||||
access_hr_work_location_manager,access_hr_work_location_manager,model_hr_work_location,group_hr_manager,1,1,1,1
|
||||
|
||||
|
@@ -52,7 +52,7 @@
|
||||
<field name="image_128" invisible="1" />
|
||||
<field name="company_id" invisible="1"/>
|
||||
<header>
|
||||
<button name="%(plan_wizard_action)d" string="Launch Plan" type="action" groups="hr.group_hr_manager"/>
|
||||
<button name="%(plan_wizard_action)d" string="Launch Plan" type="action" groups="hr.group_hr_user"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div name="button_box" class="oe_button_box">
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
id="menu_config_plan"
|
||||
name="Activity Planning"
|
||||
parent="menu_human_resources_configuration"
|
||||
groups="group_hr_manager"
|
||||
groups="group_hr_user"
|
||||
sequence="100"/>
|
||||
|
||||
<menuitem
|
||||
@@ -130,7 +130,7 @@
|
||||
name="On/Offboarding Plans"
|
||||
action="hr_plan_action"
|
||||
parent="menu_config_plan"
|
||||
groups="group_hr_manager"
|
||||
groups="group_hr_user"
|
||||
sequence="100"/>
|
||||
|
||||
</data>
|
||||
|
||||
@@ -12,7 +12,12 @@ class HrPlanWizard(models.TransientModel):
|
||||
def _default_plan_id(self):
|
||||
# We know that all employees belong to the same company
|
||||
employee = self.env['hr.employee'].browse(self.env.context.get('active_ids')[0] if self.env.context.get('active_ids') else [])
|
||||
return self.env['hr.plan'].search([('company_id', '=', employee.company_id.id)], limit=1)
|
||||
return self.env['hr.plan'].search([
|
||||
('company_id', '=', employee.company_id.id),
|
||||
'|',
|
||||
('department_id', '=', employee.department_id.id),
|
||||
('department_id', '=', False)
|
||||
], limit=1)
|
||||
|
||||
plan_id = fields.Many2one('hr.plan', default=lambda self: self._default_plan_id(),
|
||||
domain="[('company_id', '=', company_id), '|', ('department_id', '=', department_id), ('department_id', '=', False)]")
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
</div>
|
||||
</sheet>
|
||||
<footer>
|
||||
<button name="action_launch" string="Launch Plan" type="object" class="oe_highlight" attrs="{'invisible': [('warning', '!=', False)]}" groups="hr.group_hr_manager" data-hotkey="q"/>
|
||||
<button name="action_launch" string="Launch Plan" type="object" class="oe_highlight" disabled="disabled" attrs="{'invisible': [('warning', '=', False)]}" groups="hr.group_hr_manager" data-hotkey="q"/>
|
||||
<button name="action_launch" string="Launch Plan" type="object" class="oe_highlight" attrs="{'invisible': [('warning', '!=', False)]}" groups="hr.group_hr_user" data-hotkey="q"/>
|
||||
<button name="action_launch" string="Launch Plan" type="object" class="oe_highlight" disabled="disabled" attrs="{'invisible': [('warning', '=', False)]}" groups="hr.group_hr_user" data-hotkey="q"/>
|
||||
<button string="Cancel" class="btn-secondary" special="cancel" data-hotkey="z"/>
|
||||
</footer>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user