fix(dn): regression from bulk transaction fix
This commit is contained in:
parent
e769e750ec
commit
426c245032
@ -767,8 +767,11 @@ def make_delivery_note(source_name, target_doc=None, kwargs=None):
|
|||||||
if target.company_address:
|
if target.company_address:
|
||||||
target.update(get_fetch_values("Delivery Note", "company_address", target.company_address))
|
target.update(get_fetch_values("Delivery Note", "company_address", target.company_address))
|
||||||
|
|
||||||
# set target items names to ensure proper linking with packed_items
|
# if invoked in bulk creation, validations are ignored and thus this method is nerver invoked
|
||||||
target.set_new_name()
|
if frappe.flags.bulk_transaction:
|
||||||
|
# set target items names to ensure proper linking with packed_items
|
||||||
|
target.set_new_name()
|
||||||
|
|
||||||
make_packing_list(target)
|
make_packing_list(target)
|
||||||
|
|
||||||
def condition(doc):
|
def condition(doc):
|
||||||
|
@ -98,6 +98,7 @@ def task(doc_name, from_doctype, to_doctype):
|
|||||||
},
|
},
|
||||||
"Purchase Receipt": {"Purchase Invoice": purchase_receipt.make_purchase_invoice},
|
"Purchase Receipt": {"Purchase Invoice": purchase_receipt.make_purchase_invoice},
|
||||||
}
|
}
|
||||||
|
frappe.flags.bulk_transaction = True
|
||||||
if to_doctype in ["Payment Entry"]:
|
if to_doctype in ["Payment Entry"]:
|
||||||
obj = mapper[from_doctype][to_doctype](from_doctype, doc_name)
|
obj = mapper[from_doctype][to_doctype](from_doctype, doc_name)
|
||||||
else:
|
else:
|
||||||
@ -106,6 +107,7 @@ def task(doc_name, from_doctype, to_doctype):
|
|||||||
obj.flags.ignore_validate = True
|
obj.flags.ignore_validate = True
|
||||||
obj.set_title_field()
|
obj.set_title_field()
|
||||||
obj.insert(ignore_mandatory=True)
|
obj.insert(ignore_mandatory=True)
|
||||||
|
del frappe.flags.bulk_transaction
|
||||||
|
|
||||||
|
|
||||||
def check_logger_doc_exists(log_date):
|
def check_logger_doc_exists(log_date):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user