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

@@ -15,7 +15,7 @@ default_language_version:
node: "14.13.0"
repos:
- repo: https://github.com/psf/black
rev: 19.10b0
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/prettier/pre-commit

View File

@@ -133,8 +133,7 @@ class TestIrActionsReportXml(TransactionCase):
)
def test_behaviour_printing_action_on_wrong_user(self):
""" It should return the action and printer ignoring printing action
"""
"""It should return the action and printer ignoring printing action"""
report = self.Model.search([], limit=1)
self.env.user.printing_action = "client"
printing_action = self.new_printing_action()
@@ -147,8 +146,7 @@ class TestIrActionsReportXml(TransactionCase):
)
def test_behaviour_printing_action_on_wrong_report(self):
""" It should return the action and printer ignoring printing action
"""
"""It should return the action and printer ignoring printing action"""
report = self.Model.search([], limit=1)
self.env.user.printing_action = "client"
printing_action = self.new_printing_action()

View File

@@ -98,7 +98,8 @@ class TestPrintingServer(TransactionCase):
cups.Connection().getPrinters().get.return_value = False
self.Model.action_update_printers()
self.assertEqual(
"unavailable", rec_id.status,
"unavailable",
rec_id.status,
)
@mock.patch("%s.cups" % model)

View File

@@ -82,8 +82,7 @@ class TestReport(common.HttpCase):
self.assertFalse(res)
def test_render_qweb_pdf_not_printable(self):
""" It should print the report, only if it is printable
"""
"""It should print the report, only if it is printable"""
with mock.patch(
"odoo.addons.base_report_to_printer.models."
"printing_printer.PrintingPrinter."
@@ -93,8 +92,7 @@ class TestReport(common.HttpCase):
print_document.assert_not_called()
def test_render_qweb_pdf_printable(self):
""" It should print the report, only if it is printable
"""
"""It should print the report, only if it is printable"""
with mock.patch(
"odoo.addons.base_report_to_printer.models."
"printing_printer.PrintingPrinter."

View File

@@ -66,7 +66,9 @@ class PrintingLabelZpl2(models.Model):
default=True,
)
action_window_id = fields.Many2one(
comodel_name="ir.actions.act_window", string="Action", readonly=True,
comodel_name="ir.actions.act_window",
string="Action",
readonly=True,
)
test_print_mode = fields.Boolean(string="Mode Print")
test_labelary_mode = fields.Boolean(string="Mode Labelary")

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")

View File

@@ -68,8 +68,7 @@ class StockPikcing(TransactionCase):
self.uom_unit = self.env.ref("uom.product_uom_unit")
def test_stock_picking_auto_print(self):
""" Auto print when DO is ready or done
"""
"""Auto print when DO is ready or done"""
self.env["stock.quant"]._update_available_quantity(
self.product_A, self.stock_location, 2
)