[IMP] hr_expense: resuscitate tour and adapt to always edit
Slightly modify the view as well, including now showing the 'attach receipt' button before the first save (as it will trigger a save a work properly since its migration to owl). X-original-commit: 283779a8999b6ae93996bafb46b879dc6a3e0112 Part-of: odoo/odoo#101729
This commit is contained in:
@@ -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)]}"/>
|
||||
|
||||
Reference in New Issue
Block a user