fix: Missing commits from hotfix branch (#17997)

* fix: merge conflict

* fix: restored missing set_gst_state_and_state_number function

* fix: style linting as per codacy

* fix: Fixes related to customer/lead merging

* fix: merge conflict

* fix: Fixes related to customer/lead merging

* fix: Assign isue/opportunity to user

* fix: Assign isue/opportunity to user

* fix: Replaced Invoice type by GST Category

* fix: merge conflict

* fix: merge conflict

* fix: test cases

* fix: test cases
This commit is contained in:
Nabin Hait
2019-07-03 10:34:31 +05:30
committed by GitHub
parent 7763d0a059
commit 34c551d9a5
194 changed files with 34197 additions and 21884 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -252,7 +252,7 @@ class Company(NestedSet):
def set_mode_of_payment_account(self):
cash = frappe.db.get_value('Mode of Payment', {'type': 'Cash'}, 'name')
if cash and self.default_cash_account \
and not frappe.db.get_value('Mode of Payment Account', {'company': self.name}):
and not frappe.db.get_value('Mode of Payment Account', {'company': self.name, 'parent': 'Cash'}):
mode_of_payment = frappe.get_doc('Mode of Payment', cash)
mode_of_payment.append('accounts', {
'company': self.name,

View File

@@ -4,6 +4,8 @@ from __future__ import unicode_literals
import frappe
import unittest
import json
from frappe import _
from frappe.utils import random_string
from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import get_charts_for_country
@@ -78,7 +80,10 @@ class TestCompany(unittest.TestCase):
if account_type in ["Bank", "Cash"]:
filters["is_group"] = 1
self.assertTrue(frappe.get_all("Account", filters))
has_matching_accounts = frappe.get_all("Account", filters)
error_message = _("No Account matched these filters: {}".format(json.dumps(filters)))
self.assertTrue(has_matching_accounts, msg=error_message)
finally:
self.delete_mode_of_payment(template)
frappe.delete_doc("Company", template)

View File

@@ -69,7 +69,8 @@ class ItemGroup(NestedSet, WebsiteGenerator):
"items": get_product_list_for_group(product_group = self.name, start=start,
limit=context.page_length + 1, search=frappe.form_dict.get("search")),
"parents": get_parent_item_groups(self.parent_item_group),
"title": self.name
"title": self.name,
"products_as_list": cint(frappe.db.get_single_value('Products Settings', 'products_as_list'))
})
if self.slideshow:

View File

@@ -33,7 +33,7 @@ def make_sample_data(domains, make_dependent = False):
def make_opportunity(items, customer):
b = frappe.get_doc({
"doctype": "Opportunity",
"enquiry_from": "Customer",
"opportunity_from": "Customer",
"customer": customer,
"opportunity_type": _("Sales"),
"with_items": 1
@@ -52,7 +52,7 @@ def make_quote(items, customer):
qtn = frappe.get_doc({
"doctype": "Quotation",
"quotation_to": "Customer",
"customer": customer,
"party_name": customer,
"order_type": "Sales"
})