Преглед изворни кода

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
import webnotes
import webnotes, conf

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

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
self.old_doc_type = webnotes.conn.get_value('Print Format',
self.doc.name, 'doc_type')
@@ -37,6 +40,15 @@ class DocType:
webnotes.clear_cache(doctype=self.old_doc_type)
if 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):
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:
log('Executing %s in %s' % (patchmodule or str(methodargs), webnotes.conn.cur_db_name))
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)
elif method:
method(**methodargs)


Loading…
Откажи
Сачувај