mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 11:09:17 +00:00
model_wrapper is now bean, refactoring defaults
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
Reference in New Issue
Block a user