浏览代码

updated payment receipt voucher format

version-14
Rushabh Mehta 12 年前
父节点
当前提交
25cb62cb27
共有 2 个文件被更改,包括 17 次插入2 次删除
  1. +13
    -1
      core/doctype/print_format/print_format.py
  2. +4
    -1
      webnotes/modules/patch_handler.py

+ 13
- 1
core/doctype/print_format/print_format.py 查看文件

@@ -21,13 +21,16 @@
# #


from __future__ import unicode_literals from __future__ import unicode_literals
import webnotes
import webnotes, conf


class DocType: class DocType:
def __init__(self, d, dl): def __init__(self, d, dl):
self.doc, self.doclist = d,dl self.doc, self.doclist = d,dl


def validate(self): def validate(self):
if self.doc.standard=="Yes" and webnotes.session.user != "Administrator":
webnotes.msgprint("Standard Print Format cannot be updated.", raise_exception=1)
# old_doc_type is required for clearing item cache # old_doc_type is required for clearing item cache
self.old_doc_type = webnotes.conn.get_value('Print Format', self.old_doc_type = webnotes.conn.get_value('Print Format',
self.doc.name, 'doc_type') self.doc.name, 'doc_type')
@@ -37,6 +40,15 @@ class DocType:
webnotes.clear_cache(doctype=self.old_doc_type) webnotes.clear_cache(doctype=self.old_doc_type)
if self.doc.doc_type: if self.doc.doc_type:
webnotes.clear_cache(doctype=self.doc.doc_type) webnotes.clear_cache(doctype=self.doc.doc_type)

self.export_doc()
def export_doc(self):
# export
if self.doc.standard == 'Yes' and getattr(conf, 'developer_mode', 0) == 1:
from webnotes.modules.export_file import export_to_files
export_to_files(record_list=[['Print Format', self.doc.name]],
record_module=self.doc.module)
def on_trash(self): def on_trash(self):
if self.doc.doc_type: if self.doc.doc_type:


+ 4
- 1
webnotes/modules/patch_handler.py 查看文件

@@ -68,7 +68,10 @@ def execute_patch(patchmodule, method=None, methodargs=None):
try: try:
log('Executing %s in %s' % (patchmodule or str(methodargs), webnotes.conn.cur_db_name)) log('Executing %s in %s' % (patchmodule or str(methodargs), webnotes.conn.cur_db_name))
if patchmodule: if patchmodule:
webnotes.get_method(patchmodule + ".execute")()
if patchmodule.startswith("execute:"):
exec patchmodule.split("execute:")[1] in globals()
else:
webnotes.get_method(patchmodule + ".execute")()
update_patch_log(patchmodule) update_patch_log(patchmodule)
elif method: elif method:
method(**methodargs) method(**methodargs)


正在加载...
取消
保存