Commit Graph
50 Commits
Author SHA1 Message Date
Swapnesh Shah bb78b7608a [FIX] hr_payroll: prevents maximum recursion depth
When computing a salary sheet, a maximum recursion error could happen if there
is a cycle in the rules or in the categories.

Add constrains for salary rules and categories.

Closes #25405
2018-06-27 17:44:03 +02:00
Swapnesh Shah 55e2d249a6 [FIX] hr_payroll: Ad missing ValidationError import 2018-06-22 10:55:43 +02:00
Yenthe V.G fe19f45393 [IMP] hr_payroll: translate hr.salary.rule(.category)
Closes #21469
2018-03-16 16:58:26 +01:00
Nicolas Martinelli 5ce76a0e70 [FIX] hr_payroll, resource: no attendances
Method `get_day_work_hours_count` can return 0 if no attendance is found
in the calendar. Therefore, we must make sure to not divide by zero,
otherwise, boom boom.

Closes #22900
opw-1815095
2018-02-22 16:32:43 +01:00
Christophe Simonis 2f95cfb8ed [MERGE] forward port branch saas-16 up to f99c4f2b48 2018-01-19 12:43:58 +01:00
Christophe Simonis f99c4f2b48 [MERGE] forward port branch saas-15 up to 0c54862cbf 2018-01-19 11:30:35 +01:00
Christophe Simonis 3e197bf000 [MERGE] forward port branch saas-14 up to 4887a75e2c 2018-01-18 16:27:43 +01:00
Goffin Simon c05c2cc03c [FIX] hr_payroll: Unable to refund payslip
The function action_payslip_done has been overwritten in module hr_payroll_account.
Due to this overwrite, the function compute_sheet which creates the payslip lines
was called after the creation of the entries.

Then creating a refund payslip didn't create any entries.

opw:785033
2018-01-17 13:11:41 +01:00
Nicolas Martinelli 3a79d2cf2e [FIX] hr_payroll: salary structure
- Create payslip
- Add a contract with any structure
- Add a structure in payslip, different from the one defined in step 2
- Confirm or compute sheet

Payslip is computed using the contract structure, while it should be
computed using the payslip structure.

Closes #21567
opw-787671
2017-12-27 14:48:25 +01:00
Christophe Simonis b37cc1f9b7 [MERGE] forward port branch saas-16 up to a2ea4ba095 2017-12-12 18:39:43 +01:00
Yannick Tivisse 0426ddcff4 [FIX] hr_payroll: Avoid using 'getattr' and 'setattr'
Purpose
=======

This is not necessary to only check if a field exists.
2017-12-07 13:14:54 +01:00
Christophe Simonis 5ce21c7355 [MERGE] forward port branch saas-16 up to b3d0897f2d 2017-10-02 13:05:17 +02:00
Olivier Dony 8241c46f0f [FIX] hr_payroll: make internal method private
Only methods that are meant to be accessed by the client-side directly
(or via RPC) should be public. All others should be private by default.
2017-09-28 14:15:00 +02:00
Christophe Simonis 99bf9e4563 [MERGE] forward port branch saas-16 up to 89df681b45 2017-09-28 13:24:14 +02:00
Christophe Simonis 89df681b45 [MERGE] forward port branch saas-15 up to da15615c45 2017-09-28 11:56:23 +02:00
Christophe Simonis da15615c45 [MERGE] forward port branch saas-14 up to aca401c500 2017-09-28 10:53:37 +02:00
Martin Trigaux 88edeeca6a [FIX] preventing context.get('lang')
The lang in the context can be None or False
To avoid similar error as revealed at ede29e6d, correctly retrieve the context
2017-09-26 16:58:59 +02:00
Axay Javiya d2c3c1debf [FIX] hr_payroll: Fix traceback when changing employee on payslips 2017-09-25 11:24:32 +02:00
Yannick Tivisse 781a03b2bc [IMP] res_config: Update file names, xmlids, class names according to guidelines
Now that we only have one model (res.config.settings). Uniformize everything according to the guidelines.
2017-09-01 13:03:18 +02:00
Deep Patel 898224f110 [IMP] web,account,...: Regroup settings, add a nav and search bar
Purpose
=======

Settings are often way too long and hard to scan and sometimes you don't know where to find the settings you're looking for.
By adding a left navigation, you can already have an overview of the settings, and switch easily between them.

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

- Add a search bar on all the apps that have settings which can search results from all the installed apps.
  (If i'm on sales settings,and I search anything then it shows results from sales settings and also shows
  all the other matching results from all the other apps such as, Inventory...etc) with app name.
- Able to activate feature from the current page results (no matter if the searched result is from another apps).
- Highlight searched word in results
- Delete the sheet, have a full white background
- Add left navigation bar on setting
- Left navigation bar fixed
- List displayed based on installed apps
- On right panel, by default display current app setting and change accordingly
- [Mobile] Left navigation bar displayed on top
- Add Breadcrumb on top of the page: have the name "Settings" + Save / discard CTA + Search
- Add General Settings on the nav bar
- remove "save this page..." notif in all settings
- Delete all recommanded apps section + all checkbox that install app should disappear:
	payroll: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrSkMzWVpuZ0ZoaFE/view?usp=drivesdk
	Events: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrYXlHMHd2NTM2blE/view?usp=drivesdk
	Manufacturing: Delete Repair - Quality Control - Maintenance - Product Lifecycle Management [LAP][ok]
	Timesheets: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrdFg5XzNydkd2TlU/view?usp=drivesdk
	project: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrraWo3NE04TktwcTQ/view?usp=drivesdk
	inventory: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrQkRaVUR5ekFQYTQ/view?usp=drivesdk
	recruitment: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrbDdqLWQweF80UkE/view?usp=drivesdk
	purchase: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrRlAyUDBnb0trQWs/view?usp=drivesdk
	email marketing: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrOUZONjhvX2k3Y2s/view?usp=drivesdk
	expenses: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrR0JpN1ZpQmtxU3M/view?usp=drivesdk
	attendances: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrralpjZ1VJclNpMWs/view?usp=drivesdk
- About duplicate settings:
	Docsaway: Delete from Sales + delete Default Print Provider
	Attributs & Variants: Delete from Purchases - Manufacturing
	Multi-currencies: delete from Sales
	Unit Of Measures: Delete from Purchase & Expenses
- Add a scroll bar on the left bar when there's too many apps
- Keep the navbar visible even when you search
- Move General Settings to the bottom of the list
- Update on Settings:
    - Accounting:
        - rename automatic rates
        - Anglo Saxon Account: Should be in technical feature
        - Place Accounting Reports section before Taxes section
    - CRM:
        - Phone Validation: Enforce international format becomes
        - Local Numbers: (2 radio buttons proposals) Add international prefix / No prefix
    - Fleet: typo " ... a new car if ..." + text is too long <br>
    - project: fix tooltip for colab pads
2017-09-01 13:02:54 +02:00
Olivier Dony 695716efb0 [FIX] P3: remove pycompat.{keys,items,values} helpers
Now that we're closer to switching to P3 for good, these helpers have
outlived their usefulness, and mostly add noise.

All remaining dict.iter*() or dict.view*() must be converted to the
normal keys(), values() or items() calls.

Whenever the result is likely to be used for more than the scope of a
loop, or when the dict needs to be modified during iteration, the calls
must be wrapped in a ``list()``, to protect the new P3 semantics.
Those cases are very exceptional.

Also removed some dead code or improved the API to remove unnecessary
conversions.
2017-08-20 23:25:54 +02:00
Olivier Dony 5f4db9df66 [MERGE] Forward-port saas-16 up to 5afe894f44 2017-05-16 18:23:15 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
Yannick Tivisse 3a2e4c1d7d [FIX] hr_contract,hr_payroll,...: Update tooltips on contract and job fields 2017-05-08 16:55:51 +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
Yannick Tivisse 3916e0c431 [FIX] hr_payroll: Add missing method
This method is used in enterprise currently, but should be in the basic module as it make sense to use it without that
2017-04-26 16:13:44 +02:00
Yannick Tivisse d7a3f39d72 [MOV] hr_payroll: Split models and views into separate files 2017-04-26 15:08:09 +02:00
Yannick Tivisse e18e6b3c90 [IMP] hr_payroll: Add hr.contract.advantage.template model + some improvements
- Some label improvements
- Make the 'Working Schedule' required on a contract to work well on payslip. If not set, the working hours are not taken into account when computing the payslip, leading to a wage salary equal to 0.
- Add a hr.contract.advantage.template model. This is kind of a meta model to retrieve specific values for given advantages (like lower and upper bounds or default values). Add related views and actions too.
- Only add opened contract by default on a payslip in the onchange_employee_id
- Rewrite some method in new api style (with browse records)
2017-04-26 15:08:09 +02:00
Christophe Simonis 68176d80ad [MERGE] forward port branch saas-14 up to eddefc9948 2017-03-01 16:49:15 +01:00
Thibault Delavallée d9490c5f1b [REF] hr_payroll: improve resource integration and use new computation methods 2017-02-27 14:04:48 +01:00
Thibault Delavallée 45ca02258c [REF] hr_contract and various: rename working_hours to resource_calendar_id 2017-02-27 14:04:48 +01:00
Thibault Delavallée ff32384b8f [REF] resource: correctly take into account timezones and clean code
Currently timezones were not or incorrectly taken into account in resource
computation. Indeed complexity comes from attendances being expressed in
naive timezones valid for all users, whereas dates and leaves are computed
into UTC. Computation should always be done in user timezone so that there
are no overlapping days and all time intervals are correctly computed.

A new timezone field is added on leaves to know in which timezone they
were originally encoded. Indeed putting them in naive user timezone
require its original timezone, not the current user timezone, as those
can be different.

This commit also contains code cleaning in resource to be a bit more
pythonic, simplify method parameters and offer a more simple api to
other modules.

Eventually code field is removed on resource as it is not really necessary
for resources. It is explicitly added on workcenter model who use it.
2017-02-27 14:04:48 +01:00
Thibault Delavallée be01aaa99f [REF] resource: remove deprecated compatibility and rename methods
Old methods are still present since a long time and are deprecated since
saas-3. This compatibility layer adds unnecessary complexity to the module
API. Those methods should now be removed. Some renaming is also performed
to ease resource api understanding, notably to better differentiate
internal methods from other methods.

All addons are updated accordingly.
2017-02-27 14:04:48 +01:00
Christophe Simonis 387b2acfcb [MERGE] forward port branch saas-11 up to 1730dca101 2017-02-23 19:40:03 +01:00
Nicolas Martinelli 73bd7ef0e0 [FIX] hr_payroll: calculation of work days
The current calculation of work days is inconsistent with the leaves of
the employee in several cases.

The core of the problem is the logic of the algorithm: for a given day,
if we can find one hr_holiday within this day, we consider it as a
leave. One can easily spot several issues with the existing logic:
- if an employee takes less than a day-off (e.g. a half day), the
  complete day is considered as a leave.
- the timezone (TZ) is not taken into account when searching for a
  leave, while it is when computing the number of working hours. A leave
  from 3:00 AM to 3:00 PM in the Los Angeles timezone would then be
  considered as two days-off since it spread on two days in UTC.

The logic is therefore completely modified. For each day of the period:
- compute the work intervals (TZ taken into account, converted in UTC)
- search for a hr.holiday which completely includes the work interval
- if a holiday is found, the work interval is considered as a leave.
  Otherwise, it is considered as a normal work period.

This is a first step in improving the logic. The first faulty use case
is partially solved, since we cover now complete work intervals.
However, a leave covering only partially a work interval will not be
taken into account.

The second faulty use case is solved.

opw-707897
2017-02-21 15:28:49 +01:00
Nicolas Martinelli 432234c4d4 [FIX] hr_payroll: worked days calculation
In a salary slip, change the end date of the period. The "Worked Days"
are not recomputed.

Fixes #15404
opw-707897
2017-02-17 02:20:47 -08:00
Pratima Gupta 8a5360bef7 [IMP] hr_payroll: change the config settings view according to new design 2017-01-31 14:09:58 +01:00
Christophe Simonis 81f59cee2c [MERGE] forward port branch saas-11 up to b844d93889 2017-01-02 14:38:59 +01:00
Nicolas Martinelli 2ab85a0783 [FIX] hr_payroll: hidden lines
The domain on the "Payslip Lines" has several consequences:
- Lines are duplicated every time the user clicks on "Compute Sheet"
- Contribution registers that have data are not computed because they
  are not visible
- Hidden payslip lines don't go onto accounting entry

We remove the domain, since the purpose of it is to hide the lines in
the payslip of the employee, not hide them in the backend.

Closes #13926
Fixes #13925
Fixes #13987
opw-694011
2016-12-08 09:07:53 +01:00
Jared Kipe bbe0731143 FIX] hr_payroll: fix payroll rules using a BrowableObject.sum().
Since commit edcb318; using a python rule that uses the 'sum' function on a BrowsableObject was resulting in a UserError. Courtesy of jaredkipe
2016-10-31 14:11:13 +01:00
Yannick Tivisse 7fa2691175 [IMP] hr_*: Split the HR access rights by application
PURPOSE
=======

For each and every Hr application there should be one user category (One app = one category).

SPECIFICATION
=============

HR remains as it is : Employee, Officer, Manager

Each Application should have 2 access rights: User and Manager. Example for Recruitment:
- The user has access to the recruitment process
- The manager has access to the job position configuration

Each Application should grant the employee user access right (Namely the 'HR Officer')
2016-09-06 14:35:09 +02:00
Martin Trigaux 11812b0b9e [FIX] all: remove external ids fakely from base
Several modules defines records with the external ID `base.foo_bar` while it is
created inside this module (typically menus and groups).
While there is no technical reasons to do so but this may introduce issues:

- these records will not be deleted during uninstall
- if a language is loaded before the installation of the module, it won't be
  translated

The uninstallation will only remove the records with an external id linked to
this module (these would only be removed when removing base).

Installing a language before the module will drop the translations not linked
to an existing external id (as it can not be resolved).

This commit correct all the external ids tagged as from base or other incorrect
modules.
2016-09-02 16:14:26 +02:00
Denis Vermylen (dve) 6ec13d5f36 [REF] hr_payroll: replace workflow by python code
remove workflow and replace by python code.
note: hr.payslip states are messy, 4 states are defined, 3 are used
      and 5 exist.
2016-09-02 10:16:48 +02:00
Raphael Collet bf668b64c1 [IMP] all: clean usage of safe_eval
Specifically: do not import `safe_eval` as `eval`, keep it explicit instead.
2016-08-11 15:36:56 +02:00
Thibault Delavallée 665d1ec146 [FIX] various: fix digits_compute attribute changed to digits in new API 2016-08-09 11:03:12 +02:00
Yannick Tivisse 4d8894c8d6 [REM] hr_payroll, hr_payroll_account: removed unused onchange method 2016-07-29 09:55:49 +02:00
Christophe Simonis b98bb6d10f [MERGE] forward port branch saas-12 up to c16d5bc 2016-07-15 17:09:24 +02:00
Yannick Tivisse 839a4b8316 [FIX] hr_payroll: wrong call to 'working_hours_on_day' 2016-07-13 12:53:34 +02:00
Ravi Gohil edcb318a8e [MIG] hr_payroll: migration of all directories in new API, except report 2016-07-11 10:19:49 +02:00
Ravi Gohil 2079a5018d [MOV] hr_payroll: Restructured files according to new API guidelines (no splitting)
[FIX] hr_payroll: Fixed wrong decorator.
2016-07-11 10:19:49 +02:00