autoname method added to override autoname of website_generator class

This commit is contained in:
Zlash65
2018-10-02 11:44:25 +05:30
parent 687c3df871
commit 28660c5ca5

View File

@@ -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'