Skip to content

Commit

Permalink
fix: don't set finance books if gross_purchase_amount is not set (bac…
Browse files Browse the repository at this point in the history
…kport #37480) (#37482)

fix: don't set finance books if gross_purchase_amount is not set (#37480)

(cherry picked from commit 18e3a89)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
  • Loading branch information
mergify[bot] and anandbaburajan authored Oct 12, 2023
1 parent bbdf26c commit 0590f21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions erpnext/assets/doctype/asset/asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ frappe.ui.form.on('Asset', {


item_code: function(frm) {
if(frm.doc.item_code && frm.doc.calculate_depreciation) {
if(frm.doc.item_code && frm.doc.calculate_depreciation && frm.doc.gross_purchase_amount) {
frm.trigger('set_finance_book');
} else {
frm.set_value('finance_books', []);
Expand Down Expand Up @@ -448,7 +448,7 @@ frappe.ui.form.on('Asset', {

calculate_depreciation: function(frm) {
frm.toggle_reqd("finance_books", frm.doc.calculate_depreciation);
if (frm.doc.item_code && frm.doc.calculate_depreciation ) {
if (frm.doc.item_code && frm.doc.calculate_depreciation && frm.doc.gross_purchase_amount) {
frm.trigger("set_finance_book");
} else {
frm.set_value("finance_books", []);
Expand Down

0 comments on commit 0590f21

Please sign in to comment.