changeset 9a04d26c5d1b in modules/product_cost_warehouse:default
details:
https://hg.tryton.org/modules/product_cost_warehouse?cmd=changeset&node=9a04d26c5d1b
description:
Use warehouse id instead of instance in SQL clause
issue11120
review377941008
diffstat:
product.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diffs (11 lines):
diff -r 4b11634017a5 -r 9a04d26c5d1b product.py
--- a/product.py Sat Dec 18 16:31:09 2021 +0100
+++ b/product.py Thu Jan 20 18:58:49 2022 +0100
@@ -263,5 +263,6 @@
def _non_moves_clause(cls, history_table, user):
clause = super()._non_moves_clause(history_table, user)
if user.company and user.company.cost_price_warehouse:
- clause &= history_table.warehouse == user.warehouse
+ warehouse_id = user.warehouse.id if user.warehouse else None
+ clause &= history_table.warehouse == warehouse_id
return clause