修复自定义角色打印无权限的问题
This commit is contained in:
@@ -319,7 +319,7 @@ class ProductionLot(models.Model):
|
||||
# port = 9100 # 可以根据实际情况修改
|
||||
|
||||
# 获取默认打印机配置
|
||||
printer_config = self.env['printer.configuration'].search([('model', '=', self._name)], limit=1)
|
||||
printer_config = self.env['printer.configuration'].sudo().search([('model', '=', self._name)], limit=1)
|
||||
if not printer_config:
|
||||
raise UserError('请先配置打印机')
|
||||
host = printer_config.printer_id.ip_address
|
||||
|
||||
@@ -475,7 +475,7 @@ class Sf_stock_move_line(models.Model):
|
||||
# port = 9100 # 可以根据实际情况修改
|
||||
|
||||
# 获取默认打印机配置
|
||||
printer_config = self.env['printer.configuration'].search([('model', '=', self._name)], limit=1)
|
||||
printer_config = self.env['printer.configuration'].sudo().search([('model', '=', self._name)], limit=1)
|
||||
if not printer_config:
|
||||
raise UserError('请先配置打印机')
|
||||
host = printer_config.printer_id.ip_address
|
||||
@@ -983,7 +983,7 @@ class CustomStockMove(models.Model):
|
||||
# port = 9100 # 可以根据实际情况修改
|
||||
|
||||
# 获取默认打印机配置
|
||||
printer_config = self.env['printer.configuration'].search([('model', '=', self._name)], limit=1)
|
||||
printer_config = self.env['printer.configuration'].sudo().search([('model', '=', self._name)], limit=1)
|
||||
if not printer_config:
|
||||
raise UserError('请先配置打印机')
|
||||
host = printer_config.printer_id.ip_address
|
||||
|
||||
Reference in New Issue
Block a user