mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[13.0] [FIX] stock_inventory_include_exhausted: Filtered with product who has already created inventory line to avoid duplicated line.
In some cases
This commit is contained in:
@@ -18,6 +18,8 @@ class StockInventory(models.Model):
|
||||
|
||||
if self.include_exhausted:
|
||||
domain = [("qty_available", "=", 0), ("type", "=", "product")]
|
||||
product_ids = [data.get("product_id") for data in vals]
|
||||
domain.append(("id", "not in", product_ids))
|
||||
if self.product_ids:
|
||||
domain.append(("id", "in", self.product_ids.ids))
|
||||
exhausted_products = self.env["product.product"].search(domain)
|
||||
|
||||
@@ -51,6 +51,9 @@ class StockInventoryIncludeExhaustedTest(TransactionCase):
|
||||
self.location = self.location_model.create(
|
||||
{"name": "Inventory tests 1", "usage": "internal"}
|
||||
)
|
||||
self.location2 = self.location_model.create(
|
||||
{"name": "Inventory tests 2", "usage": "internal"}
|
||||
)
|
||||
|
||||
def _create_inventory_all_products(self, name, location, include_exhausted):
|
||||
inventory = self.inventory_model.create(
|
||||
|
||||
Reference in New Issue
Block a user