refactored defaults, bin material request wip

This commit is contained in:
Rushabh Mehta
2013-02-19 15:27:31 +05:30
parent c53231a841
commit 5117d9c266
31 changed files with 55 additions and 377 deletions

View File

@@ -17,7 +17,7 @@
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, flt, get_defaults
from webnotes.utils import cstr, flt
from webnotes.model.doc import addchild
from webnotes.model.bean import getlist
from webnotes.model.code import get_obj
@@ -32,7 +32,6 @@ class DocType(BuyingController):
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
self.defaults = get_defaults()
self.tname = 'Purchase Order Item'
self.fname = 'po_details'

View File

@@ -16,8 +16,9 @@
from __future__ import unicode_literals
import webnotes
import webnotes.defaults
from webnotes.utils import cint, get_defaults
from webnotes.utils import cint
from webnotes import msgprint, _
from webnotes.model.doc import make_autoname
@@ -35,7 +36,7 @@ class DocType(TransactionBase):
self.add_communication_list()
def autoname(self):
supp_master_name = get_defaults()['supp_master_name']
supp_master_name = webnotes.defaults.get_global_default('supp_master_name')
if supp_master_name == 'Supplier Name':
if webnotes.conn.exists("Customer", self.doc.supplier_name):
@@ -98,7 +99,7 @@ class DocType(TransactionBase):
def validate(self):
#validation for Naming Series mandatory field...
if get_defaults()['supp_master_name'] == 'Naming Series':
if webnotes.defaults.get_global_default('supp_master_name') == 'Naming Series':
if not self.doc.naming_series:
msgprint("Series is Mandatory.", raise_exception=1)
@@ -161,7 +162,7 @@ class DocType(TransactionBase):
def on_rename(self, new, old):
#update supplier_name if not naming series
if get_defaults().get('supp_master_name') == 'Supplier Name':
if webnotes.defaults.get_global_default('supp_master_name') == 'Supplier Name':
update_fields = [
('Supplier', 'name'),
('Address', 'supplier'),