bugGNU Health - Bugs: bug #57148, 'NoneType' object has no attribute...

 
 

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

bug #57148: 'NoneType' object has no attribute 'name'

Submitted by:  Axel Braun <coogor>
Submitted on:  Fri 01 Nov 2019 08:32:19 AM UTC  
 
Category:  Functionality Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  Luis Falcon <meanmicio>
Open/Closed:  Closed Release:  3.5.0
Module:  health

( Jump to the original submission)

Mon 04 Nov 2019 10:06:28 AM UTC, comment #7: 

comment #6:

> Should the same change not applied to the specialities section for hospitals?


No. That one is OK.

Luis Falcon <meanmicio>
Project AdministratorIn charge of this item.
Sun 03 Nov 2019 09:51:19 AM UTC, comment #6: 

Should the same change not applied to the specialities section for hospitals?

Axel Braun <coogor>
Project Member
Sat 02 Nov 2019 12:19:06 PM UTC, comment #5: 

With the 2 fixes the issue does not occur anymore.
Thank you!

Axel Braun <coogor>
Project Member
Sat 02 Nov 2019 11:23:23 AM UTC, comment #4: 
Luis Falcon <meanmicio>
Project AdministratorIn charge of this item.
Sat 02 Nov 2019 09:08:00 AM UTC, comment #3: 

comment #1:

> In the health professional form, you  need to _assign_ an existing medical specialty.
>
> In your case, I think that you are _creating_ a new medical specialty instead of assigning it.


No, I used an existing one.
I have applied your patch an tried a new installation. This resulted in an error during activation 'Invalid XML for view' - see attached screenshot (no copy and paste from this box..)


Axel Braun <coogor>
Project Member
Fri 01 Nov 2019 02:24:48 PM UTC, comment #2: 

Thanks again Axel for the feedback !

Please apply changeset :

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

This patch should fix the issue, in addition to other improvements on the model.

HMIS server. health. Fix bug related to HP specialties https://savannah.gnu.org/bugs/?57148

 

- Use editable tree view on HP specialty. Much faster coding .
- Make required both HP and specialty fields, avoiding empty entries.
- Allow search the name of main specialty
- Set unique constraint on specialty associated to the HP

Luis Falcon <meanmicio>
Project AdministratorIn charge of this item.
Fri 01 Nov 2019 09:45:33 AM UTC, comment #1: 

Hi Axel !

I think I know where lies the issue you're facing.

In the health professional form, you  need to _assign_ an existing medical specialty.

In your case, I think that you are _creating_ a new medical specialty instead of assigning it.

When assigning the specialty or specialties to the HP, just look it up or start typing it and it will search for those containing the substring.

Also, there is an issue because it allows to assign an "empty" specialty. It should be a required field. I'll check on this.

Please try to assign one and save the record and report back. Make sure that there are  no "empty rows" in the O2M widget that would trigger the traceback.

In the meantime, probably using a different widget will be the best option.

Luis Falcon <meanmicio>
Project AdministratorIn charge of this item.
Fri 01 Nov 2019 08:32:19 AM UTC, original submission:  

created a person with flag 'health professional'
created health professional and added speciality
save record:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 73, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 46, in rpc
    request, database_name, *request.rpc_params)
  File "/trytond/wsgi.py", line 44, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 122, in wrapper
    return func(request, pool, args, *kwargs)
  File "/trytond/protocols/dispatcher.py", line 176, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/modelsql.py", line 828, in read
    getter_results = field.get(ids, cls, field_list, values=result)
  File "/trytond/model/fields/function.py", line 103, in get
    return dict((name, call(name)) for name in names)
  File "/trytond/model/fields/function.py", line 103, in <genexpr>
    return dict((name, call(name)) for name in names)
  File "/trytond/model/fields/function.py", line 98, in call
    return dict((r.id, method(r, name)) for r in records)
  File "/trytond/model/fields/function.py", line 98, in <genexpr>
    return dict((r.id, method(r, name)) for r in records)
  File "/trytond/modules/health/health.py", line 1896, in get_rec_name
    return self.specialty.name
AttributeError: 'NoneType' object has no attribute 'name'

Fault: 'NoneType' object has no attribute 'name'

Axel Braun <coogor>
Project Member

 

Attached Files
file #47776:  Screenshot_20191102_100606.png added by coogor (11KiB - image/png - Screenshot of error message)

 

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 coogor (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

     

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-11-03 meanmicio Open/ClosedOpen => Closed
    2019-11-03 meanmicio StatusReady For Test => Fixed
    2019-11-02 coogor Attached File- => Added Screenshot_20191102_100606.png, #47776
    2019-11-01 meanmicio StatusNeed Info => Ready For Test
    2019-11-01 meanmicio StatusNone => Need Info
        Assigned toNone => meanmicio
        ReleaseNone => 3.5.0

    Back to the top


    Powered by Savane 3.7