8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-08-13 10:43:41 +00:00
re2o/preferences/migrations/0059_cotisationsoption.py

38 lines
1.5 KiB
Python
Raw Normal View History

2019-01-05 18:45:21 +00:00
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2019-01-03 19:56
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import re2o.mixins
import preferences.models
2019-01-05 18:45:21 +00:00
def initialize_invoice_template(apps, schema_editor):
CotisationsOption = apps.get_model('preferences', 'CotisationsOption')
CotisationsOption.objects.get_or_create()
2019-01-05 18:45:21 +00:00
class Migration(migrations.Migration):
dependencies = [
('cotisations', '0039_documenttemplate'),
2019-01-20 16:47:01 +00:00
('preferences', '0058_auto_20190108_1650'),
2019-01-05 18:45:21 +00:00
]
operations = [
migrations.CreateModel(
name='CotisationsOption',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('invoice_template', models.OneToOneField(default=preferences.models.default_invoice,on_delete=django.db.models.deletion.PROTECT, related_name='invoice_template', to='cotisations.DocumentTemplate', verbose_name='Template for invoices')),
('voucher_template', models.OneToOneField(default=preferences.models.default_voucher, on_delete=django.db.models.deletion.PROTECT, related_name='voucher_template', to='cotisations.DocumentTemplate', verbose_name='Template for subscription voucher')),
2019-01-05 18:45:21 +00:00
],
options={
'verbose_name': 'cotisations options',
},
bases=(re2o.mixins.AclMixin, models.Model),
),
migrations.RunPython(initialize_invoice_template),
]