mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
Reformatted after template update
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user