fix(regional): set frappe.flags.company temporarily, where required
(cherry picked from commit 4205f564a0)
This commit is contained in:
13
erpnext/utilities/regional.py
Normal file
13
erpnext/utilities/regional.py
Normal 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)
|
||||
Reference in New Issue
Block a user