Merge pull request #23460 from marination/cost-center-validation

fix: Avoid validation of group cost center on repost
This commit is contained in:
Deepesh Garg
2020-09-29 20:26:51 +05:30
committed by GitHub

View File

@@ -138,7 +138,7 @@ class GLEntry(Document):
frappe.throw(_("{0} {1}: Cost Center {2} does not belong to Company {3}")
.format(self.voucher_type, self.voucher_no, self.cost_center, self.company))
if self.cost_center and _check_is_group():
if not self.flags.from_repost and self.cost_center and _check_is_group():
frappe.throw(_("""{0} {1}: Cost Center {2} is a group cost center and group cost centers cannot
be used in transactions""").format(self.voucher_type, self.voucher_no, frappe.bold(self.cost_center)))