Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions website_sale_slides_portal/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
==========================
Website Sale Slides Portal
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8e2129116bdf52aaccd45cfaf84303667132f5defc24cb2c03220b6cf08ba4a7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fe--learning-lightgray.png?logo=github
:target: https://github.com/OCA/e-learning/tree/17.0/website_sale_slides_portal
:alt: OCA/e-learning
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/e-learning-17-0/e-learning-17-0-website_sale_slides_portal
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/e-learning&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module extends the Odoo portal to allow customers to view the
courses they have purchased through the website.

**Table of contents**

.. contents::
:local:

Usage
=====

1. Create a Sales Order for a course product (set Quantity > 1, or
create multiple orders for the same course).
2. Confirm the Sales Order(s).
3. Log in as the purchasing customer and go to the portal home.
4. Open **My courses** to see the purchased course(s).

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/e-learning/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/e-learning/issues/new?body=module:%20website_sale_slides_portal%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Tecnativa

Contributors
------------

- [Tecnativa](https://www.tecnativa.com/):

- Pilar Vargas

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

This module is part of the `OCA/e-learning <https://github.com/OCA/e-learning/tree/17.0/website_sale_slides_portal>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions website_sale_slides_portal/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import controllers
15 changes: 15 additions & 0 deletions website_sale_slides_portal/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2025 Tecnativa - Pilar Vargas
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Website Sale Slides Portal",
"summary": "Display of purchased courses and participation in portal",
"version": "17.0.1.0.0",
"category": "Website/eLearning",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/e-learning",
"license": "AGPL-3",
"depends": ["portal", "website_sale_slides_multi_qty"],
"data": [
"views/portal_templates.xml",
],
}
1 change: 1 addition & 0 deletions website_sale_slides_portal/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import portal
62 changes: 62 additions & 0 deletions website_sale_slides_portal/controllers/portal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright 2026 Tecnativa - Pilar Vargas
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import http
from odoo.http import request

from odoo.addons.portal.controllers.portal import CustomerPortal
from odoo.addons.portal.controllers.portal import pager as portal_pager


class CoursesCustomerPortal(CustomerPortal):
def _prepare_courses_domain(self):
commercial = request.env.user.partner_id.commercial_partner_id
return [
("partner_id.commercial_partner_id", "=", commercial.id),
("parent_id", "=", False),
("sale_order_line_ids", "!=", False),
("available_registrations", ">", 1),
]

def _prepare_home_portal_values(self, counters):
values = super()._prepare_home_portal_values(counters)
if "courses_count" in counters:
domain = self._prepare_courses_domain()
values["courses_count"] = (
request.env["slide.channel.partner"].sudo().search_count(domain)
)
return values

@http.route(["/my/courses"], type="http", auth="user", website=True)
def portal_my_courses(
self, page=1, date_begin=None, date_end=None, sortby=None, **kw
):
values = self._prepare_portal_layout_values()
SlideChannelPartner = request.env["slide.channel.partner"]
domain = self._prepare_courses_domain()
searchbar_sortings = self._prepare_searchbar_sortings()
if not sortby:
sortby = "date"
order = searchbar_sortings[sortby]["order"]
courses_count = SlideChannelPartner.sudo().search_count(domain)
# pager
pager = portal_pager(
url="/my/courses",
url_args={"date_begin": date_begin, "date_end": date_end, "sortby": sortby},
total=courses_count,
page=page,
step=self._items_per_page,
)
courses = SlideChannelPartner.sudo().search(
domain, order=order, limit=self._items_per_page, offset=pager["offset"]
)
values.update(
{
"courses": courses,
"page_name": "courses",
"default_url": "/my/courses",
"pager": pager,
"searchbar_sortings": searchbar_sortings,
"sortby": sortby,
}
)
return request.render("website_sale_slides_portal.portal_my_courses", values)
63 changes: 63 additions & 0 deletions website_sale_slides_portal/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_slides_portal
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-01-30 12:37+0000\n"
"PO-Revision-Date: 2026-01-30 13:38+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.4.2\n"

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_courses
msgid "Course #"
msgstr "Curso #"

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_courses
msgid "Courses"
msgstr "Cursos"

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_home_instances
msgid "Information about courses and participations."
msgstr "Información acerca de cursos y participaciones."

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_courses
msgid "Invitation Link"
msgstr "Link de invitación"

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_courses
msgid "Remaining"
msgstr "Disponibles"

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_home_instances
msgid "Slides"
msgstr ""

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_courses
msgid "There are no courses."
msgstr "No hay cursos."

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_courses
msgid "Total"
msgstr ""

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_courses
msgid "Used"
msgstr "Usadas"
61 changes: 61 additions & 0 deletions website_sale_slides_portal/i18n/website_sale_slides_portal.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_slides_portal
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-01-30 12:37+0000\n"
"PO-Revision-Date: 2026-01-30 12:37+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_courses
msgid "Course #"
msgstr ""

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_courses
msgid "Courses"
msgstr ""

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_home_instances
msgid "Information about courses and participations."
msgstr ""

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_courses
msgid "Invitation Link"
msgstr ""

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_courses
msgid "Remaining"
msgstr ""

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_home_instances
msgid "Slides"
msgstr ""

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_courses
msgid "There are no courses."
msgstr ""

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_courses
msgid "Total"
msgstr ""

#. module: website_sale_slides_portal
#: model_terms:ir.ui.view,arch_db:website_sale_slides_portal.portal_my_courses
msgid "Used"
msgstr ""
3 changes: 3 additions & 0 deletions website_sale_slides_portal/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions website_sale_slides_portal/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- \[Tecnativa\](<https://www.tecnativa.com/>):
- Pilar Vargas
1 change: 1 addition & 0 deletions website_sale_slides_portal/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module extends the Odoo portal to allow customers to view the courses they have purchased through the website.
4 changes: 4 additions & 0 deletions website_sale_slides_portal/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1. Create a Sales Order for a course product (set Quantity > 1, or create multiple orders for the same course).
2. Confirm the Sales Order(s).
3. Log in as the purchasing customer and go to the portal home.
4. Open **My courses** to see the purchased course(s).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading