[cleanup] Default Warehouses created on Company creation. Warehouse names have Company abbreviation as suffix

This commit is contained in:
Rushabh Mehta
2013-07-10 18:59:55 +05:30
parent 982ad35fd2
commit ad71473f35
6 changed files with 69 additions and 58 deletions

View File

@@ -27,7 +27,12 @@ class DocType:
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
def autoname(self):
suffix = " - " + webnotes.conn.get_value("Company", self.doc.company, "abbr")
if not self.doc.warehouse_name.endswith(suffix):
self.doc.name = self.doc.warehouse_name + suffix
def get_bin(self, item_code, warehouse=None):
warehouse = warehouse or self.doc.name
bin = sql("select name from tabBin where item_code = %s and \

View File

@@ -2,13 +2,12 @@
{
"creation": "2013-03-07 18:50:32",
"docstatus": 0,
"modified": "2013-07-10 18:37:24",
"modified": "2013-07-10 18:46:40",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_rename": 1,
"autoname": "field:warehouse_name",
"description": "A logical Warehouse against which stock entries are made.",
"doctype": "DocType",
"document_type": "Master",