mirror of
https://github.com/erpnext/foundation.git
synced 2026-10-16 18:00:47 +02:00
autoname method added to override autoname of website_generator class
This commit is contained in:
@@ -5,12 +5,17 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.website.website_generator import WebsiteGenerator
|
from frappe.website.website_generator import WebsiteGenerator
|
||||||
|
from frappe.model.naming import make_autoname
|
||||||
|
|
||||||
class ConferenceTalkProposal(WebsiteGenerator):
|
class ConferenceTalkProposal(WebsiteGenerator):
|
||||||
def get_context(self, context):
|
def get_context(self, context):
|
||||||
context.show_sidebar = 1
|
context.show_sidebar = 1
|
||||||
context.website_sidebar = 'Conference 2017 Sidebar'
|
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):
|
def get_list_context(context):
|
||||||
context.title = 'Talk Proposals'
|
context.title = 'Talk Proposals'
|
||||||
|
|||||||
Reference in New Issue
Block a user