Before this commit, In the product form, when the selected uom is Hours and as Hours is the default uom, we display this conversion (1.0 Hours = 1.0 Hours) which is useless Before this commit, Kanban is the only view available for projects. With this view, we can't select a batch of projects and display optional fields Before this commit, Some wordings didn't have a significant meaning. This commit hides uom conversion when selected and default uom are the same. This commit adds the projects tree view. This commit improves some wordings according to what was mentionned in the task. task-2724965 closes odoo/odoo#82135 Related: odoo/enterprise#23206 Related: odoo/upgrade#3207 Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
29 lines
1.1 KiB
Python
29 lines
1.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import fields, models
|
|
|
|
|
|
class ProjectDelete(models.TransientModel):
|
|
_name = 'project.delete.wizard'
|
|
_description = 'Project Delete Wizard'
|
|
|
|
project_ids = fields.Many2many('project.project', string='Projects')
|
|
task_count = fields.Integer(compute='_compute_task_count')
|
|
projects_archived = fields.Boolean(compute='_compute_projects_archived')
|
|
|
|
def _compute_projects_archived(self):
|
|
for wizard in self.with_context(active_test=False):
|
|
wizard.projects_archived = all(not p.active for p in wizard.project_ids)
|
|
|
|
def _compute_task_count(self):
|
|
for wizard in self:
|
|
wizard.task_count = sum(wizard.with_context(active_test=False).project_ids.mapped('task_count'))
|
|
|
|
def action_archive(self):
|
|
self.project_ids.write({'active': False})
|
|
|
|
def confirm_delete(self):
|
|
self.with_context(active_test=False).project_ids.unlink()
|
|
return self.env['ir.actions.act_window']._for_xml_id('project.open_view_project_all')
|