mirror of
https://github.com/NaN-tic/trytond-stock_lot_deactivatable.git
synced 2023-12-14 03:22:55 +01:00
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
|
# Increase transaction counter
|
||||||
Transaction().counter += 1
|
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
|
# Clean cursor cache
|
||||||
for cache in Transaction().cache.values():
|
for cache in list(Transaction().cache.values()):
|
||||||
if cls.__name__ in cache:
|
for cache in (cache,
|
||||||
for record in lots:
|
list(cache.get('_language_cache', {}).values())):
|
||||||
if record.id in cache[cls.__name__]:
|
if cls.__name__ in cache:
|
||||||
cache[cls.__name__][record.id].clear()
|
cache_cls = cache[cls.__name__]
|
||||||
|
for record in lots:
|
||||||
|
cache_cls.pop(record.id, None)
|
||||||
|
|
||||||
|
|
||||||
class Move(metaclass=PoolMeta):
|
class Move(metaclass=PoolMeta):
|
||||||
|
|
Loading…
Reference in a new issue