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
42 lines
1.6 KiB
Python
42 lines
1.6 KiB
Python
from odoo import http
|
|
from odoo.http import request
|
|
|
|
|
|
class OnboardingController(http.Controller):
|
|
|
|
@http.route('/account/account_invoice_onboarding', auth='user', type='json')
|
|
def account_invoice_onboarding(self):
|
|
""" Returns the `banner` for the account invoice 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.account_invoice_onboarding_state == 'closed':
|
|
return {}
|
|
|
|
return {
|
|
'html': request.env.ref('account.account_invoice_onboarding_panel').render({
|
|
'company': company,
|
|
'state': company.get_and_update_account_invoice_onboarding_state()
|
|
})
|
|
}
|
|
|
|
@http.route('/account/account_dashboard_onboarding', auth='user', type='json')
|
|
def account_dashboard_onboarding(self):
|
|
""" Returns the `banner` for the account dashboard 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.account_dashboard_onboarding_state == 'closed':
|
|
return {}
|
|
|
|
return {
|
|
'html': request.env.ref('account.account_dashboard_onboarding_panel').render({
|
|
'company': company,
|
|
'state': company.get_and_update_account_dashboard_onboarding_state()
|
|
})
|
|
}
|