mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-12 11:25:09 +00:00
Merge pull request #54162 from frappe/mergify/bp/version-15-hotfix/pr-54161
fix: set default posting time in RIV (backport #54161)
This commit is contained in:
@@ -74,6 +74,7 @@ class RepostItemValuation(Document):
|
||||
repost(self)
|
||||
|
||||
def validate(self):
|
||||
self.set_default_posting_time()
|
||||
self.set_company()
|
||||
self.validate_update_stock()
|
||||
self.validate_period_closing_voucher()
|
||||
@@ -83,6 +84,13 @@ class RepostItemValuation(Document):
|
||||
self.reset_recreate_stock_ledgers()
|
||||
self.validate_recreate_stock_ledgers()
|
||||
|
||||
def set_default_posting_time(self):
|
||||
if not self.posting_time:
|
||||
self.posting_time = nowtime()
|
||||
|
||||
if not self.posting_date:
|
||||
frappe.throw(_("Posting date is required"))
|
||||
|
||||
def validate_update_stock(self):
|
||||
if self.voucher_type in ["Sales Invoice", "Purchase Invoice"]:
|
||||
update_stock = frappe.get_value(self.voucher_type, self.voucher_no, "update_stock")
|
||||
|
||||
@@ -233,6 +233,8 @@ def repost_future_sle(
|
||||
|
||||
index = get_current_index(doc) or 0
|
||||
while index < len(items_to_be_repost):
|
||||
validate_item_warehouse(items_to_be_repost[index])
|
||||
|
||||
obj = update_entries_after(
|
||||
{
|
||||
"item_code": items_to_be_repost[index].get("item_code"),
|
||||
|
||||
Reference in New Issue
Block a user