From 3379f2037af2cf1907af0a887a7155833cc3a0c6 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Thu, 1 May 2025 14:36:05 +0530 Subject: [PATCH] fix: added crm products table in crm deal and total field (cherry picked from commit bc1c20c91f0535c971519424202dcc4ad4a5d3ec) --- crm/fcrm/doctype/crm_deal/crm_deal.json | 53 +++++++- crm/fcrm/doctype/crm_products/__init__.py | 0 .../doctype/crm_products/crm_products.json | 121 ++++++++++++++++++ crm/fcrm/doctype/crm_products/crm_products.py | 9 ++ 4 files changed, 181 insertions(+), 2 deletions(-) create mode 100644 crm/fcrm/doctype/crm_products/__init__.py create mode 100644 crm/fcrm/doctype/crm_products/crm_products.json create mode 100644 crm/fcrm/doctype/crm_products/crm_products.py diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.json b/crm/fcrm/doctype/crm_deal/crm_deal.json index 133630ce..9ffb6aab 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.json +++ b/crm/fcrm/doctype/crm_deal/crm_deal.json @@ -43,6 +43,13 @@ "mobile_no", "phone", "gender", + "products_tab", + "products", + "section_break_ccbj", + "total_qty", + "column_break_udbq", + "total", + "net_total", "sla_tab", "sla", "sla_creation", @@ -334,11 +341,52 @@ "fieldtype": "Link", "label": "Currency", "options": "Currency" + }, + { + "fieldname": "products_tab", + "fieldtype": "Tab Break", + "label": "Products" + }, + { + "fieldname": "products", + "fieldtype": "Table", + "label": "Products", + "options": "CRM Products" + }, + { + "fieldname": "section_break_ccbj", + "fieldtype": "Section Break" + }, + { + "fieldname": "total_qty", + "fieldtype": "Float", + "label": "Total Quantity", + "read_only": 1 + }, + { + "fieldname": "column_break_udbq", + "fieldtype": "Column Break" + }, + { + "fieldname": "total", + "fieldtype": "Currency", + "label": "Total", + "options": "currency", + "read_only": 1 + }, + { + "description": "Total after discount", + "fieldname": "net_total", + "fieldtype": "Currency", + "label": "Net Total", + "options": "currency", + "read_only": 1 } ], + "grid_page_length": 50, "index_web_pages_for_search": 1, "links": [], - "modified": "2024-12-11 14:31:41.058895", + "modified": "2025-04-28 15:55:18.175990", "modified_by": "Administrator", "module": "FCRM", "name": "CRM Deal", @@ -370,10 +418,11 @@ "write": 1 } ], + "row_format": "Dynamic", "show_title_field_in_link": 1, "sort_field": "modified", "sort_order": "DESC", "states": [], "title_field": "organization", "track_changes": 1 -} \ No newline at end of file +} diff --git a/crm/fcrm/doctype/crm_products/__init__.py b/crm/fcrm/doctype/crm_products/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/crm/fcrm/doctype/crm_products/crm_products.json b/crm/fcrm/doctype/crm_products/crm_products.json new file mode 100644 index 00000000..42fe327b --- /dev/null +++ b/crm/fcrm/doctype/crm_products/crm_products.json @@ -0,0 +1,121 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2025-04-28 12:50:49.812915", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "product_code", + "column_break_gvbc", + "product_name", + "section_break_fnvf", + "qty", + "section_break_olqb", + "discount_percentage", + "discount_amount", + "section_break_cnpb", + "column_break_pozr", + "rate", + "amount", + "net_amount" + ], + "fields": [ + { + "fieldname": "column_break_gvbc", + "fieldtype": "Column Break" + }, + { + "fieldname": "product_name", + "fieldtype": "Data", + "label": "Product Name", + "reqd": 1 + }, + { + "fieldname": "section_break_fnvf", + "fieldtype": "Section Break" + }, + { + "fieldname": "section_break_olqb", + "fieldtype": "Section Break" + }, + { + "bold": 1, + "fieldname": "discount_percentage", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "Discount %" + }, + { + "fieldname": "discount_amount", + "fieldtype": "Currency", + "label": "Discount Amount", + "options": "currency" + }, + { + "fieldname": "section_break_cnpb", + "fieldtype": "Section Break" + }, + { + "fieldname": "column_break_pozr", + "fieldtype": "Column Break" + }, + { + "bold": 1, + "fieldname": "rate", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Rate", + "options": "currency", + "reqd": 1 + }, + { + "bold": 1, + "fieldname": "amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "options": "currency", + "reqd": 1 + }, + { + "bold": 1, + "depends_on": "discount_percentage", + "description": "Amount after discount", + "fieldname": "net_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Net Amount", + "options": "currency" + }, + { + "bold": 1, + "fieldname": "product_code", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Product", + "options": "CRM Product" + }, + { + "bold": 1, + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Quantity" + } + ], + "grid_page_length": 50, + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2025-04-28 14:41:38.735793", + "modified_by": "Administrator", + "module": "FCRM", + "name": "CRM Products", + "owner": "Administrator", + "permissions": [], + "row_format": "Dynamic", + "sort_field": "creation", + "sort_order": "DESC", + "states": [] +} diff --git a/crm/fcrm/doctype/crm_products/crm_products.py b/crm/fcrm/doctype/crm_products/crm_products.py new file mode 100644 index 00000000..e8a34bb8 --- /dev/null +++ b/crm/fcrm/doctype/crm_products/crm_products.py @@ -0,0 +1,9 @@ +# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class CRMProducts(Document): + pass