调整机台二维码使用A4打印机

This commit is contained in:
胡尧
2025-04-24 09:59:05 +08:00
parent 5a61b3b459
commit 3d937b85c9

View File

@@ -24,7 +24,10 @@ class MaintenancePrinting(models.Model):
# 切换成A4打印机
printer = self.env['printing.printer'].get_default()
printer.print_document(report=None, content = qr_code_data)
try:
printer.print_document(report=None, content = qr_code_data)
except Exception as e:
raise UserError(f"打印失败: {str(e)}")
# def generate_zpl_code(self, code):