top of page

Create Your First Project

Start adding your projects to your portfolio. Click on "Manage Projects" to get started

Integrating Courses as Products and Events in Odoo

Project type

Odoo Use Case Implementaion

Use Case: Integrating Courses as Service Products and Events in Odoo
Objective:
The goal is to seamlessly integrate course offerings into Odoo by:

Adding courses as service products to facilitate sales, invoicing, and payment tracking.

Associating courses with events to manage scheduling and attendee registration.

Implementation:
Product Configuration:

A Many2One custom field, "Related Course" (x_related_course), was added to the Product Model (product.template).

This field links products to the Event Model (event.event), ensuring that each course-related product corresponds to a scheduled event.

Automated Attendee Registration:

An automation rule was created to automatically register customers for a course upon successful purchase.

Configuration details:

Name: Attendee Registration

Model: Sale Order (sale.order)

Trigger: State set to Sale Order

Action: Execute Python Code

Automation Script:

for line in record.order_line:
if line.product_id.x_related_course: # Check if the product is linked to an event
env["event.registration"].create({
"event_id": line.product_id.x_related_course.id,
"partner_id": record.partner_id.id,
"email": record.partner_id.email,
"phone": record.partner_id.phone,
"state": "open", # Define the registration status
"sale_order_id": record.id, # Link the registration to the sale order
"sale_status": "sold" # Set the registration status as 'paid'
})

This implementation ensures that when a customer purchases a course, they are automatically registered for the corresponding event, improving efficiency and user experience.

bottom of page