From 6a577438aa93d00160fde18887e7bdc6a58ce3ed Mon Sep 17 00:00:00 2001 From: Venkatesh <47534423+venkat102@users.noreply.github.com> Date: Wed, 19 Feb 2025 15:39:01 +0530 Subject: [PATCH] fix(pos profile): check company while validating mandatory accounting dimension (#45974) (cherry picked from commit 17a2f4429034a1b824226902975c4f8bc963b975) --- erpnext/accounts/doctype/pos_profile/pos_profile.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.py b/erpnext/accounts/doctype/pos_profile/pos_profile.py index 3b5aa5f75bd..a8c4a4d8d72 100644 --- a/erpnext/accounts/doctype/pos_profile/pos_profile.py +++ b/erpnext/accounts/doctype/pos_profile/pos_profile.py @@ -76,7 +76,11 @@ class POSProfile(Document): def validate_accounting_dimensions(self): acc_dims = get_checks_for_pl_and_bs_accounts() for acc_dim in acc_dims: - if not self.get(acc_dim.fieldname) and (acc_dim.mandatory_for_pl or acc_dim.mandatory_for_bs): + if ( + self.company == acc_dim.company + and not self.get(acc_dim.fieldname) + and (acc_dim.mandatory_for_pl or acc_dim.mandatory_for_bs) + ): frappe.throw( _( "{0} is a mandatory Accounting Dimension.
"