Files
WYGIWYH/app/apps/transactions/migrations/0052_transfer_templates.py
T
Herculino Trotta 3716b9b0e3 feat(transactions): link transfer sides and show them as a single item
Transfers are still two transactions, now linked to each other:
- shown as one item in lists, with each side's amount, account,
  category and tags ("Combine transfers" user setting, on by default)
- date, reference date, paid and mute stay in sync between sides
- edit opens the transfer form; delete, restore, duplicate and bulk
  actions act on both sides
- transfers made by the transfer form now trigger rules for each side

Recurring and quick transactions gain a Transfer type, with a "To
account" and optional "To amount", generating linked transfers. A
transfer can be converted into either.

Existing transfers are left as they are, since there is no reliable
way to pair them.
2026-11-02 01:14:46 -03:00

47 lines
2.2 KiB
Python

# Generated by Django 5.2.17 on 2026-11-02 03:31
import apps.transactions.validators
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0016_account_untracked_by'),
('transactions', '0051_transaction_linked_transaction'),
]
operations = [
migrations.AddField(
model_name='quicktransaction',
name='to_account',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='accounts.account', verbose_name='To account'),
),
migrations.AddField(
model_name='quicktransaction',
name='to_amount',
field=models.DecimalField(blank=True, decimal_places=30, help_text='Leave empty to use the same amount', max_digits=42, null=True, validators=[apps.transactions.validators.validate_non_negative, apps.transactions.validators.validate_decimal_places], verbose_name='To amount'),
),
migrations.AddField(
model_name='recurringtransaction',
name='to_account',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='accounts.account', verbose_name='To account'),
),
migrations.AddField(
model_name='recurringtransaction',
name='to_amount',
field=models.DecimalField(blank=True, decimal_places=30, help_text='Leave empty to use the same amount', max_digits=42, null=True, validators=[apps.transactions.validators.validate_non_negative, apps.transactions.validators.validate_decimal_places], verbose_name='To amount'),
),
migrations.AlterField(
model_name='quicktransaction',
name='type',
field=models.CharField(choices=[('IN', 'Income'), ('TR', 'Transfer'), ('EX', 'Expense')], default='EX', max_length=2, verbose_name='Type'),
),
migrations.AlterField(
model_name='recurringtransaction',
name='type',
field=models.CharField(choices=[('IN', 'Income'), ('TR', 'Transfer'), ('EX', 'Expense')], default='EX', max_length=2, verbose_name='Type'),
),
]