Skip to Content
Menu
This question has been flagged
3 Replies
12752 Views

Hi i have this problem when i create a new logged call

Error:
Odoo Server Error

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/http.py", line 656, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/odoo/odoo-server/odoo/http.py", line 314, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/odoo/odoo-server/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/odoo/odoo-server/odoo/http.py", line 698, in dispatch
    result = self._call_function(**self.params)
  File "/odoo/odoo-server/odoo/http.py", line 346, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/odoo/odoo-server/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/odoo/odoo-server/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 962, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 954, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/odoo/odoo-server/odoo/api.py", line 757, in call_kw
    return _call_kw_model_create(method, model, args, kwargs)
  File "/odoo/odoo-server/odoo/api.py", line 737, in _call_kw_model_create
    result = method(recs, *args, **kwargs)
  File "<decorator-gen-257>", line 2, in create
  File "/odoo/odoo-server/odoo/api.py", line 461, in _model_create_multi
    return create(self, [arg])
  File "/odoo/odoo-server/addons/base_automation/models/base_automation.py", line 231, in create
    action._process(action._filter_post(records))
  File "/odoo/odoo-server/addons/base_automation/models/base_automation.py", line 205, in _process
    self.action_server_id.with_context(**ctx).run()
  File "/odoo/odoo-server/odoo/addons/base/models/ir_actions.py", line 569, in run
    res = func(action, eval_context=eval_context)
  File "/odoo/odoo-server/addons/mail/models/ir_actions.py", line 115, in run_action_email
    action.template_id.with_context(cleaned_ctx).send_mail(self._context.get('active_id'), force_send=False, raise_exception=False)
  File "/odoo/odoo-server/addons/mail/models/mail_template.py", line 542, in send_mail
    mail = Mail.create(values)
  File "<decorator-gen-146>", line 2, in create
  File "/odoo/odoo-server/odoo/api.py", line 440, in _model_create_single
    return create(self, arg)
  File "/odoo/odoo-server/addons/fetchmail/models/mail_mail.py", line 18, in create
    return super(MailMail, self).create(values)
  File "<decorator-gen-113>", line 2, in create
  File "/odoo/odoo-server/odoo/api.py", line 440, in _model_create_single
    return create(self, arg)
  File "/odoo/odoo-server/addons/mail/models/mail_mail.py", line 67, in create
    new_mail = super(MailMail, self).create(values)
  File "<decorator-gen-3>", line 2, in create
  File "/odoo/odoo-server/odoo/api.py", line 461, in _model_create_multi
    return create(self, [arg])
  File "/odoo/odoo-server/odoo/models.py", line 3583, in create
    records = self._create(data_list)
  File "/odoo/odoo-server/odoo/models.py", line 3669, in _create
    col_val = field.convert_to_column(val, self, stored)
  File "/odoo/odoo-server/odoo/fields.py", line 1997, in convert_to_column
    value = self.convert_to_cache(value, record)
  File "/odoo/odoo-server/odoo/fields.py", line 2009, in convert_to_cache
    raise ValueError("Wrong value for %s: %r" % (self, value))
ValueError: Wrong value for mail.mail.state: 'done'

Any person help me to resolve this issue?

Thanks

Avatar
Discard
Best Answer

Hi,

You are facing this error because your code is trying to put 'done' value in mail.mail model's 'state' field.

And you can store only outgoing, sent, received, exception and cancel in 'state' field of 'mail.mail'. state is a selection field and it has only outgoing, sent, received, exception and cancel keys.


Thanks.

Avatar
Discard
Author Best Answer

I have an automatic action when I create a new incoming call, I automatically send an email to the user assigned for this contact. It is at this moment that the error jumpsoment that

The problem is relacionate with the automatic action to send email

Avatar
Discard
Best Answer

Hi,

Did you use any third party modules? If so remove it from the addons path and see. If there is no any custom codes, make sure that you haven't edited odoo source code wrongly. So pull the odoo latest code and also try creating new if it is a test db and see.

Thanks

Avatar
Discard