Mix box and canister labels on shared sheets
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -64,6 +64,8 @@ class Order(models.Model):
|
||||
def save(self, *args, **kwargs):
|
||||
if not self.canister_count and self.total_weight and self.canister_weight:
|
||||
self.apply_weight()
|
||||
self.canister_pages = math.ceil(self.canister_count / 4) if self.canister_count else 0
|
||||
self.box_pages = math.ceil(self.box_count / 4) if self.box_count else 0
|
||||
# Mixed sheets: canister + box labels share pages; total in canister_pages
|
||||
n = self.canister_count + self.box_count
|
||||
self.canister_pages = math.ceil(n / 4) if n else 0
|
||||
self.box_pages = 0
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user