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: