[feature] override a function regionally by adding a decorator

This commit is contained in:
Rushabh Mehta
2017-07-13 15:00:56 +05:30
parent c3153655eb
commit 7231f29e78
3 changed files with 38 additions and 1 deletions

View File

@@ -22,3 +22,8 @@ def validate_gstin_for_india(doc, method):
if doc.gstin != "NA" and doc.gst_state_number != doc.gstin[:2]:
frappe.throw(_("First 2 digits of GSTIN should match with State number {0}")
.format(doc.gst_state_number))
# don't remove this function it is used in tests
def test_method():
'''test function'''
return 'overridden'