mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-29 08:02:24 +00:00
39 lines
1.3 KiB
Python
39 lines
1.3 KiB
Python
|
# -*- 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
|
||
|
|
||
|
|
||
|
def initialize_invoice_template(apps, schema_editor):
|
||
|
CotisationsOption = apps.get_model('preferences', 'CotisationsOption')
|
||
|
DocumentTemplate = apps.get_model('cotisations', 'DocumentTemplate')
|
||
|
CotisationsOption.objects.create(
|
||
|
invoice_template=DocumentTemplate.objects.first()
|
||
|
)
|
||
|
|
||
|
|
||
|
class Migration(migrations.Migration):
|
||
|
|
||
|
dependencies = [
|
||
|
('cotisations', '0039_documenttemplate'),
|
||
|
('preferences', '0056_4_radiusoption'),
|
||
|
]
|
||
|
|
||
|
operations = [
|
||
|
migrations.CreateModel(
|
||
|
name='CotisationsOption',
|
||
|
fields=[
|
||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||
|
('invoice_template', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='invoice_template', to='cotisations.DocumentTemplate', verbose_name='Template for invoices')),
|
||
|
],
|
||
|
options={
|
||
|
'verbose_name': 'cotisations options',
|
||
|
},
|
||
|
bases=(re2o.mixins.AclMixin, models.Model),
|
||
|
),
|
||
|
migrations.RunPython(initialize_invoice_template),
|
||
|
]
|