打印配置初步优化并测试成功,自测流程成功

This commit is contained in:
mgw
2024-03-20 16:58:57 +08:00
parent 2407d2cfc7
commit c788392b36
9 changed files with 133 additions and 33 deletions

View File

@@ -471,8 +471,15 @@ class Sf_stock_move_line(models.Model):
if not qr_code_data:
raise UserError("没有找到二维码数据。")
lot_name = self.lot_name
host = "192.168.50.110" # 可以根据实际情况修改
port = 9100 # 可以根据实际情况修改
# host = "192.168.50.110" # 可以根据实际情况修改
# port = 9100 # 可以根据实际情况修改
# 获取默认打印机配置
printer_config = self.env['printer.configuration'].search([('model', '=', self._name)], limit=1)
if not printer_config:
raise UserError('请先配置打印机')
host = printer_config.ip_address
port = printer_config.port
self.print_qr_code(lot_name, host, port)
# 返回当前wizard页面
@@ -972,6 +979,11 @@ class CustomStockMove(models.Model):
# todo 待控制
if not lot_name:
raise ValidationError("请先分配序列号")
host = "192.168.50.110" # 可以根据实际情况修改
port = 9100 # 可以根据实际情况修改
# host = "192.168.50.110" # 可以根据实际情况修改
# port = 9100 # 可以根据实际情况修改
# 获取默认打印机配置
printer_config = self.env['printer.configuration'].search([('model', '=', self._name)], limit=1)
host = printer_config.ip_address
port = printer_config.port
record.print_qr_code(lot_name, host, port)