Commit Graph
131861 Commits
Author SHA1 Message Date
Laurent Smet afee07cb91 [IMP] account: Remove dead code
This field has been introduced by https://github.com/odoo/odoo/commit/2d1b8e9f3445ab0e1c1ac4683b7b5a25c867b2de
but is no longer used anywhere and is not a valid field on account.move.line.
2019-11-06 12:59:34 +00:00
fw-bot 828c251056 [FIX] test_lint: force absolute path to compute odoo path
When using the flamegraph module from a parent directory of odoo, the
dirname method returns a relative path, leading to a traceback.

With this commit, the odoo_path is enforced to be an absolute path.

closes odoo/odoo#40147

X-original-commit: 75efe4b4ca6c0ccef6ec592b317e7c2b572f28fc
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-11-12 15:39:57 +00:00
Victor FeyensandRaphael Collet 20edf21fda [FIX] orm: do not try to convert zero amount for monetary fields.
When assigning a default value to a computed monetary field, if self
contains records with different currencies, the assignation will fail
when trying to round the value (because self[currency_field] is a
recordset of multiple currencies).

Globally, assigning a monetary value to records in different currencies
should never happen.  The only case we want to support is defaulting a
computed monetary to 0.0.

Add clear error when trying to set monetaries in multi-currency.

closes odoo/odoo#40155

X-original-commit: 3a58dfa1e51702a659e9113271f19d087e3ec349
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
2019-11-12 17:03:58 +00:00
Jeremy Kersten 96daa295c7 [IMP] website: improve install theme layout
task-2086939

closes odoo/odoo#40059

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-11-12 16:07:58 +00:00
qsm-odoo 986415cf05 [REF] website: install theme_default on first website by default
The original goal was to not have any pre-installed theme by default
and to force the user to consider installing one through the customize
dialog.

Now that we have a system to allow switching theme, it is better to have
one installed by default and allow the user to switch theme from the
customize dialog (note that last part was made in the parent commit with
the merge of website_theme_install into website).

Note: theme_default is purely empty, it is only installed by default for
clarity in the theme selection screen, for the default website.
2019-11-12 15:53:21 +00:00
qsm-odoo 88e910e187 [REF] website, *: merge website_theme_install into website
* theme_bootswatch, theme_default, website_theme_install
2019-11-12 15:53:13 +00:00
Manuel Vázquez Acosta d57cd2d3ce [FIX] base: Correct optimization of name_search
Commit 5fcf891e07 introduced optimizations for
name_search in several models.  However, that produces some counter-intuitive
searches.

In a DB with project and custom data:

    >>> Project = self.env['project.task']
    >>> Project.search([('user_id', 'ilike', 'demo')]).mapped('user_id.name')
    ['Marc Demo']

    >>> Project.search([('user_id', 'not ilike', 'demo')]).mapped('user_id.name')
    ['Marc Demo']

The projects returned with 'not ilike' are a super-set of those returned with
'ilike':

    >>> Project.search([('user_id', 'ilike', 'demo')])
    project.task(22, 21, 20, 16, 14, 13)

    >>> Project.search([('user_id', 'not ilike', 'demo')])
    project.task(22, 21, 29, 28, 27, 26, 25, 20, 16, 14, 13, 31, 30)

This commit fix this behaviour by choosing '!=' instead of '=' whenever the
operator is a negation operator.

The 'res.users' is more exposed than the other models touched by
5fcf891e07, because user may search for 'Created
by' in the web client.

closes odoo/odoo#40140

X-original-commit: b3c539b09a0bd462309a10c565cb91375a7011b9
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-12 14:49:52 +00:00
lejeune quentin 3942308bc4 [FIX] iot: Fix support of device with protocol 0
The self don't contain 'interface_protocol'.
The 'interface_protocol' is in self.dev because we add this in 'supported' function.

closes odoo/odoo#40132

X-original-commit: 6963a016385c4310dd547ae2d0d7e1d5cb4fab67
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-11-12 14:09:07 +00:00
Arnold Moyaux e83e24b40d [FIX] mrp: thumbnail removed
commit 89f20d2c29 removed thumbnail but didn't adapt the views that used it.

Adapt the view and directly use the datas and not the thumbnail.

Close #38747

closes odoo/odoo#40126

X-original-commit: e73b468135d27ce8c1e84c3ecf2d0b3af176d760
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-11-12 13:33:01 +00:00
Nicolas Lempereur 614666257f [FIX] web_editor: reintroduce source mode in debug
In 12.3 there was a number of changes in source mode. This was reverted
before 13.0 and somehow it seems the source mode was lost between the
12.3 editor changes and its revert.

With this changeset, we introduce back source mode as it was in 12.

opw-2091649
opw-2116960
closes #40026

closes odoo/odoo#40120

X-original-commit: e29c08969f6e7ad981e9b7b79027d84dc89fbca2
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-11-12 12:32:02 +00:00
Swapnesh Shah c44f7a0369 [FIX] calendar: Allow any user to set calendar_last_notif_ack
Fixes https://github.com/odoo/odoo/issues/39358
Before this commit Internal user (With no other Rights) cannot perform any activity on Reminder Popup due to missing rights to set calendar_last_notif_ack field.
With this fix, we are now using sudo to write calendar_last_notif_ack

closes odoo/odoo#40104

X-original-commit: 91560fae56f1cba09141eefa1d0da03f4a7b3f72
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-12 10:17:10 +00:00
jvm-odoo 8f0e3be257 [FIX] sale: fix sales team goal not updated in CRM pipelines
Reproduce this issue

    - Install CRM & Sales
    - Create 2 sales team in CRM settings
    - Create some invoices and register payments for the 2 teams
    - Go in CRM > Sales > Team pipelines

    The invoicing amount is still 0 for both teams.

Cause

    - The `_compute_invoiced` method in `CrmTeam` models use a SQL
    query to retrieve the invoices lines but it returns an empty
    recordset because the dates are not right ordered.

    - The line balance are negatives values, doing a SUM() will always
      returns 0

This commit re-order the dates and invert the sign of line.balance.

OPW-2119819

closes odoo/odoo#40115

X-original-commit: 578dacc3af04996754d1ec67108106379a9c3c38
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
2019-11-12 11:50:26 +00:00
Ravi Gohil 1270eaad66 [FIX] l10n_lu: correctly compute few tax report sections
- fixed some tax report lines by showing correct amounts
- corrected account types
- set default receivable/payable/advance tax accounts for tax groups

closes odoo/odoo#40114

Task: 1917932
Closes: 39191
X-original-commit: 0677d4749350645b6b9dd34f6ac37c278596353a
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-11-12 11:50:05 +00:00
Yannick Tivisse b70a6cdf5c [IMP] hr_recruitment: Avoid multi-executed tests
closes odoo/odoo#40020

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-12 11:34:36 +00:00
Yannick Tivisse e28d0e02f1 [IMP] hr_contract: Convert tests to SavepointCase 2019-11-12 11:34:36 +00:00
Yannick Tivisse 3b0a28285e [IMP] delivery: Avoid multi-executed tests 2019-11-12 11:34:36 +00:00
Yannick Tivisse bae2d9f717 [IMP] crm, product, ...: Clean some common test classes 2019-11-12 11:34:36 +00:00
Yannick Tivisse 7935d1ff40 [IMP] account: Avoid multi-executed tests 2019-11-12 11:34:36 +00:00
Yannick Tivisse f44fbdb833 [IMP] account: Clean common tests classes 2019-11-12 11:34:36 +00:00
Yannick Tivisse 0e67a66111 [IMP] mrp_account: Avoid multi-executed tests
Some tests (test_00_workorder_process, ...) are executed several times, only
because we extend a test class to retrieve the setUp (or setUpClass) instead
of creating a common class.

This could lead to issues, (like for test_00_workorder_process) depending on the
installed modules.
2019-11-12 09:27:51 +00:00
Yannick Tivisse 1266cc7bbf [ADD] test_base_automation: Move tests and related models
Purpose
=======

This module contains tests related to base automation. It makes no
sense as they have no business value.

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

Move all the tests to a separate module as it contains models used only
to perform tests independently to functional aspects of other models.
2019-11-12 09:27:51 +00:00
Yannick Tivisse 9a156f9a64 [IMP] crm: Reintroduce commented test 2019-11-12 09:21:33 +00:00
mreficent d09418e861 [FIX] hr_expense: don't show attachment icon if no attachments
closes odoo/odoo#33869

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-10-03 09:56:05 +00:00
Thibault Delavallée 9ad3564ac9 [FIX] test_mail: please bring back our send method !
A patched method was not unpatched. Which triggered issues in a staging
master branch trying to untie a bit mail tests.

closes odoo/odoo#40099

X-original-commit: 5dbf4c56765c3661eb2dca24e90bc0b420918e9a
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-11-12 08:39:24 +00:00
Andrea Grazioso (agr-odoo) f52bcddccc [FIX] stock_move: show source document
Install stock and sale. Create a sale with 2+ products, save and
confirm.
Look for the created picking.

There will be no source doument, because of
cb618e9a99
the behavior has changed when there are multiple source
document, possibly to avoid displaying the wrong source if they
differ.

Adding the possibility to display multiple source documents, eventually
truncating the list

opw-2117886

closes odoo/odoo#40098

X-original-commit: baad02d01b86a8d036524b789f046a54a878a729
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-12 08:39:05 +00:00
Yannick Tivisse 70c4e5611e [IMP] sale_timesheet: Avoid generated tasks on Undefined stage
Purpose
=======

Steps to reproduce:

- Configure a product of type service to create a task on a
  sales order validation, without configuring a project template
- On the SO confirmation, the project is generated without any stages

Additional issue:
- go to the Kanban view of the Project
- filter on something that doesn't give any result
- The kanban switches to edit mode, even if there is
  a task

This commit solves both issues.

closes odoo/odoo#40057

X-original-commit: e2de6331f7f75c9c9b086e57b88f6d25a2cd303d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-08 18:13:21 +00:00
Vishnu Thuletiya 0e6bde19c0 [FIX] project: fix vendor bills state button icon issue
The icon of the 'Vendor Bills' stat button isn't displayed
so fix the icon class.

Task-2115206

closes odoo/odoo#40050

Closes: #40006
X-original-commit: 5a595c5931a87129283c3bb258e0e1169506b628
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-08 16:04:25 +00:00
Yannick Tivisse 8caf00378c [IMP] project: Don't display stages if project is not set
Purpose
=======

If the user creates a task and if the project isn't set, then all the
stages that are not linked to a project are displayed, which is polluting
the form view.

Specifications
==============

If no project is set on the task form view, do not display any stages
in the statusbar.

closes odoo/odoo#40041

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-08 14:00:18 +00:00
Martin Trigaux 7a2d960e51 [FIX] doc: remove outdated warning
In 13.0, we use the IoTBox which handle https correctly
12.0 was still a transition version but people should have switched in
13.0

closes odoo/odoo#39845

X-original-commit: 5d44adcd173cc750b72feb2888613204db5684b4
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-11-06 10:18:21 +00:00
wan 208af7f5fc [IMP] account: add the period of the tax periodicity on the dashboard
Task 2076244
Commit 4a1bbbf added that but it had to be reverted because it didn't
take into account the periodicity of the tax return of the company and
because it added the period for all mail.activity

closes odoo/odoo#38199

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-11-08 14:18:05 +00:00
Wolfgang Taferner 045a8f26b2 [FIX] base: multi-pages and multi-records traceback
In case of a multi-record and multi-page (i.e. 2 pages per PDF) report
the assertion is triggered b/c we have 4 pages and only two records with
a PDF of 2 pages each, so the outline_page needs to be unique before
assertion.

len([0, 0, 2, 2]) != len([record_id1, record_id2])
len([0, 2]) == len([record_id1, record_id2])

closes odoo/odoo#40076

X-original-commit: 573e57773b78a5bcac97c9dab4f531a5826e94c0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-10 04:38:24 +00:00
Andrea Grazioso (agr-odoo) 0f17a0ea7d [FIX] google_calendar: exclusions not propagating (from OE)
Activate Google Synchronization, create on OE a recurrent event,
synchronize the calendar, then delete an event of the recursion on GC,
sync again on OE.

The event will be deleted from GC but not from OE after sync.

This appens because of this "rewrite" rule
https://github.com/odoo/odoo/blob/12.0/addons/calendar/models/calendar.py#L918
that occur on event creation from OE, altering the event parameters when
is marked "allday".

When an "allday" event is deleted from GC the unlink is triggered in OE with the
default time "00:00:00". During the creation of the exclusion '
_inverse_dates' will be called altering start and stop datetime but not
recurrent_id_date, so the new record will not match the event generating
the recursion and the exclusion will not occur. The problem require
particular carefulness because when a recurrent event is fetched from
google the '_inverse_dates' is not called, so in that case the default
time is fine.

opw-2060526

closes odoo/odoo#39662

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-12 07:11:57 +00:00
Victor Feyens 7f01db75b4 [FIX] account: use correct company when creating tax repartition lines.
closes odoo/odoo#40047

X-original-commit: 4640ea4089fcda9d2c94e24ea2e635601891653c
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2019-11-08 15:23:57 +00:00
lejeune quentin daf42498d3 [IMP] iot: Add support for scanner without protocol
closes odoo/odoo#40044

X-original-commit: 98f48141419c81102c820929206299c80790dfc7
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-11-08 14:45:11 +00:00
jvm-odoo f59b9fafa9 [FIX] crm: fix partner_id while converting a lead to an opportunity
Prerequisites

    - Configure a mail server (incoming)
    - Enable leads in CRM app
    - Create a sales team with a mail alias (ex: testcrm@odoo.com)
      and check "Pipeline" and "Leads"
    - Set a partner email with one of yours (ex: bob@odoo.com) /!\
    - Send a mail from bob to testcrm
    - In the incoming mail server click on "Fetch"

Reproduce the issue:

    - Convert the generated lead to an opportunity
    - Choose "Existing customer" and set another one than the actual
    - The opportunity is created but the customer is the old one

Cause:

    The given partner_id is overriden by the old one in the
    `handle_partner_assignation` method.

This commit gives the priority to the new partner_id.

OPW-2089404

closes odoo/odoo#40031

X-original-commit: e1833936255839cd34eba5758ca4c3124fd2522c
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
2019-11-08 13:09:05 +00:00
Christophe Monniez 4fdb07f81b [IMP] test_lint: add a test to detect git conflict markers
Since the deployement of the forward-port bot, chances to merge code
with conflict markers has greatly increased.

With this commit, a new test is added to grep for those markers in most
common code files.

closes odoo/odoo#40029

X-original-commit: 19bf61c0e0c0464058064565be1051e5f43516ab
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-11-08 13:04:59 +00:00
mreficent 99a034774b [FIX] base: deprecated 'install_mode_data'
Firstly bd49f9fd17 did some fixes that removed a bunch of code containing 'install_mode_data'. Later, 627292f7f3 replaced 'install_mode_data' for 'install_filename'. Finally, 43dd9ecd82 reverted bd49f9fd17 (including 'install_mode_data' remnant).

closes odoo/odoo#40027

X-original-commit: 0c3d92564c0fb8c93e381ba91dd8d6e7bdfa794a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-08 13:00:12 +00:00
Victor Feyens 78f45a498f [IMP] account: minor company cleanup
closes odoo/odoo#40025

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2019-11-08 12:18:41 +00:00
Victor Feyens 730e4ce201 [IMP] stock: location creation on company creation. 2019-11-08 12:18:41 +00:00
xmo-odoo 9b4e487a5c [FIX] point_of_sale: incorrect assertAlmostEqual
The third parameter to assertAlmostEqual is a precision (places), not the
assertion message. This goes unnoticed when using two objects which are
strictly equal because assertAlmostEqual shortcuts if the two inputs are equal,
before falling back on approximation.

Since the parameters here are two integers, they're always going to be either
identical or completely different, therefore the issue is only visible if the assertion
fails, hiding the assertion error.

* pass the message by keyword
* replace assertAlmostEqual by assertEqual as the inputs are integers and integers
  can't really be "almost" equal

closes odoo/odoo#40030

X-original-commit: f22e71771f18ecffb06d56ae892c7db1c3984e3c
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-11-08 13:05:17 +00:00
Antoine Prieels 931da033a5 [FIX] pos: Too many customer display updates
Updates to the customer display were sent too often:
 - Twice when creating a new order
 - Twice when removing a payment line
 - Every time the status of a payment line with a terminal changed

closes odoo/odoo#40024

X-original-commit: b72b08cf090acd88a74e57e0e5583e0d803659c0
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-11-08 12:19:54 +00:00
qsm-odoo 68b0f9cb65 [FIX] website: restore parallax previews in edit mode
When the user changed the parallax option, it was only updated on save.
So, the user was not able to have a preview of what he chose.

Note: this commit is made in saas-12.3 but does not fully solve the
problem there... and unfortunately I don't know why. It fully solves
the problem in 13.0 though and this is more important.

closes odoo/odoo#39995

X-original-commit: 4b633949cd4fd1cae807b95d233879ac4adc01ce
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-11-07 18:52:21 +00:00
Thibault Delavallée f4ef7cbc5e [FW][FIX] mail: correctly format rejection email moderation content
When an incoming email on a channel is rejected, an email is sent to the
original author to inform him of the rejection. This email contains the
original email content added in a generic rejection email.

This original content was however considered as plaintext and escaped. Result
was quite hard to read. As content is sanitized we can safely append it to
the rejection email as valid html.

Task ID 2121319
PR #39986
FW PR #39978

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-08 08:13:33 +00:00
Thibault Delavallée 6befb1b400 [FW][FIX] mail: use queue to send channel guidelines
Commit 775e8a9 forced channel guidelines to be sent directly. It seems
safer to use the cron queue as we do not see any evidence of daily use of
channel guidelines requiring immediate sending.

Task ID 2121319
PR #39986
FW PR #39978
2019-11-08 08:11:54 +00:00
Prakash Prajapati f1baf1a793 [IMP] *: update import templates to match data model changes
Fields (and selection values) were re-labeled in multiple models but
the corresponding import templates were not updated to match, and are
now non-working (can't straight import the templates themselves which
is inconvenient).

Task 2059779

closes odoo/odoo#39834

X-original-commit: 185edc0165e834edd859b3413f03549f1dc71c69
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-11-06 08:27:12 +00:00
Nicolas Martinelli 194627a247 [FIX] website: access website in multi-company
- Create 2 companies A & B
- Create a website A
- Create a user U with access to company B only
- Connect as U and go to the website

An internal server error is raised.

This is due to 7bfcb53db37f385a99 which verifies if the user isn't
granted access to companies he is not supposed to access.

This is exactly what was done before this commit: the website is in a
company not allowed to the user.

opw-2116539

closes odoo/odoo#40004

X-original-commit: debc516c47b522bd9b4b9fef365ad11462916174
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-08 09:16:27 +00:00
fr3aker feb58ceb20 [CLA] individual: add agreement for user fr3aker
closes odoo/odoo#40003

X-original-commit: 9cc38820ae082e170bc994716f1f5bb97f160f8a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-08 09:16:09 +00:00
fr3aker 019a56d8b5 [FIX] website_event: fix end date weekday
Fix the displayed end date weekday on an event's registration page. See #39698

X-original-commit: f2a311cbe3c60b3fed8929ba180fb2ef6a5fc915
2019-11-08 09:16:09 +00:00
Arnold Moyaux d8355a0087 [FIX] purchase_requistion: call for tender zero lines
Usecase to reproduce:
- Create a purchase requistion with type Call For Tender
- Update a line and set the price to zero.

UserError 'You cannot confirm the blanket order without price.' raised.
It happens because the write don't process the same check than create
and don't check if the purchase_requistion is a blanket order or a call
for tender. It also doens't check the current state of the
purchase_requisition.

closes odoo/odoo#39980

Task: 2120211
X-original-commit: 7d69f01477a2d5dd93974737978d7af11cfc8b6d
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-11-07 16:18:13 +00:00
Florent de Labarre a67d6eff45 [IMP] core: add float_utils shortcuts to fields.Float
With this commit, the functions float_compare, float_round and
float_is_zero are available from the fields.Float class as static
methods.

This allows the usage of these helper methods without the need to import
them from odoo.tools.

closes odoo/odoo#39695

Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2019-11-08 08:16:27 +00:00