Merge pull request #28677 from GangaManoj/fix-adjust-asset-value

fix: Fix 'Adjust Asset Value' button
This commit is contained in:
Saqib 2021-12-13 21:51:09 +05:30 committed by GitHub
commit 4984513597
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -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);

View File

@ -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):