perf: improve gl entry submission (#20802)

* perf: improve gl entry submission

* perf: add indexes

* fix: replace **kwargs with *args

* fix: syntax error

* fix: travis

* chore: remove purchase invoice from status updater

* fix: set_staus args

Co-Authored-By: Nabin Hait <nabinhait@gmail.com>

* fix: only update status for invoices & fees

* [bug][fix]: set status to object instead of variable (#20790)

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
Co-authored-by: Saurabh <saurabh6790@gmail.com>
This commit is contained in:
Nabin Hait
2020-03-05 13:04:53 +05:30
committed by GitHub
parent b6a3a06c4b
commit 1f80c8dffe
8 changed files with 212 additions and 63 deletions

View File

@@ -140,8 +140,11 @@ def make_entry(args, adv_adj, update_outstanding, from_repost=False):
gle = frappe.get_doc(args)
gle.flags.ignore_permissions = 1
gle.flags.from_repost = from_repost
gle.insert()
gle.validate()
gle.flags.ignore_permissions = True
gle.db_insert()
gle.run_method("on_update_with_args", adv_adj, update_outstanding, from_repost)
gle.flags.ignore_validate = True
gle.submit()
def validate_account_for_perpetual_inventory(gl_map):