Exemplo n.º 1
0
    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
""")
Exemplo n.º 2
0
	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))
Exemplo n.º 3
0
	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))
Exemplo n.º 4
0
	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
""")
Exemplo n.º 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
""")
Exemplo n.º 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
""")
Exemplo n.º 7
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("""from __future__ import unicode_literals

import frappe

def get_context(context):
	# do your magic here
	pass
""")
Exemplo n.º 8
0
	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
""")
Exemplo n.º 9
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("""from __future__ import unicode_literals

import frappe

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

		export_module_json(self, self.standard == 1, "Printing")
Exemplo n.º 12
0
    def export_doc(self):
        from frappe.modules.utils import export_module_json

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