From 03c517203d06eb113745c73be4d918cf0b60a58e Mon Sep 17 00:00:00 2001 From: Ashkar Date: Wed, 7 May 2025 22:31:25 +0530 Subject: [PATCH] pos branch setup --- posnext/doc_events/sales_invoice.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/posnext/doc_events/sales_invoice.py b/posnext/doc_events/sales_invoice.py index 171c68e..8fb317e 100644 --- a/posnext/doc_events/sales_invoice.py +++ b/posnext/doc_events/sales_invoice.py @@ -2,8 +2,10 @@ def validate_si(doc,method): - # if 'branch' not in doc.__dict__: - # frappe.throw("Create Branch Accounting Dimensions.") + if doc.pos_profile: + show_branch = frappe.db.get_value("POS Profile",doc.pos_profile,'show_branch') + if 'branch' not in doc.__dict__ and show_branch==1: + frappe.throw("Create Branch Accounting Dimensions.") if doc.is_return and doc.is_pos: doc.update_outstanding_for_self = 0 if doc.payments: