コード例 #1
0
ファイル: web_form.py プロジェクト: jryandechavez/erpnext12
    def on_update(self):
        """
			Writes the .txt for this page and if write_content is checked,
			it will write out a .html file
		"""
        path = export_module_json(self, self.is_standard, self.module)

        if path:
            # js
            if not os.path.exists(path + '.js'):
                with open(path + '.js', 'w') as f:
                    f.write("""frappe.ready(function() {
	// bind events here
})""")

            # py
            if not os.path.exists(path + '.py'):
                with open(path + '.py', 'w') as f:
                    f.write("""from __future__ import unicode_literals

import frappe

def get_context(context):
	# do your magic here
	pass
""")
コード例 #2
0
ファイル: page.py プロジェクト: mhbu50/frappe-sebco
	def on_update(self):
		"""
			Writes the .json for this page and if write_content is checked,
			it will write out a .html file
		"""
		if self.flags.do_not_update_json:
			return

		from frappe.core.doctype.doctype.doctype import make_module_and_roles
		make_module_and_roles(self, "roles")

		from frappe.modules.utils import export_module_json
		path = export_module_json(self, self.standard=='Yes', self.module)

		if path:
			# js
			if not os.path.exists(path + '.js'):
				with open(path + '.js', 'w') as f:
					f.write("""frappe.pages['%s'].on_page_load = function(wrapper) {
	var page = frappe.ui.make_app_page({
		parent: wrapper,
		title: '%s',
		single_column: true
	});
}""" % (self.name, self.title))
コード例 #3
0
ファイル: page.py プロジェクト: ESS-LLP/frappe
	def on_update(self):
		"""
			Writes the .json for this page and if write_content is checked,
			it will write out a .html file
		"""
		if self.flags.do_not_update_json:
			return

		from frappe.core.doctype.doctype.doctype import make_module_and_roles
		make_module_and_roles(self, "roles")

		from frappe.modules.utils import export_module_json
		path = export_module_json(self, self.standard=='Yes', self.module)

		if path:
			# js
			if not os.path.exists(path + '.js'):
				with open(path + '.js', 'w') as f:
					f.write("""frappe.pages['%s'].on_page_load = function(wrapper) {
	var page = frappe.ui.make_app_page({
		parent: wrapper,
		title: '%s',
		single_column: true
	});
}""" % (self.name, self.title))
コード例 #4
0
ファイル: web_form.py プロジェクト: JiShangShiDai/frappe
	def on_update(self):
		"""
			Writes the .txt for this page and if write_content is checked,
			it will write out a .html file
		"""
		path = export_module_json(self, self.is_standard, self.module)

		if path:
			# js
			if not os.path.exists(path + '.js'):
				with open(path + '.js', 'w') as f:
					f.write("""frappe.ready(function() {
	// bind events here
})""")

			# py
			if not os.path.exists(path + '.py'):
				with open(path + '.py', 'w') as f:
					f.write("""from __future__ import unicode_literals

import frappe

def get_context(context):
	# do your magic here
	pass
""")
コード例 #5
0
    def on_update(self):
        path = export_module_json(self, self.is_standard, self.module)
        if path:
            # py
            if not os.path.exists(path + '.py'):
                with open(path + '.py', 'w') as f:
                    f.write("""from __future__ import unicode_literals

import frappe


def get_context(**kwargs):
	# do your magic here
	pass
""")
コード例 #6
0
    def on_update(self):
        path = export_module_json(self, self.is_standard, self.module)
        if path:
            # js
            if not os.path.exists(path +
                                  '.md') and not os.path.exists(path +
                                                                '.html'):
                with open(path + '.md', 'w') as f:
                    f.write(self.message)

            # py
            if not os.path.exists(path + '.py'):
                with open(path + '.py', 'w') as f:
                    f.write("""import frappe

def get_context(context):
	# do your magic here
	pass
""")
コード例 #7
0
ファイル: notification.py プロジェクト: robulik/frappe
	def on_update(self):
		path = export_module_json(self, self.is_standard, self.module)
		if path:
			# js
			if not os.path.exists(path + '.md') and not os.path.exists(path + '.html'):
				with open(path + '.md', 'w') as f:
					f.write(self.message)

			# py
			if not os.path.exists(path + '.py'):
				with open(path + '.py', 'w') as f:
					f.write("""from __future__ import unicode_literals

import frappe

def get_context(context):
	# do your magic here
	pass
""")
コード例 #8
0
ファイル: email_alert.py プロジェクト: Eddiy/frappe
	def on_update(self):
		frappe.cache().hdel('email_alerts', self.document_type)
		path = export_module_json(self, self.is_standard, self.module)
		if path:
			# js
			if not os.path.exists(path + '.md') and not os.path.exists(path + '.html'):
				with open(path + '.md', 'w') as f:
					f.write(self.message)

			# py
			if not os.path.exists(path + '.py'):
				with open(path + '.py', 'w') as f:
					f.write("""from __future__ import unicode_literals

import frappe

def get_context(context):
	# do your magic here
	pass
""")
コード例 #9
0
ファイル: notification.py プロジェクト: erpnext-tm/frappe
    def on_update(self):
        path = export_module_json(self, self.is_standard, self.module)
        if path:
            # js
            if not os.path.exists(path +
                                  ".md") and not os.path.exists(path +
                                                                ".html"):
                with open(path + ".md", "w") as f:
                    f.write(self.message)

            # py
            if not os.path.exists(path + ".py"):
                with open(path + ".py", "w") as f:
                    f.write("""from __future__ import unicode_literals

import frappe

def get_context(context):
	# do your magic here
	pass
""")
コード例 #10
0
	def export_doc(self):
		# export
		from frappe.modules.utils import export_module_json
		export_module_json(self, self.standard == 'Yes', self.module)
コード例 #11
0
	def export_doc(self):
		# export
		from frappe.modules.utils import export_module_json

		export_module_json(self, self.standard == 1, "Printing")
コード例 #12
0
ファイル: print_format.py プロジェクト: erpnext-tm/frappe
    def export_doc(self):
        from frappe.modules.utils import export_module_json

        export_module_json(self, self.standard == "Yes", self.module)