diff --git a/sf_manufacturing/security/ir.model.access.csv b/sf_manufacturing/security/ir.model.access.csv index 5f3f37d8..a9e92aaf 100644 --- a/sf_manufacturing/security/ir.model.access.csv +++ b/sf_manufacturing/security/ir.model.access.csv @@ -108,9 +108,9 @@ access_sf_production_line_group_plan_dispatch,sf.production.line,model_sf_produc access_sf_production_line_group_plan_director,sf.production.line,model_sf_production_line,sf_base.group_plan_director,1,1,1,0 access_sf_production_line,sf.production.line,model_sf_production_line,sf_maintenance.sf_group_equipment_user,1,1,1,0 access_mrp_workcenter,mrp_workcenter,model_mrp_workcenter,sf_base.group_plan_dispatch,1,1,1,0 -access_mrp_bom,mrp.bom,mrp.model_mrp_bom,sf_base.group_plan_dispatch,1,1,1,0 +access_mrp_bom_group_plan_dispatch,mrp.bom,mrp.model_mrp_bom,sf_base.group_plan_dispatch,1,0,0,0 access_mrp_bom_line,mrp.bom.line,mrp.model_mrp_bom_line,sf_base.group_plan_dispatch,1,0,0,0 -access_mrp_unbuild,mrp.unbuild,mrp.model_mrp_unbuild,sf_base.group_plan_dispatch,1,1,1,0 +access_mrp_unbuild_group_plan_dispatch,mrp.unbuild,mrp.model_mrp_unbuild,sf_base.group_plan_dispatch,1,0,0,0 access_stock_scrap_group_plan_dispatch,stock.scrap,stock.model_stock_scrap,sf_base.group_plan_dispatch,1,0,0,0 access_sf_model_type,sf.model.type,model_sf_model_type,sf_base.group_plan_dispatch,1,1,1,0 diff --git a/zpl_print/__manifest__.py b/zpl_print/__manifest__.py index c74dc79e..a18331c3 100644 --- a/zpl_print/__manifest__.py +++ b/zpl_print/__manifest__.py @@ -19,7 +19,7 @@ ], 'assets': { 'web.assets_backend': [ - 'jikimo_sfs/zpl_print/static/src/scss/changes.scss' + # 'jikimo_sfs/zpl_print/static/src/scss/changes.scss' ] }, 'license': 'LGPL-3', diff --git a/zpl_print/libs/TSCLIB.dll b/zpl_print/libs/TSCLIB.dll index e69de29b..d03d33d0 100644 Binary files a/zpl_print/libs/TSCLIB.dll and b/zpl_print/libs/TSCLIB.dll differ diff --git a/zpl_print/libs/TSCLIB11.dll b/zpl_print/libs/TSCLIB11.dll new file mode 100644 index 00000000..89e5b5f0 Binary files /dev/null and b/zpl_print/libs/TSCLIB11.dll differ diff --git a/zpl_print/models/common.py b/zpl_print/models/common.py index d45f74e0..652d02a2 100644 --- a/zpl_print/models/common.py +++ b/zpl_print/models/common.py @@ -8,14 +8,26 @@ class Common(models.Model): _description = u'公用类' def print_zpl(self, zpl_str): - WinDll_path = "D://桌面//pythonZPL//tsc_python_sdk_example//TSC_Python_SDK_Example//tsc_sample//libs//TSCLIB.dll" + # WinDll_path = "D://桌面//pythonZPL//tsc_python_sdk_example//TSC_Python_SDK_Example//tsc_sample//libs//TSCLIB.dll" + WinDll_path = "D://jikimo-dev//jikimo//SF//zpl_print//libs//TSCLIB.dll" try: tsclibrary = ctypes.WinDLL(WinDll_path) tsclibrary.openportW("USB") + print(type(zpl_str)) print(zpl_str) - tsclibrary.sendcommandW(zpl_str) + original_string = "^XA\n^FO100,50\n^A0N,44,33^FD[PO-2023-1226-0215-1] P-S00001-1^FS\n^FO100,100\n^A0N,44,33^FDLN/SN: P-S00001-1-12348啊a^FS\n^FO100,150^BY3\n^BCN,100,Y,N,N\n^FDP-S00001-1-12348啊a^FS\n^XZ" + + # 使用加号操作符 + new_string = original_string + "^CW1,E:SIMSUN.FNT #绑定字体\n^CI28 #UTF-8编码" + + # 使用字符串格式化方法 + new_string = "{}^CW1,E:SIMSUN.FNT #绑定字体\n^CI28 #UTF-8编码".format(original_string) + + print(new_string) + + tsclibrary.sendcommandW(new_string) print('111222') - tsclibrary.printlabelW("0", "1"); - tsclibrary.closeport(); + tsclibrary.printlabelW("0", "1") + tsclibrary.closeport() except Exception as e: raise UserWarning("错误警告:%s" % e)