Skip to main content
License: AGPL-3

Webhook

Module to receive webhook events. This module invoke methods to process webhook events.

Configuration

You will need create a new module to add your logic to process the events with methods called: def run_CONSUMER_EVENT* Example with gihub consumer and push event.

@api.one
def run_github_push_task(self):
    # You will have all request data in
    # variable: self.env.request
    pass

Where CONSUMER is the name of you webhook consumer. e.g. github (Extract from field name of webhook model) Where EVENT is the name of the event from webhook request data. Where * is your particular method to process this event.

To configure a new webhook you need add all ip or subnet address (with ip/integer) owned by your webhook consumer in webhook.address model as data.

Example with github:

<!--webhook github data of remote address-->
<record model="webhook.address" id="webhook_address_github">
    <field name="name">192.30.252.0/22</field>
    <field name="webhook_id" ref="webhook_github"/>
</record>

You need to add a python code to extract event name from webhook request info into python_code_get_event field of webhook model. You can get all full data of request webhook from variable request Example with github:

<!--webhook github data-->
<record model="webhook" id="webhook_github">
    <field name="name">github</field>
    <field name="python_code_get_event">request.httprequest.headers.get('X-Github-Event')</field>
</record>

Full example of create a new webhook configuration data.

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
    <data>

        <!--webhook github data-->
        <record model="webhook" id="webhook_github">
            <field name="name">github</field>
            <field name="python_code_get_event">request.httprequest.headers.get('X-Github-Event')</field>
        </record>
        <!--webhook github data of remote address-->
        <record model="webhook.address" id="webhook_address_github">
            <field name="name">192.30.252.0/22</field>
            <field name="webhook_id" ref="webhook_github"/>
        </record>

    </data>
</openerp>
alternative description

Usage

To use this module, you need to:

  1. Go to your customer webhook configuration from 3rd-party applications and use the odoo webhook url HOST/webhook/NAME_WEBHOOK

Try me on Runbot

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smash it by providing detailed and welcomed feedback.

Credits

Images

  • Odoo Community Association: Icon.

Contributors

Funders

The development of this module has been financially supported by:

  • Vauxoo

Maintainer

Odoo Community Association

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

To contribute to this module, please visit https://odoo-community.org.

Metadata

Release files for odoo10-addon-webhook 10.0.1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo10-addon-webhook 10.0.1.0.0
File Interpreter ABI Platform
odoo10_addon_webhook-10.0.1.0.0-py2-none-any.whl Python 2 none any Details

Release files / odoo10_addon_webhook-10.0.1.0.0-py2-none-any.whl

Download URL odoo10_addon_webhook-10.0.1.0.0-py2-none-any.whl
Size 16.5 kB
Tags Python 2
SHA-256 checksum
How to use checksums
08ee5a6b2363db27bdcf6ba2904b93f849f13a6c9d09b806f6cdc2f7fc765772
BLAKE2b-256 checksum
How to use checksums
484156b608a801efa61af19f7bc64d154e31ea67a69ceb07218a3a7107718b39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page