Tighten Recent Orders table layout and labels UI

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-24 13:36:26 +03:30
parent def96d1f0a
commit b5e91f3dde
4 changed files with 158 additions and 52 deletions

View File

@@ -55,6 +55,10 @@ class Order(models.Model):
def custom_count(self):
return sum(int(line['count']) for line in (self.custom_labels or []))
@property
def box_weight(self):
return self.canister_weight * self.canisters_per_box
def apply_weight(self):
"""Derive canister/box counts from total_weight (create path)."""
self.canister_count = math.ceil(self.total_weight / self.canister_weight)