[IMP] project_acceptance: change on controllers and modal view available

H11043
This commit is contained in:
Leo Pinedo
2022-10-07 20:27:35 +00:00
parent b01f62a202
commit 1f03fd2e7f
7 changed files with 103 additions and 80 deletions

View File

@@ -5,15 +5,19 @@ from odoo.addons.portal.controllers import mail
class PortalChatter(mail.PortalChatter):
@http.route()
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.with_context('skip_detect_exceptions').write({'task_acceptance': 'feedback'})
task.sudo().ignore_exception = True
task.sudo().task_acceptance = 'feedback'
task.sudo().ignore_exception = False
# try:
# task_sudo = self._document_check_access('project.task', res_id, access_token=access_token)
# except (AccessError, MissingError):
# return {'error': _('Invalid task.')}
task.sudo().with_context(skip_detect_exceptions=True).write({'task_acceptance': 'feedback'})
# task_sudo.with_context(skip_detect_exceptions=True).write({'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)