Skip to Content
Menu
This question has been flagged
2 Replies
4479 Views

Hi i have this error:

I have programed one automatic server action, what when i recibe one inboound call, the system, send email automaticaly the registry of this call to a assigned usser, but i recibe this 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'

What's happend?

Someboy help me?

Thanks

Avatar
Discard
Author Best Answer

I only installed the asterisk connector who a custom module, not have any custom module installed more, This error apear when i have programed a automatic actions to send email when i create new record in crm.phoncall when it is incoming call. Any new idea for solve this problem? I can not send email with automatic action because i recibe this error and the sistem not send the email. When i select the call and clik in tho de action button to send the call the sistem work correctly

Avatar
Discard
Best Answer

Hello Administrator,

Are you using any custom module?

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