Specification ============= - Fix lots of bug due to the BS4 migration - Improve steps - Validate some steps (Like the company configuration) in all the onboarding bars if done in one onboarding bar. - Only animate the confetti one time if a step is done, instead of on each view loading For more information, see: https://www.odoo.com/web#id=1869513&action=333&active_id=965&model=project.task&view_type=form&menu_id=4720
27 lines
935 B
Python
27 lines
935 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('/sales/sale_quotation_onboarding_panel', auth='user', type='json')
|
|
def sale_quotation_onboarding(self):
|
|
""" Returns the `banner` for the sale onboarding panel.
|
|
It can be empty if the user has closed it or if he doesn't have
|
|
the permission to see it. """
|
|
|
|
company = request.env.user.company_id
|
|
if not request.env.user._is_admin() or \
|
|
company.sale_quotation_onboarding_state == 'closed':
|
|
return {}
|
|
|
|
return {
|
|
'html': request.env.ref('sale.sale_quotation_onboarding_panel').render({
|
|
'company': company,
|
|
'state': company.get_and_update_sale_quotation_onboarding_state()
|
|
})
|
|
}
|