fix(regional): set frappe.flags.company temporarily, where required

(cherry picked from commit 4205f564a0)
This commit is contained in:
Sagar Vora
2023-07-24 18:37:36 +05:30
committed by Mergify
parent e867fe77a4
commit 73e9b38cda
4 changed files with 28 additions and 18 deletions

View File

@@ -0,0 +1,13 @@
from contextlib import contextmanager
import frappe
@contextmanager
def temporary_flag(flag_name, value):
flags = frappe.local.flags
flags[flag_name] = value
try:
yield
finally:
flags.pop(flag_name, None)