mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-04 20:53:23 +02:00
fix(repost item valuation): reorder function call
(cherry picked from commit aaa4f0ae26)
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):
|
def validate(self):
|
||||||
|
self.set_company()
|
||||||
self.validate_period_closing_voucher()
|
self.validate_period_closing_voucher()
|
||||||
self.set_status(write=False)
|
self.set_status(write=False)
|
||||||
self.reset_field_values()
|
self.reset_field_values()
|
||||||
self.set_company()
|
|
||||||
self.validate_accounts_freeze()
|
self.validate_accounts_freeze()
|
||||||
self.reset_recreate_stock_ledgers()
|
self.reset_recreate_stock_ledgers()
|
||||||
|
|
||||||
@@ -167,6 +167,7 @@ class RepostItemValuation(Document):
|
|||||||
def on_trash(self):
|
def on_trash(self):
|
||||||
self.clear_attachment()
|
self.clear_attachment()
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
def set_company(self):
|
def set_company(self):
|
||||||
if self.based_on == "Transaction":
|
if self.based_on == "Transaction":
|
||||||
self.company = frappe.get_cached_value(self.voucher_type, self.voucher_no, "company")
|
self.company = frappe.get_cached_value(self.voucher_type, self.voucher_no, "company")
|
||||||
|
|||||||
Reference in New Issue
Block a user