I have a website where i need send a message by WhatsApp to my user.
But this error is throwing.
"Traceback (most recent call last):\n File \"C:\\Program Files (x86)\\Odoo 12.0\\server\\odoo\\http.py\", line 656, in _handle_exception\n return super(JsonRequest, self)._handle_exception(exception)\n File \"C:\\Program Files (x86)\\Odoo 12.0\\server\\odoo\\http.py\", line 314, in _handle_exception\n raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])\n File \"C:\\Program Files (x86)\\Odoo 12.0\\server\\odoo\\tools\\pycompat.py\", line 87, in reraise\n raise value\n File \"C:\\Program Files (x86)\\Odoo 12.0\\server\\odoo\\http.py\", line 698, in dispatch\n result = self._call_function(**self.params)\n File \"C:\\Program Files (x86)\\Odoo 12.0\\server\\odoo\\http.py\", line 346, in _call_function\n return checked_call(self.db, *args, **kwargs)\n File \"C:\\Program Files (x86)\\Odoo 12.0\\server\\odoo\\service\\model.py\", line 97, in wrapper\n return f(dbname, *args, **kwargs)\n File \"C:\\Program Files (x86)\\Odoo 12.0\\server\\odoo\\http.py\", line 339, in checked_call\n result = self.endpoint(*a, **kw)\n File \"C:\\Program Files (x86)\\Odoo 12.0\\server\\odoo\\http.py\", line 941, in __call__\n return self.method(*args, **kw)\n File \"C:\\Program Files (x86)\\Odoo 12.0\\server\\odoo\\http.py\", line 519, in response_wrap\n response = f(*args, **kw)\n File \"c:\\program files (x86)\\odoo 12.0\\server\\odoo\\addons\\website\\controllers\\backend.py\", line 182, in website_grava_acordo\n status = self.website_send_wpp(contato,acordo)\n File \"c:\\program files (x86)\\odoo 12.0\\server\\odoo\\addons\\website\\controllers\\backend.py\", line 296, in website_send_wpp\n msg_id = Website.enviar_wpp(msg, proposta)\n File \"c:\\program files (x86)\\odoo 12.0\\server\\odoo\\addons\\website\\models\\website.py\", line 929, in enviar_wpp\n 'partner_ids':63,\n File \"<decorator-gen-3>\", line 2, in create\n File \"C:\\Program Files (x86)\\Odoo 12.0\\server\\odoo\\api.py\", line 461, in _model_create_multi\n return create(self, [arg])\n File \"C:\\Program Files (x86)\\Odoo 12.0\\server\\odoo\\models.py\", line 3525, in create\n vals = self._add_missing_default_values(vals)\n File \"C:\\Program Files (x86)\\Odoo 12.0\\server\\odoo\\models.py\", line 1691, in _add_missing_default_values\n defaults = self.default_get(list(missing_defaults))\n File \"c:\\program files (x86)\\odoo 12.0\\server\\odoo\\addons\\whatsapp_integration\\wizard\\send_msg.py\", line 129, in default_get\n rec = self.env[active_model].browse(res_id)\n File \"C:\\Program Files (x86)\\Odoo 12.0\\server\\odoo\\api.py\", line 831, in __getitem__\n return self.registry[model_name]._browse((), self)\n File \"C:\\Program Files (x86)\\Odoo 12.0\\server\\odoo\\modules\\registry.py\", line 176, in __getitem__\n return self.models[model_name]\nKeyError: None\n
My class:
## My method called into website class
return result
Hope these tips will helps: https://goo.gl/8HgnCF