Merge pull request #29131 from ankush/serial_no_patch
fix(patch): serial no whitespace trimming
diff --git a/.github/workflows/docs-checker.yml b/.github/workflows/docs-checker.yml
index db46c56..b644568 100644
--- a/.github/workflows/docs-checker.yml
+++ b/.github/workflows/docs-checker.yml
@@ -12,7 +12,7 @@
- name: 'Setup Environment'
uses: actions/setup-python@v2
with:
- python-version: 3.6
+ python-version: 3.8
- name: 'Clone repo'
uses: actions/checkout@v2
diff --git a/.github/workflows/patch.yml b/.github/workflows/patch.yml
index 33a28ac..d05bbbe 100644
--- a/.github/workflows/patch.yml
+++ b/.github/workflows/patch.yml
@@ -34,7 +34,7 @@
- name: Setup Python
uses: actions/setup-python@v2
with:
- python-version: 3.7
+ python-version: 3.8
- name: Setup Node
uses: actions/setup-node@v2
diff --git a/.github/workflows/server-tests-mariadb.yml b/.github/workflows/server-tests-mariadb.yml
index 186f95e..7347a58 100644
--- a/.github/workflows/server-tests-mariadb.yml
+++ b/.github/workflows/server-tests-mariadb.yml
@@ -46,7 +46,7 @@
- name: Setup Python
uses: actions/setup-python@v2
with:
- python-version: 3.7
+ python-version: 3.8
- name: Setup Node
uses: actions/setup-node@v2
diff --git a/.github/workflows/server-tests-postgres.yml b/.github/workflows/server-tests-postgres.yml
index 3bbf6a9..77d3c1a 100644
--- a/.github/workflows/server-tests-postgres.yml
+++ b/.github/workflows/server-tests-postgres.yml
@@ -46,7 +46,7 @@
- name: Setup Python
uses: actions/setup-python@v2
with:
- python-version: 3.7
+ python-version: 3.8
- name: Setup Node
uses: actions/setup-node@v2
diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml
index d765f04..ab6a53b 100644
--- a/.github/workflows/ui-tests.yml
+++ b/.github/workflows/ui-tests.yml
@@ -36,7 +36,7 @@
- name: Setup Python
uses: actions/setup-python@v2
with:
- python-version: 3.7
+ python-version: 3.8
- uses: actions/setup-node@v2
with:
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index 545abf7..5062c1c 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -651,7 +651,7 @@
"hide_seconds": 1,
"label": "Ignore Pricing Rule",
"no_copy": 1,
- "permlevel": 1,
+ "permlevel": 0,
"print_hide": 1
},
{
@@ -2038,7 +2038,7 @@
"link_fieldname": "consolidated_invoice"
}
],
- "modified": "2021-10-21 20:19:38.667508",
+ "modified": "2021-12-23 20:19:38.667508",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py
index 385c8b2..7303bf5 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.py
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@ -547,10 +547,7 @@
"fieldname": "balance",
"fieldtype": "Float",
"width": 130
- }
- ]
-
- columns.extend([
+ },
{
"label": _("Voucher Type"),
"fieldname": "voucher_type",
@@ -584,7 +581,7 @@
"fieldname": "project",
"width": 100
}
- ])
+ ]
if filters.get("include_dimensions"):
for dim in get_accounting_dimensions(as_list = False):
diff --git a/erpnext/accounts/test/test_reports.py b/erpnext/accounts/test/test_reports.py
new file mode 100644
index 0000000..78c109a
--- /dev/null
+++ b/erpnext/accounts/test/test_reports.py
@@ -0,0 +1,48 @@
+import unittest
+from typing import List, Tuple
+
+from erpnext.tests.utils import ReportFilters, ReportName, execute_script_report
+
+DEFAULT_FILTERS = {
+ "company": "_Test Company",
+ "from_date": "2010-01-01",
+ "to_date": "2030-01-01",
+ "period_start_date": "2010-01-01",
+ "period_end_date": "2030-01-01"
+}
+
+
+REPORT_FILTER_TEST_CASES: List[Tuple[ReportName, ReportFilters]] = [
+ ("General Ledger", {"group_by": "Group by Voucher (Consolidated)"} ),
+ ("General Ledger", {"group_by": "Group by Voucher (Consolidated)", "include_dimensions": 1} ),
+ ("Accounts Payable", {"range1": 30, "range2": 60, "range3": 90, "range4": 120}),
+ ("Accounts Receivable", {"range1": 30, "range2": 60, "range3": 90, "range4": 120}),
+ ("Consolidated Financial Statement", {"report": "Balance Sheet"} ),
+ ("Consolidated Financial Statement", {"report": "Profit and Loss Statement"} ),
+ ("Consolidated Financial Statement", {"report": "Cash Flow"} ),
+ ("Gross Profit", {"group_by": "Invoice"}),
+ ("Gross Profit", {"group_by": "Item Code"}),
+ ("Gross Profit", {"group_by": "Item Group"}),
+ ("Gross Profit", {"group_by": "Customer"}),
+ ("Gross Profit", {"group_by": "Customer Group"}),
+ ("Item-wise Sales Register", {}),
+ ("Item-wise Purchase Register", {}),
+ ("Sales Register", {}),
+ ("Purchase Register", {}),
+ ("Tax Detail", {"mode": "run", "report_name": "Tax Detail"},),
+]
+
+OPTIONAL_FILTERS = {}
+
+
+class TestReports(unittest.TestCase):
+ def test_execute_all_accounts_reports(self):
+ """Test that all script report in stock modules are executable with supported filters"""
+ for report, filter in REPORT_FILTER_TEST_CASES:
+ execute_script_report(
+ report_name=report,
+ module="Accounts",
+ filters=filter,
+ default_filters=DEFAULT_FILTERS,
+ optional_filters=OPTIONAL_FILTERS if filter.get("_optional") else None,
+ )
diff --git a/erpnext/tests/utils.py b/erpnext/tests/utils.py
index fbf2594..bc9f04e 100644
--- a/erpnext/tests/utils.py
+++ b/erpnext/tests/utils.py
@@ -125,17 +125,23 @@
if default_filters is None:
default_filters = {}
+ test_filters = []
report_execute_fn = frappe.get_attr(get_report_module_dotted_path(module, report_name) + ".execute")
report_filters = frappe._dict(default_filters).copy().update(filters)
- report_data = report_execute_fn(report_filters)
+ test_filters.append(report_filters)
if optional_filters:
for key, value in optional_filters.items():
- filter_with_optional_param = report_filters.copy().update({key: value})
- report_execute_fn(filter_with_optional_param)
+ test_filters.append(report_filters.copy().update({key: value}))
- return report_data
+ for test_filter in test_filters:
+ try:
+ report_execute_fn(test_filter)
+ except Exception:
+ print(f"Report failed to execute with filters: {test_filter}")
+ raise
+
def timeout(seconds=30, error_message="Test timed out."):
diff --git a/requirements.txt b/requirements.txt
index faefb77..f447fac 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,6 @@
# frappe # https://github.com/frappe/frappe is installed during bench-init
gocardless-pro~=1.22.0
-googlemaps # used in ERPNext, but dependency is defined in Frappe
+googlemaps
pandas~=1.1.5
plaid-python~=7.2.1
pycountry~=20.7.3