- add custom fields - override properties from PropertySetter - sort based on prev_field - optionally, post process (add js, css, select fields), or without """ from __future__ import unicode_literals # imports import webnotes import webnotes.model import webnotes.model.doc import webnotes.model.doclist from webnotes.utils import cint, get_base_path doctype_cache = webnotes.local('doctype_doctype_cache') docfield_types = webnotes.local('doctype_docfield_types') # doctype_cache = {} # docfield_types = None def get(doctype, processed=False, cached=True): """return doclist""" if cached: doclist = from_cache(doctype, processed) if doclist: if processed: update_language(doclist) return DocTypeDocList(doclist)
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes import msgprint from webnotes.utils import cint, flt, cstr, now from stock.utils import get_valuation_method import json # future reposting class NegativeStockError(webnotes.ValidationError): pass _exceptions = webnotes.local('stockledger_exceptions') # _exceptions = [] def make_sl_entries(sl_entries, is_amended=None): if sl_entries: from stock.utils import update_bin cancel = True if sl_entries[0].get("is_cancelled") == "Yes" else False if cancel: set_as_cancel(sl_entries[0].get('voucher_no'), sl_entries[0].get('voucher_type')) for sle in sl_entries: sle_id = None if sle.get('is_cancelled') == 'Yes': sle['actual_qty'] = -flt(sle['actual_qty']) #webnotes.errprint(sle.get('doctype')) #webnotes.errprint(sle.get("actual_qty") or sle.get("doctype") != 'pm')
- override properties from PropertySetter - sort based on prev_field - optionally, post process (add js, css, select fields), or without """ from __future__ import unicode_literals # imports import json import webnotes import webnotes.model import webnotes.model.doc import webnotes.model.doclist from webnotes.utils import cint doctype_cache = webnotes.local('doctype_doctype_cache') docfield_types = webnotes.local('doctype_docfield_types') # doctype_cache = {} # docfield_types = None def get(doctype, processed=False, cached=True): """return doclist""" if cached: doclist = from_cache(doctype, processed) if doclist: if processed: update_language(doclist) return DocTypeDocList(doclist) load_docfield_types()
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import webnotes from webnotes.utils import cstr, add_days, date_diff from webnotes import msgprint, _ from webnotes.utils.datautils import UnicodeWriter # doclist = None doclist = webnotes.local('uploadattendance_doclist') class DocType(): def __init__(self, doc, doclist=[]): self.doc = doc self.doclist = doclist @webnotes.whitelist() def get_template(): if not webnotes.has_permission("Attendance", "create"): raise webnotes.PermissionError args = webnotes.local.form_dict webnotes.local.uploadattendance_doclist = webnotes.model.doctype.get("Attendance") w = UnicodeWriter() w = add_header(w) w = add_data(w, args)
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import webnotes from webnotes.utils import cstr, add_days, date_diff from webnotes import msgprint, _ from webnotes.utils.datautils import UnicodeWriter # doclist = None doclist = webnotes.local('uploadattendance_doclist') class DocType(): def __init__(self, doc, doclist=[]): self.doc = doc self.doclist = doclist @webnotes.whitelist() def get_template(): if not webnotes.has_permission("Attendance", "create"): raise webnotes.PermissionError args = webnotes.local.form_dict webnotes.local.uploadattendance_doclist = webnotes.model.doctype.get( "Attendance") w = UnicodeWriter()
# License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes import msgprint from webnotes.utils import cint, flt, cstr, now from stock.utils import get_valuation_method import json # future reposting class NegativeStockError(webnotes.ValidationError): pass _exceptions = webnotes.local('stockledger_exceptions') # _exceptions = [] def make_sl_entries(sl_entries, is_amended=None): if sl_entries: from stock.utils import update_bin cancel = True if sl_entries[0].get("is_cancelled") == "Yes" else False if cancel: set_as_cancel(sl_entries[0].get('voucher_no'), sl_entries[0].get('voucher_type')) for sle in sl_entries: sle_id = None if sle.get('is_cancelled') == 'Yes':