mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 20:59:11 +00:00
Merge branch 'develop' into payment-terms
This commit is contained in:
@@ -96,6 +96,7 @@ erpnext.company.set_chart_of_accounts_options = function(doc) {
|
||||
method: "erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts.get_charts_for_country",
|
||||
args: {
|
||||
"country": doc.country,
|
||||
"with_standard": true
|
||||
},
|
||||
callback: function(r) {
|
||||
if(!r.exc) {
|
||||
|
||||
@@ -249,10 +249,10 @@ class Company(Document):
|
||||
frappe.db.sql("""delete from `tabWarehouse` where company=%s""", self.name)
|
||||
|
||||
frappe.defaults.clear_default("company", value=self.name)
|
||||
frappe.db.sql("delete from `tabMode of Payment Account` where company=%s", self.name)
|
||||
|
||||
# clear default accounts, warehouses from item
|
||||
if warehouses:
|
||||
|
||||
for f in ["default_warehouse", "website_warehouse"]:
|
||||
frappe.db.sql("""update tabItem set %s=NULL where %s in (%s)"""
|
||||
% (f, f, ', '.join(['%s']*len(warehouses))), tuple(warehouses))
|
||||
|
||||
@@ -57,7 +57,8 @@ class GlobalDefaults(Document):
|
||||
self.disable_rounded_total = cint(self.disable_rounded_total)
|
||||
|
||||
# Make property setters to hide rounded total fields
|
||||
for doctype in ("Quotation", "Sales Order", "Sales Invoice", "Delivery Note"):
|
||||
for doctype in ("Quotation", "Sales Order", "Sales Invoice", "Delivery Note",
|
||||
"Supplier Quotation", "Purchase Order"):
|
||||
make_property_setter(doctype, "base_rounded_total", "hidden", self.disable_rounded_total, "Check")
|
||||
make_property_setter(doctype, "base_rounded_total", "print_hide", 1, "Check")
|
||||
|
||||
@@ -69,6 +70,6 @@ class GlobalDefaults(Document):
|
||||
|
||||
# Make property setters to hide in words fields
|
||||
for doctype in ("Quotation", "Sales Order", "Sales Invoice", "Delivery Note",
|
||||
"Supplier Quotation", "Purchase Order", "Purchase Invoice", "Purchase Receipt"):
|
||||
"Supplier Quotation", "Purchase Order", "Purchase Invoice", "Purchase Receipt"):
|
||||
make_property_setter(doctype, "in_words", "hidden", self.disable_in_words, "Check")
|
||||
make_property_setter(doctype, "in_words", "print_hide", self.disable_in_words, "Check")
|
||||
|
||||
@@ -57,7 +57,7 @@ class ItemGroup(NestedSet, WebsiteGenerator):
|
||||
|
||||
def get_context(self, context):
|
||||
context.show_search=True
|
||||
context.page_length = 6
|
||||
context.page_length = cint(frappe.db.get_single_value('Products Settings', 'products_per_page')) or 6
|
||||
context.search_link = '/product_search'
|
||||
|
||||
start = int(frappe.form_dict.start or 0)
|
||||
@@ -81,24 +81,26 @@ def get_product_list_for_group(product_group=None, start=0, limit=10, search=Non
|
||||
child_groups = ", ".join(['"' + i[0] + '"' for i in get_child_groups(product_group)])
|
||||
|
||||
# base query
|
||||
query = """select name, item_name, item_code, route, image, website_image, thumbnail, item_group,
|
||||
description, web_long_description as website_description
|
||||
from `tabItem`
|
||||
where show_in_website = 1
|
||||
and disabled=0
|
||||
and (end_of_life is null or end_of_life='0000-00-00' or end_of_life > %(today)s)
|
||||
and (variant_of = '' or variant_of is null)
|
||||
and (item_group in ({child_groups})
|
||||
or name in (select parent from `tabWebsite Item Group` where item_group in ({child_groups})))
|
||||
query = """select I.name, I.item_name, I.item_code, I.route, I.image, I.website_image, I.thumbnail, I.item_group,
|
||||
I.description, I.web_long_description as website_description,
|
||||
case when (S.actual_qty - S.reserved_qty) > 0 then 1 else 0 end as in_stock
|
||||
from `tabItem` I
|
||||
left join tabBin S on I.item_code = S.item_code and I.website_warehouse = S.warehouse
|
||||
where I.show_in_website = 1
|
||||
and I.disabled = 0
|
||||
and (I.end_of_life is null or I.end_of_life='0000-00-00' or I.end_of_life > %(today)s)
|
||||
and (I.variant_of = '' or I.variant_of is null)
|
||||
and (I.item_group in ({child_groups})
|
||||
or I.name in (select parent from `tabWebsite Item Group` where item_group in ({child_groups})))
|
||||
""".format(child_groups=child_groups)
|
||||
# search term condition
|
||||
if search:
|
||||
query += """ and (web_long_description like %(search)s
|
||||
or item_name like %(search)s
|
||||
or name like %(search)s)"""
|
||||
query += """ and (I.web_long_description like %(search)s
|
||||
or I.item_name like %(search)s
|
||||
or I.name like %(search)s)"""
|
||||
search = "%" + cstr(search) + "%"
|
||||
|
||||
query += """order by weightage desc, item_name, modified desc limit %s, %s""" % (start, limit)
|
||||
query += """order by I.weightage desc, in_stock desc, I.item_name limit %s, %s""" % (start, limit)
|
||||
|
||||
data = frappe.db.sql(query, {"product_group": product_group,"search": search, "today": nowdate()}, as_dict=1)
|
||||
|
||||
|
||||
@@ -212,6 +212,11 @@ def install(country=None):
|
||||
{'doctype': "Party Type", "party_type": "Supplier"},
|
||||
{'doctype': "Party Type", "party_type": "Employee"},
|
||||
|
||||
{'doctype': "Opportunity Type", "name": "Hub"},
|
||||
{'doctype': "Opportunity Type", "name": _("Sales")},
|
||||
{'doctype': "Opportunity Type", "name": _("Support")},
|
||||
{'doctype': "Opportunity Type", "name": _("Maintenance")},
|
||||
|
||||
{'doctype': "Project Type", "project_type": "Internal"},
|
||||
{'doctype': "Project Type", "project_type": "External"},
|
||||
{'doctype': "Project Type", "project_type": "Other"},
|
||||
|
||||
@@ -38,7 +38,7 @@ def make_opportunity(items, customer):
|
||||
"doctype": "Opportunity",
|
||||
"enquiry_from": "Customer",
|
||||
"customer": customer,
|
||||
"enquiry_type": "Sales",
|
||||
"opportunity_type": _("Sales"),
|
||||
"with_items": 1
|
||||
})
|
||||
|
||||
|
||||
@@ -30,14 +30,14 @@ def run_setup_wizard_test():
|
||||
time.sleep(1)
|
||||
driver.click(".next-btn")
|
||||
|
||||
# Profile slide
|
||||
driver.set_field("full_name", "Great Tester")
|
||||
driver.set_field("email", "great@example.com")
|
||||
driver.set_field("password", "test")
|
||||
driver.wait_for_ajax(True)
|
||||
time.sleep(1)
|
||||
driver.click(".next-btn")
|
||||
time.sleep(1)
|
||||
# # Profile slide
|
||||
# driver.set_field("full_name", "Great Tester")
|
||||
# driver.set_field("email", "great@example.com")
|
||||
# driver.set_field("password", "test")
|
||||
# driver.wait_for_ajax(True)
|
||||
# time.sleep(1)
|
||||
# driver.click(".next-btn")
|
||||
# time.sleep(1)
|
||||
|
||||
# domain slide
|
||||
driver.set_select("domain", "Manufacturing")
|
||||
|
||||
@@ -41,7 +41,7 @@ def before_tests():
|
||||
"email" :"test@erpnext.com",
|
||||
"password" :"test",
|
||||
"chart_of_accounts" : "Standard",
|
||||
"domain" : "Manufacturing"
|
||||
"domain" : "Manufacturing",
|
||||
})
|
||||
|
||||
frappe.db.sql("delete from `tabLeave Allocation`")
|
||||
|
||||
Reference in New Issue
Block a user