[ADD] printing_auto_label_printer

This commit is contained in:
Jacques-Etienne Baudoux
2023-06-21 10:04:06 +02:00
parent 442dc6d574
commit 9dc8e3ad02
13 changed files with 587 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
# Copyright 2022 Jacques-Etienne Baudoux (BCIM) <je@bcim.be>
# Copyright 2022 Michael Tietz (MT Software) <mtietz@mt-software.de>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class PrintingAuto(models.Model):
_inherit = "printing.auto"
is_label = fields.Boolean("Is Label")
def _get_behaviour(self):
if self.is_label and not self.printer_id:
return {"printer": self.env.user.default_label_printer_id}
return super()._get_behaviour()