#3525 (Show person's address inherited from primary household)
by Luc Saffre · in Developers · assigned to Luc Saffre
Résumé
When a person has no primary address, but a primary household with a primary address, AdressableChecker should update the person's address fields from the household.
Concepts sous-jacents
Commentaires
- 2 ans, 10 mois ago by Luc Saffre about #3525 (Show person's address inherited from primary household) : I pushed my changes.
- 2 ans, 10 mois ago by Luc Saffre about #3525 (Show person's address inherited from primary household) : I reviewed the docs:for [url dev.lino-framework.org/specs/addresses.html developers] and [url using.lino-framework.org/plugins/addresses.html end users]. Of course it's not finished...
- 2 ans, 10 mois ago by Luc Saffre about #3525 (Show person's address inherited from primary household) : En passant I adapted some test failures in noi1e that were caused by my recent changes (but I hadn't seen them because test_google was failing).
- 2 ans, 10 mois ago by Luc Saffre about #3525 (Show person's address inherited from primary household) : Yes, the solution is to add a new checkdata rule stating that a person should not have a primary address when it has a primary household. I added a series of tests to test_addresses.py to show three possible problem messages, two of which are fixable.
- 2 ans, 10 mois ago by Luc Saffre about #3525 (Show person's address inherited from primary household) : I started to add code to test_addresses() in min9.
- 2 ans, 10 mois ago by Luc Saffre about #3525 (Show person's address inherited from primary household) : After looking at the code of addresses.AddressOwnerChecker I think we need a rule when somebody has a primary household, then they should not have a primary address." Before changing the current code, I want to see whether we have tests that cover it.
- 2 ans, 10 mois ago by Luc Saffre about #3525 (Show person's address inherited from primary household) : En passant I set Checkers.show_values to True because otherwise it was difficult to get the internal name of a data checker. This disclosed a bug: ChoiceList.display_text() showed the value twice when show_values is True.
- 2 ans, 10 mois ago by Luc Saffre about #3525 (Show person's address inherited from primary household) : 25 problems were fixed using [url gitlab.com/lino-framework/xl/-/commit/168931d3da0f260ffd8404e975b15b3cfdd4be05 my recent commit], now I can start working on this.
- 2 ans, 10 mois ago by Luc Saffre about #3525 (Show person's address inherited from primary household) : Before writing a new data checker, I want to fix the 26 existing data problems in froinde.
- 2 ans, 10 mois ago by Luc Saffre about #3525 (Show person's address inherited from primary household) : Another user story is when you have a single person with an address and then you meet also the spouse of that person. You create a household. Now the household should somehow "take" the address of the person.
- 6 ans, 8 mois ago by Luc Saffre about #3525 (Show person's address inherited from primary household) : Note a subtle rule: when a person has no (primary) address at all, then the data checker should leave the address fields in the Person model unchanged. This is important e.g. when migrating existing data from a version without addresses plugin to a version with addresses plugin. Or when the applicat...
- 6 ans, 8 mois ago by Luc Saffre about #3525 (Show person's address inherited from primary household) : This is not urgent. I prefer to have this done "well" rather than "quickly".
- 6 ans, 8 mois ago by Luc Saffre about #3525 (Show person's address inherited from primary household) : Hamza I assigned this to you. Please start by writing a test case. I guess that this should be a unit test in some demo project, not a doctest in the specs (because it involves changing data).
- 6 ans, 8 mois ago by Luc Saffre about #3525 (Show person's address inherited from primary household) : More precisely I guess that addresses.AddressOwnerChecker is where the change needs to go. The person's address doesn't need to update automatically after every database change, only when you click "fix data problems" (that's enough automation).