mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 19:29:10 +00:00
Merge pull request #31454 from gavindsouza/mariadb-client-refactor
fix: Misc enhancements
This commit is contained in:
7
.github/helper/install.sh
vendored
7
.github/helper/install.sh
vendored
@@ -2,13 +2,6 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Check for merge conflicts before proceeding
|
|
||||||
python -m compileall -f "${GITHUB_WORKSPACE}"
|
|
||||||
if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
|
|
||||||
then echo "Found merge conflicts"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd ~ || exit
|
cd ~ || exit
|
||||||
|
|
||||||
sudo apt update && sudo apt install redis-server libcups2-dev
|
sudo apt update && sudo apt install redis-server libcups2-dev
|
||||||
|
|||||||
8
.github/workflows/patch.yml
vendored
8
.github/workflows/patch.yml
vendored
@@ -34,6 +34,14 @@ jobs:
|
|||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Check for valid Python & Merge Conflicts
|
||||||
|
run: |
|
||||||
|
python -m compileall -f "${GITHUB_WORKSPACE}"
|
||||||
|
if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
|
||||||
|
then echo "Found merge conflicts"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: "gabrielfalcao/pyenv-action@v9"
|
uses: "gabrielfalcao/pyenv-action@v9"
|
||||||
with:
|
with:
|
||||||
|
|||||||
8
.github/workflows/server-tests-mariadb.yml
vendored
8
.github/workflows/server-tests-mariadb.yml
vendored
@@ -61,6 +61,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: '3.10'
|
||||||
|
|
||||||
|
- name: Check for valid Python & Merge Conflicts
|
||||||
|
run: |
|
||||||
|
python -m compileall -f "${GITHUB_WORKSPACE}"
|
||||||
|
if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
|
||||||
|
then echo "Found merge conflicts"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
9
.github/workflows/server-tests-postgres.yml
vendored
9
.github/workflows/server-tests-postgres.yml
vendored
@@ -48,6 +48,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: '3.10'
|
||||||
|
|
||||||
|
- name: Check for valid Python & Merge Conflicts
|
||||||
|
run: |
|
||||||
|
python -m compileall -f "${GITHUB_WORKSPACE}"
|
||||||
|
if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
|
||||||
|
then echo "Found merge conflicts"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
@@ -90,7 +98,6 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-yarn-
|
${{ runner.os }}-yarn-
|
||||||
|
|
||||||
|
|
||||||
- name: Install
|
- name: Install
|
||||||
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
|
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
|
|||||||
(pcv.name),
|
(pcv.name),
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(pcv_gle, expected_gle)
|
self.assertSequenceEqual(pcv_gle, expected_gle)
|
||||||
|
|
||||||
pcv.reload()
|
pcv.reload()
|
||||||
pcv.cancel()
|
pcv.cancel()
|
||||||
@@ -175,7 +175,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
|
|||||||
(pcv.name),
|
(pcv.name),
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(pcv_gle, expected_gle)
|
self.assertSequenceEqual(pcv_gle, expected_gle)
|
||||||
|
|
||||||
def make_period_closing_voucher(self, submit=True):
|
def make_period_closing_voucher(self, submit=True):
|
||||||
surplus_account = create_account()
|
surplus_account = create_account()
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ class TestAsset(AssetSetup):
|
|||||||
order by account""",
|
order by account""",
|
||||||
pi.name,
|
pi.name,
|
||||||
)
|
)
|
||||||
self.assertEqual(gle, expected_gle)
|
self.assertSequenceEqual(gle, expected_gle)
|
||||||
|
|
||||||
pi.cancel()
|
pi.cancel()
|
||||||
asset.cancel()
|
asset.cancel()
|
||||||
@@ -208,7 +208,7 @@ class TestAsset(AssetSetup):
|
|||||||
order by account""",
|
order by account""",
|
||||||
asset.journal_entry_for_scrap,
|
asset.journal_entry_for_scrap,
|
||||||
)
|
)
|
||||||
self.assertEqual(gle, expected_gle)
|
self.assertSequenceEqual(gle, expected_gle)
|
||||||
|
|
||||||
restore_asset(asset.name)
|
restore_asset(asset.name)
|
||||||
|
|
||||||
@@ -253,7 +253,7 @@ class TestAsset(AssetSetup):
|
|||||||
si.name,
|
si.name,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(gle, expected_gle)
|
self.assertSequenceEqual(gle, expected_gle)
|
||||||
|
|
||||||
si.cancel()
|
si.cancel()
|
||||||
self.assertEqual(frappe.db.get_value("Asset", asset.name, "status"), "Partially Depreciated")
|
self.assertEqual(frappe.db.get_value("Asset", asset.name, "status"), "Partially Depreciated")
|
||||||
@@ -361,7 +361,7 @@ class TestAsset(AssetSetup):
|
|||||||
pr.name,
|
pr.name,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(pr_gle, expected_gle)
|
self.assertSequenceEqual(pr_gle, expected_gle)
|
||||||
|
|
||||||
pi = make_invoice(pr.name)
|
pi = make_invoice(pr.name)
|
||||||
pi.submit()
|
pi.submit()
|
||||||
@@ -381,7 +381,7 @@ class TestAsset(AssetSetup):
|
|||||||
pi.name,
|
pi.name,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(pi_gle, expected_gle)
|
self.assertSequenceEqual(pi_gle, expected_gle)
|
||||||
|
|
||||||
asset = frappe.db.get_value("Asset", {"purchase_receipt": pr.name, "docstatus": 0}, "name")
|
asset = frappe.db.get_value("Asset", {"purchase_receipt": pr.name, "docstatus": 0}, "name")
|
||||||
|
|
||||||
@@ -414,7 +414,7 @@ class TestAsset(AssetSetup):
|
|||||||
asset_doc.name,
|
asset_doc.name,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(gle, expected_gle)
|
self.assertSequenceEqual(gle, expected_gle)
|
||||||
|
|
||||||
def test_asset_cwip_toggling_cases(self):
|
def test_asset_cwip_toggling_cases(self):
|
||||||
cwip = frappe.db.get_value("Asset Category", "Computers", "enable_cwip_accounting")
|
cwip = frappe.db.get_value("Asset Category", "Computers", "enable_cwip_accounting")
|
||||||
@@ -1287,7 +1287,7 @@ class TestDepreciationBasics(AssetSetup):
|
|||||||
asset.name,
|
asset.name,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(gle, expected_gle)
|
self.assertSequenceEqual(gle, expected_gle)
|
||||||
self.assertEqual(asset.get("value_after_depreciation"), 0)
|
self.assertEqual(asset.get("value_after_depreciation"), 0)
|
||||||
|
|
||||||
def test_expected_value_change(self):
|
def test_expected_value_change(self):
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class TestAssetValueAdjustment(unittest.TestCase):
|
|||||||
adj_doc.journal_entry,
|
adj_doc.journal_entry,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(gle, expected_gle)
|
self.assertSequenceEqual(gle, expected_gle)
|
||||||
|
|
||||||
|
|
||||||
def make_asset_value_adjustment(**args):
|
def make_asset_value_adjustment(**args):
|
||||||
|
|||||||
@@ -30,18 +30,20 @@ class GlobalDefaults(Document):
|
|||||||
frappe.db.set_default(key, self.get(keydict[key], ""))
|
frappe.db.set_default(key, self.get(keydict[key], ""))
|
||||||
|
|
||||||
# update year start date and year end date from fiscal_year
|
# update year start date and year end date from fiscal_year
|
||||||
year_start_end_date = frappe.db.sql(
|
if self.current_fiscal_year:
|
||||||
"""select year_start_date, year_end_date
|
if fiscal_year := frappe.get_all(
|
||||||
from `tabFiscal Year` where name=%s""",
|
"Fiscal Year",
|
||||||
self.current_fiscal_year,
|
filters={"name": self.current_fiscal_year},
|
||||||
)
|
fields=["year_start_date", "year_end_date"],
|
||||||
if year_start_end_date:
|
limit=1,
|
||||||
ysd = year_start_end_date[0][0] or ""
|
order_by=None,
|
||||||
yed = year_start_end_date[0][1] or ""
|
):
|
||||||
|
ysd = fiscal_year[0].year_start_date or ""
|
||||||
|
yed = fiscal_year[0].year_end_date or ""
|
||||||
|
|
||||||
if ysd and yed:
|
if ysd and yed:
|
||||||
frappe.db.set_default("year_start_date", ysd.strftime("%Y-%m-%d"))
|
frappe.db.set_default("year_start_date", ysd.strftime("%Y-%m-%d"))
|
||||||
frappe.db.set_default("year_end_date", yed.strftime("%Y-%m-%d"))
|
frappe.db.set_default("year_end_date", yed.strftime("%Y-%m-%d"))
|
||||||
|
|
||||||
# enable default currency
|
# enable default currency
|
||||||
if self.default_currency:
|
if self.default_currency:
|
||||||
@@ -50,7 +52,6 @@ class GlobalDefaults(Document):
|
|||||||
self.toggle_rounded_total()
|
self.toggle_rounded_total()
|
||||||
self.toggle_in_words()
|
self.toggle_in_words()
|
||||||
|
|
||||||
# clear cache
|
|
||||||
frappe.clear_cache()
|
frappe.clear_cache()
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
|
|||||||
Reference in New Issue
Block a user