bugGNU Health - Bugs: bug #45009, Creating a new Work Schedule fails...

 
 

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

bug #45009: Creating a new Work Schedule fails if the company's timezone is not set

Submitter:  Luis González <luisg123v>
Submitted:  Mon 04 May 2015 05:04:47 PM UTC
   
 
Category:  Programming / Tracebacks Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Release:  None
Module:  health_calendar Component:  None

Sat 09 May 2015 08:54:31 PM UTC, comment #1: 

I can definitely confirm this and its non-obvious error message. Those are good suggestions. I don't really like playing with the field definitions on non-Health modules, but it's possible. Assuming a default timezone could work, too, but the admin should really define a timezone! I can see confusion coming from that. I think a middle-ground solution is to expect some user effort, but present the solution in a clear way. Consequently, I just pushed a commit to display an error box with information how to fix it.  Thanks! I'll close and mark as fixed. But, we may have to move towards your solutions if this is still confusing. =-)

Chris Zimmerman <teffalump>
Mon 04 May 2015 05:04:47 PM UTC, original submission:  

When trying to create a new Work Schedule (Health -> Appointments -> New Work Schedule), it will fail if the current company's timezone is not set, i.e. it's "None".

It shows up the following traceback:
Traceback (most recent call last):
  File "/trytond/protocols/jsonrpc.py", line 150, in _marshaled_dispatch
    response['result'] = dispatch_method(method, params)
  File "/trytond/protocols/jsonrpc.py", line 179, in _dispatch
    res = dispatch(*args)
  File "/trytond/protocols/dispatcher.py", line 161, in dispatch
    result = rpc.result(meth(c_args, *c_kwargs))
  File "/trytond/wizard/wizard.py", line 249, in execute
    return wizard._execute(state_name)
  File "/trytond/wizard/wizard.py", line 280, in _execute
    result = self._execute(transition())
  File "/trytond/modules/health_calendar/wizard/wizard_health_calendar.py", line 109, in transition_create_
    dt = timezone.localize(dt)
AttributeError: 'NoneType' object has no attribute 'localize'

I think id might be solved either assuming the default timezone when it's None, or setting the company's timezone as a required field

Luis González <luisg123v>

 

(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 teffalump (Posted a comment)
  • -email is unavailable- added by luisg123v (Submitted the item)
  • -email is unavailable- added by luisg123v (A bug related to schedules)
  •  

    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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-05-09 teffalump StatusNone Fixed
        Open/ClosedOpen Closed
    2015-05-04 luisg123v Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code