Commit Graph
140385 Commits
Author SHA1 Message Date
Adrian Torres b7017e58cc [FIX] *: adapt business code to function-redefined error
This commit adapts the business code in which
class/module/function/method redefinition took place so that it no
longer happens and the pylint test passes.
2020-10-16 12:56:52 +00:00
Swapnesh Shah c810b903d4 [FIX] account: mandatory field journal
Before this commit, `journal_id` field was not required on model/view, Creating record without `journal_id` is not allowed since it is required on `account.move`.

Now field is required.

closes odoo/odoo#60146

X-original-commit: 7fbdfba8cbeb2ed724f2493320a5f609d07dca97
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-10-16 08:05:32 +00:00
William Henrotin 3f15127a40 [IMP] stock: add constraint on orderpoint
This commit adds a constraint on model stock.warehouse.orderpoint
(reordering rule) to ensure two orderpoint are not set on the same
product and on the same location. This is an issue as the replenishment
will be done multiple times in case of duplicated rules.

Task : 1939567

closes odoo/odoo#47909

Related: odoo/upgrade#1814
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2020-10-15 07:02:43 +00:00
Xavier Morel 5fc8254a89 [FIX] test_mail_full: test only runs with default port
The test fails when running tests with a non-standard http_port (which
is necessary to run tests in multiple Odoo instances concurrently)
because the http port is hard-coded.

Soft-code it properly.

closes odoo/odoo#60192

X-original-commit: 3ab87ade4274600a2d97708e54436db162b68547
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-10-16 15:44:57 +00:00
Martin Trigaux b84a0f9df4 [FIX] sale_timesheet: access action using sudo
The method _to_action_data needs to retrieve the action as sudo to be
able to read it's content.

Before this commit, an access right error was raised when a user
clicked on the "Overview" button on the project kanban, when trying to
read the content of the project.action_view_task record

closes odoo/odoo#59974

X-original-commit: 80c87e2562681ca95fa9c6c91e6564c8ad8f1cb5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-14 10:35:39 +00:00
Thanh Dodeur 52a7772317 [IMP] website: removes google map's unclear message
This commit remove the unclear message from the 'Contact Us' page,
as it could only appear when the google map option is not enabled.

task-2346193

closes odoo/odoo#58479

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-10-16 17:22:46 +00:00
Benjamin Vray b55cf76cf7 [FIX] website: remove left margin on mobile in showcase snippet
Part of #58552

task-2312878

closes odoo/odoo#60197

X-original-commit: 50f86acd2cc541a5984ae9545243da17703ed83d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-16 16:31:09 +00:00
Benjamin Vray da4735e4fd [FIX] website: center images in columns in references snippet
Before this commit images were not centered in the columns of the
reference snippet. So in small device, images were left aligned.

Part of #58552

task-2312878

X-original-commit: f6aa2ec8f7aca81138ae451ebde3dba9586d78a3
2020-10-16 16:31:08 +00:00
Benjamin Vray 2fc1ae443c [FIX] website: add padding in masonry snippet column
Before this commit there was no padding on masonry snippet columns
so in mobile device the titles touched the top border of colmun.

Part of #58552

task-2312878

X-original-commit: 82dd37beeb24addd90e756e34ccff5893127168b
2020-10-16 16:31:08 +00:00
Julien Giannone 5b98269eea [FIX] mail: no response on invalid command
This fix allows to send an invalid command as a normal message
to have it displayed in the messages list.

closes odoo/odoo#60191

Task-id: 2360504
X-original-commit: a748f66857d659db1a47d6c8ee6e4ac0c21d0361
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-16 15:44:35 +00:00
Benjamin Vray dac1894d42 [FIX] website: hide horizontal scrollbar in hamburger menu
Before this commit, when a vertical scrollbar appeared in the collapse
navbar menu, the horizontal scrollbar also appeared.

We added overflow-x hidden on navbar and navbar-collapse for never
again display this horizontal scrollbar.

task-2312878

closes odoo/odoo#60187

X-original-commit: 8a889277d8fa0af8498964e264c781424f79e3d8
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-16 14:56:27 +00:00
qsm-odoo 6857472d10 [FIX] web_editor: fix colorpalette traceback on snippet click
Sometimes, when clicking too fast, some methods were called on a
not-fully-initialized colorpalette, which made it crash.

task-2312878

closes odoo/odoo#60179

X-original-commit: 180099b3ddb78511930f48dc012d1856c3b2a03b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-16 14:08:26 +00:00
Benjamin Frantzen (bfr) 08a946c553 [FIX] account_edi: set required to fields
- account.edi.document require edi_format_id and move_id because it's its very own reason of existence
- account.edi.format require code because it's the way it's identified

closes odoo/odoo#60178

X-original-commit: d06f2060e8d5e5aa3e7bc1a37bb562bac0504e11
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2020-10-16 14:08:04 +00:00
Hiral Bhavsar be01bbd97f [FIX] mail: marking activity done from form view
Before this commit:

When editing the activity, traceback while processing with buttons
"Done & Schedule Next", "Mark as Done" from the form view.

This is happening because when we process with these buttons it complete
the action of respective buttons and then the trigger will go on the close
window. Hence, we don't have activity data as "mark as done" remove
the activity.

After this commit:

Footer buttons will be processed as expected without any traceback.

Task-2357681

closes odoo/odoo#60174

X-original-commit: 623c5176a37ae5fd048d6bb10e742fac5caa6cf2
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-10-16 13:20:58 +00:00
Swapnesh Shah 396d5f3c59 [IMP] base: Inroduce Archived ribbon
Model `ir.mail_server` already have `active` field but It was not
present on View which makes it impossible to Archive record.

Now, we add option to archive record through an action or toggle
button.

closes odoo/odoo#60167

X-original-commit: 9ad1f0d43d3ab0d6262c4fb6d1ceb9f58763b2c1
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-16 12:11:32 +00:00
Nicolas Galler 757a4c7b55 [FIX] base: preserve mime type for uploaded Word documents
Behavior before the fix:

- When uploading an office 2007 attachment (.xlsx / .docx) as a regular
(non admin) user, the preview shows it as text, and the download option
by default saves it as a text document (in certain browsers, at least).
This stems from an over-aggressive check on mime type (anything that
contains 'xml' **anywhere** in the mime type is taken to be XML, but the
mime type for an Office document is
`application/vnd.openxmlformats-officedocument.wordprocessingml.document`
so it falls in the XML case.

Behavior after the fix:

- The mime type is preserved
- Mime type for XML-like documents (including HTML and SVG) continues to
be validated

opw-2352712

closes odoo/odoo#60164

X-original-commit: 2820ec7d5763a5856274709a4d2024267313106b
Related: odoo/enterprise#14168
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Nicolas Galler <nicocrm@users.noreply.github.com>
2020-10-16 11:24:15 +00:00
Achraf (abz) 61c282a4c4 [FIX] base: Creating new currency raise traceback
Issue

    - Install 'Accounting'
    - Go to 'Settings/Accounting'
    - Try to create new currency

Cause

    The empty tuple of ids raise sql syntax error.

Solution

    Init the currency rate to 0.0 when there are not ids

opw-2359632

closes odoo/odoo#60159

X-original-commit: 24ab21811ef71f75a24fdeb441c299435789e8fb
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2020-10-16 10:37:21 +00:00
Romain DerieandSwapnesh Shah 8a22cf8626 [FIX] website_sale_coupon: correctly handle multiwebsite
Steps to reproduce:
- Create an automatic promotional program P for Website 2.
- Place Order for Website 1.
- Promotion is applied.

Fixes https://github.com/odoo/odoo/issues/55121
Closes https://github.com/odoo/odoo/pull/57895

closes odoo/odoo#60151

X-original-commit: 8a5c53bbc771c0895c001a7f7f43591c5cde2ba6
Forward-port-of: https://github.com/odoo/enterprise/pull/13875
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Swapnesh Shah <swapneshshah111@gmail.com>
2020-10-16 08:50:13 +00:00
yhu-odoo c9b133813b [FIX] base: add 'flags' to _get_readable_fields
'flags' is not a field in ir.actions.act_window, but it's used to pass
parameters to generate the action window. For example,

{'flag': {'withControlPanel': False}} can be used to hide the control
panel.

in _get_readable_fields, 'flags' is not included. This makes the
configuration passed by 'flags' not work. We add 'flags' to fix the
issue.

To reproduce, go to workorder and enter the tablet view by starting
the workorder. The control panel will be shown, even though
{'flags': {'withControlPanel': False}} is passed in the returned action.

closes odoo/odoo#60150

X-original-commit: b4eaf7cebf3be577ab8eb49530fb92129faa2892
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-16 08:49:45 +00:00
Jeremy Kersten 7659c864c8 [FIX] website: theme selector, no primary link
Before this commit, the close button in enterprise version was primary (green).
Now we make it black to avoid to have this button like a CTA, and in the same
time, while we have already hacked all this kanban view, we continue changing
the active breadcrumb to a nearly black

closes odoo/odoo#59551

X-original-commit: 481454e18e6cb1c5da317e12c820975a07d39411
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2020-10-08 17:17:08 +00:00
Pierre Masereel cb8590e865 [MOV] point_of_sale: rename files for cash opening
closes odoo/odoo#56149

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-10-16 09:16:00 +00:00
Robin Heinz 396918d638 [IMP] point_of_sale: cashbox opening popup.
Move the cashbox opening control from the left panel of the product screen widget to a popup that is raised at the opening of the session if its state is: opening_control.

task-id: 2321973
2020-10-16 08:49:14 +00:00
Victor Feyens 9d6f107b1c [FIX] doc: unclear report actions fields and report tag attributes.
FW-change: remove report section in data.rst since report xml tag usage
is now deprecated (#54564)

closes odoo/odoo#60142

X-original-commit: 052c524d7868ea683038d18a22022658abb0511c
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-10-15 22:25:36 +00:00
jbw 05706dff88 [FIX] account, account_payment, sale : add support of new 'reversed' payment_state
Add handling of reversed payment state (added in odoo/enterprise#7202) in move view, portal templates and sales_team.

closes odoo/odoo#60139

X-original-commit: 2e1003a969f6fc907544e6506e1c6147e5e11d3e
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-15 20:22:55 +00:00
Paul Morelle 99a7978b5d [FIX] project: fix duplicate filter name
odoo/odoo@dadcec593d introduced a duplicate name in the filters of the
view project.view_project_project_filter.

This commit renames the new filter from my_projects to own_projects.

closes odoo/odoo#60137

X-original-commit: a372d34a4c98e459c5170369fd90cbd4181ba4a3
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
2020-10-15 20:22:00 +00:00
Benjamin Frantzen (bfr) ab3cd5196b [FIX] account_edi_ubl: only add Description if it exist.
Description is line.name but if this field is not defined the tag in the XML should not be set.

closes odoo/odoo#60138

X-original-commit: a1d5981912631c871a3efb692e3c1a4e64bb5957
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2020-10-15 20:22:30 +00:00
Xavier Morel d9a5a28baf [FIX] base: explicitly specify resampling filter when resizing
Pillow 7.0 changed the default resampling filter from NEAREST to
BICUBIC. Because the logo parser resizes the image before sampling it
and doesn't specify a filter, its behavior changes depending on the
version of Pillow, even if the input image is the same. And there's a
test depending on its output with a fixed image.

Explicitly specify the old default as that's what's in the test.

closes odoo/odoo#60121

X-original-commit: 3dbc0711b65ae47a230bcd8b3348962127bcaf14
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-10-15 15:51:25 +00:00
Xavier Morel 7051a628c8 [FIX] core: PyPDF2 suppresses warnings
By default, PdfFileReader will monkeypatch the `warnings` module even
if it has no reason whatsoever to do so and suppress the
`captureWarnings` behavior.

This means as soon as we've loaded a PDF file, `warnings.warn` don't
trigger `logging` warnings anymore, and become invisible.

This can lead to non-deterministic behaviors depending as warnings may
or may not be suppressed depending when they occur relative to loading
a PDF e.g. load a module which runs a test which loads a PDF before a
module triggering a warning and the warning won't be visible, other
way around it will.

Except ofc while we have an override to PdfFileReader it's not
used *everywhere*, so need to monkeypatch the init.

closes odoo/odoo#60132

X-original-commit: 6b04dbcd4204a75d6bd68fc0b3010a2297779b32
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-10-15 17:34:57 +00:00
Arnaud Joset fb875a3852 [IMP] account: add compute_fiscalyear_dates method on res.company
[IMP] account: add compute_fiscalyear_dates method on res.company

The following commits
  https://github.com/odoo/odoo/commit/576a69e29e98532aa5de78eb3fcbff0b94cea32d
  https://github.com/odoo-dev/enterprise/commit/ed383522791276b17ba68a4f0d08f9e3ed4e783c

move the  compute_fiscalyear_dates method from the community account module to the enterprise one account_accounting.

This commit ensures that the method can be used when account_accounting is not installed.
As the fiscal year is irrelevant when account_accounting is not installed, this commit displays the calendar year.

taskid: 2329108
See also: taskid 220194

closes odoo/odoo#60140

X-original-commit: 544cb3682033e9f644b48b97dd5197eaf9282ff5
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-15 20:23:20 +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
Hiral Bhavsar 23ffc7f5b6 [FIX] mail, website_slides: fix while accept the request from the new attendee
Before this commit:

We have a new feature that if the course is private, and attendee make the
request to access the course it will create an activity for 'course responsible'.

Currently, after accepting the invitation request from the new user, it is still
not considered the user as an attendee and not displaying like 'You're enrolled'
to the respective users

After this commit:

The features of access invitation on courses will be workable.

Task-2328389

closes odoo/odoo#60135

X-original-commit: becf051f38fcf08d4a0aea758cb2758ad0f25bc3
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-15 19:40:29 +00:00
Loan (lse) e45767db3e [FIX] models.py: performance on filtered_domain on big recordset
Performance issue arise when the recordset is very large due to the union operator which apply at worst `len(self)` times.
By storing the ids then browse on them we avoid the union operation execution.

PySpy: https://drive.google.com/file/d/1jnxuSWGf2WmqeRz7zQOpBpmeRE5YnTwS/view?usp=sharing
filtered_domain (odoo/models.py:5398) take 65.6% of the graph (55.7% of the 85% of button_confirm)

To confirm a RFQ with 10 000 of the same product:
Before this commit: ~42s
After this commit:  ~10s

OPW-2347525

closes odoo/odoo#60131

X-original-commit: 8b0eeb5076ed5387ca7132d79182800e10c6895e
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-10-15 17:28:05 +00:00
SEINLET Nicolas 5a03cc64d3 [IMP] website_visitor: avoid double indexing
unique constraint create an btree unbique index:
``` # \d website_visitor [...] Indexes:     "website_visitor_pkey"
PRIMARY KEY, btree (id)     "website_visitor_access_token_unique" UNIQUE
CONSTRAINT, btree (access_token)     "website_visitor_partner_uniq"
UNIQUE CONSTRAINT, btree (partner_id) ``` removing index=True avoid this
double indexing.

closes odoo/odoo#60120

X-original-commit: efb33e783bd04d542009ef0f57eba6a4aacbca65
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
2020-10-15 15:50:31 +00:00
Adrian Torres ece40d83fb [FIX] doc: warn about pitfalls of inverse batching
This commit updates the documentation surrounding compute and inverse
methods for fields, explicitly warning API consumers that grouping
multiple compute fields under a single inverse method is error-prone and
could not work at all (it can still work under specific conditions but
henceforth it shall be considered bad practice).

This case was found at https://github.com/odoo/enterprise/pull/13815/commits/a651413df915f166697d26a83084582207405858

closes odoo/odoo#60115

X-original-commit: 1d21924c1da0bed59cd105a3d9bf9b60fa2d7bc4
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2020-10-15 15:05:00 +00:00
Nasreddin (bon) bc4e06106d [FIX] mail: mail not sent because partner not find in chatter + unit test
Issue

	- Install "Project" module
	- Go to the chatter of any Task
	- Log the following message (by selecting the partner) then send:
	"test@test.com
	@marc Demo "

	Message is not sent.

Cause

	When parsing the content, the match result is "@test.com\n@Marc Demo" due
	to no space between the two mentions

Solution

	Add space after line break (only when parsing selection).
	In this case, it will match with 2 mentions instead:
	"@test.com\n" and "@marc Demo "

	For _generateMentionsLinks step, add a space after '</br>',
	it will match 2 mentions but we remove the ones that end
	with '</br>'. This last fix is to avoid having a non-mention
	string containing '</br>' (for example), and therefore not
	having them escaped in final message content.

opw-2322577

closes odoo/odoo#60128

X-original-commit: 8f12c025e05e5a3a7cf3c5fa8c2696ec99e2fa07
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-15 16:51:34 +00:00
Aurélien (avd) cd26051496 [FIX] hr_expense: fix traceback on expense sheet post multiple entries
closes odoo/odoo#60125

X-original-commit: 72f39f240579fc21cde33ce4b50f875d71ac9052
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-15 16:40:40 +00:00
Kamesh Patel 7297aa0319 [FIX] sale_timesheet, web: disable autofocus on create invoce action
Before this commit:

The date range widget opened by default when the 'create invoices'
the wizard is opened. because the default focus is 'Timesheets Period'
field.

After this commit:

Disable autofocus on 'create invoice' action, after this changes The
date range widget is not opened by default when the 'create invoices'
the wizard is opened.

Task-2344289

closes odoo/odoo#60122

X-original-commit: cf8545e10062ba89ac0de5441cfcbdb65d921eaa
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-15 16:06:08 +00:00
Prakash Prajapati 1edd61c160 [IMP] web: The float_toggle widget button appear in the kanban view
Currently, float_toggle widget is not applied in kanban view because kanban
the view has read-only mode.

So in this commit, enable the button to the kanban view.

closes odoo/odoo#53782

Task-id: 2264613
Related: https://github.com/odoo/enterprise/pull/11497
Related: odoo/enterprise#11497
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-23 09:48:15 +00:00
Prakash Prajapati 418c3b78a6 [IMP] hr_timesheet: Improve the usability of timesheet Kanban view
Purpose of the task is to improve the usability of the
timesheet kanban view.

So in this commit, Improve the kanban view in such a way that it
should be compatible with timer on kanban card.

TaskID: #2264613
Related: https://github.com/odoo/enterprise/pull/11497
2020-09-23 09:27:34 +00:00
Nicolas Lempereur 748155a41c [FIX] point_of_sale,pos_sale: currency_rate more digits
In 857c485175 currency_rate precision was changed to keep more digits
for the currency rate.

This commit reflects that in the point of sale.

Also this change fixes an update issue that could recreate sale.report
uncomplete because:

=> point_of_sale and pos_sale had different definition of
   pos.order().currency_rate field

=> this caused the field to be recreated (to change from double precison
   to numeric) on a given module update (pos_hr)

=> this caused the sale.report view to be dropped

=> this caused the sale.report view to be recreated before modules (that
   added fields to sale.report) were fully loaded

opw-2306523

closes odoo/odoo#60110

X-original-commit: a73030b3d71d835145b01b81515a21e23187687c
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-10-15 14:27:14 +00:00
Nisha patel e51c341aa0 [IMP] iap: Link to the IAP Portal from each service setting
Purpose of this task is, the current link to the IAP portal is very
well hidden in the general settings, so we are confident most users
won't find it.

So in this commit, we added 'View my Services' link below the
'Buy credits' in various IAP settings like: crm, account
and settings.

closes odoo/odoo#57063

Taskid: 2157984
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-11 10:47:13 +00:00
Laurent Smet 423f0c7148 [FIX] account: Fix price_unit with fiscal position to price included tax
Suppose two price_included taxes: 10%, 20%, a product having a sale price of 110.0 and a fiscal position tax 10% => tax 20%:

When onchange_product_id is called, the price_unit is computed as follow:
110 / 1.1 = 100
100 * 1.2 = 120
So price_unit = 120 and balance = 100.0

But in onchange_uom_id, we do the same thing and we call _get_fields_onchange_balance_model with balance=100.0.
However, in this method, an empty dictionary is returned because price_subtotal == balance.
Then, {}.get('price_unit', price_unit) will return the original price_unit (110.0) instead of the new computed one (120.0).

closes odoo/odoo#60108

X-original-commit: f2a5476c52c1312d3dfc558f92b4a678d6aa5e25
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-15 14:19:55 +00:00
Giacomello Nathan (ngi) 497778b69a [FIX] Expense: Cancel activity for manager if expense is reset to draft
If we submit an expense to the manager, a next activity is created for him.
If we reset to draft, it is not cancelled.
So if we resubmit expense, a second next activity is created for the manager.

This commit will cancel created activities when we put the expense in draft

Task id: 2350168

closes odoo/odoo#60107

X-original-commit: 107ac15687befccf59527730cc776d5ad68cac44
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-15 14:19:10 +00:00
Dominik RuboandKevin Baptiste a93f1e8d9b [IMP] project: enable config-selected features in projects
This change ensures that when the user activates optional features of the
project app, they are enabled in existing projects as well as newly created
projects automatically, which is likely what the user expects.

For most optional features, this behavior was already in place. It was not in
place yet for the sub-tasks and timesheets features, which this change fixes.

Two added tests check the behavior described above for features that are
activated through a `group_*` field on `res.config.settings` (sub-tasks,
recurring tasks and ratings). The tests do not cover features that are
activated through a `module_*` field, as such fields require the installation
of further modules and we cannot simulate this.

Task 2297054

closes odoo/odoo#60106

X-original-commit: 8dd0edae898a532dbe7e4f18c9118b9b68e57900
Related: odoo/enterprise#14119
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Kevin Baptiste <50135801+kba-odoo@users.noreply.github.com>
2020-10-15 14:18:30 +00:00
shivam shah 765a4201eb [FIX] hr_expense: Fix design issue of hr expense banner
purpose of task is to solve the design issue on hr expense banner
when there is horizontal scrolling on tree view then the banner on
top will not adapt it so there is empty space at last.

So in this commit, Fix the position of the expense header so it should
not scroll with the tree.

closes odoo/odoo#60105

Taskid:  2336309
X-original-commit: 7ba0bc47d1404d5ac4bbf8cb5dcca7937558bd1a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-15 14:17:44 +00:00
Kairis 05043848a9 [FIX] expense: fix generated QRCode
When there is no expense, a messages is shown: "Did you try the mobile app?"
When clicking on the "Download on the App Store"
or on the "Get it on Google Play" buttons, generated QR codes have some invalid data before it:
- 002
- 1
- <the url>

This commit removes datas that are before the url so only the url is displayed.

closes odoo/odoo#60104

Taskid: 2326303
X-original-commit: a130784131c84326b2482ab3c4eea6e0bb3d881c
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-15 14:16:53 +00:00
Adrien Horgnies 3ee5bedcf9 [FIX] doc: active is auto installed
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#59916

X-original-commit: 89c301b445cc415140367314bc5a858b4431b922
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Adrien Horgnies <AdrienHorgnies@users.noreply.github.com>
2020-10-15 13:56:19 +00:00
Paul Morelle dfa3f9a3c4 [FIX] point_of_sale: avoid Gui undefined when connection failed
Since odoo/odoo@c6397ab3b3, the printer.js
file has been refactored, and if the connection to the IoTBox failed,
the error popup could not be displayed because Gui was undefined.

Steps to reproduce on the runbot:
- Configure your POS session with an IoTBox with receipt printer and
  cashdrawer
- Open your POS session
- Skip the connection to the IoTBox
- Proceed to payment
- Open the cashbox
- Error: Gui is not defined

This commit fixes the behavior by displaying the error properly.

In line with this fix, we are also putting the printing assets back in
the point_of_sale.assets because pos printing in the backend is no
longer needed.

closes odoo/odoo#60087

X-original-commit: 063e617a832d582d460dee0fcb54d837f3cafb1c
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-10-15 13:05:06 +00:00
William Henrotin f27369f757 [FIX] purchase(_stock): track qty_received changes
Commit 0f80e69b8d tracked all changes on
qty_received on the purchase order. But did that wrongly by calling
`write` inside a compute.
Commit b7cc3b068f685d1339f9fe7e47d0c564de1708e7 fixed this `write`
by an `=` to avoid error when the compute is called on virtual records.
This fix result on forgetting to track the quantity delivered.

This commit sends a message to post in `write` AND in the
`compute_qty_received` to be sure it is posted. This way, we do not call
write in compute anymore.

closes odoo/odoo#60067

X-original-commit: 3d592649970df3d755ccb57d68c074acdff67894
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2020-10-15 10:14:01 +00:00
Rémy Voet (ryv) ca9a12ff2a [FIX] sale_stock: fix color forecasted popover
Before, the `virtual_available_at_date` was used to
describe the `free_qty_today` when the forecasted is calculated
via the forecasted of stock move. This issue
create a difference of color when SO become confirmed
(if the `free_qty_today < 0`).

To fix this, use the `free_qty_today` to compute the `will_be_fulfilled`
(in the js widget) and fill `free_qty_today` instead
of `virtual_available_at_date` when SO is confirmed.

opw-2360024

closes odoo/odoo#60072

X-original-commit: 94c10df77643ad9a7806c4967911717692db91ce
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-10-15 11:00:20 +00:00