mirror of
https://github.com/frappe/erpnext.git
synced 2026-10-29 22:57:42 +00:00
fix(accounts): validate cost center allocation child company
(cherry picked from commit 03cf8eaf98)
This commit is contained in:
@@ -151,6 +151,14 @@ class CostCenterAllocation(Document):
|
||||
]
|
||||
|
||||
for d in self.allocation_percentages:
|
||||
if frappe.get_cached_value("Cost Center", d.cost_center, "company") != self.company:
|
||||
frappe.throw(
|
||||
_("Row {0}: Cost Center {1} does not belong to Company {2}").format(
|
||||
d.idx, d.cost_center, self.company
|
||||
),
|
||||
InvalidChildCostCenter,
|
||||
)
|
||||
|
||||
if d.cost_center in main_cost_centers:
|
||||
frappe.throw(
|
||||
_(
|
||||
|
||||
Reference in New Issue
Block a user