frappe/frappe#478 removed self.doclist
This commit is contained in:
parent
f191f854cd
commit
cfb6ccfe51
@ -182,12 +182,10 @@ class DeliveryNote(SellingController):
|
|||||||
"""
|
"""
|
||||||
Validate that if packed qty exists, it should be equal to qty
|
Validate that if packed qty exists, it should be equal to qty
|
||||||
"""
|
"""
|
||||||
if not any([flt(d.get('packed_qty')) for d in self.doclist if
|
if not any([flt(d.get('packed_qty')) for d in self.get(self.fname)]):
|
||||||
d.doctype=='Delivery Note Item']):
|
|
||||||
return
|
return
|
||||||
packing_error_list = []
|
packing_error_list = []
|
||||||
for d in self.doclist:
|
for d in self.get(self.fname):
|
||||||
if d.doctype != 'Delivery Note Item': continue
|
|
||||||
if flt(d.get('qty')) != flt(d.get('packed_qty')):
|
if flt(d.get('qty')) != flt(d.get('packed_qty')):
|
||||||
packing_error_list.append([
|
packing_error_list.append([
|
||||||
d.get('item_code', ''),
|
d.get('item_code', ''),
|
||||||
|
|||||||
@ -62,10 +62,13 @@ class Item(DocListController):
|
|||||||
ch = self.append('uom_conversion_details', {})
|
ch = self.append('uom_conversion_details', {})
|
||||||
ch.uom = self.stock_uom
|
ch.uom = self.stock_uom
|
||||||
ch.conversion_factor = 1
|
ch.conversion_factor = 1
|
||||||
|
|
||||||
|
to_remove = []
|
||||||
for d in self.get("uom_conversion_details"):
|
for d in self.get("uom_conversion_details"):
|
||||||
if d.conversion_factor == 1 and d.uom != self.stock_uom:
|
if d.conversion_factor == 1 and d.uom != self.stock_uom:
|
||||||
self.doclist.remove(d)
|
to_remove.append(d)
|
||||||
|
|
||||||
|
[self.remove(d) for d in to_remove]
|
||||||
|
|
||||||
|
|
||||||
def check_stock_uom_with_bin(self):
|
def check_stock_uom_with_bin(self):
|
||||||
|
|||||||
@ -24,8 +24,8 @@ class PackingSlip(Document):
|
|||||||
self.validate_qty()
|
self.validate_qty()
|
||||||
|
|
||||||
from erpnext.utilities.transaction_base import validate_uom_is_integer
|
from erpnext.utilities.transaction_base import validate_uom_is_integer
|
||||||
validate_uom_is_integer(self.doclist, "stock_uom", "qty")
|
validate_uom_is_integer(self, "stock_uom", "qty")
|
||||||
validate_uom_is_integer(self.doclist, "weight_uom", "net_weight")
|
validate_uom_is_integer(self, "weight_uom", "net_weight")
|
||||||
|
|
||||||
def validate_delivery_note(self):
|
def validate_delivery_note(self):
|
||||||
"""
|
"""
|
||||||
@ -104,7 +104,7 @@ class PackingSlip(Document):
|
|||||||
group by item_code""" % ("%s", condition),
|
group by item_code""" % ("%s", condition),
|
||||||
tuple([self.delivery_note] + rows), as_dict=1)
|
tuple([self.delivery_note] + rows), as_dict=1)
|
||||||
|
|
||||||
ps_item_qty = dict([[d.item_code, d.qty] for d in self.doclist])
|
ps_item_qty = dict([[d.item_code, d.qty] for d in self.get("item_details")])
|
||||||
no_of_cases = cint(self.to_case_no) - cint(self.from_case_no) + 1
|
no_of_cases = cint(self.to_case_no) - cint(self.from_case_no) + 1
|
||||||
|
|
||||||
return res, ps_item_qty, no_of_cases
|
return res, ps_item_qty, no_of_cases
|
||||||
|
|||||||
@ -423,10 +423,7 @@ class StockEntry(StockController):
|
|||||||
}
|
}
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def get_items(self):
|
def get_items(self):
|
||||||
self.doclist = filter(lambda d: d.parentfield!="mtn_details", self.doclist)
|
|
||||||
# self.set('mtn_details', [])
|
|
||||||
|
|
||||||
pro_obj = None
|
pro_obj = None
|
||||||
if self.production_order:
|
if self.production_order:
|
||||||
# common validations
|
# common validations
|
||||||
|
|||||||
@ -17,7 +17,7 @@ class Note(Document):
|
|||||||
|
|
||||||
def onload(self):
|
def onload(self):
|
||||||
if not self.public and frappe.session.user != self.owner:
|
if not self.public and frappe.session.user != self.owner:
|
||||||
if frappe.session.user not in [d.user for d in self.doclist if d.doctype=="Note User"]:
|
if frappe.session.user not in [d.user for d in self.get("share_with")]:
|
||||||
frappe.msgprint("You are not authorized to read this record.", raise_exception=True)
|
frappe.msgprint("You are not authorized to read this record.", raise_exception=True)
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
|||||||
@ -56,7 +56,7 @@ class TransactionBase(StatusUpdater):
|
|||||||
event_doclist.insert()
|
event_doclist.insert()
|
||||||
|
|
||||||
def validate_uom_is_integer(self, uom_field, qty_fields):
|
def validate_uom_is_integer(self, uom_field, qty_fields):
|
||||||
validate_uom_is_integer(self.doclist, uom_field, qty_fields)
|
validate_uom_is_integer(self, uom_field, qty_fields)
|
||||||
|
|
||||||
def validate_with_previous_doc(self, source_dt, ref):
|
def validate_with_previous_doc(self, source_dt, ref):
|
||||||
for key, val in ref.items():
|
for key, val in ref.items():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user