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

Submitter:  Niharika <niharika10>
Submitted:  Fri 19 Jun 2015 06:55:27 AM UTC
   
 
Category:  Functionality Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  teffalump
Open/Closed:  Closed Release:  None
Module:  health Component:  None

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

Updated AIR30 DB . Please check .

Best

Luis Falcon <meanmicio>
Group 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>
Group 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>
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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-06-22 teffalump StatusNone Fixed
        Assigned toNone teffalump
        Open/ClosedOpen Closed
    2015-06-19 niharika10 Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code