[FIX] (website_)hr_recruitment: unpublished job on archive

Unpublish the job from the website when they are archived, and correct
the condition to show Archive/Unarchive on the job kanban view.

task-3001159

closes odoo/odoo#102034

X-original-commit: 653a673b980133c2304e04c93730321d9f26eebe
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
Kevin Baptiste
2022-10-04 13:29:11 +02:00
parent 78dfa2a07d
commit 5afd3607a1
2 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -116,8 +116,8 @@
</div>
<div class="col-6" role="menuitem">
<a class="dropdown-item" t-if="widget.editable" name="edit_job" type="edit">Configuration</a>
<a class="dropdown-item" t-if="record.active" name="toggle_active" type="object">Archive</a>
<a class="dropdown-item" t-if="!record.active" name="toggle_active" type="object">Unarchive</a>
<a class="dropdown-item" t-if="record.active.raw_value" name="toggle_active" type="object">Archive</a>
<a class="dropdown-item" t-if="!record.active.raw_value" name="toggle_active" type="object">Unarchive</a>
</div>
</div>
</div>
@@ -45,3 +45,7 @@ class Job(models.Model):
def get_backend_menu_id(self):
return self.env.ref('hr_recruitment.menu_hr_recruitment_root').id
def toggle_active(self):
self.filtered('active').website_published = False
return super().toggle_active()