Skip to content

Commit

Permalink
Merge pull request #1365 from resilient-tech/version-14-hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
vorasmit authored Nov 30, 2023
2 parents aadf82f + 55192f7 commit 49b9cfe
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 35 deletions.
30 changes: 0 additions & 30 deletions india_compliance/gst_india/constants/custom_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,36 +899,6 @@
"print_hide": 1,
"no_copy": 1,
},
{
"fieldname": "transporter_name",
"label": "Transporter Name",
"fieldtype": "Small Text",
"insert_after": "lr_no",
"fetch_from": "transporter.supplier_name",
"read_only": 1,
"print_hide": 1,
"no_copy": 1,
"translatable": 0,
},
{
"fieldname": "lr_no",
"label": "Transport Receipt No",
"fieldtype": "Data",
"insert_after": "column_break5",
"print_hide": 1,
"no_copy": 1,
"translatable": 0,
"length": 30,
},
{
"fieldname": "lr_date",
"label": "Transport Receipt Date",
"fieldtype": "Date",
"insert_after": "lr_no",
"default": "Today",
"print_hide": 1,
"no_copy": 1,
},
{
"fieldname": "driver",
"label": "Driver",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@
},
{
"default": "0",
"depends_on": "eval: doc.enable_e_waybill",
"fieldname": "enable_e_waybill_from_pr",
"fieldtype": "Check",
"label": "Enable e-Waybill Generation from Purchase Receipt"
Expand All @@ -383,7 +384,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2023-11-07 17:56:07.859891",
"modified": "2023-11-29 17:29:51.606431",
"modified_by": "Administrator",
"module": "GST India",
"name": "GST Settings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def validate_filters(filters=None):
if not filters.from_date or not filters.to_date:
frappe.throw(
_(
"From Date & To Date is mandatory for generating e-Invoice Summary"
"From Date & To Date is mandatory for generating Bill of Entry Summary"
" Report"
),
title=_("Invalid Filter"),
Expand Down
102 changes: 102 additions & 0 deletions india_compliance/gst_india/setup/property_setters.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ def get_property_setters():
"property": "default_email_template",
"value": "Purchase Reconciliation",
},
*TRANSPORTER_NAME_PROPERTIES,
*LR_NO_PROPERTIES,
*LR_DATE_PROPERTIES,
]


Expand All @@ -120,3 +123,102 @@ def get_options_property_setter(doctype, fieldname, new_options, prepend=True):
"property": "options",
"value": options,
}


TRANSPORTER_NAME_PROPERTIES = [
{
"doctype_or_field": "DocField",
"doctype": "Purchase Receipt",
"fieldname": "transporter_name",
"property": "fieldtype",
"property_type": "Select",
"value": "Small Text",
},
{
"doctype_or_field": "DocField",
"doctype": "Purchase Receipt",
"fieldname": "transporter_name",
"property": "fetch_from",
"property_type": "Small Text",
"value": "transporter.supplier_name",
},
{
"doctype_or_field": "DocField",
"doctype": "Purchase Receipt",
"fieldname": "transporter_name",
"property": "no_copy",
"property_type": "Check",
"value": "1",
},
{
"doctype_or_field": "DocField",
"doctype": "Purchase Receipt",
"fieldname": "transporter_name",
"property": "print_hide",
"property_type": "Check",
"value": "1",
},
{
"doctype_or_field": "DocField",
"doctype": "Purchase Receipt",
"fieldname": "transporter_name",
"property": "read_only",
"property_type": "Check",
"value": "1",
},
]

LR_NO_PROPERTIES = [
{
"doctype_or_field": "DocField",
"doctype": "Purchase Receipt",
"fieldname": "lr_no",
"property": "label",
"property_type": "Data",
"value": "Transport Receipt No",
},
{
"doctype_or_field": "DocField",
"doctype": "Purchase Receipt",
"fieldname": "lr_no",
"property": "print_hide",
"property_type": "Check",
"value": "1",
},
{
"doctype_or_field": "DocField",
"doctype": "Purchase Receipt",
"fieldname": "lr_no",
"property": "length",
"property_type": "Int",
"value": "30",
},
]


LR_DATE_PROPERTIES = [
{
"doctype_or_field": "DocField",
"doctype": "Purchase Receipt",
"fieldname": "lr_date",
"property": "label",
"property_type": "Data",
"value": "Transport Receipt Date",
},
{
"doctype_or_field": "DocField",
"doctype": "Purchase Receipt",
"fieldname": "lr_date",
"property": "print_hide",
"property_type": "Check",
"value": "1",
},
{
"doctype_or_field": "DocField",
"doctype": "Purchase Receipt",
"fieldname": "lr_date",
"property": "default",
"property_type": "Text",
"value": "Today",
},
]
5 changes: 3 additions & 2 deletions india_compliance/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ execute:import frappe; frappe.delete_doc_if_exists("DocType", "GSTIN")

[post_model_sync]
india_compliance.patches.v14.set_default_for_overridden_accounts_setting
execute:from india_compliance.gst_india.setup import create_custom_fields; create_custom_fields() #36
execute:from india_compliance.gst_india.setup import create_property_setters; create_property_setters() #4
execute:from india_compliance.gst_india.setup import create_custom_fields; create_custom_fields() #37
execute:from india_compliance.gst_india.setup import create_property_setters; create_property_setters() #5
india_compliance.patches.post_install.remove_old_fields
india_compliance.patches.post_install.update_company_gstin
india_compliance.patches.post_install.update_custom_role_for_e_invoice_summary
Expand Down Expand Up @@ -33,3 +33,4 @@ india_compliance.patches.post_install.update_payment_entry_fields
india_compliance.patches.post_install.update_company_fixtures #1
india_compliance.patches.post_install.update_itc_classification_field
india_compliance.patches.v14.update_purchase_reco_email_template
india_compliance.patches.v14.delete_purchase_receipt_standard_custom_fields
2 changes: 1 addition & 1 deletion india_compliance/patches/check_version_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{
"app_name": "ERPNext",
"current_version": version.parse(erpnext.__version__),
"required_versions": {"version-14": "14.50.0", "version-15": "15.3.0"},
"required_versions": {"version-14": "14.50.0", "version-15": "15.4.0"},
},
]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import frappe

FIELDS = [
"transporter_name",
"lr_no",
"lr_date",
]


def execute():
frappe.db.delete(
"Custom Field",
filters={
"dt": "Purchase Receipt",
"fieldname": ("in", FIELDS),
},
)

0 comments on commit 49b9cfe

Please sign in to comment.