Merge branch 'hotfix' into revert_change

This commit is contained in:
Anurag Mishra
2019-05-20 16:22:20 +05:30
committed by GitHub
3 changed files with 8 additions and 2 deletions

View File

@@ -211,6 +211,11 @@ frappe.query_reports["General Ledger"] = {
"label": __("Currency"),
"fieldtype": "Select",
"options": erpnext.get_presentation_currency_list()
},
{
"fieldname": "show_opening_entries",
"label": __("Show Opening Entries"),
"fieldtype": "Check"
}
]
}

View File

@@ -283,7 +283,8 @@ def get_accountwise_gle(filters, gl_entries, gle_map):
from_date, to_date = getdate(filters.from_date), getdate(filters.to_date)
for gle in gl_entries:
if gle.posting_date < from_date or cstr(gle.is_opening) == "Yes":
if (gle.posting_date < from_date or
(cstr(gle.is_opening) == "Yes" and not filters.get("show_opening_entries"))):
update_value_in_dict(gle_map[gle.get(group_by)].totals, 'opening', gle)
update_value_in_dict(totals, 'opening', gle)

View File

@@ -110,7 +110,7 @@ class Lead(SellingController):
def set_lead_name(self):
if not self.lead_name:
# Check for leads being created through data import
if not self.company_name:
if not self.company_name and not self.flags.ignore_mandatory:
frappe.throw(_("A Lead requires either a person's name or an organization's name"))
self.lead_name = self.company_name