fix: Use .set method to set serial no.

This commit is contained in:
Suraj Shetty 2019-07-28 22:03:28 +05:30
parent 64f174fcaa
commit d43764c8e5
2 changed files with 2 additions and 3 deletions

View File

@ -61,7 +61,7 @@ def set_serial_nos(item):
'item_code': item.item, 'item_code': item.item,
'warehouse': item.warehouse 'warehouse': item.warehouse
}, limit=item.qty, order_by='purchase_date') }, limit=item.qty, order_by='purchase_date')
item.serial_no = '\n'.join([serial_no.name for serial_no in serial_nos]) item.set('serial_no', '\n'.join([serial_no.name for serial_no in serial_nos]))
def set_batch_no(item, doc): def set_batch_no(item, doc):
batches = frappe.get_all('Stock Ledger Entry', batches = frappe.get_all('Stock Ledger Entry',

View File

@ -72,7 +72,6 @@
"read_only": 1 "read_only": 1
}, },
{ {
"depends_on": "has_serial_no",
"fieldname": "serial_no", "fieldname": "serial_no",
"fieldtype": "Small Text", "fieldtype": "Small Text",
"label": "Serial No", "label": "Serial No",
@ -130,7 +129,7 @@
} }
], ],
"istable": 1, "istable": 1,
"modified": "2019-07-25 11:18:58.478250", "modified": "2019-07-26 14:47:33.965373",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Pick Ticket Item", "name": "Pick Ticket Item",