Commit 4a15ec3d authored by Committed by ntome
[cragr] Fix DateGuesser for some savings
Somme savings Accounts have Transactions with a date without a year, we use a DateGuesser to guess that year. The DateGuesser wasn't properly handed to the method, that is what this patch fixes. For DateGuesser to fulfill it's purpose the same instance needs to be shared between all Transaction objects, or the default behaviour of *Element is to make a copy of the parent's env variable (the dictionnary used by the filter Env) so each Transaction would have a new instance of DateGuesser. Here we create a child class of DateGuesser with it's __deepcopy__ method overridden so that a call of deepcopy on it will return the object itself instead of a copy, this counteracts the behaviour of *Element and allows all Transaction objects to share the same instance of DateGuesser. This may break again.
Showing with 7 additions and 1 deletion