[minor] formatter for item and employee
This commit is contained in:
parent
69e0441041
commit
180e43585f
@ -179,6 +179,22 @@ erpnext.utils.map_current_doc = function(opts) {
|
||||
}
|
||||
}
|
||||
|
||||
frappe.form.link_formatters['Item'] = function(value, doc) {
|
||||
if(doc.item_name && doc.item_name !== value) {
|
||||
return value + ': ' + doc.item_name;
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
frappe.form.link_formatters['Employee'] = function(value, doc) {
|
||||
if(doc.employee_name && doc.employee_name !== value) {
|
||||
return value + ': ' + doc.employee_name;
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
// add description on posting time
|
||||
$(document).on('app_ready', function() {
|
||||
if(!frappe.datetime.is_timezone_same()) {
|
||||
|
@ -121,6 +121,9 @@ class Item(WebsiteGenerator):
|
||||
if not self.is_stock_item or self.has_serial_no or self.has_batch_no:
|
||||
return
|
||||
|
||||
if not self.valuation_rate and self.standard_rate:
|
||||
self.valuation_rate = self.standard_rate
|
||||
|
||||
if not self.valuation_rate:
|
||||
frappe.throw(_("Valuation Rate is mandatory if Opening Stock entered"))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user