feat(accounting): Migrations for model AssetBase

ref: #741 #737
This commit is contained in:
2025-05-05 00:44:31 +09:30
parent b11a978962
commit 471b5c08f6

View File

@ -0,0 +1,39 @@
# Generated by Django 5.1.8 on 2025-05-04 12:42
import access.fields
import access.models.tenancy
import accounting.models.asset_base
import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('access', '0005_entity_person_entityhistory_entitynotes_role_and_more'),
]
operations = [
migrations.CreateModel(
name='AssetBase',
fields=[
('model_notes', models.TextField(blank=True, default=None, help_text='Tid bits of information', null=True, verbose_name='Notes')),
('id', models.AutoField(help_text='Ticket ID Number', primary_key=True, serialize=False, unique=True, verbose_name='Number')),
('asset_number', models.CharField(blank=True, help_text='Number or tag to use to track this asset', max_length=30, null=True, unique=True, verbose_name='Asset Number')),
('serial_number', models.CharField(blank=True, help_text='Serial number of this asset assigned by manufacturer.', max_length=30, null=True, unique=True, verbose_name='Serial Number')),
('asset_type', models.CharField(blank=True, choices=accounting.models.asset_base.AssetBase.get_model_type_choices, default='asset', help_text='Asset Type. (derived from asset model)', max_length=30, validators=[accounting.models.asset_base.AssetBase.validate_not_null], verbose_name='Asset Type')),
('created', access.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, help_text='Date and time of creation', verbose_name='Created')),
('modified', access.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, help_text='Date and time of last modification', verbose_name='Modified')),
('organization', models.ForeignKey(help_text='Organization this belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='+', to='access.organization', validators=[access.models.tenancy.TenancyObject.validatate_organization_exists], verbose_name='Organization')),
],
options={
'verbose_name': 'Asset',
'verbose_name_plural': 'Assets',
'ordering': ['id'],
'sub_model_type': 'asset',
},
),
]