def get_account(self, name, **pattern): if self.account_parent: return self.parent.get_account(name, **pattern) else: transaction = Transaction() with transaction.reset_context(), \ transaction.set_context(self._context): return self.get_multivalue(name[:-5], **pattern)
def wrapper(self, *args, **kwargs): if not self.getter_with_context: transaction = Transaction() context = { k: v for k, v in transaction.context.items() if k in transaction.cache_keys } with transaction.reset_context(), \ transaction.set_context(context): return func(self, *args, **kwargs) else: return func(self, *args, **kwargs)
def list_price_used(self): transaction = Transaction() with transaction.reset_context(), \ transaction.set_context(self._context): return self.template.get_multivalue('list_price')