17 Star 73 Fork 75

则霖信息技术(深圳)有限公司 / ERPNext开箱即用

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
__init__.py 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
余则霖 提交于 2022-11-26 17:35 . fix asset related
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import importlib
import frappe
patches_loaded = False
__version__ = '13.0.2'
def console(*data):
frappe.publish_realtime("out_to_console", data, user=frappe.session.user)
def load_monkey_patches():
global patches_loaded
if (
patches_loaded
or not getattr(frappe, "conf", None)
or not "erpnext_oob" in frappe.get_installed_apps()
):
return
for app in frappe.get_installed_apps():
if app in ['frappe', 'erpnext']: continue
folder = frappe.get_app_path(app, "monkey_patches")
if not os.path.exists(folder): continue
for module_name in os.listdir(folder):
if not module_name.endswith(".py") or module_name == "__init__.py":
continue
importlib.import_module(f"{app}.monkey_patches.{module_name[:-3]}")
patches_loaded = True
connect = frappe.connect
def custom_connect(*args, **kwargs):
out = connect(*args, **kwargs)
if frappe.conf.auto_commit_on_many_writes:
frappe.db.auto_commit_on_many_writes = 1
load_monkey_patches()
return out
frappe.connect = custom_connect
Python
1
https://gitee.com/yuzelin/erpnext_oob.git
git@gitee.com:yuzelin/erpnext_oob.git
yuzelin
erpnext_oob
ERPNext开箱即用
master

搜索帮助