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

Hi!

My incoming mails don't create crm leads. My log:

2019-01-09 22:47:36,719 4102 ERROR XXXXX odoo.sql_db: bad query: b'INSERT INTO "crm_lead" ("id", "date_open", "message_bounce", "priority", "stage_id", "probability", "type", "color", "team_id", "date_last_stage_update", "active", "company_id", "user_id", "name", "email_from", "email_cc", "partner_id", "partner_name", "contact_name", "title", "street", "street2", "city", "state_id", "country_id", "phone", "mobile", "zip", "function", "website", "opt_out", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval(\'crm_lead_id_seq\'), \'2019-01-09 22:47:36\', 0, \'0\', 1, 0.0, \'lead\', 0, 1, \'2019-01-09 22:47:36\', true, \'False\', NULL, \'test3\', \'XXXXX \', \'\', 1181, NULL, \'Manfred Meyer\', NULL, \'\', \'sdfsf\', \'sdfsd\', NULL, 44, \'+414564654\', NULL, \'1212\', NULL, NULL, false, 5, 5, (now() at time zone \'UTC\'), (now() at time zone \'UTC\')) RETURNING id'
ERROR: invalid input syntax for integer: "False"
LINE 1: ..., 0.0, 'lead', 0, 1, '2019-01-09 22:47:36', true, 'False', N...
                                                             ^

2019-01-09 22:47:36,719 4102 INFO XXXXX odoo.addons.fetchmail.models.fetchmail: Failed to process mail from imap server info@XXXXX.
Traceback (most recent call last):
  File "/home/odoo/odoo-11.0/addons/fetchmail/models/fetchmail.py", line 179, in fetch_mail
    res_id = MailThread.with_context(**additionnal_context).message_process(server.object_id.model, data[0][1], save_original=server.original, strip_attachments=(not server.attach))
  File "/home/odoo/odoo-11.0/addons/mail/models/mail_thread.py", line 1306, in message_process
    thread_id = self.message_route_process(msg_txt, msg, routes)
  File "/home/odoo/odoo-11.0/addons/mail/models/mail_thread.py", line 1215, in message_route_process
    thread = MessageModel.message_new(message_dict, custom_values)
  File "/home/odoo/odoo-11.0/addons/crm/models/crm_lead.py", line 1185, in message_new
    return super(Lead, self).message_new(msg_dict, custom_values=defaults)
  File "/home/odoo/odoo-11.0/addons/mail/models/mail_thread.py", line 1342, in message_new
    return RecordModel.create(data)
  File "/home/odoo/odoo-11.0/addons/crm/models/crm_lead.py", line 298, in create
    return super(Lead, self.with_context(context, mail_create_nolog=True)).create(vals)
  File "/home/odoo/odoo-11.0/addons/mail/models/mail_thread.py", line 238, in create
    thread = super(MailThread, self).create(values)
  File "/home/odoo/odoo-11.0/odoo/models.py", line 3373, in create
    record = self.browse(self._create(old_vals))
  File "/home/odoo/odoo-11.0/odoo/models.py", line 3466, in _create
    cr.execute(query, tuple(u[2] for u in updates if len(u) > 2))
  File "/home/odoo/odoo-11.0/odoo/sql_db.py", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "/home/odoo/odoo-11.0/odoo/sql_db.py", line 232, in execute
    res = self._obj.execute(query, params)
psycopg2.DataError: invalid input syntax for integer: "False"
LINE 1: ..., 0.0, 'lead', 0, 1, '2019-01-09 22:47:36', true, 'False', N...
                                                             ^

Also, if I try to manually create a lead, get this error after clicking on 'create' (not if I am Administrator, then it's working...):

Traceback (most recent call last):
  File "/home/odoo/odoo-11.0/odoo/fields.py", line 937, in __get__
    value = record.env.cache.get(record, self)
  File "/home/odoo/odoo-11.0/odoo/api.py", line 960, in get
    value = self._data[field][record.id][key]
KeyError: (<odoo.sql_db.Cursor object at 0x7f1f5473e0f0>, 5)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/odoo/odoo-11.0/odoo/http.py", line 651, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/odoo/odoo-11.0/odoo/http.py", line 310, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/home/odoo/odoo-11.0/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/home/odoo/odoo-11.0/odoo/http.py", line 693, in dispatch
    result = self._call_function(**self.params)
  File "/home/odoo/odoo-11.0/odoo/http.py", line 342, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/odoo/odoo-11.0/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/odoo/odoo-11.0/odoo/http.py", line 335, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/odoo/odoo-11.0/odoo/http.py", line 937, in __call__
    return self.method(*args, **kw)
  File "/home/odoo/odoo-11.0/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/home/odoo/odoo-11.0/addons/web/controllers/main.py", line 934, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo/odoo-11.0/addons/web/controllers/main.py", line 926, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/odoo/odoo-11.0/odoo/api.py", line 689, in call_kw
    return call_kw_multi(method, model, args, kwargs)
  File "/home/odoo/odoo-11.0/odoo/api.py", line 680, in call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/odoo/odoo-11.0/odoo/models.py", line 1509, in name_get
    result.append((record.id, convert(record[name], record)))
  File "/home/odoo/odoo-11.0/odoo/models.py", line 4759, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/home/odoo/odoo-11.0/odoo/fields.py", line 941, in __get__
    self.determine_value(record)
  File "/home/odoo/odoo-11.0/odoo/fields.py", line 1042, in determine_value
    record._prefetch_field(self)
  File "/home/odoo/odoo-11.0/odoo/models.py", line 2647, in _prefetch_field
    result = records.read([f.name for f in fs], load='_classic_write')
  File "/home/odoo/odoo-11.0/odoo/models.py", line 2591, in read
    self._read_from_database(stored, inherited)
  File "/home/odoo/odoo-11.0/odoo/models.py", line 2710, in _read_from_database
    cr.execute(query_str, params)
  File "/home/odoo/odoo-11.0/odoo/sql_db.py", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "/home/odoo/odoo-11.0/odoo/sql_db.py", line 232, in execute
    res = self._obj.execute(query, params)
psycopg2.DataError: invalid input syntax for integer: "False"
LINE 16: ...overdue_msg"."res_id") WHERE "res_company".id IN ('False') A...
                                                              ^


Avatar
Discard

Can you still reproduce it on the latest Odoo? Update your source code, update the module and try again.

Author Best Answer

I just updated my odoo, upgraded the crm-app, but I am still getting this error!

EDIT: Problem solved. I set some crm-default values in odoo8 that were causing these problems. After removing them everything is working.

Thank you for your help.

Avatar
Discard
Related Posts Replies Views Activity
3
Nov 24
1842
2
Nov 24
257
2
Jun 24
519
2
Jan 24
5011
1
Nov 23
762