Improve label print calibration and polish Lithium Label UI.

Align print/calibrate fields to the reference PDF (including bottom-row offset), fix partial box weights and page padding, and rename branding to Lithium Label Manager with Vazirmatn for Persian.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-01 21:38:28 +03:30
parent cbb1030641
commit 69ddfe4b60
15 changed files with 161 additions and 126 deletions

View File

@@ -5,9 +5,9 @@ from slips.models import Product
SEED_PRODUCTS = [
{'code': 'ICJ/408', 'description': 'DIGITAL INK RED BROWN', 'default_net_weight': 5},
{'code': 'ICJ/407', 'description': 'DIGITAL INK RED BROWN', 'default_net_weight': 5},
{'code': 'ICJ/309', 'description': 'DIGITAL INK CYAN', 'default_net_weight': 10},
{'code': 'ICJ/309', 'description': 'DIGITAL INK CYAN', 'default_net_weight': 5},
{'code': 'ICJ/EH630', 'description': 'DIGITAL INK BLACK', 'default_net_weight': 5},
{'code': 'ICJ/308', 'description': 'DIGITAL INK BLUE', 'default_net_weight': 20},
{'code': 'ICJ/308', 'description': 'DIGITAL INK BLUE', 'default_net_weight': 5},
]
@@ -25,10 +25,16 @@ class Command(BaseCommand):
created_count = 0
for product_data in SEED_PRODUCTS:
if options['skip_existing']:
_, created = Product.objects.get_or_create(
product, created = Product.objects.get_or_create(
code=product_data['code'],
defaults=product_data,
)
if not created:
# Sync seed canister weight without wiping other edits
w = product_data['default_net_weight']
if product.default_net_weight != w:
product.default_net_weight = w
product.save(update_fields=['default_net_weight'])
else:
Product.objects.update_or_create(
code=product_data['code'],