[CLN] global: apply ruff

This commit is contained in:
Stéphan Sainléger
2025-06-25 15:57:21 +02:00
parent 76db335030
commit 2afa90260f
32 changed files with 194 additions and 159 deletions

View File

@@ -1,9 +1,7 @@
===================================
helpdesk_transfer_timesheet_to_task
===================================
# helpdesk_transfer_timesheet_to_task
This module assigns the field task of the timesheets' ticket to the task linked to the ticket.
Exception : the timesheet is not transfered to the task linked to the ticket if
This module assigns the field task of the timesheets' ticket to the task linked to the
ticket. Exception : the timesheet is not transfered to the task linked to the ticket if
it has already been invoiced (timesheet_invoice_id != False).
# Installation
@@ -17,10 +15,10 @@ None.
# Bug Tracker
Bugs are tracked on `our issues website <https://github.com/elabore-coop/helpdesk-tools/issues>`\_. In case of
trouble, please check there if your issue has already been
reported. If you spotted it first, help us smashing it by providing a
detailed and welcomed feedback.
Bugs are tracked on
`our issues website <https://github.com/elabore-coop/helpdesk-tools/issues>`\_. In case
of trouble, please check there if your issue has already been reported. If you spotted
it first, help us smashing it by providing a detailed and welcomed feedback.
# Credits

View File

@@ -14,7 +14,7 @@
"helpdesk_mgmt",
"helpdesk_mgmt_project",
"helpdesk_mgmt_timesheet",
"sale_timesheet"
"sale_timesheet",
],
"data": [],
"installable": True,

View File

@@ -1,4 +1,4 @@
from odoo import models, api, Command
from odoo import Command, api, models
class HelpdeskTicket(models.Model):
@@ -8,5 +8,9 @@ class HelpdeskTicket(models.Model):
def _onchange_task_id(self):
for record in self:
if record.timesheet_ids and record.task_id:
not_yet_invoiced_timesheet_ids = [t.id for t in record.timesheet_ids if not t.timesheet_invoice_id]
record.task_id.timesheet_ids = [Command.link(t_id) for t_id in not_yet_invoiced_timesheet_ids]
not_yet_invoiced_timesheet_ids = [
t.id for t in record.timesheet_ids if not t.timesheet_invoice_id
]
record.task_id.timesheet_ids = [
Command.link(t_id) for t_id in not_yet_invoiced_timesheet_ids
]

View File

@@ -2,9 +2,8 @@ from odoo.tests.common import TransactionCase
class TestHelpdeskTicket(TransactionCase):
def setUp(self):
super(TestHelpdeskTicket, self).setUp()
super().setUp()
self.HelpdeskTicket = self.env["helpdesk.ticket"]
self.ProjectTask = self.env["project.task"]
self.AccountAnalyticLine = self.env["account.analytic.line"]