Merge branch 'develop' into fix_mandatory_error

This commit is contained in:
Karthikeyan S 2020-07-10 18:05:18 +05:30 committed by GitHub
commit 183ebb237e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
61 changed files with 463 additions and 424 deletions

View File

@ -140,10 +140,8 @@ def make_entry(args, adv_adj, update_outstanding):
gle = frappe.new_doc("GL Entry") gle = frappe.new_doc("GL Entry")
gle.update(args) gle.update(args)
gle.flags.ignore_permissions = 1 gle.flags.ignore_permissions = 1
gle.validate() gle.insert()
gle.db_insert()
gle.run_method("on_update_with_args", adv_adj, update_outstanding) gle.run_method("on_update_with_args", adv_adj, update_outstanding)
gle.flags.ignore_validate = True
gle.submit() gle.submit()
# check against budget # check against budget

View File

@ -13,7 +13,7 @@
"documentation_url": "https://docs.erpnext.com/docs/user/manual/en/accounts", "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/accounts",
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"modified": "2020-05-14 22:11:06.475938", "modified": "2020-07-08 14:06:09.033880",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Accounts", "name": "Accounts",
@ -44,8 +44,7 @@
"step": "Configure Account Settings" "step": "Configure Account Settings"
} }
], ],
"subtitle": "Accounts, invoices and taxation.", "subtitle": "Accounts, Invoices, Taxation, and more.",
"success_message": "The Accounts module is now set up!", "success_message": "The Accounts Module is all set up!",
"title": "Let's Setup Your Accounts and Taxes.", "title": "Let's Set Up Your Accounts and Taxes."
"user_can_dismiss": 1
} }

View File

@ -8,7 +8,7 @@
"is_mandatory": 0, "is_mandatory": 0,
"is_single": 0, "is_single": 0,
"is_skipped": 0, "is_skipped": 0,
"modified": "2020-05-14 17:46:41.831517", "modified": "2020-06-01 13:16:19.731719",
"modified_by": "Administrator", "modified_by": "Administrator",
"name": "Create a Customer", "name": "Create a Customer",
"owner": "Administrator", "owner": "Administrator",

View File

@ -1,6 +1,6 @@
{ {
"action": "Create Entry", "action": "Create Entry",
"creation": "2020-05-14 17:45:28.554605", "creation": "2020-05-12 18:16:06.624554",
"docstatus": 0, "docstatus": 0,
"doctype": "Onboarding Step", "doctype": "Onboarding Step",
"idx": 0, "idx": 0,
@ -8,7 +8,7 @@
"is_mandatory": 0, "is_mandatory": 0,
"is_single": 0, "is_single": 0,
"is_skipped": 0, "is_skipped": 0,
"modified": "2020-05-14 17:45:28.554605", "modified": "2020-05-12 18:30:02.489949",
"modified_by": "Administrator", "modified_by": "Administrator",
"name": "Create a Product", "name": "Create a Product",
"owner": "Administrator", "owner": "Administrator",

View File

@ -17,41 +17,6 @@ frappe.query_reports["Accounts Payable"] = {
"fieldtype": "Date", "fieldtype": "Date",
"default": frappe.datetime.get_today() "default": frappe.datetime.get_today()
}, },
{
"fieldname":"ageing_based_on",
"label": __("Ageing Based On"),
"fieldtype": "Select",
"options": 'Posting Date\nDue Date\nSupplier Invoice Date',
"default": "Due Date"
},
{
"fieldname":"range1",
"label": __("Ageing Range 1"),
"fieldtype": "Int",
"default": "30",
"reqd": 1
},
{
"fieldname":"range2",
"label": __("Ageing Range 2"),
"fieldtype": "Int",
"default": "60",
"reqd": 1
},
{
"fieldname":"range3",
"label": __("Ageing Range 3"),
"fieldtype": "Int",
"default": "90",
"reqd": 1
},
{
"fieldname":"range4",
"label": __("Ageing Range 4"),
"fieldtype": "Int",
"default": "120",
"reqd": 1
},
{ {
"fieldname":"finance_book", "fieldname":"finance_book",
"label": __("Finance Book"), "label": __("Finance Book"),
@ -88,6 +53,41 @@ frappe.query_reports["Accounts Payable"] = {
} }
} }
}, },
{
"fieldname":"ageing_based_on",
"label": __("Ageing Based On"),
"fieldtype": "Select",
"options": 'Posting Date\nDue Date\nSupplier Invoice Date',
"default": "Due Date"
},
{
"fieldname":"range1",
"label": __("Ageing Range 1"),
"fieldtype": "Int",
"default": "30",
"reqd": 1
},
{
"fieldname":"range2",
"label": __("Ageing Range 2"),
"fieldtype": "Int",
"default": "60",
"reqd": 1
},
{
"fieldname":"range3",
"label": __("Ageing Range 3"),
"fieldtype": "Int",
"default": "90",
"reqd": 1
},
{
"fieldname":"range4",
"label": __("Ageing Range 4"),
"fieldtype": "Int",
"default": "120",
"reqd": 1
},
{ {
"fieldname":"payment_terms_template", "fieldname":"payment_terms_template",
"label": __("Payment Terms Template"), "label": __("Payment Terms Template"),

View File

@ -17,41 +17,6 @@ frappe.query_reports["Accounts Receivable"] = {
"fieldtype": "Date", "fieldtype": "Date",
"default": frappe.datetime.get_today() "default": frappe.datetime.get_today()
}, },
{
"fieldname":"ageing_based_on",
"label": __("Ageing Based On"),
"fieldtype": "Select",
"options": 'Posting Date\nDue Date',
"default": "Due Date"
},
{
"fieldname":"range1",
"label": __("Ageing Range 1"),
"fieldtype": "Int",
"default": "30",
"reqd": 1
},
{
"fieldname":"range2",
"label": __("Ageing Range 2"),
"fieldtype": "Int",
"default": "60",
"reqd": 1
},
{
"fieldname":"range3",
"label": __("Ageing Range 3"),
"fieldtype": "Int",
"default": "90",
"reqd": 1
},
{
"fieldname":"range4",
"label": __("Ageing Range 4"),
"fieldtype": "Int",
"default": "120",
"reqd": 1
},
{ {
"fieldname":"finance_book", "fieldname":"finance_book",
"label": __("Finance Book"), "label": __("Finance Book"),
@ -101,6 +66,41 @@ frappe.query_reports["Accounts Receivable"] = {
} }
} }
}, },
{
"fieldname":"ageing_based_on",
"label": __("Ageing Based On"),
"fieldtype": "Select",
"options": 'Posting Date\nDue Date',
"default": "Due Date"
},
{
"fieldname":"range1",
"label": __("Ageing Range 1"),
"fieldtype": "Int",
"default": "30",
"reqd": 1
},
{
"fieldname":"range2",
"label": __("Ageing Range 2"),
"fieldtype": "Int",
"default": "60",
"reqd": 1
},
{
"fieldname":"range3",
"label": __("Ageing Range 3"),
"fieldtype": "Int",
"default": "90",
"reqd": 1
},
{
"fieldname":"range4",
"label": __("Ageing Range 4"),
"fieldtype": "Int",
"default": "120",
"reqd": 1
},
{ {
"fieldname":"customer_group", "fieldname":"customer_group",
"label": __("Customer Group"), "label": __("Customer Group"),
@ -113,12 +113,6 @@ frappe.query_reports["Accounts Receivable"] = {
"fieldtype": "Link", "fieldtype": "Link",
"options": "Payment Terms Template" "options": "Payment Terms Template"
}, },
{
"fieldname":"territory",
"label": __("Territory"),
"fieldtype": "Link",
"options": "Territory"
},
{ {
"fieldname":"sales_partner", "fieldname":"sales_partner",
"label": __("Sales Partner"), "label": __("Sales Partner"),
@ -131,6 +125,12 @@ frappe.query_reports["Accounts Receivable"] = {
"fieldtype": "Link", "fieldtype": "Link",
"options": "Sales Person" "options": "Sales Person"
}, },
{
"fieldname":"territory",
"label": __("Territory"),
"fieldtype": "Link",
"options": "Territory"
},
{ {
"fieldname": "group_by_party", "fieldname": "group_by_party",
"label": __("Group By Customer"), "label": __("Group By Customer"),

View File

@ -405,12 +405,12 @@ def set_gl_entries_by_account(
FROM `tabDistributed Cost Center` FROM `tabDistributed Cost Center`
WHERE cost_center IN %(cost_center)s WHERE cost_center IN %(cost_center)s
AND parent NOT IN %(cost_center)s AND parent NOT IN %(cost_center)s
AND is_cancelled = 0
GROUP BY parent GROUP BY parent
) as DCC_allocation ) as DCC_allocation
WHERE company=%(company)s WHERE company=%(company)s
{additional_conditions} {additional_conditions}
AND posting_date <= %(to_date)s AND posting_date <= %(to_date)s
AND is_cancelled = 0
AND cost_center = DCC_allocation.parent AND cost_center = DCC_allocation.parent
""".format(additional_conditions=additional_conditions.replace("and cost_center in %(cost_center)s ", '')) """.format(additional_conditions=additional_conditions.replace("and cost_center in %(cost_center)s ", ''))

View File

@ -13,7 +13,7 @@
"documentation_url": "https://docs.erpnext.com/docs/user/manual/en/asset", "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/asset",
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"modified": "2020-05-08 16:17:31.685943", "modified": "2020-07-08 14:05:51.828497",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Assets", "module": "Assets",
"name": "Assets", "name": "Assets",
@ -27,7 +27,7 @@
}, },
{ {
"step": "Create an Asset Category" "step": "Create an Asset Category"
}, },
{ {
"step": "Purchase an Asset Item" "step": "Purchase an Asset Item"
}, },
@ -35,8 +35,7 @@
"step": "Create an Asset" "step": "Create an Asset"
} }
], ],
"subtitle": "Assets, Depreciations, Repairs and more", "subtitle": "Assets, Depreciations, Repairs, and more.",
"success_message": "The Asset Module is all set up!", "success_message": "The Assets Module is all set up!",
"title": "Let's Setup Asset Management", "title": "Let's Set Up the Assets Module."
"user_can_dismiss": 1
} }

View File

@ -6,11 +6,14 @@
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"is_mandatory": 0, "is_mandatory": 0,
"is_single": 0,
"is_skipped": 0, "is_skipped": 0,
"modified": "2020-05-08 13:20:00.259985", "modified": "2020-05-08 13:20:00.259985",
"modified_by": "Administrator", "modified_by": "Administrator",
"name": "Create a Fixed Asset Item", "name": "Create a Fixed Asset Item",
"owner": "Administrator", "owner": "Administrator",
"reference_document": "Item", "reference_document": "Item",
"title": "Create a Fixed Asset Item" "show_full_form": 0,
"title": "Create a Fixed Asset Item",
"validate_action": 0
} }

View File

@ -6,11 +6,14 @@
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"is_mandatory": 0, "is_mandatory": 0,
"is_single": 0,
"is_skipped": 0, "is_skipped": 0,
"modified": "2020-05-08 13:21:53.332538", "modified": "2020-05-08 13:21:53.332538",
"modified_by": "Administrator", "modified_by": "Administrator",
"name": "Create an Asset", "name": "Create an Asset",
"owner": "Administrator", "owner": "Administrator",
"reference_document": "Asset", "reference_document": "Asset",
"title": "Create an Asset" "show_full_form": 0,
"title": "Create an Asset",
"validate_action": 0
} }

View File

@ -1,16 +1,19 @@
{ {
"action": "Create Entry", "action": "Create Entry",
"creation": "2020-05-08 13:21:53.332538", "creation": "2020-05-08 13:21:53.332538",
"docstatus": 0, "docstatus": 0,
"doctype": "Onboarding Step", "doctype": "Onboarding Step",
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"is_mandatory": 0, "is_mandatory": 0,
"is_skipped": 0, "is_single": 0,
"modified": "2020-05-08 13:21:53.332538", "is_skipped": 0,
"modified_by": "Administrator", "modified": "2020-05-08 13:21:53.332538",
"name": "Create an Asset Category", "modified_by": "Administrator",
"owner": "Administrator", "name": "Create an Asset Category",
"reference_document": "Asset Category", "owner": "Administrator",
"title": "Create an Asset Category" "reference_document": "Asset Category",
} "show_full_form": 0,
"title": "Create an Asset Category",
"validate_action": 0
}

View File

@ -6,11 +6,14 @@
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"is_mandatory": 0, "is_mandatory": 0,
"is_single": 0,
"is_skipped": 0, "is_skipped": 0,
"modified": "2020-05-08 16:06:16.625646", "modified": "2020-05-08 16:06:16.625646",
"modified_by": "Administrator", "modified_by": "Administrator",
"name": "Introduction to Assets", "name": "Introduction to Assets",
"owner": "Administrator", "owner": "Administrator",
"show_full_form": 0,
"title": "Introduction to Assets", "title": "Introduction to Assets",
"validate_action": 0,
"video_url": "https://www.youtube.com/watch?v=I-K8pLRmvSo" "video_url": "https://www.youtube.com/watch?v=I-K8pLRmvSo"
} }

View File

@ -6,11 +6,14 @@
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"is_mandatory": 0, "is_mandatory": 0,
"is_single": 0,
"is_skipped": 0, "is_skipped": 0,
"modified": "2020-05-08 13:21:28.208059", "modified": "2020-05-08 13:21:28.208059",
"modified_by": "Administrator", "modified_by": "Administrator",
"name": "Purchase an Asset Item", "name": "Purchase an Asset Item",
"owner": "Administrator", "owner": "Administrator",
"reference_document": "Purchase Receipt", "reference_document": "Purchase Receipt",
"title": "Purchase an Asset Item" "show_full_form": 0,
"title": "Purchase an Asset Item",
"validate_action": 0
} }

View File

@ -123,14 +123,14 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
} }
if(doc.status != "Closed") { if(doc.status != "Closed") {
if (doc.status != "On Hold") { if (doc.status != "On Hold") {
if(flt(doc.per_received, 2) < 100 && allow_receipt) { if(flt(doc.per_received) < 100 && allow_receipt) {
cur_frm.add_custom_button(__('Receipt'), this.make_purchase_receipt, __('Create')); cur_frm.add_custom_button(__('Receipt'), this.make_purchase_receipt, __('Create'));
if(doc.is_subcontracted==="Yes" && me.has_unsupplied_items()) { if(doc.is_subcontracted==="Yes" && me.has_unsupplied_items()) {
cur_frm.add_custom_button(__('Material to Supplier'), cur_frm.add_custom_button(__('Material to Supplier'),
function() { me.make_stock_entry(); }, __("Transfer")); function() { me.make_stock_entry(); }, __("Transfer"));
} }
} }
if(flt(doc.per_billed, 2) < 100) if(flt(doc.per_billed) < 100)
cur_frm.add_custom_button(__('Invoice'), cur_frm.add_custom_button(__('Invoice'),
this.make_purchase_invoice, __('Create')); this.make_purchase_invoice, __('Create'));

View File

@ -19,7 +19,7 @@
"documentation_url": "https://docs.erpnext.com/docs/user/manual/en/buying", "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/buying",
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"modified": "2020-06-01 12:55:09.234944", "modified": "2020-07-08 14:05:28.273641",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Buying", "name": "Buying",
@ -47,8 +47,7 @@
"step": "Buying Settings" "step": "Buying Settings"
} }
], ],
"subtitle": "Products, Purchases, Analysis and more.", "subtitle": "Products, Purchases, Analysis, and more.",
"success_message": "The Buying Module is all set up!", "success_message": "The Buying Module is all set up!",
"title": "Let's Set Up the Buying Module.", "title": "Let's Set Up the Buying Module."
"user_can_dismiss": 1
} }

View File

@ -1,19 +1,19 @@
{ {
"action": "Show Form Tour", "action": "Update Settings",
"creation": "2020-05-06 15:53:44.667414", "creation": "2020-05-06 15:53:44.667414",
"docstatus": 0, "docstatus": 0,
"doctype": "Onboarding Step", "doctype": "Onboarding Step",
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"is_mandatory": 1, "is_mandatory": 0,
"is_single": 1, "is_single": 0,
"is_skipped": 0, "is_skipped": 0,
"modified": "2020-06-01 12:52:57.668870", "modified": "2020-05-12 18:30:06.323797",
"modified_by": "Administrator", "modified_by": "Administrator",
"name": "Buying Settings", "name": "Buying Settings",
"owner": "Administrator", "owner": "Administrator",
"reference_document": "Buying Settings", "reference_document": "Buying Settings",
"show_full_form": 0, "show_full_form": 0,
"title": "Configure Buying Settings.", "title": "Configure Buying Settings.",
"validate_action": 0 "validate_action": 1
} }

View File

@ -8,13 +8,13 @@
"is_mandatory": 0, "is_mandatory": 0,
"is_single": 0, "is_single": 0,
"is_skipped": 0, "is_skipped": 0,
"modified": "2020-05-19 18:54:19.383397", "modified": "2020-07-04 12:33:16.970031",
"modified_by": "Administrator", "modified_by": "Administrator",
"name": "Setup your Warehouse", "name": "Setup your Warehouse",
"owner": "Administrator", "owner": "Administrator",
"path": "Tree/Warehouse", "path": "Tree/Warehouse",
"reference_document": "Warehouse", "reference_document": "Warehouse",
"show_full_form": 0, "show_full_form": 0,
"title": "Setup your Warehouse", "title": "Set up your Warehouse",
"validate_action": 1 "validate_action": 1
} }

View File

@ -172,7 +172,9 @@ def get_number_cards():
"doctype": "Number Card", "doctype": "Number Card",
"document_type": "Lead", "document_type": "Lead",
"name": "New Lead (Last 1 Month)", "name": "New Lead (Last 1 Month)",
"filters_json": json.dumps([["Lead","creation","Previous","1 month",False]]), "filters_json": json.dumps([
["Lead", "creation", "Timespan", "last month"]
]),
"function": "Count", "function": "Count",
"is_public": 1, "is_public": 1,
"label": _("New Lead (Last 1 Month)"), "label": _("New Lead (Last 1 Month)"),
@ -183,7 +185,9 @@ def get_number_cards():
"doctype": "Number Card", "doctype": "Number Card",
"document_type": "Opportunity", "document_type": "Opportunity",
"name": "New Opportunity (Last 1 Month)", "name": "New Opportunity (Last 1 Month)",
"filters_json": json.dumps([["Opportunity","creation","Previous","1 month",False]]), "filters_json": json.dumps([
["Opportunity", "creation", "Timespan", "last month"]
]),
"function": "Count", "function": "Count",
"is_public": 1, "is_public": 1,
"label": _("New Opportunity (Last 1 Month)"), "label": _("New Opportunity (Last 1 Month)"),
@ -194,7 +198,10 @@ def get_number_cards():
"doctype": "Number Card", "doctype": "Number Card",
"document_type": "Opportunity", "document_type": "Opportunity",
"name": "Won Opportunity (Last 1 Month)", "name": "Won Opportunity (Last 1 Month)",
"filters_json": json.dumps([["Opportunity","creation","Previous","1 month",False]]), "filters_json": json.dumps([
["Opportunity", "status", "=", "Converted",False],
["Opportunity", "creation", "Timespan", "last month"]
]),
"function": "Count", "function": "Count",
"is_public": 1, "is_public": 1,
"label": _("Won Opportunity (Last 1 Month)"), "label": _("Won Opportunity (Last 1 Month)"),

View File

@ -114,10 +114,12 @@ class Lead(SellingController):
def set_lead_name(self): def set_lead_name(self):
if not self.lead_name: if not self.lead_name:
# Check for leads being created through data import # Check for leads being created through data import
if not self.company_name and not self.flags.ignore_mandatory: if not self.company_name and not self.email_id and not self.flags.ignore_mandatory:
frappe.throw(_("A Lead requires either a person's name or an organization's name")) frappe.throw(_("A Lead requires either a person's name or an organization's name"))
elif self.company_name:
self.lead_name = self.company_name self.lead_name = self.company_name
else:
self.lead_name = self.email_id.split("@")[0]
def set_title(self): def set_title(self):
if self.organization_lead: if self.organization_lead:

View File

@ -16,7 +16,7 @@
"documentation_url": "https://docs.erpnext.com/docs/user/manual/en/CRM", "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/CRM",
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"modified": "2020-05-28 21:07:41.278784", "modified": "2020-07-08 14:05:42.644448",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "CRM", "module": "CRM",
"name": "CRM", "name": "CRM",
@ -35,8 +35,7 @@
"step": "Create and Send Quotation" "step": "Create and Send Quotation"
} }
], ],
"subtitle": "Lead, Opportunity, Customer and more.", "subtitle": "Lead, Opportunity, Customer, and more.",
"success_message": "CRM Module is all Set Up!", "success_message": "The CRM Module is all set up!",
"title": "Let's Set Up Your CRM.", "title": "Let's Set Up Your CRM."
"user_can_dismiss": 1
} }

View File

@ -11,6 +11,7 @@
"title", "title",
"appointment", "appointment",
"procedure_template", "procedure_template",
"medical_code",
"column_break_30", "column_break_30",
"company", "company",
"invoiced", "invoiced",
@ -290,11 +291,19 @@
"no_copy": 1, "no_copy": 1,
"print_hide": 1, "print_hide": 1,
"read_only": 1 "read_only": 1
},
{
"fetch_from": "procedure_template.medical_code",
"fieldname": "medical_code",
"fieldtype": "Link",
"label": "Medical Code",
"options": "Medical Code",
"read_only": 1
} }
], ],
"is_submittable": 1, "is_submittable": 1,
"links": [], "links": [],
"modified": "2020-04-27 21:36:23.796924", "modified": "2020-06-29 14:28:11.779815",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Healthcare", "module": "Healthcare",
"name": "Clinical Procedure", "name": "Clinical Procedure",

View File

@ -30,6 +30,16 @@ frappe.ui.form.on('Clinical Procedure Template', {
mark_change_in_item(frm); mark_change_in_item(frm);
}, },
medical_code: function(frm) {
frm.set_query("medical_code", function() {
return {
filters: {
medical_code_standard: frm.doc.medical_code_standard
}
};
});
},
refresh: function(frm) { refresh: function(frm) {
frm.fields_dict['items'].grid.set_column_disp('barcode', false); frm.fields_dict['items'].grid.set_column_disp('barcode', false);
frm.fields_dict['items'].grid.set_column_disp('batch_no', false); frm.fields_dict['items'].grid.set_column_disp('batch_no', false);

View File

@ -21,6 +21,9 @@
"is_billable", "is_billable",
"rate", "rate",
"medical_department", "medical_department",
"medical_coding_section",
"medical_code_standard",
"medical_code",
"consumables", "consumables",
"consume_stock", "consume_stock",
"items", "items",
@ -46,7 +49,6 @@
"fieldname": "item_code", "fieldname": "item_code",
"fieldtype": "Data", "fieldtype": "Data",
"label": "Item Code", "label": "Item Code",
"options": "Item",
"read_only_depends_on": "eval: !doc.__islocal ", "read_only_depends_on": "eval: !doc.__islocal ",
"reqd": 1 "reqd": 1
}, },
@ -173,10 +175,29 @@
"no_copy": 1, "no_copy": 1,
"options": "Item", "options": "Item",
"read_only": 1 "read_only": 1
},
{
"collapsible": 1,
"fieldname": "medical_coding_section",
"fieldtype": "Section Break",
"label": "Medical Coding"
},
{
"fieldname": "medical_code_standard",
"fieldtype": "Link",
"label": "Medical Code Standard",
"options": "Medical Code Standard"
},
{
"depends_on": "medical_code_standard",
"fieldname": "medical_code",
"fieldtype": "Link",
"label": "Medical Code",
"options": "Medical Code"
} }
], ],
"links": [], "links": [],
"modified": "2020-02-28 14:16:13.184981", "modified": "2020-06-29 14:12:27.158130",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Healthcare", "module": "Healthcare",
"name": "Clinical Procedure Template", "name": "Clinical Procedure Template",

View File

@ -33,9 +33,10 @@
"user", "user",
"invoiced", "invoiced",
"sb_first", "sb_first",
"template",
"lab_test_name", "lab_test_name",
"column_break_26", "column_break_26",
"template", "medical_code",
"lab_test_group", "lab_test_group",
"sb_normal", "sb_normal",
"normal_test_items", "normal_test_items",
@ -424,11 +425,19 @@
"print_hide": 1, "print_hide": 1,
"read_only": 1, "read_only": 1,
"report_hide": 1 "report_hide": 1
},
{
"fetch_from": "template.medical_code",
"fieldname": "medical_code",
"fieldtype": "Link",
"label": "Medical Code",
"options": "Medical Code",
"read_only": 1
} }
], ],
"is_submittable": 1, "is_submittable": 1,
"links": [], "links": [],
"modified": "2020-04-04 19:16:29.131168", "modified": "2020-06-29 14:24:26.509721",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Healthcare", "module": "Healthcare",
"name": "Lab Test", "name": "Lab Test",

View File

@ -8,7 +8,7 @@ frappe.ui.form.on("Lab Test Template",{
if (!frm.doc.lab_test_description) if (!frm.doc.lab_test_description)
frm.set_value("lab_test_description", frm.doc.lab_test_name); frm.set_value("lab_test_description", frm.doc.lab_test_name);
}, },
refresh : function(frm) { refresh: function(frm) {
// Restrict Special, Grouped type templates in Child TestGroups // Restrict Special, Grouped type templates in Child TestGroups
frm.set_query("lab_test_template", "lab_test_groups", function() { frm.set_query("lab_test_template", "lab_test_groups", function() {
return { return {
@ -17,6 +17,15 @@ frappe.ui.form.on("Lab Test Template",{
} }
}; };
}); });
},
medical_code: function(frm) {
frm.set_query("medical_code", function() {
return {
filters: {
medical_code_standard: frm.doc.medical_code_standard
}
};
});
} }
}); });

View File

@ -19,6 +19,9 @@
"disabled", "disabled",
"is_billable", "is_billable",
"lab_test_rate", "lab_test_rate",
"medical_coding_section",
"medical_code_standard",
"medical_code",
"section_break_normal", "section_break_normal",
"lab_test_uom", "lab_test_uom",
"lab_test_normal_range", "lab_test_normal_range",
@ -237,10 +240,29 @@
"fieldtype": "Text", "fieldtype": "Text",
"ignore_xss_filter": 1, "ignore_xss_filter": 1,
"label": "Collection Details" "label": "Collection Details"
},
{
"collapsible": 1,
"fieldname": "medical_coding_section",
"fieldtype": "Section Break",
"label": "Medical Coding"
},
{
"depends_on": "medical_code_standard",
"fieldname": "medical_code",
"fieldtype": "Link",
"label": "Medical Code",
"options": "Medical Code"
},
{
"fieldname": "medical_code_standard",
"fieldtype": "Link",
"label": "Medical Code Standard",
"options": "Medical Code Standard"
} }
], ],
"links": [], "links": [],
"modified": "2020-03-25 16:53:01.740103", "modified": "2020-06-29 14:07:20.772219",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Healthcare", "module": "Healthcare",
"name": "Lab Test Template", "name": "Lab Test Template",

View File

@ -1,156 +1,69 @@
{ {
"allow_copy": 1, "actions": [],
"allow_guest_to_view": 0, "allow_copy": 1,
"allow_import": 1, "allow_import": 1,
"allow_rename": 1, "allow_rename": 1,
"beta": 1, "beta": 1,
"creation": "2017-06-21 13:02:56.122897", "creation": "2017-06-21 13:02:56.122897",
"custom": 0, "doctype": "DocType",
"docstatus": 0, "editable_grid": 1,
"doctype": "DocType", "engine": "InnoDB",
"document_type": "", "field_order": [
"editable_grid": 1, "medical_code_standard",
"engine": "InnoDB", "code",
"description"
],
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0, "fieldname": "medical_code_standard",
"allow_on_submit": 0, "fieldtype": "Link",
"bold": 0, "ignore_user_permissions": 1,
"collapsible": 0, "label": "Medical Code Standard",
"columns": 0, "options": "Medical Code Standard",
"fieldname": "medical_code_standard", "reqd": 1
"fieldtype": "Link", },
"hidden": 0,
"ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Medical Code Standard",
"length": 0,
"no_copy": 0,
"options": "Medical Code Standard",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "code",
"allow_on_submit": 0, "fieldtype": "Data",
"bold": 0, "ignore_xss_filter": 1,
"collapsible": 0, "in_list_view": 1,
"columns": 0, "label": "Code",
"fieldname": "code", "reqd": 1,
"fieldtype": "Data", "unique": 1
"hidden": 0, },
"ignore_user_permissions": 0,
"ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Code",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "bold": 1,
"allow_on_submit": 0, "fieldname": "description",
"bold": 1, "fieldtype": "Small Text",
"collapsible": 0, "ignore_xss_filter": 1,
"columns": 0, "in_list_view": 1,
"fieldname": "description", "label": "Description"
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
} }
], ],
"has_web_view": 0, "links": [],
"hide_heading": 0, "modified": "2020-06-29 14:02:30.980032",
"hide_toolbar": 0, "modified_by": "Administrator",
"idx": 0, "module": "Healthcare",
"image_view": 0, "name": "Medical Code",
"in_create": 0, "owner": "Administrator",
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-10-04 17:08:11.053418",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Medical Code",
"name_case": "",
"owner": "Administrator",
"permissions": [ "permissions": [
{ {
"amend": 0, "create": 1,
"apply_user_permissions": 0, "delete": 1,
"cancel": 0, "email": 1,
"create": 1, "export": 1,
"delete": 1, "print": 1,
"email": 1, "read": 1,
"export": 1, "report": 1,
"if_owner": 0, "role": "Physician",
"import": 0, "share": 1,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Physician",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1 "write": 1
} }
], ],
"quick_entry": 1, "quick_entry": 1,
"read_only": 0, "restrict_to_domain": "Healthcare",
"read_only_onload": 0, "search_fields": "code, description",
"restrict_to_domain": "Healthcare", "sort_field": "modified",
"search_fields": "code, description", "sort_order": "DESC",
"show_name_in_global_search": 0, "track_changes": 1
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "",
"track_changes": 1,
"track_seen": 0
} }

View File

@ -73,7 +73,7 @@ def update_encounter_medical_record(encounter):
insert_encounter_to_medical_record(encounter) insert_encounter_to_medical_record(encounter)
def delete_medical_record(encounter): def delete_medical_record(encounter):
frappe.db.delete_doc_if_exists('Patient Medical Record', 'reference_name', encounter.name) frappe.delete_doc_if_exists('Patient Medical Record', 'reference_name', encounter.name)
def set_subject_field(encounter): def set_subject_field(encounter):
subject = frappe.bold(_('Healthcare Practitioner: ')) + encounter.practitioner + '<br>' subject = frappe.bold(_('Healthcare Practitioner: ')) + encounter.practitioner + '<br>'

View File

@ -19,6 +19,7 @@
"practitioner", "practitioner",
"department", "department",
"details_section", "details_section",
"medical_code",
"duration", "duration",
"rate", "rate",
"location", "location",
@ -206,11 +207,19 @@
"fieldtype": "Data", "fieldtype": "Data",
"label": "Patient Name", "label": "Patient Name",
"read_only": 1 "read_only": 1
},
{
"fetch_from": "therapy_type.medical_code",
"fieldname": "medical_code",
"fieldtype": "Link",
"label": "Medical Code",
"options": "Medical Code",
"read_only": 1
} }
], ],
"is_submittable": 1, "is_submittable": 1,
"links": [], "links": [],
"modified": "2020-04-29 16:49:16.286006", "modified": "2020-06-29 14:33:34.836594",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Healthcare", "module": "Healthcare",
"name": "Therapy Session", "name": "Therapy Session",

View File

@ -45,6 +45,16 @@ frappe.ui.form.on('Therapy Type', {
medical_department: function(frm) { medical_department: function(frm) {
mark_change_in_item(frm); mark_change_in_item(frm);
},
medical_code: function(frm) {
frm.set_query("medical_code", function() {
return {
filters: {
medical_code_standard: frm.doc.medical_code_standard
}
};
});
} }
}); });

View File

@ -22,6 +22,9 @@
"item_group", "item_group",
"column_break_12", "column_break_12",
"description", "description",
"medical_coding_section",
"medical_code_standard",
"medical_code",
"section_break_18", "section_break_18",
"therapy_for", "therapy_for",
"add_exercises", "add_exercises",
@ -160,10 +163,30 @@
{ {
"fieldname": "section_break_18", "fieldname": "section_break_18",
"fieldtype": "Section Break" "fieldtype": "Section Break"
},
{
"collapsible": 1,
"fieldname": "medical_coding_section",
"fieldtype": "Section Break",
"label": "Medical Coding",
"options": "Medical Coding"
},
{
"fieldname": "medical_code_standard",
"fieldtype": "Link",
"label": "Medical Code Standard",
"options": "Medical Code Standard"
},
{
"depends_on": "medical_code_standard",
"fieldname": "medical_code",
"fieldtype": "Link",
"label": "Medical Code",
"options": "Medical Code"
} }
], ],
"links": [], "links": [],
"modified": "2020-04-21 13:09:04.006289", "modified": "2020-06-29 14:18:50.669951",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Healthcare", "module": "Healthcare",
"name": "Therapy Type", "name": "Therapy Type",

View File

@ -10,7 +10,7 @@
"documentation_url": "https://docs.erpnext.com/docs/user/manual/en/healthcare", "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/healthcare",
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"modified": "2020-05-26 23:16:37.603361", "modified": "2020-07-08 14:06:19.512946",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Healthcare", "module": "Healthcare",
"name": "Healthcare", "name": "Healthcare",
@ -35,8 +35,7 @@
"step": "Explore Clinical Procedure Templates" "step": "Explore Clinical Procedure Templates"
} }
], ],
"subtitle": "Patients, Practitioner Schedules, Settings and more.", "subtitle": "Patients, Practitioner Schedules, Settings, and more.",
"success_message": "Yayy! The Healthcare Module is all set up!", "success_message": "The Healthcare Module is all set up!",
"title": "Let's Setup the Healthcare Module", "title": "Let's Set Up the Healthcare Module."
"user_can_dismiss": 1
} }

View File

@ -123,7 +123,7 @@ def get_number_cards():
number_cards.append( number_cards.append(
get_number_cards_doc("Employee", "New Joinees (Last year)", filters_json = json.dumps([ get_number_cards_doc("Employee", "New Joinees (Last year)", filters_json = json.dumps([
["Employee","date_of_joining","Previous","1 year"], ["Employee","date_of_joining","Timespan","last year"],
["Employee","status","=","Active"] ["Employee","status","=","Active"]
]) ])
) )
@ -131,7 +131,7 @@ def get_number_cards():
number_cards.append( number_cards.append(
get_number_cards_doc("Employee", "Employees Left (Last year)", filters_json = json.dumps([ get_number_cards_doc("Employee", "Employees Left (Last year)", filters_json = json.dumps([
["Employee", "relieving_date", "Previous", "1 year"], ["Employee", "relieving_date", "Timespan", "last year"],
["Employee", "status", "=", "Left"] ["Employee", "status", "=", "Left"]
]) ])
) )
@ -139,7 +139,7 @@ def get_number_cards():
number_cards.append( number_cards.append(
get_number_cards_doc("Job Applicant", "Total Applicants (Last month)", filters_json = json.dumps([ get_number_cards_doc("Job Applicant", "Total Applicants (Last month)", filters_json = json.dumps([
["Job Applicant", "creation", "Previous", "1 month"] ["Job Applicant", "creation", "Timespan", "last month"]
]) ])
) )
) )

View File

@ -410,6 +410,8 @@
"options": "Branch" "options": "Branch"
}, },
{ {
"fetch_from": "grade.default_leave_policy",
"fetch_if_empty": 1,
"fieldname": "leave_policy", "fieldname": "leave_policy",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Leave Policy", "label": "Leave Policy",
@ -804,16 +806,14 @@
"fieldname": "expense_approver", "fieldname": "expense_approver",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Expense Approver", "label": "Expense Approver",
"options": "User", "options": "User"
"show_days": 1,
"show_seconds": 1
} }
], ],
"icon": "fa fa-user", "icon": "fa fa-user",
"idx": 24, "idx": 24,
"image_field": "image", "image_field": "image",
"links": [], "links": [],
"modified": "2020-06-18 18:01:27.223535", "modified": "2020-07-03 21:28:04.109189",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employee", "name": "Employee",

View File

@ -413,7 +413,11 @@ def get_employee_emails(employee_list):
@frappe.whitelist() @frappe.whitelist()
def get_children(doctype, parent=None, company=None, is_root=False, is_tree=False): def get_children(doctype, parent=None, company=None, is_root=False, is_tree=False):
filters = [['company', '=', company]]
filters = []
if company and company != 'All Companies':
filters = [['company', '=', company]]
fields = ['name as value', 'employee_name as title'] fields = ['name as value', 'employee_name as title']
if is_root: if is_root:

View File

@ -4,7 +4,7 @@ frappe.treeview_settings['Employee'] = {
{ {
fieldname: "company", fieldname: "company",
fieldtype:"Select", fieldtype:"Select",
options: erpnext.utils.get_tree_options("company"), options: ['All Companies'].concat(erpnext.utils.get_tree_options("company")),
label: __("Company"), label: __("Company"),
default: erpnext.utils.get_tree_default("company") default: erpnext.utils.get_tree_default("company")
} }

View File

@ -40,6 +40,8 @@ frappe.ui.form.on("Leave Application", {
validate: function(frm) { validate: function(frm) {
if (frm.doc.from_date == frm.doc.to_date && frm.doc.half_day == 1){ if (frm.doc.from_date == frm.doc.to_date && frm.doc.half_day == 1){
frm.doc.half_day_date = frm.doc.from_date; frm.doc.half_day_date = frm.doc.from_date;
}else if (frm.doc.half_day == 0){
frm.doc.half_day_date = "";
} }
frm.toggle_reqd("half_day_date", frm.doc.half_day == 1); frm.toggle_reqd("half_day_date", frm.doc.half_day == 1);
}, },

View File

@ -293,6 +293,8 @@ class LeaveApplication(Document):
def set_half_day_date(self): def set_half_day_date(self):
if self.from_date == self.to_date and self.half_day == 1: if self.from_date == self.to_date and self.half_day == 1:
self.half_day_date = self.from_date self.half_day_date = self.from_date
elif self.half_day == 0:
self.half_day_date = None
def notify_employee(self): def notify_employee(self):
employee = frappe.get_doc("Employee", self.employee) employee = frappe.get_doc("Employee", self.employee)

View File

@ -13,7 +13,7 @@
"documentation_url": "https://docs.erpnext.com/docs/user/manual/en/human-resources", "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/human-resources",
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"modified": "2020-05-20 11:20:07.992597", "modified": "2020-07-08 14:05:47.018799",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Human Resource", "name": "Human Resource",
@ -44,8 +44,7 @@
"step": "HR Settings" "step": "HR Settings"
} }
], ],
"subtitle": "Employee, Leaves and more.", "subtitle": "Employee, Leaves, and more.",
"success_message": "The HR Module is all set up!", "success_message": "The Human Resource Module is all set up!",
"title": "Let's Setup the Human Resource Module. ", "title": "Let's Set Up the Human Resource Module. "
"user_can_dismiss": 0
} }

View File

@ -19,7 +19,7 @@
"documentation_url": "https://docs.erpnext.com/docs/user/manual/en/manufacturing", "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/manufacturing",
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"modified": "2020-06-29 20:25:36.899106", "modified": "2020-07-08 14:05:56.197563",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "Manufacturing", "name": "Manufacturing",
@ -50,7 +50,7 @@
"step": "Explore Manufacturing Settings" "step": "Explore Manufacturing Settings"
} }
], ],
"subtitle": "Products, Raw Materials, BOM, Work Order and more.", "subtitle": "Products, Raw Materials, BOM, Work Order, and more.",
"success_message": "Manufacturing module is all setup!", "success_message": "Manufacturing module is all set up!",
"title": "Let's Set Up the Manufacturing Module" "title": "Let's Set Up the Manufacturing Module."
} }

View File

@ -13,6 +13,7 @@ class EmployeeIncentive(Document):
additional_salary = frappe.new_doc('Additional Salary') additional_salary = frappe.new_doc('Additional Salary')
additional_salary.employee = self.employee additional_salary.employee = self.employee
additional_salary.salary_component = self.salary_component additional_salary.salary_component = self.salary_component
additional_salary.overwrite_salary_structure_amount = 0
additional_salary.amount = self.incentive_amount additional_salary.amount = self.incentive_amount
additional_salary.payroll_date = self.payroll_date additional_salary.payroll_date = self.payroll_date
additional_salary.company = company additional_salary.company = company

View File

@ -30,6 +30,7 @@ frappe.ui.form.on('Payroll Entry', {
).toggleClass('btn-primary', !(frm.doc.employees || []).length); ).toggleClass('btn-primary', !(frm.doc.employees || []).length);
} }
if ((frm.doc.employees || []).length) { if ((frm.doc.employees || []).length) {
frm.page.clear_primary_action();
frm.page.set_primary_action(__('Create Salary Slips'), () => { frm.page.set_primary_action(__('Create Salary Slips'), () => {
frm.save('Submit').then(()=>{ frm.save('Submit').then(()=>{
frm.page.clear_primary_action(); frm.page.clear_primary_action();
@ -49,13 +50,14 @@ frappe.ui.form.on('Payroll Entry', {
return frappe.call({ return frappe.call({
doc: frm.doc, doc: frm.doc,
method: 'fill_employee_details', method: 'fill_employee_details',
callback: function(r) { }).then(r => {
if (r.docs[0].employees){ if (r.docs && r.docs[0].employees){
frm.save(); frm.employees = r.docs[0].employees;
frm.refresh(); frm.dirty();
if(r.docs[0].validate_attendance){ frm.save();
render_employee_attendance(frm, r.message); frm.refresh();
} if(r.docs[0].validate_attendance){
render_employee_attendance(frm, r.message);
} }
} }
}) })

View File

@ -26,6 +26,7 @@ class RetentionBonus(Document):
additional_salary.amount = self.bonus_amount additional_salary.amount = self.bonus_amount
additional_salary.payroll_date = self.bonus_payment_date additional_salary.payroll_date = self.bonus_payment_date
additional_salary.company = company additional_salary.company = company
additional_salary.overwrite_salary_structure_amount = 0
additional_salary.ref_doctype = self.doctype additional_salary.ref_doctype = self.doctype
additional_salary.ref_docname = self.name additional_salary.ref_docname = self.name
additional_salary.submit() additional_salary.submit()
@ -53,7 +54,7 @@ class RetentionBonus(Document):
'employee': self.employee, 'employee': self.employee,
'salary_component': self.salary_component, 'salary_component': self.salary_component,
'payroll_date': self.bonus_payment_date, 'payroll_date': self.bonus_payment_date,
'company': company, 'company': self.company,
'docstatus': 1, 'docstatus': 1,
'ref_doctype': self.doctype, 'ref_doctype': self.doctype,
'ref_docname': self.name 'ref_docname': self.name

View File

@ -13,7 +13,7 @@
"documentation_url": "https://docs.erpnext.com/docs/user/manual/en/human-resources/payroll-entry", "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/human-resources/payroll-entry",
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"modified": "2020-06-29 17:00:25.113341", "modified": "2020-07-08 14:06:13.994310",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Payroll", "module": "Payroll",
"name": "Payroll", "name": "Payroll",
@ -44,8 +44,7 @@
"step": "Payroll Settings" "step": "Payroll Settings"
} }
], ],
"subtitle": "Salary, Compensations and more.", "subtitle": "Salary, Compensation, and more.",
"success_message": "The Payroll is all set up!", "success_message": "The Payroll Module is all set up!",
"title": "Let's Setup the Payroll Module. ", "title": "Let's Set Up the Payroll Module. "
"user_can_dismiss": 1
} }

View File

@ -15,5 +15,5 @@
"reference_document": "Employee", "reference_document": "Employee",
"show_full_form": 0, "show_full_form": 0,
"title": "Create Employee", "title": "Create Employee",
"validate_action": 1 "validate_action": 0
} }

View File

@ -8,7 +8,7 @@
"is_mandatory": 1, "is_mandatory": 1,
"is_single": 0, "is_single": 0,
"is_skipped": 0, "is_skipped": 0,
"modified": "2020-06-29 11:53:54.553947", "modified": "2020-06-01 11:53:54.553947",
"modified_by": "Administrator", "modified_by": "Administrator",
"name": "Create Payroll Period", "name": "Create Payroll Period",
"owner": "Administrator", "owner": "Administrator",

View File

@ -1,19 +1,19 @@
{ {
"action": "Update Settings", "action": "Go to Page",
"creation": "2020-06-04 16:34:29.664917", "creation": "2020-06-04 16:34:29.664917",
"docstatus": 0, "docstatus": 0,
"doctype": "Onboarding Step", "doctype": "Onboarding Step",
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"is_mandatory": 0, "is_mandatory": 0,
"is_single": 1, "is_single": 0,
"is_skipped": 0, "is_skipped": 0,
"modified": "2020-06-29 16:34:29.664917", "modified": "2020-06-04 16:34:29.664917",
"modified_by": "Administrator", "modified_by": "Administrator",
"name": "Payroll Settings", "name": "Payroll Settings",
"owner": "Administrator", "owner": "Administrator",
"reference_document": "Payroll Settings", "path": "#Form/Payroll Settings",
"show_full_form": 0, "show_full_form": 0,
"title": "Payroll Settings", "title": "Payroll Settings",
"validate_action": 0 "validate_action": 1
} }

View File

@ -3,55 +3,36 @@
frappe.provide("erpnext.projects"); frappe.provide("erpnext.projects");
cur_frm.add_fetch("project", "company", "company");
frappe.ui.form.on("Task", { frappe.ui.form.on("Task", {
onload: function(frm) { setup: function (frm) {
frm.set_query("task", "depends_on", function() { frm.set_query("project", function () {
var filters = { return {
query: "erpnext.projects.doctype.task.task.get_project"
}
});
frm.make_methods = {
'Timesheet': () => frappe.model.open_mapped_doc({
method: 'erpnext.projects.doctype.task.task.make_timesheet',
frm: frm
})
}
},
onload: function (frm) {
frm.set_query("task", "depends_on", function () {
let filters = {
name: ["!=", frm.doc.name] name: ["!=", frm.doc.name]
}; };
if(frm.doc.project) filters["project"] = frm.doc.project; if (frm.doc.project) filters["project"] = frm.doc.project;
return { return {
filters: filters filters: filters
}; };
}) })
}, },
refresh: function(frm) { refresh: function (frm) {
frm.fields_dict['parent_task'].get_query = function () { frm.set_query("parent_task", { "is_group": 1 });
return {
filters: {
"is_group": 1,
}
}
}
if (!frm.doc.is_group) {
if (!frm.is_new()) {
if (frappe.model.can_read("Timesheet")) {
frm.add_custom_button(__("Timesheet"), () => {
frappe.route_options = { "project": frm.doc.project, "task": frm.doc.name }
frappe.set_route("List", "Timesheet");
}, __("View"), true);
}
if (frappe.model.can_read("Expense Claim")) {
frm.add_custom_button(__("Expense Claims"), () => {
frappe.route_options = { "project": frm.doc.project, "task": frm.doc.name };
frappe.set_route("List", "Expense Claim");
}, __("View"), true);
}
}
}
},
setup: function(frm) {
frm.fields_dict.project.get_query = function() {
return {
query: "erpnext.projects.doctype.task.task.get_project"
}
};
}, },
is_group: function (frm) { is_group: function (frm) {
@ -69,12 +50,8 @@ frappe.ui.form.on("Task", {
}) })
}, },
validate: function(frm) { validate: function (frm) {
frm.doc.project && frappe.model.remove_from_locals("Project", frm.doc.project && frappe.model.remove_from_locals("Project",
frm.doc.project); frm.doc.project);
}, }
}); });
cur_frm.add_fetch('task', 'subject', 'subject');
cur_frm.add_fetch('task', 'project', 'project');

View File

@ -325,6 +325,7 @@
"options": "Department" "options": "Department"
}, },
{ {
"fetch_from": "project.company",
"fieldname": "company", "fieldname": "company",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Company", "label": "Company",

View File

@ -7,10 +7,11 @@ import json
import frappe import frappe
from frappe import _, throw from frappe import _, throw
from frappe.desk.form.assign_to import clear, close_all_assignments
from frappe.model.mapper import get_mapped_doc
from frappe.utils import add_days, cstr, date_diff, get_link_to_form, getdate, today from frappe.utils import add_days, cstr, date_diff, get_link_to_form, getdate, today
from frappe.utils.nestedset import NestedSet from frappe.utils.nestedset import NestedSet
from frappe.desk.form.assign_to import close_all_assignments, clear
from frappe.utils import date_diff
class CircularReferenceError(frappe.ValidationError): pass class CircularReferenceError(frappe.ValidationError): pass
class EndDateCannotBeGreaterThanProjectEndDateError(frappe.ValidationError): pass class EndDateCannotBeGreaterThanProjectEndDateError(frappe.ValidationError): pass
@ -220,6 +221,26 @@ def set_tasks_as_overdue():
continue continue
frappe.get_doc("Task", task.name).update_status() frappe.get_doc("Task", task.name).update_status()
@frappe.whitelist()
def make_timesheet(source_name, target_doc=None, ignore_permissions=False):
def set_missing_values(source, target):
target.append("time_logs", {
"hours": source.actual_time,
"completed": source.status == "Completed",
"project": source.project,
"task": source.name
})
doclist = get_mapped_doc("Task", source_name, {
"Task": {
"doctype": "Timesheet"
}
}, target_doc, postprocess=set_missing_values, ignore_permissions=ignore_permissions)
return doclist
@frappe.whitelist() @frappe.whitelist()
def get_children(doctype, parent, task=None, project=None, is_root=False): def get_children(doctype, parent, task=None, project=None, is_root=False):

View File

@ -26,7 +26,7 @@ class ProductBundle(Document):
def validate_child_items(self): def validate_child_items(self):
for item in self.items: for item in self.items:
if frappe.db.exists("Product Bundle", item.item_code): if frappe.db.exists("Product Bundle", item.item_code):
frappe.throw(_("Child Item should not be a Product Bundle. Please remove item `{0}` and save").format(item.item_code)) frappe.throw(_("Row #{0}: Child Item should not be a Product Bundle. Please remove Item {1} and Save").format(item.idx, frappe.bold(item.item_code)))
@frappe.whitelist() @frappe.whitelist()
def get_new_item_code(doctype, txt, searchfield, start, page_len, filters): def get_new_item_code(doctype, txt, searchfield, start, page_len, filters):

View File

@ -19,7 +19,7 @@
"documentation_url": "https://docs.erpnext.com/docs/user/manual/en/selling", "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/selling",
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"modified": "2020-06-01 13:35:16.100512", "modified": "2020-07-08 14:05:37.669753",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",
"name": "Selling", "name": "Selling",
@ -47,8 +47,7 @@
"step": "Selling Settings" "step": "Selling Settings"
} }
], ],
"subtitle": "Products, Sales, Analysis and more.", "subtitle": "Products, Sales, Analysis, and more.",
"success_message": "The Selling Module is all set up!", "success_message": "The Selling Module is all set up!",
"title": "Let's Set Up the Selling Module.", "title": "Let's Set Up the Selling Module."
"user_can_dismiss": 1
} }

View File

@ -8,13 +8,13 @@
"is_mandatory": 0, "is_mandatory": 0,
"is_single": 0, "is_single": 0,
"is_skipped": 0, "is_skipped": 0,
"modified": "2020-05-19 18:54:19.383397", "modified": "2020-07-04 12:33:16.970031",
"modified_by": "Administrator", "modified_by": "Administrator",
"name": "Setup your Warehouse", "name": "Setup your Warehouse",
"owner": "Administrator", "owner": "Administrator",
"path": "Tree/Warehouse", "path": "Tree/Warehouse",
"reference_document": "Warehouse", "reference_document": "Warehouse",
"show_full_form": 0, "show_full_form": 0,
"title": "Setup your Warehouse", "title": "Set up your Warehouse",
"validate_action": 1 "validate_action": 1
} }

View File

@ -29,12 +29,10 @@ def after_install():
def check_setup_wizard_not_completed(): def check_setup_wizard_not_completed():
if frappe.db.get_default('desktop:home_page') == 'desktop': if frappe.db.get_default('desktop:home_page') != 'setup-wizard':
print() message = """ERPNext can only be installed on a fresh site where the setup wizard is not completed.
print("ERPNext can only be installed on a fresh site where the setup wizard is not completed") You can reinstall this site (after saving your data) using: bench --site [sitename] reinstall"""
print("You can reinstall this site (after saving your data) using: bench --site [sitename] reinstall") frappe.throw(message)
print()
return False
def set_single_defaults(): def set_single_defaults():
@ -105,4 +103,3 @@ def add_company_to_session_defaults():
"ref_doctype": "Company" "ref_doctype": "Company"
}) })
settings.save() settings.save()

View File

@ -172,7 +172,7 @@
"default": "Today", "default": "Today",
"fieldname": "valid_from", "fieldname": "valid_from",
"fieldtype": "Date", "fieldtype": "Date",
"label": "Valid From " "label": "Valid From"
}, },
{ {
"default": "0", "default": "0",
@ -187,7 +187,7 @@
{ {
"fieldname": "valid_upto", "fieldname": "valid_upto",
"fieldtype": "Date", "fieldtype": "Date",
"label": "Valid Upto " "label": "Valid Upto"
}, },
{ {
"fieldname": "section_break_24", "fieldname": "section_break_24",
@ -208,7 +208,7 @@
"icon": "fa fa-flag", "icon": "fa fa-flag",
"idx": 1, "idx": 1,
"links": [], "links": [],
"modified": "2020-02-28 14:21:25.580331", "modified": "2020-07-06 22:31:32.943475",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Item Price", "name": "Item Price",

View File

@ -190,23 +190,6 @@ class SerialNo(StockController):
if sle_exists: if sle_exists:
frappe.throw(_("Cannot delete Serial No {0}, as it is used in stock transactions").format(self.name)) frappe.throw(_("Cannot delete Serial No {0}, as it is used in stock transactions").format(self.name))
def before_rename(self, old, new, merge=False):
if merge:
frappe.throw(_("Sorry, Serial Nos cannot be merged"))
def after_rename(self, old, new, merge=False):
"""rename serial_no text fields"""
for dt in frappe.db.sql("""select parent from tabDocField
where fieldname='serial_no' and fieldtype in ('Text', 'Small Text')"""):
for item in frappe.db.sql("""select name, serial_no from `tab%s`
where serial_no like %s""" % (dt[0], frappe.db.escape('%' + old + '%'))):
serial_nos = map(lambda i: new if i.upper()==old.upper() else i, item[1].split('\n'))
frappe.db.sql("""update `tab%s` set serial_no = %s
where name=%s""" % (dt[0], '%s', '%s'),
('\n'.join(list(serial_nos)), item[0]))
def update_serial_no_reference(self, serial_no=None): def update_serial_no_reference(self, serial_no=None):
last_sle = self.get_last_sle(serial_no) last_sle = self.get_last_sle(serial_no)
self.set_purchase_details(last_sle.get("purchase_sle")) self.set_purchase_details(last_sle.get("purchase_sle"))

View File

@ -19,7 +19,7 @@
"documentation_url": "https://docs.erpnext.com/docs/user/manual/en/stock", "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/stock",
"idx": 0, "idx": 0,
"is_complete": 0, "is_complete": 0,
"modified": "2020-06-29 16:41:09.440378", "modified": "2020-07-08 14:22:07.951891",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Stock", "name": "Stock",
@ -47,7 +47,7 @@
"step": "Stock Settings" "step": "Stock Settings"
} }
], ],
"subtitle": "Inventory, Warehouses, Analysis and more.", "subtitle": "Inventory, Warehouses, Analysis, and more.",
"success_message": "The Stock Module is all set up!", "success_message": "The Stock Module is all set up!",
"title": "Let's Set Up the Stock Module." "title": "Let's Set Up the Stock Module."
} }

View File

@ -8,7 +8,7 @@
"is_mandatory": 0, "is_mandatory": 0,
"is_single": 0, "is_single": 0,
"is_skipped": 0, "is_skipped": 0,
"modified": "2020-06-29 16:36:53.948242", "modified": "2020-05-14 22:09:10.043554",
"modified_by": "Administrator", "modified_by": "Administrator",
"name": "Create a Supplier", "name": "Create a Supplier",
"owner": "Administrator", "owner": "Administrator",

View File

@ -8,13 +8,13 @@
"is_mandatory": 0, "is_mandatory": 0,
"is_single": 0, "is_single": 0,
"is_skipped": 0, "is_skipped": 0,
"modified": "2020-05-19 18:54:19.383397", "modified": "2020-07-04 12:33:16.970031",
"modified_by": "Administrator", "modified_by": "Administrator",
"name": "Setup your Warehouse", "name": "Setup your Warehouse",
"owner": "Administrator", "owner": "Administrator",
"path": "Tree/Warehouse", "path": "Tree/Warehouse",
"reference_document": "Warehouse", "reference_document": "Warehouse",
"show_full_form": 0, "show_full_form": 0,
"title": "Setup your Warehouse", "title": "Set up your Warehouse",
"validate_action": 1 "validate_action": 1
} }

View File

@ -21,7 +21,7 @@ def execute(filters=None):
for cd in consumed_details.get(item_code): for cd in consumed_details.get(item_code):
if (cd.voucher_no not in material_transfer_vouchers): if (cd.voucher_no not in material_transfer_vouchers):
if cd.voucher_type=="Delivery Note": if cd.voucher_type in ["Delivery Note", "Sales Invoice"]:
delivered_qty += abs(flt(cd.actual_qty)) delivered_qty += abs(flt(cd.actual_qty))
delivered_amount += abs(flt(cd.stock_value_difference)) delivered_amount += abs(flt(cd.stock_value_difference))
elif cd.voucher_type!="Delivery Note": elif cd.voucher_type!="Delivery Note":

View File

@ -121,7 +121,6 @@ class TransactionBase(StatusUpdater):
def validate_rate_with_reference_doc(self, ref_details): def validate_rate_with_reference_doc(self, ref_details):
buying_doctypes = ["Purchase Order", "Purchase Invoice", "Purchase Receipt"] buying_doctypes = ["Purchase Order", "Purchase Invoice", "Purchase Receipt"]
selling_doctypes = ["Sales Invoice", "Delivery Note"]
if self.doctype in buying_doctypes: if self.doctype in buying_doctypes:
to_disable = "Maintain same rate throughout Purchase cycle" to_disable = "Maintain same rate throughout Purchase cycle"