From 615cd2f59c61f1fbf09d3de1422c1324f21c7b8c Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Thu, 1 Apr 2021 09:17:02 +0200 Subject: [PATCH] "Number of Parents" column in Person Views doesn't sum all parent Fixes #012268 --- gramps/gui/views/treemodels/peoplemodel.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gramps/gui/views/treemodels/peoplemodel.py b/gramps/gui/views/treemodels/peoplemodel.py index a8af9259c..f8b544cdb 100644 --- a/gramps/gui/views/treemodels/peoplemodel.py +++ b/gramps/gui/views/treemodels/peoplemodel.py @@ -422,11 +422,14 @@ class PeopleBaseModel(BaseModel): def _get_parents_data(self, data): parents = 0 if data[COLUMN_PARENT]: - family = self.db.get_family_from_handle(data[COLUMN_PARENT][0]) - if family.get_father_handle(): - parents += 1 - if family.get_mother_handle(): - parents += 1 + person = self.db.get_person_from_gramps_id(data[COLUMN_ID]) + family_list = person.get_parent_family_handle_list() + for fam_hdle in family_list: + family = self.db.get_family_from_handle(fam_hdle) + if family.get_father_handle(): + parents += 1 + if family.get_mother_handle(): + parents += 1 return parents def _get_marriages_data(self, data):