Skip to content

Commit 834ea5d

Browse files
committed
[FIX] cetmix_tower_jet_isolation: enforce strict pylint rules
1 parent c0066cd commit 834ea5d

3 files changed

Lines changed: 25 additions & 28 deletions

File tree

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
from odoo import models, fields
22

33
class CxTowerJetTemplate(models.Model):
4-
_inherit = 'cx.tower.jet.template'
5-
4+
_inherit = "cx.tower.jet.template"
5+
66
isolation_mode = fields.Boolean(
7-
"Isolation Mode",
87
help="When active, prevents users from changing applicability or tags when running commands/plans."
98
)
109
forced_applicability = fields.Selection([
11-
('this', "For selected server(s)"),
12-
('shared', "Non server restricted")
13-
], "Forced Applicability")
14-
10+
("this", "For selected server(s)"),
11+
("shared", "Non server restricted")
12+
])
13+
1514
forced_command_tag_ids = fields.Many2many(
16-
comodel_name='cx.tower.tag',
17-
relation='cx_tower_template_forced_command_tag_rel',
18-
string="Forced Command Tags",
15+
comodel_name="cx.tower.tag",
16+
relation="cx_tower_template_forced_command_tag_rel",
1917
)
20-
18+
2119
forced_plan_tag_ids = fields.Many2many(
22-
comodel_name='cx.tower.tag',
23-
relation='cx_tower_template_forced_plan_tag_rel',
24-
string="Forced Flight Plan Tags",
20+
comodel_name="cx.tower.tag",
21+
relation="cx_tower_template_forced_plan_tag_rel",
2522
)
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from odoo import models, fields, api
22

33
class CxTowerCommandRunWizardFilter(models.TransientModel):
4-
_inherit = 'cx.tower.command.run.wizard'
4+
_inherit = "cx.tower.command.run.wizard"
55

6-
is_isolated_context = fields.Boolean(compute='_compute_is_isolated_context')
6+
is_isolated_context = fields.Boolean(compute="_compute_is_isolated_context")
77

8-
@api.depends('jet_ids')
8+
@api.depends("jet_ids")
99
def _compute_is_isolated_context(self):
1010
for record in self:
1111
if record.jet_ids and any(j.jet_template_id.isolation_mode for j in record.jet_ids):
@@ -16,14 +16,14 @@ def _compute_is_isolated_context(self):
1616
@api.model
1717
def default_get(self, fields_list):
1818
res = super().default_get(fields_list)
19-
if 'default_jet_ids' in self.env.context:
20-
jet_ids = self.env['cx.tower.jet'].browse(self.env.context['default_jet_ids'])
19+
if "default_jet_ids" in self.env.context:
20+
jet_ids = self.env["cx.tower.jet"].browse(self.env.context["default_jet_ids"])
2121
if jet_ids:
2222
template = jet_ids[0].jet_template_id
2323

2424
if template.isolation_mode:
2525
if template.forced_applicability:
26-
res['applicability'] = template.forced_applicability
26+
res["applicability"] = template.forced_applicability
2727
if template.forced_command_tag_ids:
28-
res['tag_ids'] = [(6, 0, template.forced_command_tag_ids.ids)]
28+
res["tag_ids"] = [(6, 0, template.forced_command_tag_ids.ids)]
2929
return res
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from odoo import models, fields, api
22

33
class CxTowerPlanRunWizardFilter(models.TransientModel):
4-
_inherit = 'cx.tower.plan.run.wizard'
4+
_inherit = "cx.tower.plan.run.wizard"
55

6-
is_isolated_context = fields.Boolean(compute='_compute_is_isolated_context')
6+
is_isolated_context = fields.Boolean(compute="_compute_is_isolated_context")
77

8-
@api.depends('jet_ids')
8+
@api.depends("jet_ids")
99
def _compute_is_isolated_context(self):
1010
for record in self:
1111
if record.jet_ids and any(j.jet_template_id.isolation_mode for j in record.jet_ids):
@@ -16,14 +16,14 @@ def _compute_is_isolated_context(self):
1616
@api.model
1717
def default_get(self, fields_list):
1818
res = super().default_get(fields_list)
19-
if 'default_jet_ids' in self.env.context:
20-
jet_ids = self.env['cx.tower.jet'].browse(self.env.context['default_jet_ids'])
19+
if "default_jet_ids" in self.env.context:
20+
jet_ids = self.env["cx.tower.jet"].browse(self.env.context["default_jet_ids"])
2121
if jet_ids:
2222
template = jet_ids[0].jet_template_id
2323

2424
if template.isolation_mode:
2525
if template.forced_applicability:
26-
res['applicability'] = template.forced_applicability
26+
res["applicability"] = template.forced_applicability
2727
if template.forced_plan_tag_ids:
28-
res['tag_ids'] = [(6, 0, template.forced_plan_tag_ids.ids)]
28+
res["tag_ids"] = [(6, 0, template.forced_plan_tag_ids.ids)]
2929
return res

0 commit comments

Comments
 (0)