Skip to content

Commit

Permalink
Merge pull request #2587 from resilient-tech/version-14-hotfix
Browse files Browse the repository at this point in the history
chore: release v14
  • Loading branch information
vorasmit committed Aug 30, 2024
2 parents 7778f25 + da29fa2 commit 1d9af68
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 19 deletions.
15 changes: 0 additions & 15 deletions india_compliance/gst_india/constants/custom_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,21 +543,6 @@
),
"translatable": 0,
},
{
"fieldname": "reason_for_issuing_document",
"label": "Reason For Issuing Document",
"fieldtype": "Select",
"insert_after": "return_against",
"print_hide": 1,
"depends_on": "eval:doc.is_return == 1",
"length": 45,
"options": (
"\n01-Sales Return\n02-Post Sale Discount\n03-Deficiency in"
" services\n04-Correction in Invoice\n05-Change in POS\n06-Finalization"
" of Provisional assessment\n07-Others"
),
"translatable": 0,
},
],
(
"Sales Taxes and Charges",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def test_advance_payment_entry_with_returns(self):
is_in_state=1,
is_return=1,
qty=-1,
reason_for_issuing_document="01-Sales Return",
return_against=invoice_doc.name,
)

Expand Down
1 change: 0 additions & 1 deletion india_compliance/gst_india/report/gstr_1/gstr_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def __init__(self, filters=None):
port_code,
shipping_bill_number,
shipping_bill_date,
reason_for_issuing_document,
company_gstin,
(
CASE
Expand Down
2 changes: 1 addition & 1 deletion india_compliance/income_tax_india/overrides/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def get_wdv_or_dd_depr_amount(
flt(fb_row.rate_of_depreciation) / 100
)
# if leap year, then consider 366 days
if cint(schedule_date.year) % 4 == 0:
if cint(schedule_date.year) % 4 == 0 and fb_row.daily_prorata_based:
depreciation_amount = depreciation_amount * 366 / 365
elif fb_row.frequency_of_depreciation == 1:
if fb_row.daily_prorata_based:
Expand Down
2 changes: 1 addition & 1 deletion india_compliance/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ india_compliance.patches.v14.set_default_for_overridden_accounts_setting
execute:from india_compliance.gst_india.setup import create_custom_fields; create_custom_fields() #51
execute:from india_compliance.gst_india.setup import create_property_setters; create_property_setters() #7
execute:from india_compliance.income_tax_india.setup import create_custom_fields; create_custom_fields() #1
india_compliance.patches.post_install.remove_old_fields #1
india_compliance.patches.post_install.remove_old_fields #2
india_compliance.patches.post_install.set_gst_tax_type
india_compliance.patches.post_install.set_gst_tax_type_in_journal_entry
india_compliance.patches.post_install.update_company_gstin
Expand Down
1 change: 1 addition & 0 deletions india_compliance/patches/post_install/remove_old_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def execute():
delete_old_fields("pan_details", "Company")
delete_old_fields("export_type", ("Customer", "Supplier"))
delete_old_fields("company_address", "Journal Entry")
delete_old_fields("reason_for_issuing_document", "Sales Invoice")

# Field renamed post release
delete_old_fields(
Expand Down
34 changes: 34 additions & 0 deletions india_compliance/test_patches.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import frappe
from frappe.modules.patch_handler import get_patches_from_app
from frappe.tests.utils import FrappeTestCase

from india_compliance.install import POST_INSTALL_PATCHES


class TestPatches(FrappeTestCase):
def test_post_install_patch_exists(self):
for patch in POST_INSTALL_PATCHES:
self.assertTrue(
frappe.get_attr(
f"india_compliance.patches.post_install.{patch}.execute"
)
)

def test_patches_exists(self):
patches = get_patches_from_app("india_compliance")

for patch in patches:
if patch.startswith("execute:"):
import_path = patch.split("execute:")[1]

if not import_path.startswith("from"):
continue

components = import_path.split("from")[1].split()
module = components[0]
function_name = components[2].replace(";", "").replace(",", "")
patch_path = module + "." + function_name
else:
patch_path = f"{patch.split(maxsplit=1)[0]}.execute"

frappe.get_attr(patch_path)

0 comments on commit 1d9af68

Please sign in to comment.