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

Submitted by:  Luis González <luisg123v>
Submitted on:  Mon 04 May 2015 05:04:47 PM UTC  
 
Category: Programming / TracebacksSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: ClosedRelease: None
Module: health_calendar

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>
Project Member
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>

 

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

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

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 09 May 2015 08:54:31 PM UTCteffalumpStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Mon 04 May 2015 05:04:47 PM UTCluisg123vCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1