Merge pull request #31454 from gavindsouza/mariadb-client-refactor
fix: Misc enhancements
This commit is contained in:
commit
7b90986eb0
7
.github/helper/install.sh
vendored
7
.github/helper/install.sh
vendored
@ -2,13 +2,6 @@
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
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
|
||||
uses: "gabrielfalcao/pyenv-action@v9"
|
||||
with:
|
||||
|
8
.github/workflows/server-tests-mariadb.yml
vendored
8
.github/workflows/server-tests-mariadb.yml
vendored
@ -61,6 +61,14 @@ jobs:
|
||||
with:
|
||||
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
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
|
9
.github/workflows/server-tests-postgres.yml
vendored
9
.github/workflows/server-tests-postgres.yml
vendored
@ -48,6 +48,14 @@ jobs:
|
||||
with:
|
||||
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
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
@ -90,7 +98,6 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
|
||||
- name: Install
|
||||
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
|
||||
env:
|
||||
|
@ -114,7 +114,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
|
||||
(pcv.name),
|
||||
)
|
||||
|
||||
self.assertEqual(pcv_gle, expected_gle)
|
||||
self.assertSequenceEqual(pcv_gle, expected_gle)
|
||||
|
||||
pcv.reload()
|
||||
pcv.cancel()
|
||||
@ -175,7 +175,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
|
||||
(pcv.name),
|
||||
)
|
||||
|
||||
self.assertEqual(pcv_gle, expected_gle)
|
||||
self.assertSequenceEqual(pcv_gle, expected_gle)
|
||||
|
||||
def make_period_closing_voucher(self, submit=True):
|
||||
surplus_account = create_account()
|
||||
|
@ -133,7 +133,7 @@ class TestAsset(AssetSetup):
|
||||
order by account""",
|
||||
pi.name,
|
||||
)
|
||||
self.assertEqual(gle, expected_gle)
|
||||
self.assertSequenceEqual(gle, expected_gle)
|
||||
|
||||
pi.cancel()
|
||||
asset.cancel()
|
||||
@ -208,7 +208,7 @@ class TestAsset(AssetSetup):
|
||||
order by account""",
|
||||
asset.journal_entry_for_scrap,
|
||||
)
|
||||
self.assertEqual(gle, expected_gle)
|
||||
self.assertSequenceEqual(gle, expected_gle)
|
||||
|
||||
restore_asset(asset.name)
|
||||
|
||||
@ -253,7 +253,7 @@ class TestAsset(AssetSetup):
|
||||
si.name,
|
||||
)
|
||||
|
||||
self.assertEqual(gle, expected_gle)
|
||||
self.assertSequenceEqual(gle, expected_gle)
|
||||
|
||||
si.cancel()
|
||||
self.assertEqual(frappe.db.get_value("Asset", asset.name, "status"), "Partially Depreciated")
|
||||
@ -361,7 +361,7 @@ class TestAsset(AssetSetup):
|
||||
pr.name,
|
||||
)
|
||||
|
||||
self.assertEqual(pr_gle, expected_gle)
|
||||
self.assertSequenceEqual(pr_gle, expected_gle)
|
||||
|
||||
pi = make_invoice(pr.name)
|
||||
pi.submit()
|
||||
@ -381,7 +381,7 @@ class TestAsset(AssetSetup):
|
||||
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")
|
||||
|
||||
@ -414,7 +414,7 @@ class TestAsset(AssetSetup):
|
||||
asset_doc.name,
|
||||
)
|
||||
|
||||
self.assertEqual(gle, expected_gle)
|
||||
self.assertSequenceEqual(gle, expected_gle)
|
||||
|
||||
def test_asset_cwip_toggling_cases(self):
|
||||
cwip = frappe.db.get_value("Asset Category", "Computers", "enable_cwip_accounting")
|
||||
@ -1287,7 +1287,7 @@ class TestDepreciationBasics(AssetSetup):
|
||||
asset.name,
|
||||
)
|
||||
|
||||
self.assertEqual(gle, expected_gle)
|
||||
self.assertSequenceEqual(gle, expected_gle)
|
||||
self.assertEqual(asset.get("value_after_depreciation"), 0)
|
||||
|
||||
def test_expected_value_change(self):
|
||||
|
@ -91,7 +91,7 @@ class TestAssetValueAdjustment(unittest.TestCase):
|
||||
adj_doc.journal_entry,
|
||||
)
|
||||
|
||||
self.assertEqual(gle, expected_gle)
|
||||
self.assertSequenceEqual(gle, expected_gle)
|
||||
|
||||
|
||||
def make_asset_value_adjustment(**args):
|
||||
|
@ -30,18 +30,20 @@ class GlobalDefaults(Document):
|
||||
frappe.db.set_default(key, self.get(keydict[key], ""))
|
||||
|
||||
# update year start date and year end date from fiscal_year
|
||||
year_start_end_date = frappe.db.sql(
|
||||
"""select year_start_date, year_end_date
|
||||
from `tabFiscal Year` where name=%s""",
|
||||
self.current_fiscal_year,
|
||||
)
|
||||
if year_start_end_date:
|
||||
ysd = year_start_end_date[0][0] or ""
|
||||
yed = year_start_end_date[0][1] or ""
|
||||
if self.current_fiscal_year:
|
||||
if fiscal_year := frappe.get_all(
|
||||
"Fiscal Year",
|
||||
filters={"name": self.current_fiscal_year},
|
||||
fields=["year_start_date", "year_end_date"],
|
||||
limit=1,
|
||||
order_by=None,
|
||||
):
|
||||
ysd = fiscal_year[0].year_start_date or ""
|
||||
yed = fiscal_year[0].year_end_date or ""
|
||||
|
||||
if ysd and yed:
|
||||
frappe.db.set_default("year_start_date", ysd.strftime("%Y-%m-%d"))
|
||||
frappe.db.set_default("year_end_date", yed.strftime("%Y-%m-%d"))
|
||||
if ysd and yed:
|
||||
frappe.db.set_default("year_start_date", ysd.strftime("%Y-%m-%d"))
|
||||
frappe.db.set_default("year_end_date", yed.strftime("%Y-%m-%d"))
|
||||
|
||||
# enable default currency
|
||||
if self.default_currency:
|
||||
@ -50,7 +52,6 @@ class GlobalDefaults(Document):
|
||||
self.toggle_rounded_total()
|
||||
self.toggle_in_words()
|
||||
|
||||
# clear cache
|
||||
frappe.clear_cache()
|
||||
|
||||
@frappe.whitelist()
|
||||
|
Loading…
x
Reference in New Issue
Block a user