Webhook

webhook
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/10.0/webhook
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYServer Tools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Vauxoo
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Vauxoo
COMMITTERS
COMMITTERSJairo Llopis, Stéphane Bidoul (ACSONE), OCA Transbot, oca-travis, Weblate, OCA-git-bot
WEBSITE
WEBSITEhttps://www.vauxoo.com
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:20:00
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - web
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES ipaddress
requests
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_webhook_form view.webhook.form webhook form New
view_webhook_tree view.webhook.tree webhook tree New
HTTP endpoints (1)
Route(s)HandlerAuthTypeMethodsFlags
/webhook/<webhook_name> WebhookController.webhook none json ALL sudo
Models touched (2)

New fields (5)
  • active Boolean
    default=True
  • address_ids One2many → webhook.address
    help='This address will be filter to know who is consumer webhook' required=True args: 'webhook.address', 'webhook_id', 'IP or Network Address'
  • name Char
    help='Name of your consumer webhook. This name will be used in named of event methods' required=True args: 'Consumer name'
  • python_code_get_event Text
    default='# You can use object.env.request variable to get full data of webhook request.\n# Example:\n#request.httprequest.headers.get("X-Github-Event")' help='Python code to get event from request data.\nYou have object.env.request variable with full webhook request.' required=True args: 'Get event'
  • python_code_get_ip Text
    default='# You can use object.env.request variable to get full data of webhook request.\n# Example:\n#object.env.request.httprequest.remote_addr\nrequest.httprequest.remote_addr' help='Python code to get remote IP address from request data.\nYou have object.env.request variable with full webhook request.' required=True args: 'Get IP'
Public methods (6)
  • get_event_methods(self, event_method_base)
    @api.model
    List all methods of current object that start with base name. e.g. if exists methods called 'x1', 'x2' and other ones called 'y1', 'y2' if you have event_method_base='x' Then will return ['x1', 'x2'] :param string event_method_base: Name of method event base returns: List of methods with that start wtih method base
  • get_ping_events(self)
    @api.model
    List all name of event type ping. This event is a dummy event just to know if a provider is working. :return: List with names of ping events
  • is_address_range(self, remote_address)
    @api.multi
    Check if a remote IP address is in range of one IP or network address of current object data. :param string remote_address: Remote IP address :return: if remote address match then return True else then return False
  • process_python_code(self, python_code, request=None)
    @api.multi
    Execute a python code with eval. :param string python_code: Python code to process :param object request: Request object with data of json and http request :return: Result of process python code.
  • run_webhook(self, request)
    @api.multi
    Run methods to process a webhook event. Get all methods with base name 'run_CONSUMER_EVENT*' Invoke all methods found. :param object request: Request object with data of json and http request :return: True
  • search_with_request(self, request)
    @api.model
    Method to search of all webhook and return only one that match with remote address and range of address. :param object request: Request object with data of json and http request :return: object of webhook found or if not found then return False

New fields (2)
  • name Char
    help='IP or network address of your consumer webhook:\nip address e.g.: 10.10.0.8\nnetwork address e.g. of: 10.10.0.8/24' required=True args: 'IP or Network Address'
  • webhook_id Many2one → webhook
    ondelete='cascade' required=True args: 'webhook', 'Webhook'
Public methods (0)

No public methods.