Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions propms/auto_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,16 @@ def getIssueName(name):

@frappe.whitelist()
def validateSalesInvoiceItemDuplication(self, method):
for item in self.items:
for item_child in self.items:
if not item.name == item_child.name:
if item.item_code == item_child.item_code:
frappe.throw(
_("Duplicate Item Exists - {0}. Duplications are not allowed.").format(
item.item_code
if frappe.db.get_single_value("Property Management Settings", "so_item_duplication_check"):
for item in self.items:
for item_child in self.items:
if not item.name == item_child.name:
if item.item_code == item_child.item_code:
frappe.throw(
_("Duplicate Item Exists - {0}. Duplications are not allowed.").format(
item.item_code
)
)
)


@frappe.whitelist()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@
"allow_end_of_the_month",
"section_break_17",
"self_consumption_customer",
"generate_invoice_schedule_next_month"
"generate_invoice_schedule_next_month",
"column_break_fwvp",
"so_item_duplication_check",
"section_break_provider_prioritization",
"enable_provider_auto_assignment",
"enable_nearby_search",
"column_break_provider",
"nearby_search_radius_km"
],
"fields": [
{
Expand Down Expand Up @@ -148,12 +155,54 @@
"fieldname": "make_invoice_schedule_up_to_tomorrow_only",
"fieldtype": "Check",
"label": "Make Invoice Schedule up to tomorrow only"
},
{
"fieldname": "section_break_provider_prioritization",
"fieldtype": "Section Break",
"label": "Provider Prioritization Settings"
},
{
"default": "0",
"description": "Automatically assign service providers to Issues based on prioritization rules",
"fieldname": "enable_provider_auto_assignment",
"fieldtype": "Check",
"label": "Enable Provider Auto-Assignment"
},
{
"default": "0",
"depends_on": "enable_provider_auto_assignment",
"description": "Enable geolocation-based fallback search for nearby providers",
"fieldname": "enable_nearby_search",
"fieldtype": "Check",
"label": "Enable Nearby Search"
},
{
"fieldname": "column_break_provider",
"fieldtype": "Column Break"
},
{
"default": "10",
"depends_on": "enable_nearby_search",
"description": "Search radius in kilometers for nearby provider search",
"fieldname": "nearby_search_radius_km",
"fieldtype": "Float",
"label": "Nearby Search Radius (km)"
},
{
"fieldname": "column_break_fwvp",
"fieldtype": "Column Break"
},
{
"default": "0",
"fieldname": "so_item_duplication_check",
"fieldtype": "Check",
"label": "SO Item duplication check"
}
],
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2025-06-26 16:00:42.304877",
"modified": "2025-12-23 07:04:05.371373",
"modified_by": "Administrator",
"module": "Property Management Solution",
"name": "Property Management Settings",
Expand Down