feat: Allow the Supplier on an invoice to match more loosely

This commit is contained in:
Glen Whitney 2020-11-22 01:07:51 +00:00
parent 7958f6baf6
commit f3be72cda9
1 changed files with 3 additions and 1 deletions

View File

@ -163,7 +163,9 @@ class JWImport(Document):
or frappe.get_all('Supplier', {
'supplier_name': ['like', f"%{fullref}%"]})
or (comma and frappe.get_all('Supplier', {
'supplier_name': ['like', f"%{lastref}"]})))
'supplier_name': ['like', f"%{lastref}"]}))
or (comma and frappe.get_all('Supplier', {
'supplier_name': ['like', f"%{lastref}%"]})))
if not suppliers or len(suppliers) != 1: return
suplr = suppliers[0].name
invoices = frappe.get_all('Purchase Invoice',