Browse Source
fix(patch): create only component type field instead of running the whole setup (#28734)
develop
Rucha Mahabal
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
2 deletions
-
erpnext/patches/v13_0/check_is_income_tax_component.py
|
|
@ -3,9 +3,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
import frappe |
|
|
|
from frappe.custom.doctype.custom_field.custom_field import create_custom_field |
|
|
|
|
|
|
|
import erpnext |
|
|
|
from erpnext.regional.india.setup import setup |
|
|
|
|
|
|
|
|
|
|
|
def execute(): |
|
|
@ -30,7 +30,14 @@ def execute(): |
|
|
|
frappe.reload_doc('Regional', 'Report', report) |
|
|
|
|
|
|
|
if erpnext.get_region() == "India": |
|
|
|
setup(patch=True) |
|
|
|
create_custom_field('Salary Component', |
|
|
|
dict(fieldname='component_type', |
|
|
|
label='Component Type', |
|
|
|
fieldtype='Select', |
|
|
|
insert_after='description', |
|
|
|
options='\nProvident Fund\nAdditional Provident Fund\nProvident Fund Loan\nProfessional Tax', |
|
|
|
depends_on='eval:doc.type == "Deduction"') |
|
|
|
) |
|
|
|
|
|
|
|
if frappe.db.exists("Salary Component", "Income Tax"): |
|
|
|
frappe.db.set_value("Salary Component", "Income Tax", "is_income_tax_component", 1) |
|
|
|