Reformatted after template update

This commit is contained in:
Enric Tobella
2022-09-01 11:04:43 +02:00
parent 479efcaa46
commit 0203e5b621
25 changed files with 136 additions and 126 deletions

View File

@@ -13,4 +13,6 @@ class PrintingAction(models.Model):
res.append(("remote_default", "Use remote's default"))
return res
action_type = fields.Selection(selection=_available_action_types,)
action_type = fields.Selection(
selection=_available_action_types,
)

View File

@@ -7,7 +7,8 @@ class ResRemote(models.Model):
_inherit = "res.remote"
remote_printer_ids = fields.One2many(
"res.remote.printer", inverse_name="remote_id",
"res.remote.printer",
inverse_name="remote_id",
)
def get_printer_behaviour(self):

View File

@@ -8,10 +8,19 @@ class ResRemotePrinter(models.Model):
_name = "res.remote.printer"
_description = "Remote Printer"
remote_id = fields.Many2one("res.remote", ondelete="cascade", readonly=True,)
printer_id = fields.Many2one("printing.printer", ondelete="cascade",)
remote_id = fields.Many2one(
"res.remote",
ondelete="cascade",
readonly=True,
)
printer_id = fields.Many2one(
"printing.printer",
ondelete="cascade",
)
printer_tray_id = fields.Many2one(
"printing.tray", ondelete="cascade", domain="[('printer_id', '=', printer_id)]",
"printing.tray",
ondelete="cascade",
domain="[('printer_id', '=', printer_id)]",
)
is_default = fields.Boolean(default=False)
printer_usage = fields.Selection([("standard", "Standard")], default="standard")
@@ -26,7 +35,7 @@ class ResRemotePrinter(models.Model):
@api.onchange("printer_id")
def _onchange_printing_printer_id(self):
""" Reset the tray when the printer is changed """
"""Reset the tray when the printer is changed"""
self.printer_tray_id = False
@api.constrains("remote_id", "printer_usage", "is_default")