From 4882a521f1b7646c02844f8ba4bdd2772e9b5a0e Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 28 Jun 2016 19:35:25 -0700 Subject: [PATCH 1/2] [IMP] Expense: tour + employee created by default --- .../account_accountant/static/src/js/tour.js | 8 ++--- addons/crm/static/src/js/tour.js | 4 +-- addons/hr/data/hr_data.xml | 9 ++++++ addons/hr/views/hr_views.xml | 2 +- addons/hr_expense/models/hr_expense.py | 10 +++--- addons/hr_expense/models/res_config.py | 15 +++++++++ addons/hr_expense/static/src/js/tour.js | 32 ++++++++++++++++++- addons/hr_expense/views/hr_expense_views.xml | 14 ++++---- addons/hr_expense/views/res_config_views.xml | 1 + addons/mail/static/src/js/tour.js | 10 ++++-- 10 files changed, 82 insertions(+), 23 deletions(-) diff --git a/addons/account_accountant/static/src/js/tour.js b/addons/account_accountant/static/src/js/tour.js index dae2266b526..26344471dac 100644 --- a/addons/account_accountant/static/src/js/tour.js +++ b/addons/account_accountant/static/src/js/tour.js @@ -10,21 +10,21 @@ tour.register('account_accountant_tour', { 'skip_enabled': true, }, [{ trigger: '.o_app[data-menu-xmlid="account.menu_finance"], .oe_menu_toggler[data-menu-xmlid="account.menu_finance"]', - content: _t('Ready to discover an awesome accounting app? Follow the tips.'), + content: _t('Ready to discover your new favorite accounting app? Get started by clicking here.'), position: 'bottom', }, { trigger: ".o_invoice_new", extra_trigger: '.o_account_kanban', - content: _t("Let\'s start with a customer invoice."), + content: _t("Let\'s start with a new customer invoice."), position: "bottom" }, { trigger: ".breadcrumb li:not(.active):last", extra_trigger: "[data-id='open'].btn-primary, [data-id='open'].oe_active", - content: _t("Use the breadcrumbs to easily go back to preceeding screens."), + content: _t("Use the path to quickly click back to previous screens, without reloading the page."), position: "bottom" }, { trigger: 'li a[data-menu-xmlid="account.menu_finance_reports"], div[data-menu-xmlid="account.menu_finance_reports"]', - content: _t("Your reports are available in real time. No need to close a fiscal year to get a Profit & Loss statement or a Balance Sheet."), + content: _t("Your reports are available in real time. No need to close a fiscal year to get a Profit & Loss statement or view the Balance Sheet."), position: "bottom" }]); diff --git a/addons/crm/static/src/js/tour.js b/addons/crm/static/src/js/tour.js index 7f5b3989406..a6725656fd4 100644 --- a/addons/crm/static/src/js/tour.js +++ b/addons/crm/static/src/js/tour.js @@ -10,7 +10,7 @@ tour.register('crm_tour', { 'skip_enabled': true, }, [{ trigger: '.o_app[data-menu-xmlid="sales_team.menu_base_partner"], .oe_menu_toggler[data-menu-xmlid="sales_team.menu_base_partner"]', - content: _t("Ready to boost you sales? It starts with the CRM app."), + content: _t("Ready to boost you sales? Your sales pipeline can be found here, under this app."), position: 'bottom', }, { trigger: ".o_welcome_content .o_dashboard_action", @@ -20,7 +20,7 @@ tour.register('crm_tour', { }, { trigger: ".o-kanban-button-new", extra_trigger: '.o_opportunity_kanban', - content: _t("Create your first business opportunity."), + content: _t("Click here to create your first opportunity and add it to your pipeline."), position: "right" }, { trigger: ".o_opportunity_kanban .o_kanban_record:nth-child(2)", diff --git a/addons/hr/data/hr_data.xml b/addons/hr/data/hr_data.xml index 699b25bf890..22ecf490e8b 100644 --- a/addons/hr/data/hr_data.xml +++ b/addons/hr/data/hr_data.xml @@ -21,5 +21,14 @@ Leave Management (keep track of employee leaves), Expense Management (manage emp Sales + + + + + + + + + diff --git a/addons/hr/views/hr_views.xml b/addons/hr/views/hr_views.xml index bff1ec0c4fb..0d74d1e4c81 100644 --- a/addons/hr/views/hr_views.xml +++ b/addons/hr/views/hr_views.xml @@ -585,7 +585,7 @@ action="open_module_tree_department" id="menu_hr_department_tree" parent="menu_hr_root" - sequence="1" + sequence="90" groups="base.group_hr_user"/> diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index 95296fe2fb0..fe8e0fd2e01 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -283,12 +283,12 @@ class HrExpense(models.Model): if help_message: alias_record = self.env.ref('hr_expense.mail_alias_expense') if alias_record and alias_record.alias_domain and alias_record.alias_name: - dynamic_help = '

%s

' % _("""Create a new expense, or send receipts by email to %(link)s to automatically create new expenses.""") % { - 'link': "%(email)s" % {'email': '%s@%s' % (alias_record.alias_name, alias_record.alias_domain)} + link = "%(email)s" % { + 'email': '%s@%s' % (alias_record.alias_name, alias_record.alias_domain) } - return '

%s

%s%s' % ( - _('Click to add a new expense'), - dynamic_help, + return '

%s
%s

%s' % ( + _('Click to add a new expense,'), + _('or send receipts by email to %s.') % (link,), help_message) return super(HrExpense, self).get_empty_list_help(help_message) diff --git a/addons/hr_expense/models/res_config.py b/addons/hr_expense/models/res_config.py index c1eda4f459b..93bd1889ad9 100644 --- a/addons/hr_expense/models/res_config.py +++ b/addons/hr_expense/models/res_config.py @@ -1,14 +1,29 @@ # -*- coding: utf-8 -*- from odoo import api, fields, models +from openerp import SUPERUSER_ID class HrExpenseConfigSettings(models.TransientModel): _name = 'hr.expense.config.settings' _inherit = 'res.config.settings' + alias_expense_open = fields.Selection([ + ('open', "Accept expenses from any email address"), + ('restricted', "Accept expenses from employee email address only") + ], "Mail Gateway") + alias_prefix = fields.Char('Default Alias Name for Expenses') alias_domain = fields.Char('Alias Domain', default=lambda self: self.env["ir.config_parameter"].get_param("mail.catchall.domain")) + @api.model + def get_default_alias_expense_open(self): + return {'alias_expense_open': self.env['ir.config_parameter'].get_param("hr_expense.email.gateway")} + + @api.multi + def set_default_alias_expense_open(self): + self.env['ir.config_parameter'].set_param("hr_expense.email.gateway", self.alias_expense_open) + return True + @api.model def get_default_alias_prefix(self, fields): alias_name = self.env.ref('hr_expense.mail_alias_expense').alias_name diff --git a/addons/hr_expense/static/src/js/tour.js b/addons/hr_expense/static/src/js/tour.js index d19eafeb423..30d34fcd743 100644 --- a/addons/hr_expense/static/src/js/tour.js +++ b/addons/hr_expense/static/src/js/tour.js @@ -10,7 +10,37 @@ tour.register('hr_expense_tour', { 'skip_enabled': true, }, [{ trigger: '.o_app[data-menu-xmlid="hr_expense.menu_hr_expense_root"], .oe_menu_toggler[data-menu-xmlid="hr_expense.menu_hr_expense_root"]', - content: _t("Want to manage your employee expenses? Let's go to the Expenses app."), + content: _t("Want to manage your employee expenses and receipts? Start here."), + position: 'bottom', +}, { + trigger: 'a#o_mail_test', + content: _t("Click to try submitting an expense by email. You can attach a photo of the receipt to the mail."), + position: 'right', +}, { + trigger: '.o_expense_submit:visible', + content: _t("

Once completed, you can submit the expense for approval.

Tip: from the list view, select all expenses to submit them all at once, in a single report."), + extra_trigger: '.o_form_readonly', + position: 'bottom', +}, { + trigger: '.o_form_button_save:visible', + extra_trigger: '.o_expense_sheet', + content: _t("Save the report, your manager will receive a notification by email to approve it."), + position: 'right', +}, { + trigger: '.o_expense_sheet_approve:visible', + content: _t("

Managers can validate or refuse expense reports.

If you refuse a report, explain the reason using the New Message button in the bottom.

"), + position: 'bottom', +}, { + trigger: '.o_expense_sheet_post:visible', + content: _t("

The accountant receive approved expense reports.

He can post journal entries in one click if taxes and accounts are right.

"), + position: 'bottom', +}, { + trigger: '.o_expense_sheet_pay:visible', + content: _t("The accountant can register a payment to reimburse the employee directly."), + 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', }]); diff --git a/addons/hr_expense/views/hr_expense_views.xml b/addons/hr_expense/views/hr_expense_views.xml index 8d0037000fd..830e87fb3a7 100644 --- a/addons/hr_expense/views/hr_expense_views.xml +++ b/addons/hr_expense/views/hr_expense_views.xml @@ -27,7 +27,7 @@
-
@@ -409,8 +409,8 @@ hr.expense.sheet - + @@ -424,11 +424,11 @@ hr.expense.sheet - +
-