Add default showcase selection per warehouse
- Add is_default field to Showcase model with unique constraint per warehouse - Implement Showcase.save() to ensure only one default per warehouse - Add SetDefaultShowcaseView for AJAX-based default selection - Update ShowcaseForm to include is_default checkbox - Add interactive checkbox UI in showcase list with AJAX functionality - Update POS API to return showcase.is_default instead of warehouse.is_default - Update terminal.js to auto-select showcase based on its is_default flag - Add migration for is_default field 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# Generated by Django 5.0.10 on 2025-11-20 08:08
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0003_showcase_reservation_showcase_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='showcase',
|
||||
name='is_default',
|
||||
field=models.BooleanField(default=False, verbose_name='По умолчанию'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='showcase',
|
||||
index=models.Index(fields=['is_default'], name='inventory_s_is_defa_bf9a7c_idx'),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user