mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-26 13:25:20 +00:00
Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into e-commerce-refactor
This commit is contained in:
@@ -55,4 +55,3 @@ def get_default_energy_point_rules():
|
||||
'points': rule.get('points'),
|
||||
'user_field': rule.get('user_field') or 'owner'
|
||||
} for doctype, rule in doctype_rule_map.items()]
|
||||
|
||||
|
||||
@@ -24,4 +24,3 @@ def get_default_success_action():
|
||||
'first_success_message': get_first_success_message(doctype),
|
||||
'next_actions': 'new\nprint\nemail'
|
||||
} for doctype in doctype_list]
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
|
||||
|
||||
|
||||
//--------- ONLOAD -------------
|
||||
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,4 +21,4 @@ def get_brand_defaults(item, company):
|
||||
row.pop("name")
|
||||
return row
|
||||
|
||||
return frappe._dict()
|
||||
return frappe._dict()
|
||||
|
||||
@@ -4,4 +4,4 @@ from __future__ import unicode_literals
|
||||
|
||||
|
||||
import frappe
|
||||
test_records = frappe.get_test_records('Brand')
|
||||
test_records = frappe.get_test_records('Brand')
|
||||
|
||||
@@ -313,4 +313,3 @@ var disbale_coa_fields = function(frm, bool=true) {
|
||||
frm.set_df_property("chart_of_accounts", "read_only", bool);
|
||||
frm.set_df_property("existing_company", "read_only", bool);
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ class Company(NestedSet):
|
||||
frappe.flags.country_change = True
|
||||
self.create_default_accounts()
|
||||
self.create_default_warehouses()
|
||||
|
||||
|
||||
if not frappe.db.get_value("Cost Center", {"is_group": 0, "company": self.name}):
|
||||
self.create_default_cost_center()
|
||||
|
||||
@@ -393,6 +393,10 @@ class Company(NestedSet):
|
||||
frappe.db.sql("delete from `tabPurchase Taxes and Charges Template` where company=%s", self.name)
|
||||
frappe.db.sql("delete from `tabItem Tax Template` where company=%s", self.name)
|
||||
|
||||
# delete Process Deferred Accounts if no GL Entry found
|
||||
if not frappe.db.get_value('GL Entry', {'company': self.name}):
|
||||
frappe.db.sql("delete from `tabProcess Deferred Accounting` where company=%s", self.name)
|
||||
|
||||
@frappe.whitelist()
|
||||
def enqueue_replace_abbr(company, old, new):
|
||||
kwargs = dict(queue="long", company=company, old=old, new=new)
|
||||
|
||||
@@ -37,4 +37,4 @@ def get_data():
|
||||
'items': ['Project']
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,4 +30,4 @@ frappe.treeview_settings["Company"] = {
|
||||
onload: function(treeview) {
|
||||
treeview.make_tree();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -130,4 +130,3 @@ def create_test_lead_in_company(company):
|
||||
lead.company = company
|
||||
lead.save()
|
||||
return lead.name
|
||||
|
||||
|
||||
@@ -22,4 +22,4 @@ QUnit.test("Test: Company [SetUp]", function (assert) {
|
||||
'chart of cost centers created'),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -16,4 +16,4 @@ QUnit.test("Test: Company", function (assert) {
|
||||
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,24 +7,24 @@ $.extend(cur_frm.cscript, {
|
||||
cur_frm.set_value("to_currency", frappe.defaults.get_global_default("currency"));
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
refresh: function() {
|
||||
cur_frm.cscript.set_exchange_rate_label();
|
||||
},
|
||||
|
||||
|
||||
from_currency: function() {
|
||||
cur_frm.cscript.set_exchange_rate_label();
|
||||
},
|
||||
|
||||
|
||||
to_currency: function() {
|
||||
cur_frm.cscript.set_exchange_rate_label();
|
||||
},
|
||||
|
||||
|
||||
set_exchange_rate_label: function() {
|
||||
if(cur_frm.doc.from_currency && cur_frm.doc.to_currency) {
|
||||
var default_label = __(frappe.meta.docfield_map[cur_frm.doctype]["exchange_rate"].label);
|
||||
cur_frm.fields_dict.exchange_rate.set_label(default_label +
|
||||
cur_frm.fields_dict.exchange_rate.set_label(default_label +
|
||||
repl(" (1 %(from_currency)s = [?] %(to_currency)s)", cur_frm.doc));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -62,7 +62,7 @@ class TestCurrencyExchange(unittest.TestCase):
|
||||
|
||||
exchange_rate = get_exchange_rate("USD", "INR", "2016-01-30", "for_selling")
|
||||
self.assertEqual(exchange_rate, 62.9)
|
||||
|
||||
|
||||
# Exchange rate as on 15th Dec, 2015, should be fetched from fixer.io
|
||||
self.clear_cache()
|
||||
exchange_rate = get_exchange_rate("USD", "INR", "2015-12-15", "for_selling")
|
||||
|
||||
@@ -30,4 +30,4 @@ def get_parent_customer_groups(customer_group):
|
||||
order by lft asc""", (lft, rgt), as_dict=True)
|
||||
|
||||
def on_doctype_update():
|
||||
frappe.db.add_index("Customer Group", ["lft", "rgt"])
|
||||
frappe.db.add_index("Customer Group", ["lft", "rgt"])
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
frappe.treeview_settings["Customer Group"] = {
|
||||
ignore_fields:["parent_customer_group"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,4 +7,4 @@ test_ignore = ["Price List"]
|
||||
|
||||
|
||||
import frappe
|
||||
test_records = frappe.get_test_records('Customer Group')
|
||||
test_records = frappe.get_test_records('Customer Group')
|
||||
|
||||
@@ -28,4 +28,4 @@ frappe.ui.form.on("Email Digest", {
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -32,4 +32,3 @@ def get_random_quote():
|
||||
]
|
||||
|
||||
return random.choice(quotes)
|
||||
|
||||
|
||||
@@ -180,8 +180,8 @@
|
||||
<br>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Purchase Order Items Overdue -->
|
||||
|
||||
<!-- Purchase Order Items Overdue -->
|
||||
{% if purchase_orders_items_overdue_list %}
|
||||
<h4 style="{{ section_head }}" class="text-center">{{ _("Purchase Order Items not received on time") }}</h4>
|
||||
<div>
|
||||
@@ -254,6 +254,6 @@
|
||||
<div class="text-center">
|
||||
<br><br><span class="text-danger">Please take necessary action</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
frappe.treeview_settings["Item Group"] = {
|
||||
ignore_fields:["parent_item_group"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
|
||||
|
||||
|
||||
//--------- ONLOAD -------------
|
||||
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,4 +7,4 @@ import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class PrintHeading(Document):
|
||||
pass
|
||||
pass
|
||||
|
||||
@@ -4,4 +4,4 @@ from __future__ import unicode_literals
|
||||
|
||||
|
||||
import frappe
|
||||
test_records = frappe.get_test_records('Print Heading')
|
||||
test_records = frappe.get_test_records('Print Heading')
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
|
||||
|
||||
|
||||
//--------- ONLOAD -------------
|
||||
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,4 +7,4 @@ import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class QuotationLostReason(Document):
|
||||
pass
|
||||
pass
|
||||
|
||||
@@ -4,4 +4,4 @@ from __future__ import unicode_literals
|
||||
|
||||
|
||||
import frappe
|
||||
test_records = frappe.get_test_records('Quotation Lost Reason')
|
||||
test_records = frappe.get_test_records('Quotation Lost Reason')
|
||||
|
||||
@@ -12,4 +12,4 @@ def get_data():
|
||||
'items': ['Sales Order', 'Delivery Note', 'Sales Invoice']
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,4 +9,4 @@ frappe.treeview_settings["Sales Person"] = {
|
||||
{fieldtype:'Check', fieldname:'is_group', label:__('Group Node'),
|
||||
description: __("Further nodes can be only created under 'Group' type nodes")}
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
frappe.treeview_settings["Supplier Group"] = {
|
||||
breadcrumbs: "Buying",
|
||||
ignore_fields:["parent_supplier_group"]
|
||||
};
|
||||
};
|
||||
|
||||
@@ -7,4 +7,4 @@ import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class TargetDetail(Document):
|
||||
pass
|
||||
pass
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
|
||||
|
||||
|
||||
//--------- ONLOAD -------------
|
||||
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,6 @@ def get_terms_and_conditions(template_name, doc):
|
||||
doc = json.loads(doc)
|
||||
|
||||
terms_and_conditions = frappe.get_doc("Terms and Conditions", template_name)
|
||||
|
||||
|
||||
if terms_and_conditions.terms:
|
||||
return frappe.render_template(terms_and_conditions.terms, doc)
|
||||
return frappe.render_template(terms_and_conditions.terms, doc)
|
||||
|
||||
@@ -36,4 +36,4 @@ cur_frm.fields_dict['parent_territory'].get_query = function(doc,cdt,cdn) {
|
||||
['Territory', 'name', '!=', doc.territory_name]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,4 +24,4 @@ class Territory(NestedSet):
|
||||
self.validate_one_root()
|
||||
|
||||
def on_doctype_update():
|
||||
frappe.db.add_index("Territory", ["lft", "rgt"])
|
||||
frappe.db.add_index("Territory", ["lft", "rgt"])
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
frappe.treeview_settings["Territory"] = {
|
||||
ignore_fields:["parent_territory"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class TestTransactionDeletionRecord(unittest.TestCase):
|
||||
contains_company = True
|
||||
break
|
||||
self.assertTrue(contains_company)
|
||||
|
||||
|
||||
def test_no_of_docs_is_correct(self):
|
||||
for i in range(5):
|
||||
create_task('Dunder Mifflin Paper Co')
|
||||
@@ -40,13 +40,13 @@ class TestTransactionDeletionRecord(unittest.TestCase):
|
||||
'company' : 'Dunder Mifflin Paper Co'
|
||||
})
|
||||
self.assertEqual(tasks_containing_company, [])
|
||||
|
||||
|
||||
def create_company(company_name):
|
||||
company = frappe.get_doc({
|
||||
'doctype': 'Company',
|
||||
'company_name': company_name,
|
||||
'default_currency': 'INR'
|
||||
})
|
||||
})
|
||||
company.insert(ignore_if_duplicate = True)
|
||||
|
||||
def create_transaction_deletion_request(company):
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
frappe.ui.form.on('Transaction Deletion Record', {
|
||||
onload: function(frm) {
|
||||
if (frm.doc.docstatus == 0) {
|
||||
let doctypes_to_be_ignored_array;
|
||||
let doctypes_to_be_ignored_array;
|
||||
frappe.call({
|
||||
method: 'erpnext.setup.doctype.transaction_deletion_record.transaction_deletion_record.get_doctypes_to_be_ignored',
|
||||
callback: function(r) {
|
||||
@@ -25,15 +25,15 @@ frappe.ui.form.on('Transaction Deletion Record', {
|
||||
frm.fields_dict['doctypes_to_be_ignored'].grid.set_column_disp('no_of_docs', false);
|
||||
frm.refresh_field('doctypes_to_be_ignored');
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
function populate_doctypes_to_be_ignored(doctypes_to_be_ignored_array, frm) {
|
||||
if (!(frm.doc.doctypes_to_be_ignored)) {
|
||||
var i;
|
||||
for (i = 0; i < doctypes_to_be_ignored_array.length; i++) {
|
||||
for (i = 0; i < doctypes_to_be_ignored_array.length; i++) {
|
||||
frm.add_child('doctypes_to_be_ignored', {
|
||||
doctype_name: doctypes_to_be_ignored_array[i]
|
||||
doctype_name: doctypes_to_be_ignored_array[i]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class TransactionDeletionRecord(Document):
|
||||
clear_notifications()
|
||||
self.delete_company_transactions()
|
||||
|
||||
def populate_doctypes_to_be_ignored_table(self):
|
||||
def populate_doctypes_to_be_ignored_table(self):
|
||||
doctypes_to_be_ignored_list = get_doctypes_to_be_ignored()
|
||||
for doctype in doctypes_to_be_ignored_list:
|
||||
self.append('doctypes_to_be_ignored', {
|
||||
@@ -74,7 +74,7 @@ class TransactionDeletionRecord(Document):
|
||||
doctypes_to_be_ignored_list = self.get_doctypes_to_be_ignored_list()
|
||||
docfields = self.get_doctypes_with_company_field(doctypes_to_be_ignored_list)
|
||||
|
||||
tables = self.get_all_child_doctypes()
|
||||
tables = self.get_all_child_doctypes()
|
||||
for docfield in docfields:
|
||||
if docfield['parent'] != self.doctype:
|
||||
no_of_docs = self.get_number_of_docs_linked_with_specified_company(docfield['parent'], docfield['fieldname'])
|
||||
@@ -90,7 +90,7 @@ class TransactionDeletionRecord(Document):
|
||||
naming_series = frappe.db.get_value('DocType', docfield['parent'], 'autoname')
|
||||
if naming_series:
|
||||
if '#' in naming_series:
|
||||
self.update_naming_series(naming_series, docfield['parent'])
|
||||
self.update_naming_series(naming_series, docfield['parent'])
|
||||
|
||||
def get_doctypes_to_be_ignored_list(self):
|
||||
singles = frappe.get_all('DocType', filters = {'issingle': 1}, pluck = 'name')
|
||||
@@ -101,9 +101,9 @@ class TransactionDeletionRecord(Document):
|
||||
return doctypes_to_be_ignored_list
|
||||
|
||||
def get_doctypes_with_company_field(self, doctypes_to_be_ignored_list):
|
||||
docfields = frappe.get_all('DocField',
|
||||
docfields = frappe.get_all('DocField',
|
||||
filters = {
|
||||
'fieldtype': 'Link',
|
||||
'fieldtype': 'Link',
|
||||
'options': 'Company',
|
||||
'parent': ['not in', doctypes_to_be_ignored_list]},
|
||||
fields=['parent', 'fieldname'])
|
||||
@@ -121,7 +121,7 @@ class TransactionDeletionRecord(Document):
|
||||
self.append('doctypes', {
|
||||
'doctype_name' : doctype,
|
||||
'no_of_docs' : no_of_docs
|
||||
})
|
||||
})
|
||||
|
||||
def delete_child_tables(self, doctype, company_fieldname):
|
||||
parent_docs_to_be_deleted = frappe.get_all(doctype, {
|
||||
@@ -129,7 +129,7 @@ class TransactionDeletionRecord(Document):
|
||||
}, pluck = 'name')
|
||||
|
||||
child_tables = frappe.get_all('DocField', filters = {
|
||||
'fieldtype': 'Table',
|
||||
'fieldtype': 'Table',
|
||||
'parent': doctype
|
||||
}, pluck = 'options')
|
||||
|
||||
|
||||
@@ -9,4 +9,4 @@ frappe.listview_settings['Transaction Deletion Record'] = {
|
||||
return [__("Completed"), "green"];
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
|
||||
|
||||
|
||||
//--------- ONLOAD -------------
|
||||
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,4 +7,4 @@ import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class UOM(Document):
|
||||
pass
|
||||
pass
|
||||
|
||||
@@ -9,4 +9,4 @@ import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class WebsiteItemGroup(Document):
|
||||
pass
|
||||
pass
|
||||
|
||||
@@ -173,4 +173,4 @@ def test_sample():
|
||||
frappe.db.sql('delete from tabProject')
|
||||
frappe.db.sql('delete from tabTask')
|
||||
make_projects('Education')
|
||||
import_notification()
|
||||
import_notification()
|
||||
|
||||
@@ -145,7 +145,7 @@ def make_taxes_and_charges_template(company_name, doctype, template):
|
||||
|
||||
doc = frappe.get_doc(template)
|
||||
|
||||
# Data in country wise json is already pre validated, hence validations can be ignored
|
||||
# Data in country wise json is already pre validated, hence validations can be ignored
|
||||
# Ingone validations to make doctypes faster
|
||||
doc.flags.ignore_links = True
|
||||
doc.flags.ignore_validate = True
|
||||
@@ -177,7 +177,7 @@ def make_item_tax_template(company_name, template):
|
||||
|
||||
doc = frappe.get_doc(template)
|
||||
|
||||
# Data in country wise json is already pre validated, hence validations can be ignored
|
||||
# Data in country wise json is already pre validated, hence validations can be ignored
|
||||
# Ingone validations to make doctypes faster
|
||||
doc.flags.ignore_links = True
|
||||
doc.flags.ignore_validate = True
|
||||
|
||||
Reference in New Issue
Block a user