Commit Graph
85 Commits
Author SHA1 Message Date
Kevin Baptiste ba619ce027 [IMP] hr_holidays: allow users to cancel Time Off
A user without Time Off rights is now allowed to cancel their own
validated time off when:
    - It's not yet started;
    - No work-entries has been generated for it yet.

The time off is archived and the days taken reallocated.

closes odoo/odoo#76722

Taskid: 2643713
Related: odoo/upgrade#2843
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-10-28 11:34:57 +00:00
Kevin Baptiste 4cc00d44d6 [FIX] hr_holidays: correctly compute Time Off type statbuttons
The stat buttons were showing incorrect values, the accrual action was
not returning, archiving an employee was no longer possible because an
incorrect state was used.

closes odoo/odoo#76468

Taskid: 2641596
X-original-commit: cc75a1233ed40cb1a4812a5f4a377b8859795b26
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-14 08:22:05 +00:00
William Braeckman 1aed8b70f5 [IMP] hr: departure wizard
Improve the departure wizard form view aswell as the flow when using it.
Removes the confirmation dialog when archiving an employee to directly
display the departure wizard.
Also changes departure reason to an html field instead of pure text.

Task ID: 2575279

closes odoo/odoo#72367

Related: odoo/enterprise#19116
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-03 14:36:02 +00:00
Kevin Baptiste 86aa7b78aa [IMP] *: introduce data-hotkey on form and modal views
Define `data-hotkey` on most used action buttons.

For the modals, the following keys are dedicated for "special"
actions:
 - Alt+G: add
 - Alt+V: save
 - Alt+Z: cancel

closes odoo/odoo#73275

Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-15 08:39:49 +00:00
sofiagvaladze 8804690e7a [IMP] hr_holidays: Improve archived employees management
Add filter on everyone menu
Add archived filters

task - 2416659

closes odoo/odoo#64806

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-15 04:07:52 +00:00
yhu-odoo 32fc38ef58 [IMP] hr_appraisal: Improve employee archiving flow
PURPOSE
=======

When you close a payroll (employees), there are often a lot of document
linked. Archiving an employee should archive the contract, cancel future
leaves, archive the private address

Specification
=============

Add departure date (hr):
  - Add a Date field to both hr.departure.wizard and hr.employee. In
    the wizard, the field is required.
  - In toggle_active() method in hr.employee, set departure_date to
    false when unarchive the employee.
  - If user has a current running contract, a user error will raise if
    user enter a departure date earlier than the start date of the
    contract.
Add checkbox to set a closing date on hr.contract (hr.contract):
  - In the hr.departure.wizard, set the departure date to be the end
    date of runing contract. Set the states of all draft contracts to
    "cancel".
Add checkbox to free car (hr.fleet):
  - In the hr.departure.wizard, set end_date to
    fleet.vehicle.assignation.log, if there is no end_date or end_date >
    departure_date
  - Go through fleet.vehicle, find records with dirver_id to be the
    employee, set it to False.
Add checkbox to archive private address (hr):
   - when the private address not link to a internel user, set
     employee.address_home_id.active to Flase
   - unarchive it after the employee unarchived
Add checkbox to cancel future appraisals (hr.appraisal)
   - find all appraisals link to the employee and state in
     ['new', 'pending'], set their state to 'cancel'.
Add checkbox to cancel future leaves (hr.holidays):
   - only consider leaves are not in state ['refuse', 'cancel'],
     find leaves with to_date > departure_date, set their state to
     'cancel'.

PR #42526
Task 2153106

Related: odoo/enterprise#7471
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-29 10:05:12 +00:00
Yannick Tivisse abd73d61a2 [IMP] hr_holidays: Improve general UX (back2basics)
TaskID: 2053585

closes odoo/odoo#35737

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-16 11:24:04 +00:00
RomainLibert e0b16b22e8 [IMP] hr_holidays: Improve general UX (back2basics)
Purpose
=======

Having a clean policy in leave access right. If there
are some internal need or bugs, read this before decided
if it is an expected brhavior or not. It is what we want
in a standrard point of vew.

Specification
=============

Access rights Policy
--------------------

Remove Time Off - Team Leader access right

Leave_manager_id is now requried, by default it
is = parent_id for admin it is admin by default (data
employee_admin)

3 access rights:
- Internal User
- Time Off - All Approver
- Time Off - Administrator

3 fields for "manager"
- parent_id
- leave_manager_id
- manager_id on department

Department
Is just there for information. So never use it in
default filters

Rules Policy
------------

Don't forget to take the leave type configuration into
account
* no validation means automatic
* officer validation means you need to be at least
holidays_user to approve
* manager validation means anyone who is at least
leave_manager_id can approve

Internal User
-------------

In double validation mode he:
- can only do the first approval
- can see the everyone's leaves with a anonymisation of
the leave description
- can create a leave (even if leave type is directly approved)
- can refuse its own leaves (till not reported in payslip)
- can reset to draft his own leaves and reconfirm them
- can delete a leave in draft state
- can cancel a leave if the date_start is in the future
- cannot validate its own leaves

If leave type is configured in manager mode, he:
- can approve or refuse the leaves if he is leave_manager_id

If leave type is configured in both mode, he:
- can only do the first approval or refuse for the leave
if he is leave_manager_id

Time Off - All Approver
-----------------------

In double validation mode he:
- can only do the second approval
- can see, write, read all leaves and perform the second
approval.
- Can set a leaves as reported in payslip.
- Cannot validate its own leaves
- cannot configure leave type
- cannot create leaves in batch

Time Off - Administrator
------------------------

In double validation mode he:
- can do all the approvals
- can bypass all leaves (approve or refuse).
- can configure Time Off Types
- can create batch leaves
- can validate its own leaves

Menu
----

- My Time Off (access rights: internal user)
- Dashboard
- Time Off Requests
- Allocation Requests
- My Team (rename into "Everyone", access rights: internal
user. default filters on current year and group by
employee; default view: gantt can switch to list and form)
- Managers
- To Approve (internal user who are leave_manager_id
see and can approve. See only leave he has to approve
(domain))
- Time Off
- Allocation
- All
- Time Off
- Allocation
- Payroll
- Time Off to report.
- Reporting (access right: time off administrator)
- Time Off Analysis
- Report by Department
- Configuration (access right: time off administrator)

Usability
---------

- In all list of "manager menus", add actions to change
status in mass
- In leave type data:
- move Home Working from data to demo data
- There are 2 Paid time off, get rid of the company on
it and share it on all companies (keep only the one
in data)
- Leave type like this:
- Overtime Compensation/compensatory days (keep only
one of both, to avoid having 2 same leaves in
demo data). Validation by: team leader and hr
officer, no validity date
- Paid Time Off 2019. Validation by Team Leader
and Payroll Officer. Remove validity, remove 2019.
- Unpaid. Can be taken in hours. Approved by Payroll
officer and team leader. No allocation needed.
- New leave request: order of leave type in the m2o:
1. leaves where allocation are fixed by rh and remaining
> 0 and allocated > 0
2. leaves where free allocation. Where reaming is > 0
and allocated >0
3. One already taken
4. All other leaves.
- Remove the sequence widget in leave type
- The employee should get a notification when his leave is
refused "Your "leave_type_name_" planned on "start_date"
has been refused"
- from the dashboard calendar, the reset to draft should lead
to edit (avoid user has to click on edit)
- An employee should be notified when a leave is approved
"Your [leave_type_name] on [start date] has been approved"

Leave Dashboard V2
------------------

https://drive.google.com/file/d/1pMCqDlecqM7ngvmhJJdWtkG2_GiXHyIX/view?usp=sharing

Testing
-------

Everything concerning the leave requests has to be tested.
All the access rights have been reviewed and need testing.

Migration
---------

Don't forget to keep the filters in the calendar view (otherwise RIP perfomances and usability)

TaskID: 1950998

closes odoo/odoo#33813

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-23 08:21:55 +00:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00
Hiral Bhavsar 3cd7ed07a2 [IMP] *: remove 'view_type' on window actions.
The old tree views don't really exist anymore, this odd pseudo-flag to
dispatch between "list" and "tree" tree views has no reason to remain.

Task 1937686

closes odoo/odoo#31243

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-17 11:34:17 +00:00
jbm-odoo a3daff6bc1 [IMP] hr_holidays: Rename 'leave' into 'time off' + add dashboard
Purpose
=======

We need to use an international word to define holidays and leaves, rename everything into Time Off.
Employees needs a good dashboard and leaves summary

Specification
=============

1/ Add a new dashboard: https://balsamiq.cloud/sm5j0d/pg5w04r
   Create a new dashboard with a calendar and a summary of all time off and time off request
2/ Rename leaves into Time Off everywhere
3/ Improve general usability

TaskID: 1916871

closes odoo/odoo#29634
2019-01-21 11:29:30 +00:00
Thibault Delavallée 5013323b4f [IMP] hr_holidays: improve Leave application menus
It seems specifications of new menus implemented at 9af6e9070a were not
totally correct and broke some Odoo conventions. New specification for leaves
application menus are now the following :

 * Dashboard
 * My leaves (user sees this only)
  * New request (calendar view by default)
  * Leaves requests (only my, list view by default)
  * Allocation requests (only my, list view by default)
  * Summary (only my, summary list view by default)
 * Managers (HR officers or managers only)
  * To approve
   * Leaves (default filters: to approve, on my department)
   * Allocations (default filters: to approve, on my department)
  * All
   * Leaves
   * Allocations
  * Payroll
   * Leaves to report (default filters: grey kanban state)
 * Reporting (HR officers or managers only)
  * Leaves Analysis
  * Report by Department
 * Configuration
  * Leaves Types

This commit is linked to task ID 1876795 and PR #26571.
2018-09-10 13:08:40 +02:00
qsm-odoo c59380bac5 [REF] *: BS4, rename btn-default to btn-secondary
BS4 "btn-default" class was replaced with "btn-secondary", which makes
more sense.
2018-07-27 12:36:54 +02:00
Benjamin Stiens 6383120f3b [IMP] all: Improve error messages
Many error messages are misleading or too "vague"
This task aims to improve all error message.

Task #47042
PR #23321
2018-05-28 16:45:48 +02:00
Goffin Simon 733ce266ef [FIX] base, hr_holidays: Printing leaves by department report with no logo
When calling the function report_action from write_company_and_print_report,
it failed because all the required data from the transient model "hr.holidays.summary.dept"
were lost.

opw:803051
2018-01-17 09:13:35 +01:00
Raphael Collet 55549f1e61 [ADD] base: direct support for binding an action to a model 2017-08-28 09:53:23 +02:00
Florent de Labarre 9fc7a04b4b [IMP] hr_holidays: change xmlid of menu
Was referring to account, probably copy-paste

Closes #17545
2017-06-21 09:51:29 +02:00
Laurent Smet e80238042c [REF] report: remove the report module
The content of the report module is now dispatched in
the 'base' and the 'web' modules.
2017-05-08 09:23:12 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Ravi Gohil 46bc624479 [IMP] hr_holidays: a few code improvements
- added encoding to xml files
- replace search_read() with search() for _search_absent_employee()
- fixed setting first date of current month as default value for wizards
- reduce calls to <dict>.get()
2016-06-15 09:47:10 +02:00
Jainik Patel eda051f43d [REM] web: Remove GTK icons and replace them by Font-awesome 2016-06-13 12:04:17 +02:00
Ravi Gohil 46ccb7036f [MIG] hr_holidays : migration to new api 2016-06-07 16:34:54 +02:00
Ravi Gohil ea2e476606 [MOV] hr_holidays: reorganize module directory
Also,
- removed unused hr_bel_holidays_2008.xml file
- removed unused action with xml_id 'act_hr_employee_holiday_request_approved' from hr_holidays_views.xml
2016-06-07 16:34:54 +02:00
Ronak Baxi 393f136509 [IMP] *: Uniformize all modal footers
The main button has classnames btn btn-primary.
Other buttons have classnames btn btn-default.
No more 'or' between the buttons.
2015-08-19 08:10:45 +02:00
Olivier Dony 0bd4545348 [LEGAL] Use global LICENSE/COPYRIGHT files, remove boilerplate text
- Preserved explicit 3rd-party copyright notices
- Explicit boilerplate should not be necessary - copyright law applies
  automatically in all countries thanks to Berne Convention + WTO rules,
  and a reference to the applicable license is clear enough.
2015-06-02 03:16:04 +02:00
Yannick Tivisse 74f3cbc6a6 [IMP] New design : menus reorganization
- Several Modules have been splitted into several apps
  Examples :
      Human Resources : Splitted into Leaves, Recruitment, Expenses, Appraisals, Timesheets, Employees, Payroll
      Marketing : Mass Mailing, Events, ...
      Messaging : Chat, Agenda, Notes, Address Book, ...
- Generally, the related reports have been moved in the apps, as last menu
- Also, configuration menu (no_one group) have been moved into a config root menu
  exception made for the warehouse and lunch modules
- Configuration for typical frontend modules have been moved into the website settings
  Related modules : Ecommerce, blog, slides, forum
- When they are present, menus like 'product' or 'customers' have been moved
  ex : Customers in Sales menu, Product in POS menu
- A lot of sequences and xmlids have been added or modified in this commit
- List of apps :
1  Chat : Inbox, Channels
2  Agenda : Calendar
3  Notes
4  Address Book : The view contact is still laying in the mail module (1 app => 2 icons)
5  eCommerce : Still to define : Config + Orders Analysis + Shipping + incoming Amazon module
6  Sales : Dashboard (Sales Team Kanban), CRM, Sales (note that they are splitted into 2 submenus)
         Assignation, After-Sales (Invoicing and Services), Reports
7  Point of Sale : Dashboard (POS status), Orders, Reports
8  Project : Dashboard (Project Kanban), Search (all tasks, issues), Incoming Forecasts module, Reports
   Project.issue.version feature has been removed completely
9  Members : Dashboard (Members Kanban), Report, Config
10 Timesheets : Time Tracking, Approvals, Reports
11 Purchase : Purchase, Control (Products and Bills)
12 Warehouse : Dashboard (Warehouse Kanban), Operations, Inventory Control, Schedulers, Configuration
13 Manufacturing : Same menu structure
14 Mass Mailing : Mailings, Campaigns, Reports
15 Events : Events, Reports
16 Lead Automation : Campaigns, Reports
17 Surveys : Surveys, Reports
18 Human Resources : Dashboard (Departments Kanban), Employees, Contracts, Engagement (Gamification)
19 Recruitment : Job Positions, Applications, Resumes & Letters, Reports
20 Expenses : Expenses, Approvals, Reports
21 Leaves : My Leaves, Approvals, Reports
22 Appraisals : Appraisals, Interview, Reports --> Will probably be modified by the incoming refactoring
23 Payroll : Current Menu
24 Lunch : My Lunch, Manager, Configuration
25 Accounting : Same menus currently, waiting the new accounting to be merged
26 Fleet : Current menu
27 Sign : Incoming docusign module
28 No root menuitem with this sequence
29 Attendance : Attendance, Reports
   Sign in/out by project feature has been removed completely
30 Link Tracker (group_no_one) : Link Tracker, UTMs
   New view added : URL Shortner, which is the frontend view embedded in backend
31 Versionning : Website domain, Versions, Experiments
32 Slides (group_no_one) : Channels, Categories, Slides, Tags
33 No root menu item with this sequence
34 Livechat : Channels, History, Reports
35 Dashboards : My Boards, Configuration
36 App Store : Local Modules, Apps, Updates
Last Settings : Incoming Dashboard Settings, Sales, ...., Website Settings
General Pattern for all modules' settings :
| Module_name
|-- Settings : General Config view (checkbox screen)
|-- Record setting 1
|-- ...
|-- Record setting n
Example for Sale module
| Sales
|-- Settings : Checkbox screen
|-- Quotations
|---- Quotation Templates
|---- Report Layout Categories
|---- Contract Template
|---- Invoice Type
|-- Contract
|---- Deduplicate Contacts
|-- Delivery
|---- Delivery Methods
|---- Delivery Pricelist
2015-04-24 16:41:08 +02:00
rsi-odoo 1a2b4f4de7 [IMP] hr_holidays: Convert Leaves Summary xsl report in qweb report 2015-02-04 15:28:50 +01:00
Goffin Simon 0fd773a486 [IMP] Cleanup and refactoring of exception handling
Unify and refactor exception handling in framework and addons.

The generic `except_osv` is now deprecated, and replaced by more specialized exception subtypes:
 - `UserError` (renamed from Warning, as it conflicts with the built-in `Warning`) raised when a non-technical error occurs during a business operation. It could be a missing information in the data provided by the user, or a misconfiguration.
 - `AccessError`: raised when any operation is denied because the user conducting it does not have the required access rights.
 - `AccessDenied`: raised when an operation that requires authenticated access is attempted via an unauthenticated request.
 - `MissingError`: raised when an operation is attempted on a record that does not exist.
 - `ValidationError`: raised when an operation violates a SQL or Python constraint.
 - All other exceptions are internal errors due to a system problem or bug, and raised untouched to the client-side, which should display a traceback.

All exceptions take a single message argument.

The `test_exceptions` module has been updated to showcase both new and old (deprecated) exceptions.

A great many old `except_osv` had a useless title with "Error!" or "Warning", those have been removed, as this is handled by the client-side widget that displays the messages.

This commit introduces a more consistent policy for logging errors and warnings:
 - All messages that do not require administrator attention should be logged at INFO level or lower. This includes all errors that are notified to the user in a friendly manner, even for access right problems or validation errors during business operations.
 - All messages that indicate a likely misconfiguration or malicious use by the users should be logged at WARNING level, as they typically require administrator attention.
 - All other unhandled internal errors cannot typically be handled by the user and should be logged at ERROR or higher level, as they require immediate administrator attention.
2015-01-16 17:15:18 +01:00
Leonardo Donelli 4a0b13ed92 [REF] remove vim modelines and resulting trailing blank lines
Let 2015 be a year without modelines!
cf #4174
2014-12-31 15:52:13 +01:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00
Fabien Meghazi faa09da325 Removed version="7.0" from form views 2014-06-12 09:09:59 +02:00
Vo Minh Thu e69326ee3b [REF] removed explicit model instanciations.
bzr revid: vmt@openerp.com-20130415102349-vgcrfok2k5y10cwz
2013-04-15 12:23:49 +02:00
Vo Minh Thu e7f4891d46 [IMP] use the openerp namespace.
bzr revid: vmt@openerp.com-20121206145632-0h1coh5aaem65wsy
2012-12-06 15:56:32 +01:00
Vo Minh Thu 9822629548 [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20120813160657-ilujdek8ys4fzhp9
2012-08-13 18:06:57 +02:00
Twinkle Christian (OpenERP) 721adad01e [IMP]Remove type field from the whole hr module
bzr revid: tch@tinyerp.com-20120808124839-ecd1uic8mscg3s7f
2012-08-08 18:18:39 +05:30
Antonin Bourguignon 8a64e7580a [IMP] all the error messages now start with 'Error\!' (not 'Error' or 'Error \!')
bzr revid: abo@openerp.com-20120807113137-44vehm0mthqawlo3
2012-08-07 13:31:37 +02:00
Saurang Suthar(OpenERP) 25d650e96e [IMP] Improved warning messages for hr* modules
bzr revid: pso@tinyerp.com-20120725121354-hypwxo74c43jm5gp
2012-07-25 17:43:54 +05:30
Pinakin Nayi (OpenERP) 881148d4b1 [IMP]hr-warning-message
bzr revid: pna@tinyerp.com-20120713121613-poze6x6838cr9xpe
2012-07-13 17:46:13 +05:30
Pinakin Nayi (OpenERP) 27226c12b2 [IMP]hr-warning-message
bzr revid: pna@tinyerp.com-20120713070425-b3envibswfdt6umq
2012-07-13 12:34:25 +05:30
Fabien Pinckaers 64a9321d56 [IMP] footer on forms
bzr revid: fp@tinyerp.com-20120710164011-unqi1okf2uu8yhts
2012-07-10 18:40:11 +02:00
Kuldeep Joshi (OpenERP) 8f7be97676 [IMP] set button class
bzr revid: kjo@tinyerp.com-20120702110747-s3f0iv72d6iv3wzj
2012-07-02 16:37:47 +05:30
Kuldeep Joshi (OpenERP) 0c9b077fc8 [IMP]hr_timesheet: report menu in hr
bzr revid: kjo@tinyerp.com-20120702100409-8i7fkuwzuy5cdi9z
2012-07-02 15:34:09 +05:30
Kuldeep Joshi (OpenERP) 9997bd5f8d [IMP]hr_holidays: remove calss and add icon to button
bzr revid: kjo@tinyerp.com-20120702092341-pn0beqbf3tnwqxwd
2012-07-02 14:53:41 +05:30
Kuldeep Joshi (OpenERP) 36b05a7194 [MERGE] lp:openobject-addons
bzr revid: kjo@tinyerp.com-20120702091329-mur9imoo2v6tb4hc
2012-07-02 14:43:29 +05:30
Raphael Collet 76f17eb480 [IMP] in form views, remove useless colspans on buttons in headers
bzr revid: rco@openerp.com-20120629084603-yz0hdnvtjy1fplp1
2012-06-29 10:46:03 +02:00
Raphael Collet 5133bee1d5 [FIX] in form views, replace class 'oe_highlight_on_dirty' by 'oe_highlight'
bzr revid: rco@openerp.com-20120629083024-rqhtbf9melkygg0m
2012-06-29 10:30:24 +02:00
Jigar Amin - OpenERP 282b172739 [FIX] hr* added special cancel link button
bzr revid: jam@tinyerp.com-20120627123017-bei5cjpghhzn1vr8
2012-06-27 18:00:17 +05:30
Pinakin Nayi (OpenERP) e65b5db25a [IMP]reporting-checker-wizards-menus
bzr revid: pna@tinyerp.com-20120627115613-e6q3wh7428b217e6
2012-06-27 17:26:13 +05:30
Twinkle (OpenERP) 471037495c [IMP]Apply css class flow on wizards buttons
bzr revid: tch@tinyerp.com-20120626063119-5i93di16milljxap
2012-06-26 12:01:19 +05:30
Twinkle (OpenERP) 0e97cefe9e [IMP]Improve wizard button
bzr revid: tch@tinyerp.com-20120625100901-ucjbttxod55erqmf
2012-06-25 15:39:01 +05:30