Files
odoo_source/addons/mail_bot/models/ir_http.py
T
Thibault Delavallée 2598061be8 [IMP] mail_bot: remove required on odoobot_state
Purpose is to avoid having strong requirements on fields where it is not
really necessary. In this commit we consider now that a void odoobot_state
is the same as ``not_initialized`` key. It allows to remove both the default
and required parameters on the field.

Task ID 2233014
PR #49661
2020-05-27 12:48:21 +00:00

15 lines
438 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class Http(models.AbstractModel):
_inherit = 'ir.http'
def session_info(self):
res = super(Http, self).session_info()
if self.env.user.has_group('base.group_user'):
res['odoobot_initialized'] = self.env.user.odoobot_state not in [False, 'not_initialized']
return res