Catégories globales + flag neutre + seed_reference
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
# Catégories globales + vue TVA + passage de Depense.categorie en clé étrangère.
|
||||
# Note : on remplace l'ancien champ texte `categorie` par une FK plutôt que de
|
||||
# l'altérer (un AlterField texte->FK échouerait sur PostgreSQL avec des données).
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('compta', '0004_paiement_depense_paiement'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Categorie',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('nom', models.CharField(max_length=100, unique=True)),
|
||||
('usage', models.CharField(choices=[('depense', 'Dépense'), ('vente', 'Vente'), ('neutre', 'Mouvement neutre')], default='depense', max_length=10)),
|
||||
('exclure_calculs', models.BooleanField(default=False, help_text='Cochez pour les mouvements non fiscaux : TVA payée, cotisations URSSAF, remboursement de TVA, virements…', verbose_name='Neutre (exclue des calculs)')),
|
||||
('actif', models.BooleanField(default=True)),
|
||||
('ordre', models.IntegerField(default=0)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Catégorie',
|
||||
'verbose_name_plural': 'Catégories',
|
||||
'ordering': ['usage', 'ordre', 'nom'],
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='entreprise',
|
||||
name='vue_tva',
|
||||
field=models.CharField(choices=[('simplifie', 'Résumé simplifié'), ('ca3', 'Champs CA3 officiels')], default='simplifie', max_length=10, verbose_name="Mode d'affichage de la déclaration TVA"),
|
||||
),
|
||||
# Ancien champ texte abandonné, remplacé par une FK propre.
|
||||
migrations.RemoveField(
|
||||
model_name='depense',
|
||||
name='categorie',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='depense',
|
||||
name='categorie',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='depenses', to='compta.categorie'),
|
||||
),
|
||||
]
|
||||
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user