itpp-labs/sync-addons

telegram /website/action-json request

rosenvladimirov opened this issue · 3 comments

When try to send from Telegram bot chat /start in log is received error:
404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

Hi
It could be a multi-db issue. You should try to configure --db-filter in odoo.
It might be fixed on Sync Studio level by adding ?db=dbnamehere to the url, but I'm not sure and don't plan to do it soon.

I add the db_filter in config file, but is same error.
"POST /website/action-json/f5b7aa72-0fbb-40fb-8117-1fb23d896af1 HTTP/1.1" 404

The odoo is work behind proxy, to fix wrong web.base.url (http) i make small fix

def _get_website_url(self, website_path, webhook_type):
        base_url = self.env["ir.config_parameter"].sudo().get_param("web.base.url")
        if config.get('proxy_mode', False) and not base_url.startswith('https://') and base_url.find('http://') != -1:
            base_url = 'https://' + base_url.split('http://')[1]
        link = (
            website_path
            or (self.action_server_id.id and "%d" % self.action_server_id.id)
            or ""
        )
        if base_url and link:
            path = "website/action-{webhook_type}/{link}".format(
                webhook_type=webhook_type, link=link
            )
            return urls.url_join(base_url, path)
        return ""

I found problem, for moment in config file i add the db_name not db_filter. I will fork repository and will fix session.db in future. Thanks