mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 04:09:11 +00:00
[autoname] [cleanup] strip blank spaces and remove autoname where naming_series: can be set in doctype
This commit is contained in:
@@ -17,16 +17,12 @@
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
from webnotes.utils import flt, getdate
|
||||
from webnotes.model.doc import make_autoname
|
||||
from webnotes.model.bean import getlist
|
||||
|
||||
class DocType:
|
||||
def __init__(self,d,dl):
|
||||
self.doc, self.doclist = d,dl
|
||||
|
||||
def autoname(self):
|
||||
self.doc.name = make_autoname(self.doc.naming_series + '.#####')
|
||||
|
||||
def validate(self):
|
||||
"""Validate invoice that c-form is applicable
|
||||
and no other c-form is received for that"""
|
||||
|
||||
@@ -29,7 +29,7 @@ class DocType(DocTypeNestedSet):
|
||||
def autoname(self):
|
||||
company_abbr = webnotes.conn.sql("select abbr from tabCompany where name=%s",
|
||||
self.doc.company_name)[0][0]
|
||||
self.doc.name = self.doc.cost_center_name + ' - ' + company_abbr
|
||||
self.doc.name = self.doc.cost_center_name.strip() + ' - ' + company_abbr
|
||||
|
||||
def validate_mandatory(self):
|
||||
if not self.doc.group_or_ledger:
|
||||
|
||||
@@ -34,11 +34,6 @@ class DocType(AccountsController):
|
||||
self.credit_days_global = -1
|
||||
self.is_approving_authority = -1
|
||||
|
||||
def autoname(self):
|
||||
if not self.doc.naming_series:
|
||||
webnotes.msgprint("""Naming Series is mandatory""", raise_exception=1)
|
||||
self.doc.name = make_autoname(self.doc.naming_series+'.#####')
|
||||
|
||||
def validate(self):
|
||||
if not self.doc.is_opening:
|
||||
self.doc.is_opening='No'
|
||||
|
||||
@@ -30,7 +30,6 @@ from webnotes import _, msgprint
|
||||
|
||||
month_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, 'Yearly': 12}
|
||||
|
||||
|
||||
from controllers.selling_controller import SellingController
|
||||
|
||||
class DocType(SellingController):
|
||||
@@ -40,9 +39,6 @@ class DocType(SellingController):
|
||||
self.tname = 'Sales Invoice Item'
|
||||
self.fname = 'entries'
|
||||
|
||||
def autoname(self):
|
||||
self.doc.name = make_autoname(self.doc.naming_series+ '.#####')
|
||||
|
||||
def validate(self):
|
||||
super(DocType, self).validate()
|
||||
self.fetch_missing_values()
|
||||
|
||||
Reference in New Issue
Block a user