mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
Apply suggestions from code review
Co-authored-by: Guewen Baconnier <guewen.baconnier@camptocamp.com>
This commit is contained in:
committed by
Hai Lang
parent
cc6da708da
commit
8a53cd17bc
@@ -28,7 +28,7 @@ class StockLocation(models.Model):
|
||||
domain="[('location_ids', 'in', id), ('state', '=', 'done')]",
|
||||
)
|
||||
|
||||
@api.depends("validated_inventory_ids", "validated_inventory_ids.write_date")
|
||||
@api.depends("validated_inventory_ids", "validated_inventory_ids.date")
|
||||
def _compute_last_inventory_date(self):
|
||||
"""Store date of the last inventory for each leaf location"""
|
||||
for loc in self:
|
||||
@@ -38,7 +38,7 @@ class StockLocation(models.Model):
|
||||
and loc.validated_inventory_ids
|
||||
):
|
||||
loc.last_inventory_date = loc.validated_inventory_ids.sorted(
|
||||
lambda inventory: inventory.write_date
|
||||
lambda inventory: inventory.date
|
||||
)[-1].date
|
||||
else:
|
||||
loc.last_inventory_date = False
|
||||
|
||||
Reference in New Issue
Block a user