fix: Modify set_payment_schedule() to include fetch_payment_terms_from_order()

This commit is contained in:
GangaManoj
2021-07-22 05:57:42 +05:30
parent 6333c3bee5
commit def7cc6cb3
5 changed files with 70 additions and 56 deletions

View File

@@ -443,8 +443,6 @@ def make_purchase_invoice_from_portal(purchase_order_name):
frappe.response.location = '/purchase-invoices/' + doc.name
def get_mapped_purchase_invoice(source_name, target_doc=None, ignore_permissions=False):
from erpnext.controllers.accounts_controller import fetch_payment_terms_from_order
def postprocess(source, target):
target.flags.ignore_permissions = ignore_permissions
set_missing_values(source, target)
@@ -496,7 +494,7 @@ def get_mapped_purchase_invoice(source_name, target_doc=None, ignore_permissions
automatically_fetch_payment_terms = cint(frappe.db.get_single_value('Accounts Settings', 'automatically_fetch_payment_terms'))
if automatically_fetch_payment_terms:
fetch_payment_terms_from_order(doc)
doc.set_payment_schedule()
return doc