validation for stock and nonstock items in purchase cycle
This commit is contained in:
parent
6124247765
commit
d58d1b5a18
@ -45,12 +45,13 @@ class BuyingController(StockController):
|
|||||||
|
|
||||||
def validate_stock_or_nonstock_items(self):
|
def validate_stock_or_nonstock_items(self):
|
||||||
items = [d.item_code for d in self.doclist.get({"parentfield": self.fname})]
|
items = [d.item_code for d in self.doclist.get({"parentfield": self.fname})]
|
||||||
if self.stock_items and len(items) > len(self.stock_items):
|
if self.stock_items:
|
||||||
nonstock_items = list(set(items) - set(self.stock_items))
|
nonstock_items = list(set(items) - set(self.stock_items))
|
||||||
webnotes.msgprint(_("Stock and non-stock items can not be entered in the same ") +
|
if nonstock_items:
|
||||||
self.doc.doctype + _(""". You should make separate documents for them.
|
webnotes.msgprint(_("Stock and non-stock items can not be entered in the same ") +
|
||||||
Stock Items: """) + ", ".join(self.stock_items) + _("""
|
self.doc.doctype + _(""". You should make separate documents for them.
|
||||||
Non-stock Items: """) + ", ".join(nonstock_items), raise_exception=1)
|
Stock Items: """) + ", ".join(self.stock_items) + _("""
|
||||||
|
Non-stock Items: """) + ", ".join(nonstock_items), raise_exception=1)
|
||||||
|
|
||||||
elif items and not self.stock_items:
|
elif items and not self.stock_items:
|
||||||
tax_for_valuation = [d.account_head for d in
|
tax_for_valuation = [d.account_head for d in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user