mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 23:52:57 +00:00
Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-28533
This commit is contained in:
@@ -80,20 +80,20 @@ frappe.ui.form.on('Asset', {
|
|||||||
|
|
||||||
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)) {
|
||||||
frm.add_custom_button("Transfer Asset", function() {
|
frm.add_custom_button(__("Transfer Asset"), function() {
|
||||||
erpnext.asset.transfer_asset(frm);
|
erpnext.asset.transfer_asset(frm);
|
||||||
}, __("Manage"));
|
}, __("Manage"));
|
||||||
|
|
||||||
frm.add_custom_button("Scrap Asset", function() {
|
frm.add_custom_button(__("Scrap Asset"), function() {
|
||||||
erpnext.asset.scrap_asset(frm);
|
erpnext.asset.scrap_asset(frm);
|
||||||
}, __("Manage"));
|
}, __("Manage"));
|
||||||
|
|
||||||
frm.add_custom_button("Sell Asset", function() {
|
frm.add_custom_button(__("Sell Asset"), function() {
|
||||||
frm.trigger("make_sales_invoice");
|
frm.trigger("make_sales_invoice");
|
||||||
}, __("Manage"));
|
}, __("Manage"));
|
||||||
|
|
||||||
} else if (frm.doc.status=='Scrapped') {
|
} else if (frm.doc.status=='Scrapped') {
|
||||||
frm.add_custom_button("Restore Asset", function() {
|
frm.add_custom_button(__("Restore Asset"), function() {
|
||||||
erpnext.asset.restore_asset(frm);
|
erpnext.asset.restore_asset(frm);
|
||||||
}, __("Manage"));
|
}, __("Manage"));
|
||||||
}
|
}
|
||||||
@@ -121,7 +121,7 @@ frappe.ui.form.on('Asset', {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (frm.doc.purchase_receipt || !frm.doc.is_existing_asset) {
|
if (frm.doc.purchase_receipt || !frm.doc.is_existing_asset) {
|
||||||
frm.add_custom_button("View General Ledger", function() {
|
frm.add_custom_button(__("View General Ledger"), function() {
|
||||||
frappe.route_options = {
|
frappe.route_options = {
|
||||||
"voucher_no": frm.doc.name,
|
"voucher_no": frm.doc.name,
|
||||||
"from_date": frm.doc.available_for_use_date,
|
"from_date": frm.doc.available_for_use_date,
|
||||||
|
|||||||
@@ -1094,7 +1094,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
$.each(this.frm.doc.taxes || [], function(i, d) {
|
$.each(this.frm.doc.taxes || [], function(i, d) {
|
||||||
if(d.charge_type == "Actual") {
|
if(d.charge_type == "Actual") {
|
||||||
frappe.model.set_value(d.doctype, d.name, "tax_amount",
|
frappe.model.set_value(d.doctype, d.name, "tax_amount",
|
||||||
flt(d.tax_amount) / flt(exchange_rate));
|
flt(d.base_tax_amount) / flt(exchange_rate));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -204,43 +204,6 @@ erpnext.company.set_chart_of_accounts_options = function(doc) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.change_abbr = function() {
|
|
||||||
var dialog = new frappe.ui.Dialog({
|
|
||||||
title: "Replace Abbr",
|
|
||||||
fields: [
|
|
||||||
{"fieldtype": "Data", "label": "New Abbreviation", "fieldname": "new_abbr",
|
|
||||||
"reqd": 1 },
|
|
||||||
{"fieldtype": "Button", "label": "Update", "fieldname": "update"},
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
dialog.fields_dict.update.$input.click(function() {
|
|
||||||
var args = dialog.get_values();
|
|
||||||
if(!args) return;
|
|
||||||
frappe.show_alert(__("Update in progress. It might take a while."));
|
|
||||||
return frappe.call({
|
|
||||||
method: "erpnext.setup.doctype.company.company.enqueue_replace_abbr",
|
|
||||||
args: {
|
|
||||||
"company": cur_frm.doc.name,
|
|
||||||
"old": cur_frm.doc.abbr,
|
|
||||||
"new": args.new_abbr
|
|
||||||
},
|
|
||||||
callback: function(r) {
|
|
||||||
if(r.exc) {
|
|
||||||
frappe.msgprint(__("There were errors."));
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
cur_frm.set_value("abbr", args.new_abbr);
|
|
||||||
}
|
|
||||||
dialog.hide();
|
|
||||||
cur_frm.refresh();
|
|
||||||
},
|
|
||||||
btn: this
|
|
||||||
})
|
|
||||||
});
|
|
||||||
dialog.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
erpnext.company.setup_queries = function(frm) {
|
erpnext.company.setup_queries = function(frm) {
|
||||||
$.each([
|
$.each([
|
||||||
["default_bank_account", {"account_type": "Bank"}],
|
["default_bank_account", {"account_type": "Bank"}],
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
"details",
|
"details",
|
||||||
"company_name",
|
"company_name",
|
||||||
"abbr",
|
"abbr",
|
||||||
"change_abbr",
|
|
||||||
"is_group",
|
"is_group",
|
||||||
"cb0",
|
"cb0",
|
||||||
"domain",
|
"domain",
|
||||||
@@ -128,12 +127,6 @@
|
|||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"set_only_once": 1
|
"set_only_once": 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"depends_on": "eval:!doc.__islocal && in_list(frappe.user_roles, \"System Manager\")",
|
|
||||||
"fieldname": "change_abbr",
|
|
||||||
"fieldtype": "Button",
|
|
||||||
"label": "Change Abbreviation"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"bold": 1,
|
"bold": 1,
|
||||||
"default": "0",
|
"default": "0",
|
||||||
@@ -749,7 +742,7 @@
|
|||||||
"image_field": "company_logo",
|
"image_field": "company_logo",
|
||||||
"is_tree": 1,
|
"is_tree": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-05-12 16:51:08.187233",
|
"modified": "2021-12-02 14:52:08.187233",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "Company",
|
"name": "Company",
|
||||||
|
|||||||
@@ -54,9 +54,11 @@ class RepostItemValuation(Document):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def restart_reposting(self):
|
def restart_reposting(self):
|
||||||
self.set_status('Queued')
|
self.set_status('Queued', write=False)
|
||||||
frappe.enqueue(repost, timeout=1800, queue='long',
|
self.current_index = 0
|
||||||
job_name='repost_sle', now=True, doc=self)
|
self.distinct_item_and_warehouse = None
|
||||||
|
self.items_to_be_repost = None
|
||||||
|
self.db_update()
|
||||||
|
|
||||||
def deduplicate_similar_repost(self):
|
def deduplicate_similar_repost(self):
|
||||||
""" Deduplicate similar reposts based on item-warehouse-posting combination."""
|
""" Deduplicate similar reposts based on item-warehouse-posting combination."""
|
||||||
|
|||||||
Reference in New Issue
Block a user