mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 10:11:20 +00:00
model_wrapper is now bean, refactoring defaults
This commit is contained in:
@@ -19,7 +19,7 @@ import webnotes
|
||||
|
||||
from webnotes.utils import add_days, cint, cstr, flt
|
||||
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, _
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import webnotes
|
||||
|
||||
from webnotes.utils import cstr, flt, get_defaults
|
||||
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 buying.utils import get_last_purchase_details
|
||||
|
||||
@@ -19,7 +19,7 @@ import webnotes
|
||||
|
||||
from webnotes.model import db_exists
|
||||
from webnotes.model.doc import addchild, make_autoname
|
||||
from webnotes.model.wrapper import copy_doclist
|
||||
from webnotes.model.bean import copy_doclist
|
||||
|
||||
sql = webnotes.conn.sql
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ class DocType(BuyingController):
|
||||
self.doc, self.doclist, """[['Material Request', 'Supplier Quotation'],
|
||||
['Material Request Item', 'Supplier Quotation Item']]""")
|
||||
|
||||
from webnotes.model.wrapper import getlist
|
||||
from webnotes.model.bean import getlist
|
||||
for d in getlist(self.doclist, self.fname):
|
||||
if d.item_code and not d.purchase_rate:
|
||||
d.purchase_ref_rate = d.discount_rate = d.purchase_rate = 0.0
|
||||
|
||||
@@ -37,7 +37,7 @@ def get_item_details(args):
|
||||
|
||||
args = webnotes._dict(args)
|
||||
|
||||
item_wrapper = webnotes.model_wrapper("Item", args.item_code)
|
||||
item_wrapper = webnotes.bean("Item", args.item_code)
|
||||
item = item_wrapper.doc
|
||||
|
||||
from stock.utils import validate_end_of_life
|
||||
@@ -98,7 +98,7 @@ def get_item_details(args):
|
||||
|
||||
def get_rates_as_per_price_list(args, item_doclist=None):
|
||||
if not item_doclist:
|
||||
item_doclist = webnotes.model_wrapper("Item", args.item_code).doclist
|
||||
item_doclist = webnotes.bean("Item", args.item_code).doclist
|
||||
|
||||
result = item_doclist.get({"parentfield": "ref_rate_details",
|
||||
"price_list_name": args.price_list_name, "ref_currency": args.price_list_currency,
|
||||
|
||||
Reference in New Issue
Block a user