This technical module can be used to configure onboarding panels flows at company or global level (required for new Appointment onboarding, see ENT PR). This implementation, which should be able to support the migration of the other onboardings, separates the closed state from the completion state (allowing to know that steps are not completed even though the panel is closed). Basic tree and form view are included. Adding an onboarding with this module requires to provide records data for the models: - `onboarding.onboarding` + action to close the panel - `onboarding.onboarding.step` + actions for the 'opening' and 'saving' of each step. See related ENT PR for the `appointment` example, in particular `onboarding_data.xml` and `onboarding_onboarding.py` Several python tests are also included. Misc. In base, we slightly refresh the wording/style of the modal closing the onboarding panel. Task-2852375 Part of Task-2900763 Part-of: odoo/odoo#97105
23 lines
867 B
Python
23 lines
867 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import http
|
|
from odoo.http import request
|
|
|
|
|
|
class OnboardingController(http.Controller):
|
|
@http.route('/onboarding/<string:route_name>', auth='user', type='json')
|
|
def get_onboarding_data(self, route_name=None):
|
|
if not request.env.is_admin():
|
|
return {}
|
|
|
|
onboarding = request.env['onboarding.onboarding'].search([('route_name', '=', route_name)])
|
|
if onboarding and not onboarding._search_or_create_progress().is_onboarding_closed:
|
|
# JS implementation of the onboarding panel expects this data structure
|
|
return {
|
|
'html': request.env['ir.qweb']._render(
|
|
'onboarding.onboarding_panel', onboarding._prepare_rendering_values())
|
|
}
|
|
|
|
return {}
|