[enhance] set material request title as comma separated list of items
This commit is contained in:
parent
a305c29b0e
commit
be2dde468d
@ -75,10 +75,24 @@ class MaterialRequest(BuyingController):
|
|||||||
pc_obj = frappe.get_doc('Purchase Common')
|
pc_obj = frappe.get_doc('Purchase Common')
|
||||||
pc_obj.validate_for_items(self)
|
pc_obj.validate_for_items(self)
|
||||||
|
|
||||||
|
self.set_title()
|
||||||
|
|
||||||
|
|
||||||
# self.validate_qty_against_so()
|
# self.validate_qty_against_so()
|
||||||
# NOTE: Since Item BOM and FG quantities are combined, using current data, it cannot be validated
|
# NOTE: Since Item BOM and FG quantities are combined, using current data, it cannot be validated
|
||||||
# Though the creation of Material Request from a Production Plan can be rethought to fix this
|
# Though the creation of Material Request from a Production Plan can be rethought to fix this
|
||||||
|
|
||||||
|
def set_title(self):
|
||||||
|
'''Set title as comma separated list of items'''
|
||||||
|
items = []
|
||||||
|
for d in self.items:
|
||||||
|
if d.item_code not in items:
|
||||||
|
items.append(d.item_code)
|
||||||
|
if(len(items)==4):
|
||||||
|
break
|
||||||
|
|
||||||
|
self.title = ', '.join(items)
|
||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
frappe.db.set(self, 'status', 'Submitted')
|
frappe.db.set(self, 'status', 'Submitted')
|
||||||
self.update_requested_qty()
|
self.update_requested_qty()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user