diff --git a/project_acceptance/controllers/mail.py b/project_acceptance/controllers/mail.py index 226f8c00..d0c253e1 100644 --- a/project_acceptance/controllers/mail.py +++ b/project_acceptance/controllers/mail.py @@ -11,6 +11,8 @@ class PortalChatter(mail.PortalChatter): def portal_chatter_post(self, res_model, res_id, message, attachment_ids='', attachment_tokens='', **kwargs): if request.httprequest.method == 'POST': task = request.env['project.task'].browse([res_id]) - task.task_acceptance = 'feedback' + task.sudo().ignore_exception = True + task.sudo().task_acceptance = 'feedback' + task.sudo().ignore_exception = False return super(PortalChatter, self).portal_chatter_post(res_model, res_id, message, attachment_ids=attachment_ids, attachment_tokens=attachment_tokens, **kwargs) \ No newline at end of file diff --git a/project_acceptance/controllers/portal.py b/project_acceptance/controllers/portal.py index 03497725..66f340d3 100644 --- a/project_acceptance/controllers/portal.py +++ b/project_acceptance/controllers/portal.py @@ -13,15 +13,20 @@ class CustomerPortal(portal.CustomerPortal): @http.route('/my/task//accept', type='http', auth="user", website=True) def portal_task_accept(self, task_id, access_token=None, **post): - if request.httprequest.method == 'POST': + if request.httprequest.method == 'POST': task = request.env['project.task'].browse([task_id]) - task.sudo().task_acceptance = 'accept' + task.sudo().ignore_exception = True + task.sudo().task_acceptance = 'accept' + task.sudo().ignore_exception = False + @http.route(['/my/task//decline'], type='http', auth="user", website=True) def portal_task_decline(self, task_id, access_token=None, **post): if request.httprequest.method == 'POST': task = request.env['project.task'].browse([task_id]) + task.sudo().ignore_exception = True task.sudo().task_acceptance = 'decline' + task.sudo().ignore_exception = False # @http.route(['/my/task//feedback'], type='http', auth="user", website=True) # def portal_task_feedback(self, task_id, access_token=None, **post): diff --git a/project_acceptance/data/mail_template_data.xml b/project_acceptance/data/mail_template_data.xml index 30e5ada6..4af039b9 100644 --- a/project_acceptance/data/mail_template_data.xml +++ b/project_acceptance/data/mail_template_data.xml @@ -52,7 +52,7 @@ + Please click on one of the below icons to indicate approval.
Please click on to go to the portal and confirm your selection
diff --git a/project_acceptance/data/project_exception_data.xml b/project_acceptance/data/project_exception_data.xml index da03b7e8..81a29683 100644 --- a/project_acceptance/data/project_exception_data.xml +++ b/project_acceptance/data/project_exception_data.xml @@ -7,8 +7,7 @@ When task stage changes and requires acceptance and task acceptance is blank 50 project.task - - failed = not task.task_acceptance and task.stage_id.requires_acceptance + if not task.task_acceptance and task.stage_id.requires_acceptance: failed=True