Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Guewen Baconnier <guewen.baconnier@camptocamp.com>
  • Loading branch information
2 people authored and hailangvn committed Sep 24, 2021
1 parent cc6da70 commit 8a53cd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stock_location_last_inventory_date/models/stock_location.py
Expand Up @@ -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:
Expand All @@ -38,7 +38,7 @@ def _compute_last_inventory_date(self):
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

0 comments on commit 8a53cd1

Please sign in to comment.