Skip to content

Commit

Permalink
Fix category mapping relation (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwin1111 authored Sep 22, 2023
1 parent d71f31e commit 3ed2373
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
24 changes: 24 additions & 0 deletions fyle_accounting_mappings/migrations/0024_auto_20230922_0819.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 3.1.14 on 2023-09-22 08:19

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('fyle_accounting_mappings', '0023_auto_20230918_1316'),
]

operations = [
migrations.AlterField(
model_name='categorymapping',
name='source_category',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='categorymapping', to='fyle_accounting_mappings.expenseattribute'),
),
migrations.AlterField(
model_name='mapping',
name='destination',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='mapping', to='fyle_accounting_mappings.destinationattribute'),
),
]
2 changes: 1 addition & 1 deletion fyle_accounting_mappings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ class CategoryMapping(models.Model):
Category Mappings
"""
id = models.AutoField(primary_key=True)
source_category = models.OneToOneField(ExpenseAttribute, on_delete=models.PROTECT, related_name='categorymapping')
source_category = models.ForeignKey(ExpenseAttribute, on_delete=models.PROTECT, related_name='categorymapping')
destination_account = models.ForeignKey(
DestinationAttribute, on_delete=models.PROTECT, null=True, related_name='destination_account')
destination_expense_head = models.ForeignKey(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='fyle-accounting-mappings',
version='1.27.0',
version='1.27.1',
author='Shwetabh Kumar',
author_email='[email protected]',
description='Django application to store the fyle accounting mappings in a generic manner',
Expand Down

0 comments on commit 3ed2373

Please sign in to comment.