fix(serial no): Set supplier info based on pur invoice if serial no is created from Purchase Invoice (#15820)

This commit is contained in:
Nabin Hait 2018-11-05 14:01:59 +05:30 committed by Rushabh Mehta
parent eeb66dfc8e
commit 3e6663d47e

View File

@ -81,9 +81,9 @@ class SerialNo(StockController):
self.purchase_date = purchase_sle.posting_date
self.purchase_time = purchase_sle.posting_time
self.purchase_rate = purchase_sle.incoming_rate
if purchase_sle.voucher_type == "Purchase Receipt":
if purchase_sle.voucher_type in ("Purchase Receipt", "Purchase Invoice"):
self.supplier, self.supplier_name = \
frappe.db.get_value("Purchase Receipt", purchase_sle.voucher_no,
frappe.db.get_value(purchase_sle.voucher_type, purchase_sle.voucher_no,
["supplier", "supplier_name"])
# If sales return entry
@ -253,8 +253,8 @@ def has_duplicate_serial_no(sn, sle):
status = False
if sn.purchase_document_no:
if sle.voucher_type in ['Purchase Receipt', 'Stock Entry'] and \
sn.delivery_document_type not in ['Purchase Receipt', 'Stock Entry']:
if sle.voucher_type in ['Purchase Receipt', 'Stock Entry', "Purchase Invoice"] and \
sn.delivery_document_type not in ['Purchase Receipt', 'Stock Entry', "Purchase Invoice"]:
status = True
if status and sle.voucher_type == 'Stock Entry' and \