-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_fields.py
More file actions
42 lines (31 loc) · 1.04 KB
/
Copy pathcreate_fields.py
File metadata and controls
42 lines (31 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python3
import sys
import os
# Add the current directory to Python path
sys.path.insert(0, '/home/shihab/frappe-bench')
# Set environment variables
os.environ['FRAPPE_SITE'] = 'all'
# Import frappe
import frappe
def create_fields():
"""Create commission custom fields"""
try:
# Initialize frappe
frappe.init(site='all')
frappe.connect()
print("Creating commission custom fields...")
# Import and run the function
from apps.dlitscustom.dlitscustom.fixtures.custom_fields import create_commission_custom_fields
create_commission_custom_fields()
# Commit to database
frappe.db.commit()
print("Commission custom fields created successfully!")
print("Please refresh your Sales Invoice and Sales Order forms.")
except Exception as e:
print(f"Error: {str(e)}")
import traceback
traceback.print_exc()
finally:
frappe.destroy()
if __name__ == "__main__":
create_fields()