mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[FIX] Fix compute contains_unreserved on NewId records
This commit is contained in:
@@ -17,6 +17,10 @@ class StockQuant(models.Model):
|
||||
@api.depends("product_id", "location_id", "quantity", "reserved_quantity")
|
||||
def _compute_contains_unreserved(self):
|
||||
for record in self:
|
||||
# Avoid error when adding a new line on manually Update Quantity
|
||||
if isinstance(record.id, models.NewId):
|
||||
record.contains_unreserved = False
|
||||
continue
|
||||
available = record._get_available_quantity(
|
||||
record.product_id, record.location_id
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user