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

This commit is contained in:
Sagar Vora
2023-07-24 18:37:36 +05:30
parent 1436040d4c
commit 4205f564a0
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)