datasektionen / cashflow

Django project to manage receipts and reimbursements at Datasektionen
https://cashflow.datasektionen.se
4 stars 13 forks source link

Disappearing expense parts #201

Open foodelevator opened 2 months ago

foodelevator commented 2 months ago

When editing an expense that has (at least) two parts that are for different cost centres but that have a secondary cost centre with the same name and that secondary cost centre was picked for the first expense, it will be blank and forced to be repicked. This also goes for if the secondary cost centres are different but both have the same name for a budget line.

Exmaple: When editing an expense with dHusbyggarna -> Allmänt -> Tegel and dKnas -> Allmänt -> Knas, the first part will be dHusbyggarna -> -> Tegel.

When editing an expense with dAta -> Internt -> Fika and dSnacks -> Allmänt -> Fika, the first part will be dAta -> -> Fika.

foodelevator commented 2 months ago

I think that the reason is that at templates/expenses/edit.html:236 we can't check only the SecondaryCostCentreName but rather both CostCentreName and CostCentreName