bugGNU Health - Bugs: bug #45350, Error message : "none...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #45350: Error message : "none type" object has no attribute "id" when father/mother name is not filled in birth certificate modu

Submitted by:  Niharika <niharika10>
Submitted on:  Fri 19 Jun 2015 06:55:27 AM UTC  
 
Category: FunctionalitySeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Chris Zimmerman <teffalump>
Open/Closed: ClosedRelease: None
Module: health

Wed 22 Jul 2015 03:10:02 PM UTC, comment #4:

Updated AIR30 DB . Please check .

Best

Luis Falcon <meanmicio>
Project Administrator
Wed 22 Jul 2015 03:07:13 PM UTC, comment #3:

Thanks a lot Chris / Roberto / Niharita for the feedback and patches !

Yes, I forgot a second validation. I like checking the existance of the mother/father on the certficate, before returning the id.

http://hg.savannah.gnu.org/hgweb/health/rev/f1707c2c2130

Let me know your thoughts.

Best,

Luis Falcon <meanmicio>
Project Administrator
Mon 22 Jun 2015 05:21:34 AM UTC, comment #2:

Thanks for this report! Quite annoying bug! I just pushed a commit that should correct this issue.

http://hg.savannah.gnu.org/hgweb/health/rev/a2e0d91ad7f2

I've tested it and seems to be working. Although, if you discover any problems, I can re-open the bug report. =-)

Chris Zimmerman <teffalump>
Project MemberIn charge of this item.
Fri 19 Jun 2015 05:26:37 PM UTC, comment #1:

I have run onto the same problem. I do not think, though, that making father or mother mandatory is a good solution, because it is very common to have birth certificates without a father and, sometimes, without even a mother. This can happen for many reasons: parents are unknown, abandoned child, incomplete registration procedures, etc. I think the best solution would be to treat the exception, something like:

def get_father(self, name):
if (self.birth_certificate):
try:
return self.birth_certificate.father.id
except SomeError:
pass

Roberto Novaes <rvnovaes>
Fri 19 Jun 2015 06:55:27 AM UTC, original submission:

# Step to Reproduce:
1. Go to demographics under health module (GNU Health).
2. Under demographics go to Birth certificate submenu.
3. Fill the required fields only (highlighted with blue)
4. Save the form.
5. Now go to parties menu
6. Under parties go to people submenu.
7. Select the record of the people whose birth certificate has been created.
8. Error Message Comes Up.

# Solutions to the problem:

1. Make father/mother name as mandatory field in birth certificate.

2. Change the code at http://hg.savannah.gnu.org/hgweb/health/file/2d4c69f341cd/tryton/health/health.py#l326 as -

if (self.birth_certificate) and (self.birth_certificate.father):

Similarly, at http://hg.savannah.gnu.org/hgweb/health/file/2d4c69f341cd/tryton/health/health.py#l321

if (self.birth_certificate) and (self.birth_certificate.mother):

3 Raise an error "father/mother name is missing in birth certificate " while opening the people record.

http://hg.savannah.gnu.org/hgweb/health/file/2d4c69f341cd/tryton/health/health.py#l324

def get_father(self, name):
if (self.birth_certificate):
if not self.birth_certificate.father:
self.raise_user_error(
"Father's Name is missing in Birth Certificate for %s" %
self.name)
return self.birth_certificate.father.id

Niharika <niharika10>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by meanmicio (Posted a comment)
  • -unavailable- added by teffalump (Posted a comment)
  • -unavailable- added by rvnovaes (Posted a comment)
  • -unavailable- added by niharika10 (Submitted the item)
  • -unavailable- added by niharika10
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 22 Jun 2015 05:21:34 AM UTCteffalumpStatusNone=>Fixed
      Assigned toNone=>teffalump
      Open/ClosedOpen=>Closed
    Fri 19 Jun 2015 06:55:27 AM UTCniharika10Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1