model_wrapper is now bean, refactoring defaults

This commit is contained in:
Rushabh Mehta
2013-02-18 18:24:28 +05:30
parent 9c880da381
commit c53231a841
104 changed files with 351 additions and 163 deletions

View File

@@ -20,7 +20,7 @@ import webnotes
from webnotes.utils import cstr, getdate
from webnotes.model import db_exists
from webnotes.model.doc import make_autoname
from webnotes.model.wrapper import getlist, copy_doclist
from webnotes.model.bean import getlist, copy_doclist
from webnotes.model.code import get_obj
from webnotes import msgprint
from stock.utils import get_valid_serial_nos

View File

@@ -23,7 +23,7 @@ from core.doctype.communication.communication import make
def add_sales_communication(subject, content, sender, real_name, mail=None,
status="Open", date=None):
def set_status(doctype, name):
w = webnotes.model_wrapper(doctype, name)
w = webnotes.bean(doctype, name)
w.ignore_permissions = True
w.doc.status = is_system_user and "Replied" or status
w.doc.save()
@@ -36,7 +36,7 @@ def add_sales_communication(subject, content, sender, real_name, mail=None,
if not (lead_name or contact_name):
# none, create a new Lead
lead = webnotes.model_wrapper({
lead = webnotes.bean({
"doctype":"Lead",
"lead_name": real_name or sender,
"email_id": sender,

View File

@@ -20,7 +20,7 @@ import webnotes
from webnotes.utils import add_days, cstr, getdate
from webnotes.model import db_exists
from webnotes.model.doc import Document, addchild
from webnotes.model.wrapper import getlist
from webnotes.model.bean import getlist
from webnotes import msgprint
sql = webnotes.conn.sql

View File

@@ -19,7 +19,7 @@ import webnotes
from webnotes.utils import cint, cstr, get_defaults, now
from webnotes.model import db_exists
from webnotes.model.wrapper import copy_doclist
from webnotes.model.bean import copy_doclist
sql = webnotes.conn.sql

View File

@@ -18,7 +18,7 @@ from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, getdate
from webnotes.model.wrapper import getlist
from webnotes.model.bean import getlist
from webnotes.model.code import get_obj
from webnotes import msgprint

View File

@@ -19,7 +19,7 @@ import webnotes
from webnotes.utils import cint, cstr, flt, getdate, nowdate, formatdate
from webnotes.model.doc import addchild
from webnotes.model.wrapper import getlist
from webnotes.model.bean import getlist
from webnotes.model.code import get_obj
from webnotes import msgprint, _
from setup.utils import get_company_currency

View File

@@ -18,7 +18,7 @@ from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, flt, getdate
from webnotes.model.wrapper import getlist
from webnotes.model.bean import getlist
from webnotes.model.code import get_obj
from webnotes import msgprint

View File

@@ -19,7 +19,7 @@ import webnotes
from webnotes.utils import cstr
from webnotes.model import db_exists
from webnotes.model.wrapper import copy_doclist
from webnotes.model.bean import copy_doclist
from webnotes.model.code import get_obj
from webnotes import msgprint

View File

@@ -30,4 +30,4 @@ def add_node():
parent_field: webnotes.form_dict['parent'],
"is_group": webnotes.form_dict['is_group']
}]
webnotes.model_wrapper(doclist).save()
webnotes.bean(doclist).save()