mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-14 18:23:55 +00:00
fix(repost item valuation): reorder function call
This commit is contained in:
@@ -132,4 +132,19 @@ frappe.ui.form.on("Repost Item Valuation", {
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
voucher_type: function (frm) {
|
||||
console.log(frm.doc);
|
||||
frm.trigger("set_company_on_transaction");
|
||||
},
|
||||
|
||||
voucher_no: function (frm) {
|
||||
frm.trigger("set_company_on_transaction");
|
||||
},
|
||||
|
||||
set_company_on_transaction(frm) {
|
||||
if (frm.doc.voucher_no && frm.doc.voucher_no) {
|
||||
frm.call("set_company");
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -70,10 +70,10 @@ class RepostItemValuation(Document):
|
||||
)
|
||||
|
||||
def validate(self):
|
||||
self.set_company()
|
||||
self.validate_period_closing_voucher()
|
||||
self.set_status(write=False)
|
||||
self.reset_field_values()
|
||||
self.set_company()
|
||||
self.validate_accounts_freeze()
|
||||
self.reset_recreate_stock_ledgers()
|
||||
|
||||
@@ -162,6 +162,7 @@ class RepostItemValuation(Document):
|
||||
def on_trash(self):
|
||||
self.clear_attachment()
|
||||
|
||||
@frappe.whitelist()
|
||||
def set_company(self):
|
||||
if self.based_on == "Transaction":
|
||||
self.company = frappe.get_cached_value(self.voucher_type, self.voucher_no, "company")
|
||||
|
||||
Reference in New Issue
Block a user