lims_administrative_task: avoid error when task has no origin

This commit is contained in:
Adrián Bernardi 2021-10-07 09:17:59 -03:00
parent 736f16e2ed
commit 9e0cd2b061

View file

@ -377,9 +377,10 @@ class AdministrativeTask(Workflow, ModelSQL, ModelView):
body += '\n%s: %s' % (
gettext('lims_administrative_task.field_task_priority'),
str(self.priority_string))
body += '\n%s: %s' % (
gettext('lims_administrative_task.field_task_origin'),
str(self.origin.rec_name))
if self.origin:
body += '\n%s: %s' % (
gettext('lims_administrative_task.field_task_origin'),
str(self.origin.rec_name))
return subject, body
def _get_task_url(self):