Commit Graph
1156 Commits
Author SHA1 Message Date
Xavier-Do 288595f558 [FIX] *: add explicit license to all manifest
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.

closes odoo/odoo#74245

Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-26 13:09:57 +00:00
Martin Trigaux 6758868731 [I18N] *: export saas-14.4 source terms
Without demo data

closes odoo/odoo#73560

X-original-commit: 802e46541117573e028b711ea33dad9df9075a39
Related: odoo/enterprise#19602
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-07-12 10:57:37 +00:00
Adrien Widart 13266efa6b [FIX] resource: allow a working time of 24 hours
It is not possible to define a working time that lasts a whole day. This
can lead to calculation errors.

To reproduce the error:
(Need mrp,hr_payroll)
1. In Settings, enable:
    - Work Orders
2. Create a Work Center WC
    - Working Hours: <Create and Edit>
        - 2 shifts:
            - Monday, From 0 To 24
            - Tuesday, From 0 To 24
3. Create a routing R:
    - Add an operation:
        - Work Center: WC
        - Default Duration: 1440 (i.e., 24h)
4. Create a Bills of Materials BM
    - Routing: R
5. Create a MO:
    - Bill of Material: BM
    - Plan From: Next Monday
6. Save, Mark as ToDo, Plan

Error: Since the operation should last 24 hours, the end time should be
the same. However, the Planned Date field is incorrect: the end time is
one minute too late. This error is even more noticeable when increasing
the quantity to be produced.

On step 2, when setting the 'Work to' field to 24, it automatically
becomes 23:59. The first consequence is directly observable on working
time form: we should have a total of 48 hours/week but the current total
is 47.98 hours/week. Another consequence is the end of the planned date
(as described above).

OPW-2462094

closes odoo/odoo#72210

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-16 07:09:22 +00:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
Yannick Tivisse cf7e386032 [FIX] resource: Correctly pass domain if set
closes odoo/odoo#68536

X-original-commit: 62a01fa6ff2f1f078b333f5d8bb16d73d0921bdb
Related: odoo/enterprise#17371
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-30 11:24:21 +00:00
Martin Trigaux 3f13751e9b [I18N] *: export saas-14.1 source terms
Without demo data

closes odoo/odoo#63238

X-original-commit: 4e6683973b1d1ecc67f1312a8ef98b1272e2d5a5
Related: odoo/enterprise#15268
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-12-11 12:30:42 +00:00
Yannick Tivisse 0078a21876 [IMP] resource: Remove deprecated methods 2020-12-08 10:22:36 +00:00
Yannick Tivisse 0b07defece [IMP] resource: Index calendar/resources on calendar leaves
Improves performances, notably on the method  https://github.com/odoo/odoo/blame/14.0/addons/resource/models/resource.py#L487

closes odoo/odoo#62821

X-original-commit: fc962de2b60adaa1ffa3bf70bfadc5c3d17867b3
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-03 13:00:41 +00:00
fw-bot 53f877bf38 [FW][MERGE] l10n_be_hr_payroll: Clean tests + Handle threshold for training time off + ATN for 0€ payslips
closes odoo/odoo#62697

Taskid: 2393750
Forward-port-of: #15020
Related: odoo/enterprise#15077
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-02 08:48:09 +00:00
Victor Feyens f09afc4241 [REM] resource: remove duplicate constraint
The constraint is already enforced at the SQL level,
there is no need to add a duplicate python constraint to
verify the same thing.

Task Id: 2328664
COM PR: https://github.com/odoo/odoo/pull/55525
ENT PR: https://github.com/odoo/enterprise/pull/12250
2020-11-20 10:04:27 +00:00
Martin Trigaux e433bc57ff [FIX] *: rephrase, correct typos
Courtesy of Transifex's translators for reporting bad/unclear sentences.

closes odoo/odoo#61804

X-original-commit: f5d0f4a1ebf406583889e9e04912d40c0693343e
Related: odoo/enterprise#14769
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-11-16 16:47:28 +00:00
Yannick Tivisse c5550eed5a [FIX] resource: Fix erroneous date/datetime comparison
closes odoo/odoo#60975

X-original-commit: febd3251aa970f6711f303d539eeeabebf16e818
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-29 11:42:31 +00:00
Yannick Tivisse f3c1a8fbd9 [FIX] resource: _get_resources_day_total is ensure_one
closes odoo/odoo#60974

Valueerror: Expected singleton: resource.calendar()
X-original-commit: af94ac4b4a25048adfd82f1de7fe2dc09755fd56
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-29 11:41:15 +00:00
fw-bot 2be103239f [MERGE] l10n_be_hr_payroll: Validate the CP200 different payslips
Purpose
=======

In Belgium, the job market is divided into "sectors": chemicals, metals, banks,
department stores, pharmacies ... This breakdown is made on the basis of the
activities of the company. In order to be able to ensure the functioning of the
sectors, each sector has its own consultation body, called the "joint commission".

A joint committee is a consultation body in which representatives of employers
and unions set, after negotiation, the minimum wage conditions as well as the
working conditions in legal texts, called “collective labor agreements”. These
are applicable to all employees in a specific sector.

These are agreements that employers and workers in a given sector must make and
respect. These agreements may be different from one sector to another. Each sector
has its label and number.

The CP 200 is the auxiliary joint committee of employees (CPAE). About a quarter
of private sector companies and employees in Belgium are found in CP 200. This
makes it the largest and most diverse CP in the country!

TaskID: 2352568

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

Most of the different use cases that we can face in belgian payroll for CP200
have been tested and validated by a fiscal expert.  Briefly, it covers the following
use cases:

- Unpaid time off
- Legal time off
- Credit time
    - Classical
    - With paid time off
    - With unpaid time off
    - With sick time off
    - Starting in the middle of a month
    - Full time (O hours / week)
- Half-days in working hours
    - Classical
    - With full-day time off
    - With half-day time off
- Low salaries
- Back-to-work - Sick time off
    - Relapse
    - Guaranteed salary
    - Long sick off (+1 month)
- Student contracts
- Posted Employess
    - Without ONSS
    - Wihtout withholding taxes
- Public Holiday
    - Classical (during the working hours)
    - Compensation (during the week end)
    - After the end of the contract
    - Note: Variable compensation is not handled yet, but it's planned
- Brief Holiday (In french: "Petit Chômage")
    - 1 day
    - 1 week
    - Note: Variable compensation is not handled yet, but it's planned
    - 1 day for unpredictable reason
- End of contract in the middle of the month
- Half-days time off
- New design of the payslip to improve readability

The detailed list of the fixes/improvements is the following:

- 1/ hr_work_entry_contract: Define 1 leave work entry per presence

    Purpose:
    Some sick time off have to be defined into different work entry types, according
    to the type of sick leaves.

    Example: after 30 calendar days of sick leaves, the employee is not paid by the
    same organism and therefore, the time off should be reported into different work
    entry types.

    Specification:
    Instead of creating a big work entry per time off, create as many work entries
    as there should have been presence work entries.

- 2/ hr_work_entries: Prevent users deleting work entries

    Prefer to archive them instead.

- 3/ hr_work_entry: Display work entry type on calendar views

- 4/ web: Add styling classes for report

    Purpose:
    Those classes are useful for the payslip printed pdf reports, but some
    of them are useless for any kind of report, and thus the classes have
    been defined in the web addons.
    Task-2341886

- 5/ resources: Take company attendances/global leaves on creation

    Purpose:
    When creating a new calendar (38 hours/week) on a Belgian company,
    the new calendar is prefilled on a 40 hours/week basis, even if the
    company calendar is correctly defined.

    Specification:
    Copy the global time off + the attendances on the company calendar
    on company modification

- 6/ hr_holidays: Allow to refuse overlapping time offs

    Purpose:
    It's normally not possible to create 2 time off that overlaps on the
    same period.

    But, if for a given reason it happens on a production database, it should
    be possible to refuse those time off. Otherwise, the user is stuck with
    this wrong configuration.

- 7/ hr_holidays: Prevent creating time off of 0 hours

    Purpose:
    It makes no sense + it could cause conflicts when generating the work
    entries

- 8/ resource: Add method to retrieve the longest work day

    Purpose:
    Add a method on the calendar to retrieve the maximum number of hours
    an employee is supposed to work.

    Example:
    Monday: 8-12, 13-17
    Tuesday: 8-12, 13-17
    Wednesday: 8-12
    Thurday: Off
    Friday: Off

    The method will return 8

- 9/ hr_holidays: Adapt query counter due to changes on hr_payroll

    See: https://github.com/odoo/enterprise/pull/13848/

- 10/ hr_payroll: Update translations

    Lots of new terms have been added on the printed reports, etc...

- 11/ l10n_be_hr_payroll: Consider out of contract public holiday

    Purpose:
    If there is a public holiday less than 30 days after the end of the
    contract, the employee should be paid for that day too

- 12/ l10n_be_hr_payroll_posted_employee: Add an easy way to create a public time off

    Purpose:
    Public time off should be created via the calendar (at least for belgian companies using payroll).

    The reason behind this is that there should be a resource.calendar.leaves available even if the
    employee ends its contract. If it's created using a hr.leave, there won't be any
    resource.calendar.leave as the employee is not supposed to work anymore at that time.

    When an employee leaves the company, it's possible that he's paid for public time off if it
    occurs less than 30 days after the end of his contract.

- 13/ l10n_be_hr_payroll: Rename bank holiday into Public holiday

    Purpose:
    A bank holiday is a specific holiday name, not the generic one.

- 14/ hr_work_entry_contract: Add menuitem to access calendars

    It shouldn't be required to enter debug mode to access this information.

- 15/ l10n_be_hr_payroll_posted_employee: Add support for posted employees

    Purpose:
    https://www.socialsecurity.be/citizen/fr/travailleur-salarie-occupe-en-belgique-detache-a-l-etranger

- 16/ l10n_be_hr_payroll: Implement guaranteed wage/relapse for sick leaves

    Purpose:

    Guaranteed salary for employees:
    The employee who is incapacitated for work as a result of a work accident, an accident on
    the way to work or an occupational disease retains, at the employer's expense, the right to
    his remuneration for the first 30 days of incapacity for work. The daily allowances relating
    to this period are paid to the employer by the body responsible for industrial accidents or
    by the Fund for Occupational Diseases.

    Successive disabilities - relapse:
    It is possible that a worker will be unable to work during different successive periods.

    When two incapacities follow one another without interruption (for example, accident followed by
    illness; successive illnesses of a different nature), there is only one period of incapacity and
    the guaranteed remuneration is not due again. time.

    On the other hand, we talk about relapse when a new disability occurs after the worker has returned
    to work normally.

    In this case, the guaranteed remuneration is not due again when the new incapacity for work occurs
    within the first 14 days following the end of a period of incapacity for work giving rise to the
    payment of the guaranteed remuneration.

    However, there is still a right to the guaranteed salary for the part remaining to run, if the first
    period of incapacity has not exhausted the entire right to the guaranteed salary during the first
    period of incapacity. A new guaranteed wage is also due again when the worker establishes by a
    medical certificate that this new incapacity for work is due to another illness or to another
    accident.

- 17/ hr_work_entry_contract: Define 1 leave work entry per presence

    Purpose:
    Some sick time off have to be defined into different work entry types, according
    to the type of sick leaves.

    Example: after 30 calendar days of sick leaves, the employee is not paid by the
    same organism and therefore, the time off should be reported into different work
    entry types.

    Specification:
    Instead of creating a big work entry per time off, create as many work entries
    as there should have been presence work entries.

- 18/ test_l10n_be_hr_payroll: Add test for full time credit time

- 19/ test_l10n_be_hr_payroll: Add test for out of contract credit time

- 20/ test_l10n_be_hr_payroll: Avoid undeterministic bug on generated tests

- 21/ hr_payroll: Don't display out of contract line on pdf

- 22/ test_l10n_be_hr_payroll: Fix undeterministic test crashes

- 23/ payroll : Improve the printed payslip report

    Improves the design of the payslip report
    Generates the report in the employee's language (add a message if the lang is not official)
    Adds some data to Laurie Poiret
    Task-2341886

- 24/ test_l10n_be_hr_payroll_account: Add test for unjustified reasons

- 25/ test_l10n_be_hr_payroll_account: Add tests for small unemployment

- 26/ test_l10n_be_hr_payroll_account: Add tests for half days time off

- 27/ test_l10n_be_hr_payroll_account: Fix false positive

- 28/ hr_holidays: Prevent creating time off of 0 hours

    Purpose:
    It makes no sense + it could cause conflicts when generating the work
    entries

- 29/ test_l10n_be_hr_payroll_account: Add test for end of contract

- 30/ test_l10n_be_hr_payroll_account: Add tests for public holidays

- 31/ hr_payroll: Display amount if hourly wage

- 32/ hr_work_entry_contract: Allow creating record on gantt view

- 33/ l10n_be_hr_payroll: Add new structure for student employees

    Purpose:
    Also bring some fixes on fields display + hours/days counts
    TaskID: 2347843

- 34/ test_l10n_be_hr_payroll_account: Add test for low salaries

    Ensure the correct computation of the employment bonus.

- 35/ l10n_be_hr_payroll: Make separate lines for half/full worked days

    Purpose:
    Worked days should be separated between the complete full days and the
    half days.

    Example:
    I work on Monday, Tuesday, Wednesday (half day)

    The calculation is OK, but the number of days is, in principle, 14 in the month of
    September 2020 (9 full and 5 in half-days). This number of days should be the subject
    of 2 separate lines:

    9 days - 68.4 hours - € 1,100.77
    5 days (in the form of half-days) - 19 hours - 224.33 €.

    In this case, we cannot use the hourly formula since the monthly salary must always be
    the same, without having an identical number of working days.

    The worker benefits from 14 meal vouchers. The number of days must however correspond
    to the number of meal vouchers so that the worker can check.

- 36/ test_l10n_be_hr_payroll: Test credit time with sick leaves

- 37/ test_l10n_be_hr_payroll_account: Test credit time with unpaid leaves

- 38/ l10n_be_hr_payroll: Don't consider time off as credit times

    Purpose:
    When generating the work entries, we compare the standard attendances
    (i.e. the full time contract) and the credit time attendances to
    deduct the intervals on which the employee is on credit time.

    But if the employee is on a time off during a period, those intervals
    will be removed from the supposed attendances, and then those periods
    are considered as credit time.

- 39/ l10n_be_hr_payroll: Fix credit time amount on payslip computation

    Purpose:
    The time credit days must not include a corresponding amount.

    In fact, no remuneration is linked to the taking of time credits. The necessary modifications
    are:
    Code LEAVE300 -> no amount

- 40/ hr_payroll: Export standard calendar if needed on payslip export

- 41/ l10n_be_hr_payroll: Fix worked days lines amount computation

    Purpose:
    The amount was computed as a simple ratio based on the number of days.

    To be correct and compliant with the law, we should consider the hourly
    equivalent wage, and compute the amount based on the worked hours.

- 42/ l10n_be_hr_payroll: Fix unpaid worked days amount computation

    Purpose:
    Don't use the normal wage which is an integer btw.

    Compute the worked days amount using the classic hourly computation formula

- 43/ l10n_be_hr_payroll: Fix unpaid leaves retenues formula

    Purpose:
    Unpaid leave must be deducted from the usual gross monthly salary
    up to the number of working hours concerned.

    The formula is in principle the following:
    gross monthly salary * 3/12/38 -> “usual” hourly salary.

    So, in the case of 2 days of unpaid leave, corresponding to 15.2 hours,
    the formula is as follows: 2650 * 3/13/38 * 15.2 = 244.61 €.

    The gross for the days actually worked is € 2,650 - € 244.61, or € 2,405.39

- 44/ hr_payroll: Generate python test from arbitrary payslip

    When the payroll is incorrect, the feedback that we receive is
    generally: "this doesn't work".

    This commit add a route in the controller of hr_payroll, to export
    in a python file, all data useful to reproduce the exact employee
    situation about the incorrect payslip.

    Before testing and fixing the incorrect payslip, we need to anonymize all
    sensitive data about the employee. This commit converts all sensitive
    data into demo data.

    This commit add a button in payslip form view to use the new route to
    export all data about the incorrect payroll.

    This button is only displayed when we are in debug mode and the current
    user is a payroll manager.
    task-2337786

closes odoo/odoo#60136

X-original-commit: 60eaecb749ad68429e4d8ba00ff0200c3360cdcb
Related: odoo/enterprise#14147
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-15 19:54:53 +00:00
Martin Trigaux e79531c136 [I18N] *: export 14.0 source terms
Including demo data this time

closes odoo/odoo#58862

X-original-commit: 575abde110acb3d12b25f177a863374becef0894
Related: odoo/enterprise#13705
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-29 17:52:02 +00:00
Victor Feyens 594ccdcbf4 [FIX] *: typos and english incoherences
Mainly transifex issues but also some errors found through 'grep' checks.

Fix typos and obscure english strings in xml contents, fields strings/helps, some docstrings, ...
ensuring correct translations base (and fallback when translations isn't available).

closes odoo/odoo#57276

X-original-commit: 4214f05d454bca2b60fda3a288d529c098e84f77
Related: odoo/enterprise#13053
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-09-08 18:12:26 +00:00
alt-odooandPierreCourt e8f81ae39c [FIX] resource: attendance intervals should be expressed in resource timezone
closes odoo/odoo#57053

X-original-commit: efec3e57c2eeda188e0dd2cc7c7413987d58513e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
Co-authored-by: PierreCourt <pco@odoo.com>
2020-09-03 15:20:09 +00:00
Martin Trigaux 90d85eb9c5 [I18N] export saas-13.5 source terms
Without demo data

closes odoo/odoo#56869

X-original-commit: 33f251b6489455cd7221f2c62dee0400a69784b8
Related: odoo/enterprise#12836
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-01 11:18:00 +00:00
Arnaud Joset 0cb64fd99c [IMP] resource: improve clarity of two weeks explanations
Before this commit, when two week calendar were used, the tooltip was wrongfully assuming which week were odd and even.
Even with correct information, it was not easy to fill and could easily lead to wrong information on the payroll.

closes odoo/odoo#56055

Taskid: 2308804
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-28 12:26:07 +00:00
Yannick Tivisse 3eec4d6a69 [FW][MERGE] resource,calendar,hr_holidays: Improve the performances
TL;DR
=====

Improve performances with nearly a factor of 2. Use case, call action_validate on hr.leave for 100 employees
- 1987 requests -> 844 requests
- 1300 ms -> 700 ms

Purpose
=======

The first purpose of this commit is to add a test ensuring the number of request while creating
a company leave for 100 employees, if 15 of them already have a leave during that period.

It includes, the mass leave generation, and the conflicts resolutions. (Cancelling/Splitting the
already existing one and adapting the dates accordingly).

The second one is to reduce the number of request for this test.

In term of requests, currently we have:
- 5154 requests without bypassing the mail tracking + the activities management
- 1987 requests when bypassing the mail post-process (this is the current value, the bypassing was
  already done several month ago)
- 844 requests with all the optimization done in resource/calendar/hr_holidays

In terms of execution time, we have a reduction from +- 1300 ms to call the method action_validate
to +- 700 ms

As the performances issues severity increases with the number of leaves to create and the real time access
to the database, on the production base, we reduced the execution time to generate more than 500 hr.leaves
from several minutes to 21 seconds. A fix to avoid deadlock was already made at
https://github.com/odoo/enterprise/pull/10740/files

Some contortions were made to avoid changing a signature method in a stable release and thus
introducing for each method a second one, with the "batched" implementation, to keep a retro-compatibility
for the existing custom code.

But surely this could be cleaned in the master version. The old one will be deprecated while waiting to be
removed in a few versions.

closes odoo/odoo#56534

Taskid: 2256705
X-original-commit: 8c96a887d3f05680c923dcd44f9c70c0e5e0bd32
Related: odoo/enterprise#12670
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-25 15:44:07 +00:00
Kevin Baptiste 71f719a61e [IMP] resource: move unavailable intervals on resource.calendar
The method `_get_unavailable_intervals` was only available on
`resource.resource`. It's now moved to the `resource.calendar`.

closes odoo/odoo#51311

Taskid: 2253893
Related: odoo/enterprise#10616
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-07-02 06:48:45 +00:00
Xavier Morel 6835aeb0de [REM] core, *: deprecate <act_window> and <report>
Convert deprecated tags through the codebase.
2020-07-28 13:03:13 +00:00
Kevin Baptiste c8d496382f [IMP] resource: hide start/end date on resource attendance
This commit sets the fields date_from and date_to as optional hidden on
the resource.calendar.attendace.

closes odoo/odoo#51527

Taskid: 2241686
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-06-29 11:53:57 +00:00
Lucas Lefèvre 103feca347 [FIX] resource: Find intervals in the resource timezone
With a user with timezone "Europe/Brussels", add a
slot on the gantt view where the preceding day is a working day.
The default starting time will be the previous day.
Reason: the default starting time is midnight, adjusted to
the closest attendance interval in the employee's calendar.
However, midnight in "Europe/Brussels" is actually 10pm UTC
the previous day.
The method adjusting the datetime to the closest attendance only
checks within the corresponding day.

Two ways to fix this:
1) the business code calling `_adjust_to_calendar` should
   timezone the datetimes itself. To avoid similar bugs in the future,
   the method should be modified to only accept timezoned datetimes.

2) Change `_adjust_to_calendar` to convert datetimes it was given
   to the resource's timezone and consider the dates in those converted
   datetimes.

Option 2 is chosen because it seems to take care of the problem at a lower
level which allows the business code to not think about those timezone details.
While this is technically an API change (in a stable release), the method was
introduced recently by b058ca1 as a fix for an already broken method.

closes odoo/odoo#53582

X-original-commit: c6cecac60360a1d8b0c62ee155a818a3a28505e1
Related: odoo/enterprise#11399
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-06-24 12:35:11 +00:00
Martin Trigaux ba244cef01 [IMP] *: replace to new _() syntax
Using a few regex like
\((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\)
($1, $3))

Old syntax is still compatible but starts the migration to the new
syntax that catches error.
2020-06-18 13:03:34 +02:00
Lucas Lefèvre 5d50509be8 [FIX] resource: Fail fast if no calendar
The methods `get_work_hours_count` and `_attendance_intervals`
raise a traceback if `self` does not contain a single calendar record.

This commit adds an explicit check for this requirement.

Related PR odoo/enterprise#10593

closes odoo/odoo#51326

X-original-commit: e5d93be382b03c7a9c925b4a2e6be6875843195d
Related: odoo/enterprise#10619
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-15 10:47:38 +00:00
Swapnesh Shah 2eecd98679 [IMP] resource: add possibility to archive resource calendar
Before this commit, It was not possible to Hide Working Time or Deleting Working Time if Resource is linked to it.

Now we add, Active field to Hide Working timw without removing it.

closes odoo/odoo#50963

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-09 05:24:38 +00:00
Lucas Lefèvre b674e4401d [FIX] resource: Adjust time span to calendar
The method `_get_work_interval` has several problems:

1) The name is not self explanatory in any way

2) It should be defined on the `resource.mixin`

3) It simply does not work (as described in its docstring).
   Here is a simplified example (only concerned about hours):
   Currently, given two attendances: 8-12 and 13-17,
   with parameters start=9 and end=18 it returns (9, 17)
   while it should return (8, 17).

   This leads to strange behaviors in the planning app:
   Given employee A with calendar 8-17 and employee B 8-16.
   Create a planning slot and assign employee A: the start and end times
   are set to 8-17.
   Then assign employee B, the start and end times are correcly set to 8-16.
   Now reassign employee A: the start and end times are not set to 8-17.

Task 2229296

closes odoo/odoo#50804

X-original-commit: 7dfab89bc0025cf6424f00b6992fef1f42463ffe
Related: odoo/enterprise#10426
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
2020-05-07 08:22:22 +00:00
Swapnesh Shah 6054f60d51 [FIX] resource: display hours with float_time widget
closes odoo/odoo#50750

X-original-commit: 1bb0f50bf6a04c93b144d889fe1faecfca949c92
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-06 11:59:12 +00:00
Jorge Pinna Puissant ed5ab19065 [FIX] resource: week_type for new periods
In a calendar with 2 weeks mode (odd and even), before this commit, all
new created periods (placed in one of the two sections) don't have the
week_type field set. This generates a confusion, because a period that
should be applied only in odd weeks, for instance, it was applied also
in the even weeks.

Now, the new periods will have the week_type field set with the
week_type of the section where is it. Also, an error message is raised
if a period is not in one of the two sections.

opw-2239966

closes odoo/odoo#50478

X-original-commit: 33a62118818952872321591e85403b657380128a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-04-30 13:53:17 +00:00
Yannick Tivisse f9fc55b9fe [FIX] resource: Improve calendar duplicate
Purpose
=======

When duplicating a calendar, duplicate their global time off too.

closes odoo/odoo#49255

Taskid: 2230549
X-original-commit: b1417a8f094331246120ce5f0a5d25db6c6eb8a7
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-08 16:02:09 +00:00
Raphael Collet 51c4e6e2fc [FIX] *: invalid parameter 'tracking' on non-mail-thread models 2020-04-07 09:25:08 +00:00
Victor Feyens a3ded9043d [IMP] *: declare ir.rule in noupdate
ir.rule are default values but can be customized based on the
company's policy and needs.
This is typically a record that is in noupdate as should be
customization-friendly.
2020-03-20 16:21:25 +01:00
Nisha patel 159699b09c [IMP] various: set boolean_toggle on 'active' fields in form view
Currently, to activate/deactivate records with the 'active' checkbox
user has to switch to edit mode of the form.
So the purpose of the task is to allow the user to activate/deactivate
records from the readonly mode of the form view.

In this commit, we  set widget='boolean_toggle' on the 'active' field in form
view.

closes odoo/odoo#46567

Taskid: 2206794
Related: https://github.com/odoo/enterprise/pull/8918
Related: odoo/enterprise#8918
Closes: #46567
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-02 06:26:02 +00:00
jbm-odoo 41a465bc86 [FIX] hr_work_entry: Closed contract
When a contract is closed, set the date of the day.
In the contract cron, ensure that all closed contracts have
an end date if it is followed by a new contract.
Add multi-edit on work_entry list

closes odoo/odoo#44118

Taskid: 2180263
X-original-commit: 0b5d8ce756eac904a040ca700f44ea860daefcb4
Related: odoo/enterprise#7991
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-28 14:16:21 +00:00
jbm-odoo 00b2046460 [IMP] calendar: Adapt views and test for new color and filters
closes odoo/odoo#41573

Taskid: 2153249
Related: odoo/enterprise#7157
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-27 16:08:34 +00:00
Martin Trigaux b7d91ba25b [I18N] *: remove es_AR translations
Followup of a425695e
The terms were back in 12.0
Courtesy of Juan José Scarafía

closes odoo/odoo#41624

X-original-commit: 85d0c7001a997748d7691205bbb8d066597591a5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-12-10 10:00:18 +00:00
Yannick Tivisse 4462386434 [FIX] resource: Avoid "Attendances can't overlap' issue on reinstall 2019-11-05 16:18:10 +01:00
Odoo Translation Bot b6e7ed6c7b [I18N] Update translation terms from Transifex 2019-10-07 09:11:11 +02:00
Odoo Translation Bot 40deff7cbe [I18N] Update translation terms from Transifex 2019-10-01 21:21:46 +02:00
Yenthe666 24435c876d [IMP] resource: add missing sheet on form view
closes odoo/odoo#35966

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-10-01 12:34:51 +00:00
Geoffroy Larue 9a39194813 [MOV] hr, resource: unavailability methods
Move and adapt gantt unavailability related methods (
_get_work_interval() and _get_unavailable_intervals() ) from
hr.employee to resource.resource. This move allows the unavailability
to be generated for users without related employees (like in FSM in
enterprise).

Task-2069861

closes odoo/odoo#36785

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-09-30 07:59:10 +00:00
Odoo Translation Bot d7b8831ea8 [I18N] Update translation terms from Transifex 2019-09-29 01:22:33 +02:00
Yannick Tivisse 4f6de10d41 [FIX] resource: Fix typo 2019-09-23 07:56:12 +00:00
Odoo Translation Bot 974261f7e9 [I18N] Update translation terms from Transifex 2019-09-22 01:19:57 +02:00
Sébastien Theys b6288e5446 [IMP] *: remove image_64 and clean views
There are too many image sizes. Since they are stored resized this takes time to
generate when saving a new image, it's more rows on the attachment table, more
files on the disk, ...

64px is close enough to 128px that it can be removed without a big impact on
download size.

It will even reduce download and number of requests when both images are
displayed because now only one has to be downloaded and then benefit from cache.

The difference between the two is typically around 1.5kB which is negligible
these days, especially when the request overhead is around 0.5kB already, not
even taking into account other factors such as latency.

If a 64px image must absolutely be returned, it is still possible to pass the
size parameters to the image route. But the current guideline is to handle
resizing in the views when necessary.

Views
=====

- remove width and height attributes when existing CSS rules are overriding them
  (eg. `.oe_kanban_avatar` in the right context)
- add CSS rules instead of width and height attributes when possible
- use `object-fit: cover;` where width and height are forced to avoid distortion
  of non-square images
- for products, use `object-fit: contain;` instead, keep ratio but without crop
- add new CSS rules where the expected size was max 64px*64px before due to the
  image size itself
- remove `img-fluid` where using size classes to avoid conflicting rules

task-2060865

closes odoo/odoo#36147

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2019-09-19 10:23:39 +00:00
Odoo Translation Bot e80b81dca1 [I18N] Update translation terms from Transifex 2019-09-15 01:30:37 +02:00
Odoo Translation Bot 0d51520083 [I18N] Update translation terms from Transifex 2019-09-08 01:29:12 +02:00
Odoo Translation Bot 86809804f9 [I18N] Update translation terms from Transifex 2019-09-01 01:28:13 +02:00
Martin Trigaux b247aa3252 [I18N] *: export saas-12.5 source terms
That will be used a the basis for the future 13.0 version
Without demo data

closes odoo/odoo#36057

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-26 09:38:09 +00:00