Skip to content

Commit ad68360

Browse files
committed
[FIX] util.inconsistencies.verify_{uoms,products}
Correctly handle the `INCLUDE_ARCHIVED_PRODUCTS` option. When set we shouldn't filter on active products. Part-of: #82
1 parent e65d655 commit ad68360

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/inconsistencies.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def verify_uoms(cr, model, uom_field="product_uom_id", product_field="product_id
148148
category_name=get_value_or_en_translation(cr, "uom_category", "name"),
149149
product_template_name=get_value_or_en_translation(cr, "product_template", "name"),
150150
ids=" AND t.id IN %s" if ids else "",
151-
active=" AND pp.active" if INCLUDE_ARCHIVED_PRODUCTS else "",
151+
active=" AND pp.active" if not INCLUDE_ARCHIVED_PRODUCTS else "",
152152
)
153153

154154
rows = []
@@ -312,7 +312,7 @@ def verify_products(
312312
model_product_field=q(model_product_field),
313313
foreign_model_product_field=q(foreign_model_product_field),
314314
ids=" AND t.id IN %s" if ids else "",
315-
active=" AND tpp.active" if INCLUDE_ARCHIVED_PRODUCTS else "",
315+
active=" AND tpp.active" if not INCLUDE_ARCHIVED_PRODUCTS else "",
316316
)
317317

318318
rows = []

0 commit comments

Comments
 (0)