Esempio n. 1
0
    def get_msg_html(self):
        """Build email digest content"""
        frappe.flags.ignore_account_permission = True
        from erpnext.setup.doctype.email_digest.quotes import get_random_quote

        context = frappe._dict()
        context.update(self.__dict__)

        self.set_title(context)
        self.set_style(context)
        self.set_accounting_cards(context)

        context.events = self.get_calendar_events()
        context.todo_list = self.get_todo_list()
        context.notifications = self.get_notifications()

        quote = get_random_quote()
        context.quote = {"text": quote[0], "author": quote[1]}

        if not (context.events or context.todo_list or context.notifications
                or context.cards):
            return None

        frappe.flags.ignore_account_permission = False

        # style
        return frappe.render_template(
            "erpnext/setup/doctype/email_digest/templates/default.html",
            context,
            is_path=True)
Esempio n. 2
0
	def get_msg_html(self):
		"""Build email digest content"""
		frappe.flags.ignore_account_permission = True
		from erpnext.setup.doctype.email_digest.quotes import get_random_quote

		context = frappe._dict()
		context.update(self.__dict__)

		self.set_title(context)
		self.set_style(context)
		self.set_accounting_cards(context)

		context.events = self.get_calendar_events()
		context.todo_list = self.get_todo_list()
		context.notifications = self.get_notifications()

		quote = get_random_quote()
		context.quote = {"text": quote[0], "author": quote[1]}

		if not (context.events or context.todo_list or context.notifications or context.cards):
			return None

		frappe.flags.ignore_account_permission = False

		# style
		return frappe.render_template("erpnext/setup/doctype/email_digest/templates/default.html",
			context, is_path=True)
Esempio n. 3
0
    def get_msg_html(self):
        """Build email digest content"""
        frappe.flags.ignore_account_permission = True
        from erpnext.setup.doctype.email_digest.quotes import get_random_quote

        context = frappe._dict()
        context.update(self.__dict__)

        self.set_title(context)
        self.set_style(context)
        self.set_accounting_cards(context)

        if self.get("calendar_events"):
            context.events, context.event_count = self.get_calendar_events()
        if self.get("todo_list"):
            context.todo_list = self.get_todo_list()
            context.todo_count = self.get_todo_count()
        if self.get("notifications"):
            context.notifications = self.get_notifications()
        if self.get("issue"):
            context.issue_list = self.get_issue_list()
            context.issue_count = self.get_issue_count()
        if self.get("project"):
            context.project_list = self.get_project_list()
            context.project_count = self.get_project_count()

        quote = get_random_quote()
        context.quote = {"text": quote[0], "author": quote[1]}

        if self.get("purchase_orders_items_overdue"):
            context.purchase_order_list, context.purchase_orders_items_overdue_list = self.get_purchase_orders_items_overdue_list(
            )
            if not context.purchase_order_list:
                frappe.throw(_("No items to be received are overdue"))

        if not (context.events or context.todo_list or context.notifications or
                context.cards or context.purchase_orders_items_overdue_list):
            return None

        frappe.flags.ignore_account_permission = False

        # style
        return frappe.render_template(
            "erpnext/setup/doctype/email_digest/templates/default.html",
            context,
            is_path=True)
Esempio n. 4
0
	def get_msg_html(self):
		"""Build email digest content"""
		frappe.flags.ignore_account_permission = True
		from erpnext.setup.doctype.email_digest.quotes import get_random_quote

		context = frappe._dict()
		context.update(self.__dict__)

		self.set_title(context)
		self.set_style(context)
		self.set_accounting_cards(context)

		if self.get("calendar_events"):
			context.events, context.event_count = self.get_calendar_events()
		if self.get("todo_list"):
			context.todo_list = self.get_todo_list()
			context.todo_count = self.get_todo_count()
		if self.get("notifications"):
			context.notifications = self.get_notifications()
		if self.get("issue"):
			context.issue_list = self.get_issue_list()
			context.issue_count = self.get_issue_count()
		if self.get("project"):
			context.project_list = self.get_project_list()
			context.project_count = self.get_project_count()

		quote = get_random_quote()
		context.quote = {"text": quote[0], "author": quote[1]}

		if self.get("purchase_orders_items_overdue"):
			context.purchase_order_list, context.purchase_orders_items_overdue_list = self.get_purchase_orders_items_overdue_list()
			if not context.purchase_order_list:
				frappe.throw(_("No items to be received are overdue"))

		if not (context.events or context.todo_list or context.notifications or context.cards
				or context.purchase_orders_items_overdue_list):
			return None

		frappe.flags.ignore_account_permission = False

		# style
		return frappe.render_template("erpnext/setup/doctype/email_digest/templates/default.html",
			context, is_path=True)