From 28660c5ca5ba32edd91aa1fbab0dc5ecae4ef1f6 Mon Sep 17 00:00:00 2001 From: Zlash65 Date: Tue, 2 Oct 2018 11:44:25 +0530 Subject: [PATCH] autoname method added to override autoname of website_generator class --- .../conference_talk_proposal/conference_talk_proposal.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/foundation/erpnext_foundation/doctype/conference_talk_proposal/conference_talk_proposal.py b/foundation/erpnext_foundation/doctype/conference_talk_proposal/conference_talk_proposal.py index a49751bc..0fff6ee5 100644 --- a/foundation/erpnext_foundation/doctype/conference_talk_proposal/conference_talk_proposal.py +++ b/foundation/erpnext_foundation/doctype/conference_talk_proposal/conference_talk_proposal.py @@ -5,12 +5,17 @@ from __future__ import unicode_literals import frappe from frappe.website.website_generator import WebsiteGenerator +from frappe.model.naming import make_autoname class ConferenceTalkProposal(WebsiteGenerator): def get_context(self, context): context.show_sidebar = 1 context.website_sidebar = 'Conference 2017 Sidebar' + def autoname(self): + ''' autoname = TALK-.YYYY.-.### ''' + autoname = frappe.get_meta(self.get("doctype")).autoname or "" + self.name = make_autoname(autoname) def get_list_context(context): context.title = 'Talk Proposals'