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. =-)
|
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
|