Loading of Test data fails due to unique primary key constraint in Allowance (#613)

* Ignore Pycharm IDE directory

* init will get executed even if there are no tables, hence migrations cannot be applies at the first step

* Separate loanaccount test data load because primary key conflicts due to post_save signal

* Avoid multiple DB save calls
This commit is contained in:
Dr. Shubham Dipt
2025-03-20 12:49:20 +01:00
committed by GitHub
parent 4295b94115
commit ab6584d889
6 changed files with 56 additions and 48 deletions

View File

@@ -1592,32 +1592,5 @@
"status": "requested",
"description": "Software license for Sublime Text (1-year subscription for team development)."
}
},
{
"model": "payroll.loanaccount",
"pk": 1,
"fields": {
"created_at": "2024-12-12T09:45:26.097Z",
"created_by": 1,
"modified_by": 1,
"is_active": true,
"type": "loan",
"title": "Medical Loan",
"employee_id": 18,
"loan_amount": 60000.0,
"provided_date": "2024-12-01",
"allowance_id": 5,
"description": "Loan for parents medical case",
"is_fixed": true,
"rate": 0.0,
"installment_amount": 5000.0,
"installments": 12,
"installment_start_date": "2025-01-01",
"apply_on": "end_of_month",
"settled": false,
"settled_date": null,
"asset_id": null,
"deduction_ids": [22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]
}
}
]

View File

@@ -0,0 +1,29 @@
[
{
"model": "payroll.loanaccount",
"pk": 1,
"fields": {
"created_at": "2024-12-12T09:45:26.097Z",
"created_by": 1,
"modified_by": 1,
"is_active": true,
"type": "loan",
"title": "Medical Loan",
"employee_id": 18,
"loan_amount": 60000.0,
"provided_date": "2024-12-01",
"allowance_id": 5,
"description": "Loan for parents medical case",
"is_fixed": true,
"rate": 0.0,
"installment_amount": 5000.0,
"installments": 12,
"installment_start_date": "2025-01-01",
"apply_on": "end_of_month",
"settled": false,
"settled_date": null,
"asset_id": null,
"deduction_ids": [1,2,3]
}
}
]