diff --git a/apps/fyle/models.py b/apps/fyle/models.py index 9eb1ff6a..88392f84 100644 --- a/apps/fyle/models.py +++ b/apps/fyle/models.py @@ -144,9 +144,7 @@ def create_expense_objects(expenses: List[Dict], workspace_id, skip_update: bool expense_data_to_append = { 'claim_number': expense['claim_number'], 'report_title': expense['report_title'], - 'approved_at': expense['approved_at'], - 'expense_created_at': expense['expense_created_at'], - 'expense_updated_at': expense['expense_updated_at'] + 'approved_at': expense['approved_at'] } defaults = { @@ -175,6 +173,8 @@ def create_expense_objects(expenses: List[Dict], workspace_id, skip_update: bool 'file_ids': expense['file_ids'], 'spent_at': expense['spent_at'], 'posted_at': expense['posted_at'], + 'expense_created_at': expense['expense_created_at'], + 'expense_updated_at': expense['expense_updated_at'], 'fund_source': SOURCE_ACCOUNT_MAP[expense['source_account_type']], 'verified_at': expense['verified_at'], 'custom_properties': expense['custom_properties'], diff --git a/tests/test_fyle/fixtures.py b/tests/test_fyle/fixtures.py index 2fd00f08..518b31b1 100644 --- a/tests/test_fyle/fixtures.py +++ b/tests/test_fyle/fixtures.py @@ -43,7 +43,7 @@ 'name': 'Administration' }, 'cost_center_id': 23166, - 'created_at': None, + 'created_at': '2024-05-10T07:52:10.551260+00:00', 'creator_user_id': 'usVN2WTtPqE7', 'currency': 'USD', 'custom_fields': [ @@ -180,7 +180,7 @@ 'tax_group': None, 'tax_group_id': None, 'travel_classes': [], - 'updated_at': None, + 'updated_at': '2024-06-10T11:41:40.779611+00:00', 'user': { 'email': 'admin1@fyleforimporrttest.in', 'full_name': 'Theresa Brown',