[FW][MERGE] (various): adapt tours to always edit
Always edit mode comes with several layout and behavioral changes that may necessitate changes in tours (both in terms of selectors for the tips and in terms of content, e.g. since "Save" steps are now kind of redundant). closes odoo/odoo#101729 Forward-port-of: odoo/odoo#101328 Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
This commit is contained in:
@@ -35,13 +35,16 @@ tour.register('account_tour', {
|
||||
content: _t("Now, we'll create your first invoice."),
|
||||
position: "bottom",
|
||||
}, {
|
||||
trigger: "div[name=partner_id] input",
|
||||
trigger: "div[name=partner_id] .o_input_dropdown",
|
||||
// FIXME WOWL: this selector needs to work in both legacy and non-legacy views
|
||||
// because account_invoice_extracts *adds* a js_class on the base view which forces
|
||||
// the use of a legacy view in enterprise only
|
||||
extra_trigger: "[name=move_type] [raw-value=out_invoice], [name=move_type][raw-value=out_invoice]",
|
||||
content: Markup(_t("Write a company name to <b>create one</b> or <b>see suggestions</b>.")),
|
||||
position: "right",
|
||||
}, {
|
||||
trigger: "div[name=partner_id] input",
|
||||
auto: true,
|
||||
}, {
|
||||
trigger: ".o_m2o_dropdown_option a:contains('Create')",
|
||||
// FIXME WOWL: this selector needs to work in both legacy and non-legacy views
|
||||
|
||||
@@ -78,11 +78,11 @@ tour.register('crm_tour', {
|
||||
},
|
||||
}, {
|
||||
trigger: ".o_lead_opportunity_form .o_statusbar_status",
|
||||
content: _t("This bar also allows you to switch stage."),
|
||||
content: _t("You can make your opportunity advance through your pipeline from here."),
|
||||
position: "bottom"
|
||||
}, {
|
||||
trigger: ".breadcrumb-item:not(.active):first",
|
||||
content: _t("Click on the breadcrumb to go back to the Pipeline."),
|
||||
content: _t("Click on the breadcrumb to go back to your Pipeline. Odoo will save all modifications as you navigate."),
|
||||
position: "bottom",
|
||||
run: function (actions) {
|
||||
actions.auto(".breadcrumb-item:not(.active):last");
|
||||
|
||||
@@ -61,9 +61,9 @@ This module also uses analytic accounting and is compatible with the invoice on
|
||||
'hr_expense/static/src/views/*.xml',
|
||||
'hr_expense/static/src/scss/hr_expense.scss',
|
||||
'hr_expense/static/src/xml/**/*',
|
||||
'hr_expense/static/src/js/tours/*.js',
|
||||
],
|
||||
'web.assets_tests': [
|
||||
'hr_expense/static/src/js/tours/hr_expense.js',
|
||||
'hr_expense/static/tests/tours/expense_upload_tours.js',
|
||||
],
|
||||
},
|
||||
|
||||
@@ -6,59 +6,77 @@ const {Markup} = require('web.utils');
|
||||
var tour = require('web_tour.tour');
|
||||
|
||||
tour.register('hr_expense_tour' , {
|
||||
url: "/web"
|
||||
url: "/web",
|
||||
rainbowManMessage: _t("There you go - expense management in a nutshell!"),
|
||||
}, [tour.stepUtils.showAppsMenuItem(), {
|
||||
trigger: '.o_app[data-menu-xmlid="hr_expense.menu_hr_expense_root"]',
|
||||
content: _t("Want to manage your expenses? It starts here."),
|
||||
content: _t("Wasting time recording your receipts? Let’s try a better way."),
|
||||
position: 'right',
|
||||
edition: 'community'
|
||||
}, {
|
||||
trigger: '.o_app[data-menu-xmlid="hr_expense.menu_hr_expense_root"]',
|
||||
content: _t("Want to manage your expenses? It starts here."),
|
||||
content: _t("Wasting time recording your receipts? Let’s try a better way."),
|
||||
position: 'bottom',
|
||||
edition: 'enterprise'
|
||||
}, {
|
||||
trigger: '.o_form_button_save',
|
||||
content: Markup(_t("<p>Once your <b> Expense </b> is ready, you can save it.</p>")),
|
||||
trigger: '.o_list_button_add',
|
||||
extra_trigger: '.o_button_upload_expense',
|
||||
content: _t("It all begins here - let's go!"),
|
||||
position: 'bottom',
|
||||
mobile: false,
|
||||
}, {
|
||||
trigger: '.o-kanban-button-new',
|
||||
extra_trigger: '.o_button_upload_expense',
|
||||
content: _t("It all begins here - let's go!"),
|
||||
position: 'bottom',
|
||||
mobile: true,
|
||||
}, {
|
||||
trigger: '.o_field_widget[name="product_id"] .o_input_dropdown',
|
||||
extra_trigger: '.o_expense_form',
|
||||
content: _t("Enter a name then choose a category and configure the amount of your expense."),
|
||||
position: 'bottom',
|
||||
}, {
|
||||
trigger: '.o_attach_document',
|
||||
content: _t("Attach your receipt here."),
|
||||
trigger: '.o_form_status_indicator_dirty .o_form_button_save',
|
||||
extra_trigger: '.o_expense_form',
|
||||
content: Markup(_t("Ready? You can save it manually or discard modifications from here. You don't <em>need to save</em> - Odoo will save eveyrthing for you when you navigate.")),
|
||||
position: 'bottom',
|
||||
}, {
|
||||
trigger: '.o_expense_submit',
|
||||
}, ...tour.stepUtils.statusbarButtonsSteps(_t("Attach Receipt"), _t("Attach a receipt - usually an image or a PDF file.")),
|
||||
...tour.stepUtils.statusbarButtonsSteps(_t("Create Report"), _t("Create a report to submit one or more expenses to your manager.")),
|
||||
...tour.stepUtils.statusbarButtonsSteps(_t("Submit to Manager"), Markup(_t('Once your <b>Expense Report</b> is ready, you can submit it to your manager and wait for approval.'))),
|
||||
...tour.stepUtils.goBackBreadcrumbsMobile(
|
||||
_t("Use the breadcrumbs to go back to the list of expenses."),
|
||||
undefined,
|
||||
".o_expense_form",
|
||||
),
|
||||
{
|
||||
trigger: '.breadcrumb > li.breadcrumb-item:first',
|
||||
extra_triggger: ".o_expense_form",
|
||||
content: Markup(_t('<p>Click on <b> Create Report </b> to create the report.</p>')),
|
||||
position: 'right',
|
||||
}, {
|
||||
trigger: '.o_expense_tree input[type=checkbox]',
|
||||
content: Markup(_t('<p>Select expenses to submit them to your manager</p>')),
|
||||
position: 'bottom'
|
||||
}, {
|
||||
trigger: '.dropdown-toggle',
|
||||
extra_trigger: ".o_expense_tree",
|
||||
content: Markup(_t('<p>Click on <b> Action Create Report </b> to submit selected expenses to your manager</p>')),
|
||||
position: 'right',
|
||||
}, {
|
||||
trigger: '.o_expense_sheet_submit',
|
||||
content: Markup(_t('Once your <b>Expense report</b> is ready, you can submit it to your manager and wait for the approval from your manager.')),
|
||||
content: _t("Let's go back to your expenses."),
|
||||
position: 'bottom',
|
||||
mobile: false,
|
||||
}, {
|
||||
trigger: '.o_expense_sheet_approve',
|
||||
content: Markup(_t("<p>Approve the report here.</p><p>Tip: if you refuse, don’t forget to give the reason thanks to the hereunder message tool</p>")),
|
||||
trigger: '.o_expense_container',
|
||||
content: _t("The status of all your current expenses is visible from here."),
|
||||
position: 'bottom',
|
||||
},
|
||||
tour.stepUtils.openBuggerMenu(),
|
||||
{
|
||||
trigger: "[data-menu-xmlid='hr_expense.menu_hr_expense_report']",
|
||||
extra_trigger: '.o_main_navbar',
|
||||
content: _t("Let's check out where you can manage all your employees expenses"),
|
||||
position: "bottom"
|
||||
}, {
|
||||
trigger: '.o_expense_sheet_post',
|
||||
content: Markup(_t("<p>The accountant receive approved expense reports.</p><p>He can post journal entries in one click if taxes and accounts are right.</p>")),
|
||||
trigger: '.o_list_renderer tbody tr[data-id]',
|
||||
content: _t('Managers can inspect all expenses from here.'),
|
||||
position: 'bottom',
|
||||
mobile: false,
|
||||
}, {
|
||||
trigger: '.o_expense_sheet_pay',
|
||||
content: _t("The accountant can register a payment to reimburse the employee directly."),
|
||||
trigger: '.o_kanban_renderer .oe_kanban_card',
|
||||
content: _t('Managers can inspect all expenses from here.'),
|
||||
position: 'bottom',
|
||||
}, {
|
||||
trigger: 'li a[data-menu-xmlid="hr_expense.menu_hr_expense_sheet_my_all"], div[data-menu-xmlid="hr_expense.menu_hr_expense_sheet_my_all"]',
|
||||
content: _t("Managers can get all reports to approve from this menu."),
|
||||
position: 'bottom',
|
||||
}]);
|
||||
mobile: true,
|
||||
},
|
||||
...tour.stepUtils.statusbarButtonsSteps(_t("Approve"), _t("Managers can approve the report here, then an accountant can post the accounting entries.")),
|
||||
]);
|
||||
|
||||
});
|
||||
|
||||
@@ -110,8 +110,8 @@
|
||||
<form string="Expenses" class="o_expense_form" js_class="hr_expense_form_view">
|
||||
<header>
|
||||
<button name="action_submit_expenses" string="Create Report" type="object" class="oe_highlight o_expense_submit" attrs="{'invisible': ['|', ('attachment_number', '<=', 0), ('sheet_id', '!=', False)]}" data-hotkey="v"/>
|
||||
<widget name="attach_document" string="Attach Receipt" action="attach_document" attrs="{'invisible': ['|', ('attachment_number', '<', 1), ('id','=',False)]}"/>
|
||||
<widget name="attach_document" string="Attach Receipt" action="attach_document" highlight="1" attrs="{'invisible': ['|',('attachment_number', '>=', 1), ('id','=',False)]}"/>
|
||||
<widget name="attach_document" string="Attach Receipt" action="attach_document" attrs="{'invisible': [('attachment_number', '<', 1)]}"/>
|
||||
<widget name="attach_document" string="Attach Receipt" action="attach_document" highlight="1" attrs="{'invisible': [('attachment_number', '>=', 1)]}"/>
|
||||
<button name="action_submit_expenses" string="Create Report" type="object" class="o_expense_submit" attrs="{'invisible': ['|', ('attachment_number', '>=', 1), ('sheet_id', '!=', False)]}" data-hotkey="v"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,reported,approved,done,refused"/>
|
||||
<button name="action_view_sheet" type="object" string="View Report" class="oe_highlight" attrs="{'invisible': [('sheet_id', '=', False)]}" data-hotkey="w"/>
|
||||
@@ -155,7 +155,7 @@
|
||||
|
||||
<label for="total_amount" string="Total" attrs="{'invisible': [('product_has_cost', '=', True)]}"/>
|
||||
<div class="o_row" attrs="{'invisible': [('product_has_cost', '=', True)]}">
|
||||
<field name="total_amount" widget='monetary' options="{'currency_field': 'currency_id'}" attrs="{'readonly': [('sheet_is_editable', '=', False)]}"/>
|
||||
<field name="total_amount" widget='monetary' options="{'currency_field': 'currency_id'}" attrs="{'readonly': [('sheet_is_editable', '=', False)]}" class="oe_inline"/>
|
||||
<field name="currency_id" groups="base.group_multi_currency"/>
|
||||
</div>
|
||||
<label for="total_amount_company" attrs="{'invisible': [('product_has_cost', '=', False)]}"/>
|
||||
|
||||
@@ -106,12 +106,30 @@ tour.register('project_tour', {
|
||||
content: "Schedule your activity once it is ready.",
|
||||
position: "bottom",
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: ".o_field_widget[name='user_ids'] input",
|
||||
extra_trigger: '.o_form_project_tasks',
|
||||
content: _t("Assign a responsible to your task"),
|
||||
position: "right",
|
||||
run: "text a"
|
||||
}, {
|
||||
trigger: ".ui-autocomplete > li > a:not(:has(i.fa))",
|
||||
auto: true,
|
||||
}, {
|
||||
trigger: ".o_form_button_save",
|
||||
extra_trigger: '.o_form_project_tasks.o_form_dirty',
|
||||
content: Markup(_t("You have unsaved changes - no worries! Odoo will automatically save it as you navigate.<br/> You can discard these changes from here or manually save your task.<br/>Let's save it manually.")),
|
||||
position: "bottom",
|
||||
}, {
|
||||
trigger: ".breadcrumb-item:not(.active):last",
|
||||
extra_trigger: '.o_form_project_tasks.o_form_saved',
|
||||
extra_trigger: '.o_form_project_tasks',
|
||||
content: Markup(_t("Let's go back to the <b>kanban view</b> to have an overview of your next tasks.")),
|
||||
position: "right",
|
||||
run: 'click',
|
||||
}, {
|
||||
trigger: '.o_kanban_renderer',
|
||||
// last step to confirm we've come back before considering the tour successful
|
||||
auto: true
|
||||
}]);
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user