Clear lot cache after SQL UPDATE. #048200
This commit is contained in:
parent
79fa2a439d
commit
8a8bad1e9c
18
stock.py
18
stock.py
|
@ -77,18 +77,14 @@ class Lot(DeactivableMixin, metaclass=PoolMeta):
|
|||
# Increase transaction counter
|
||||
Transaction().counter += 1
|
||||
|
||||
# Clean local cache
|
||||
for record in lots:
|
||||
local_cache = record._local_cache.get(record.id)
|
||||
if local_cache:
|
||||
local_cache.clear()
|
||||
|
||||
# Clean cursor cache
|
||||
for cache in Transaction().cache.values():
|
||||
if cls.__name__ in cache:
|
||||
for record in lots:
|
||||
if record.id in cache[cls.__name__]:
|
||||
cache[cls.__name__][record.id].clear()
|
||||
for cache in list(Transaction().cache.values()):
|
||||
for cache in (cache,
|
||||
list(cache.get('_language_cache', {}).values())):
|
||||
if cls.__name__ in cache:
|
||||
cache_cls = cache[cls.__name__]
|
||||
for record in lots:
|
||||
cache_cls.pop(record.id, None)
|
||||
|
||||
|
||||
class Move(metaclass=PoolMeta):
|
||||
|
|
Loading…
Reference in New Issue