-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #234 from sihaysistema/custom-quick-entry
Custom quick entry
- Loading branch information
Showing
6 changed files
with
345 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
factura_electronica.patches.v7_0_9.update_props_address |
115 changes: 115 additions & 0 deletions
115
factura_electronica/patches/v7_0_9/update_props_address.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
import frappe | ||
|
||
# This patch deletes all the duplicate indexes created for same column | ||
# The patch only checks for indexes with UNIQUE constraints | ||
|
||
def execute(): | ||
try: | ||
# Cambios propiedades campo pincode | ||
frappe.make_property_setter({ | ||
"doctype": "Address", | ||
"fieldname": "pincode", | ||
"property": "allow_in_quick_entry", | ||
"value": 1, | ||
"property_type": "Int" | ||
}) | ||
|
||
frappe.make_property_setter({ | ||
"doctype": "Address", | ||
"fieldname": "pincode", | ||
"default": "0", | ||
"property": "reqd", | ||
"value": 1, | ||
"property_type": "Int" | ||
}) | ||
|
||
# Cambios propiedades campo email_id | ||
frappe.make_property_setter({ | ||
"doctype": "Address", | ||
"fieldname": "email_id", | ||
"property": "allow_in_quick_entry", | ||
"value": 1, | ||
"property_type": "Int" | ||
}) | ||
|
||
frappe.make_property_setter({ | ||
"doctype": "Address", | ||
"fieldname": "email_id", | ||
"property": "reqd", | ||
"value": 0, | ||
"property_type": "Int" | ||
}) | ||
|
||
# Cambios propiedades campo phone | ||
frappe.make_property_setter({ | ||
"doctype": "Address", | ||
"fieldname": "phone", | ||
"property": "reqd", | ||
"value": 0, | ||
"property_type": "Int" | ||
}) | ||
|
||
frappe.make_property_setter({ | ||
"doctype": "Address", | ||
"fieldname": "phone", | ||
"property": "allow_in_quick_entry", | ||
"value": 1, | ||
"property_type": "Int" | ||
}) | ||
|
||
# Campo tax id en Customer Dt | ||
frappe.make_property_setter({ | ||
"doctype": "Customer", | ||
"fieldname": "tax_id", | ||
"property": "reqd", | ||
"value": 1, | ||
"property_type": "Int" | ||
}) | ||
|
||
frappe.make_property_setter({ | ||
"doctype": "Address", | ||
"fieldname": "tax_id", | ||
"default": "C/F", | ||
"property": "allow_in_quick_entry", | ||
"value": 1, | ||
"property_type": "Int" | ||
}) | ||
|
||
frappe.make_property_setter({ | ||
"doctype": "Customer", | ||
"fieldname": "county", | ||
"property": "reqd", | ||
"value": 0, | ||
"property_type": "Int" | ||
}) | ||
|
||
frappe.make_property_setter({ | ||
"doctype": "Address", | ||
"fieldname": "county", | ||
"default": "Guatemala", | ||
"property": "allow_in_quick_entry", | ||
"value": 1, | ||
"property_type": "Int" | ||
}) | ||
|
||
for ffield in ["city", "state", "country"]: | ||
frappe.make_property_setter({ | ||
"doctype": "Address", | ||
"fieldname": ffield, | ||
"default": "Guatemala", | ||
"property": "reqd", | ||
"value": 1, | ||
"property_type": "Int" | ||
}) | ||
|
||
frappe.make_property_setter({ | ||
"doctype": "Address", | ||
"fieldname": ffield, | ||
"property": "allow_in_quick_entry", | ||
"value": 1, | ||
"property_type": "Int" | ||
}) | ||
|
||
except: | ||
with open("debug.txt", "w") as f: | ||
f.write(str(frappe.get_traceback())) |
Oops, something went wrong.