Merge pull request #28677 from GangaManoj/fix-adjust-asset-value
fix: Fix 'Adjust Asset Value' button
This commit is contained in:
commit
4984513597
@ -110,7 +110,7 @@ frappe.ui.form.on('Asset', {
|
||||
|
||||
if (frm.doc.status != 'Fully Depreciated') {
|
||||
frm.add_custom_button(__("Adjust Asset Value"), function() {
|
||||
frm.trigger("create_asset_adjustment");
|
||||
frm.trigger("create_asset_value_adjustment");
|
||||
}, __("Manage"));
|
||||
}
|
||||
|
||||
@ -322,14 +322,14 @@ frappe.ui.form.on('Asset', {
|
||||
});
|
||||
},
|
||||
|
||||
create_asset_adjustment: function(frm) {
|
||||
create_asset_value_adjustment: function(frm) {
|
||||
frappe.call({
|
||||
args: {
|
||||
"asset": frm.doc.name,
|
||||
"asset_category": frm.doc.asset_category,
|
||||
"company": frm.doc.company
|
||||
},
|
||||
method: "erpnext.assets.doctype.asset.asset.create_asset_adjustment",
|
||||
method: "erpnext.assets.doctype.asset.asset.create_asset_value_adjustment",
|
||||
freeze: 1,
|
||||
callback: function(r) {
|
||||
var doclist = frappe.model.sync(r.message);
|
||||
|
@ -757,14 +757,14 @@ def create_asset_repair(asset, asset_name):
|
||||
return asset_repair
|
||||
|
||||
@frappe.whitelist()
|
||||
def create_asset_adjustment(asset, asset_category, company):
|
||||
asset_maintenance = frappe.get_doc("Asset Value Adjustment")
|
||||
asset_maintenance.update({
|
||||
def create_asset_value_adjustment(asset, asset_category, company):
|
||||
asset_value_adjustment = frappe.new_doc("Asset Value Adjustment")
|
||||
asset_value_adjustment.update({
|
||||
"asset": asset,
|
||||
"company": company,
|
||||
"asset_category": asset_category
|
||||
})
|
||||
return asset_maintenance
|
||||
return asset_value_adjustment
|
||||
|
||||
@frappe.whitelist()
|
||||
def transfer_asset(args):
|
||||
|
Loading…
Reference in New Issue
Block a user