mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-18 20:49:19 +00:00
Merge pull request #29602 from rohitwaghchaure/merge-branch-hotfix-to-pre-release-for-12-29
chore: merge branch 'version-12-hotfix' into 'v12-pre-release'
This commit is contained in:
@@ -78,6 +78,7 @@ frappe.ui.form.on('Asset', {
|
|||||||
frappe.ui.form.trigger("Asset", "is_existing_asset");
|
frappe.ui.form.trigger("Asset", "is_existing_asset");
|
||||||
frm.toggle_display("next_depreciation_date", frm.doc.docstatus < 1);
|
frm.toggle_display("next_depreciation_date", frm.doc.docstatus < 1);
|
||||||
frm.events.make_schedules_editable(frm);
|
frm.events.make_schedules_editable(frm);
|
||||||
|
frm.trigger("toggle_make_depreciation_entry");
|
||||||
|
|
||||||
if (frm.doc.docstatus==1) {
|
if (frm.doc.docstatus==1) {
|
||||||
if (in_list(["Submitted", "Partially Depreciated", "Fully Depreciated"], frm.doc.status)) {
|
if (in_list(["Submitted", "Partially Depreciated", "Fully Depreciated"], frm.doc.status)) {
|
||||||
@@ -141,6 +142,18 @@ frappe.ui.form.on('Asset', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
toggle_make_depreciation_entry: function(frm) {
|
||||||
|
if (frm.doc.calculate_depreciation){
|
||||||
|
if (in_list(["Submitted", "Partially Depreciated"], frm.doc.status)){
|
||||||
|
frm.fields_dict['schedules'].grid.set_column_disp('make_depreciation_entry', true);
|
||||||
|
} else {
|
||||||
|
frm.fields_dict['schedules'].grid.set_column_disp('make_depreciation_entry', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
frm.refresh_field('schedules');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
toggle_reference_doc: function(frm) {
|
toggle_reference_doc: function(frm) {
|
||||||
if (frm.doc.purchase_receipt && frm.doc.purchase_invoice && frm.doc.docstatus === 1) {
|
if (frm.doc.purchase_receipt && frm.doc.purchase_invoice && frm.doc.docstatus === 1) {
|
||||||
frm.set_df_property('purchase_invoice', 'read_only', 1);
|
frm.set_df_property('purchase_invoice', 'read_only', 1);
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ def make_depreciation_entry(asset_name, date=None):
|
|||||||
date = today()
|
date = today()
|
||||||
|
|
||||||
asset = frappe.get_doc("Asset", asset_name)
|
asset = frappe.get_doc("Asset", asset_name)
|
||||||
|
validate_asset(asset)
|
||||||
|
|
||||||
fixed_asset_account, accumulated_depreciation_account, depreciation_expense_account = \
|
fixed_asset_account, accumulated_depreciation_account, depreciation_expense_account = \
|
||||||
get_depreciation_accounts(asset)
|
get_depreciation_accounts(asset)
|
||||||
|
|
||||||
@@ -101,6 +103,10 @@ def make_depreciation_entry(asset_name, date=None):
|
|||||||
|
|
||||||
return asset
|
return asset
|
||||||
|
|
||||||
|
def validate_asset(asset):
|
||||||
|
if asset.status not in ['Submitted', 'Partially Depreciated']:
|
||||||
|
frappe.throw(_("Cannot depreciate {0} Asset").format(asset.status))
|
||||||
|
|
||||||
def get_depreciation_accounts(asset):
|
def get_depreciation_accounts(asset):
|
||||||
fixed_asset_account = accumulated_depreciation_account = depreciation_expense_account = None
|
fixed_asset_account = accumulated_depreciation_account = depreciation_expense_account = None
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ braintree==3.57.1
|
|||||||
# frappe # https://github.com/frappe/frappe is installed during bench-init
|
# frappe # https://github.com/frappe/frappe is installed during bench-init
|
||||||
gocardless-pro==1.11.0
|
gocardless-pro==1.11.0
|
||||||
googlemaps==3.1.1
|
googlemaps==3.1.1
|
||||||
pandas==0.24.2
|
pandas>=0.24.0,<1.2.0
|
||||||
plaid-python~=7.2.1
|
plaid-python~=7.2.1
|
||||||
PyGithub==1.44.1
|
PyGithub==1.44.1
|
||||||
python-stdnum==1.12
|
python-stdnum==1.12
|
||||||
|
|||||||
Reference in New Issue
Block a user