Commit Graph
132074 Commits
Author SHA1 Message Date
jvm-odoo 6e1357e500 [FIX] hr_holidays: fix no id to export when selecting all in tree view
Reproduce the issue

    - Install Time Off
    - Select all the lines
    - Action > Export

    The file has only columns but no data

Cause

    In `hr_leave_type.py` the `_search` method's limit is `False` when
    we select all the lines.

    In 04e85ef, we return the leaves ids with `[:limit]` so `[:False]`
    that always returns an empty array instead of `[:None]` that returns
    the full list.

This commit replaces the `[:limit]` by `[:limit or None]`

OPW-2126109

closes odoo/odoo#40622

X-original-commit: 2c0b58c161dff4fe9a8f953463ed2b1efdf7b431
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
2019-11-21 12:38:47 +00:00
Romain Estievenart 3fd2debdc8 [FIX] web: Basic model X2Many commands don't handled correctly
Steps to reproduce:

1. Go to the Accounting / Invoicing apps
2. Open Taxes (Configuration -> Accounting / Invoicing -> Taxes)
3. Try to create a new tax and the client crash.

It occurs because the `_processX2ManyCommands()` method doesn't handle
correctly a missing `fieldInfo` on some X2Many tags.

On mobile, when calling `load_views` the kanban view is used by default.
But if the kanban isn't defined, a default kanban view with only the id
of the model is used.

In the case of the taxes form, the `default_get` retrieved for this
form refers to a Many2Many (`tag_ids`) inside a One2Many. But this field
isn't present inside the loaded kanban view, so when we process the
command defined by the `default_get`, the `field_view` item doesn't
exist (because the default kanban loaded only contains the id of the
field).

Now instead of using an undefined `fieldInfo`, we fall back to an empty
object on the missing field to avoid the crash.

closes odoo/odoo#40617

X-original-commit: 47a306a31ac6d3c9e68e83b77a80426d5c6ceb05
Signed-off-by: res-odoo <res-odoo@users.noreply.github.com>
2019-11-21 12:20:53 +00:00
Florimond Husquinet (fhu) 07f70e3c10 [IMP] website_slide: add a card description independent from short description
The Channel model contains the two following fields: `description` and
`description_html`. The former is a short plain-text description that can be
filled in the creation form. The latter is a long html-formatted description.

Before this commit:

The description displayed on the card of the course is the `description` field.

After this commit:

There is an additional `description_short` field, which is initialized to the
same value as the `description` field. If the `description` field is modified
the `description_short` reflects the modifications. This happens however only
if the user didn't modify the `description_short` field manually. If it is
modified to another value manually, the link is broken.

Description short is now used only on the course page, below title, in the
header. Description short is used in kanban card displayed in homepage.
Html description is used as a long course description on course page.

Beside, in the creation form of a course, the description textarea is now a
one-line input field to reflect the fact that it's supposed to be a relatively
short description.

Task ID: 2026165
PR #39388

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-21 12:25:52 +00:00
Victor Feyens 27a87141dd [FIX] payment: UI
closes odoo/odoo#40611

X-original-commit: 402228e41621811b5fe892e4dafaf68218abeeab
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2019-11-21 11:16:00 +00:00
Tran Thanh Phuc a6569824ef [CLA] signature for phuctranerp
closes odoo/odoo#40598

X-original-commit: 4d35059a85780fba998fedbec5602175bd01a11c
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-11-21 08:59:12 +00:00
jvm-odoo 0036273aa5 [FIX] event_sale: no lines in the registration wizard on a SO
Reproduce the issue

    - Install Sales & Events
    - Create an event with tickets (remember the category you choose)
    - Configuration > Event categories
    - Check "Ticketing" and add your tickets types
    - Create a quotation with "EVENT_REG" product
    - Select your event and your ticket
    - Confirm the quotation

    A wizard open with no lines in registration.

Cause

    The backend response is different from the V12 due to some dark
    and deep changes. The old response was converting the
    `registration_event_ids` into a create action but it does'nt do
    that anymore.

This commit specifies the action for the `registration_event_ids`.

closes odoo/odoo#40596

X-original-commit: 727675e5fce6bd4b0627491d43a6d8844362dbc8
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-21 08:20:00 +00:00
jvm-odooandaab-odoo 570ddf7001 [FIX] web: fix big dropdown menu out of screen
Reproduce the issue

    - Install CRM
    - Go in CRM > Reporting > Pipelines
    - Click on the first "Group by" button

    The dropdown menu is out of the screen at 100% zoom.
    If we want to see the whole menu we have to dezoom ("Ctrl" + "-")

Cause

    We are using bootstrap to handle dropdowns. Bootstrap uses a library
    named "popper.js" to compute the position of the dropdown according
    to the remaining space.

    In this case, there is no space left to place the dropdown below
    the button, so popper.js flip it above the button and
    this cause the issue.

This commit disable the flip from popper.js and set the max height
of the dropdown menu to 140px:
    - navbar: 42px
    - control panel: 82px
    - some margin: 6px

OPW-2116974

closes odoo/odoo#40530

X-original-commit: 9def02699d96f4dfd8dd806d2bec86a872a0c6eb
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
Co-authored-by: aab-odoo <aab@odoo.com>
2019-11-19 16:55:18 +00:00
Nans Lefebvre 9fca59f5b6 [FIX] website_sale: traceback when adding payment terms
Go to the webshop checkout page.
Customise to add "Accept Terms & Conditions".
You get a traceback.

The 'change #checkbox_cgv' event was triggered before the initialisation
of the WebsiteSalePayment widget.

opw 2126456
opw 2122942

Closes odoo/odoo#39814

closes odoo/odoo#40553

X-original-commit: 2741f3d9ab7833e3d777d87206537eca6894ef79
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-11-20 11:11:46 +00:00
Andrea Grazioso (agr-odoo) 64b9269b9b [FIX] account: no force lock date after deleting tax line
Open Accounting app, go to Accounting>"Lock Dates" and set a "Tax Lock
Date". Now create a Vendor Bill with invoice date prior to the tax lock
date, add a line, Odoo will display a warning. Remove the Tax from the
line, save.

The accounting date will be forced to tax_lock_date + 1 which should be
not the case since the order is without tax.

Adding a check to force the tax only when tax line ids are present.

opw-2115547

closes odoo/odoo#40570

X-original-commit: 8083f103287b7632351e06de6c48bf3ea32d90aa
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-20 15:00:41 +00:00
wan 210858cc66 [FIX] account: duplicate tax when removing analytic
The method _get_tax_grouping_key_from_tax_line could give twice the same
key if we removed the analytic tags or tax ids: when 2 lines were
slightly different but are merged, a key conflict could happen.

If this is the case, drop the subsequent lines with the same key.

closes odoo/odoo#40583

X-original-commit: 7383452fbfc6718e32a46f5d727119171303211e
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-11-20 17:36:10 +00:00
wan 0ca97ae3d6 [FIX] account_analytic_default: compute instead of default_get + onchange
Task 2075249

The commit dd627b9 added a default_get to retrieve the default analytic
values. However, it was depending on self, which cannot be done in a
api.model

In this commit, we use an editable compute in order to update the
analytic values in all the cases, and to reduce the duplication of the
code.

X-original-commit: 69bf61bbc991eee96e673316ae8c37e98e1b8a1d
2019-11-20 17:36:09 +00:00
Jorge Pinna Puissant 730309caa5 [FIX] account: invisible modifier in hidden table cells
— In a SO, create a section or a note;
— Add an invisible modifier (with studio for example).

Before this commit, the table-cells of the section/note were not aligned
any more, and the delete button (trash-can icon) wasn't available.

In a list, the invisible modifier uses a display: table-cell to keep
table cells aligned. But in this specific case, the display is already
none, because they are hidden cells. Therefore, the invisible modifier
it removes the display: none in the hidden cells, this has as outcome
that the table cells are not aligned any more.

Now, the hidden cells cannot have an invisible modifier.

opw-2117714

closes odoo/odoo#40584

X-original-commit: d040f02dd0140d9b7128e806e4a974fe1e8aa0d3
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-11-20 17:41:00 +00:00
William Henrotin 8f7cad7d38 [FIX] mrp: quantity to consume lost
Process a workorder in the community version. Change the quantity to
produce. The quantity to consume is adapted for each component. Save the
workorder and the quantities to consume are rollbacked to the previous values

Those quantities are readonly so not saved to the server.

Task : 2127443

closes odoo/odoo#40579

X-original-commit: 4fc6d8a206c03c7db4ce7dd88e85f0e5312ad3f5
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-11-20 16:29:39 +00:00
Nicolas Lempereur a855f47b3b [FIX] website_form: website form type in form parameters
In 13.0 odoo/odoo@6404233bb0 adds a new website_form_key field that was
not taken into account when creating a form from website studio.

This would cause that when editing the form, we would not see it in the
list of form type, and so think it was doing another action that the
current one. And if saved that could cause an issue because the form is
now for doing something else and no way to change it back.

With this changeset, we get back to what was before 13.0 and display a
model in the "Change Form Parameters" modal even if it has no associated
form in the registry (through a website_form_key).

opw-2118567
closes #40533

closes odoo/odoo#40578

X-original-commit: 6337a04b73e8030b13d5338cee8c045006c21eae
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-11-20 16:28:58 +00:00
Odoo's Mergebot 169b45d0a2 [MERGE] {test_}mail{_full / mass_mailing}: move helper tools and classes from test_mail to mail to ease reuse
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in application tests or force them
to write custom quick and dirty tools and asserts. Purpose of this merge
is therefore to move tools classes and mocks to mail directly and use them
in various sub modules.

SPECIFICATIONS

Have class, mocks, tools and asserts available in mail so that all modules
below from mail can use them.

Including

  * mock mail gateway in a clean way: mock server connection, email building
    and sending;
  * allow to simulate errors while sending emails to test corner cases;
  * provide tools to insert emails in mail gateway;
  * mock mail application to check record creation (message, notifications,
    mails, ...);
  * mock bus notification;
  * provide clearer assert methods for bus and mail notifications;
  * provide clearer emails sending and content methods;
  * provide a with_user tool context manager for tests allowing to quickly
    change current user given a login;

Most of those tools, asserts and mocks come from test_mail/tests/common.py.
They have been partially rewritten to be easier to use or to perform tests
more cleanly.

In this merge we gradually apply changes on existing tests in test_mail,
test_mass_mailing and test_mail_full. First commits will provide the new
classes, then tests will be updated, and finally dead classes removed.
Having it done step by step make it easier to read and understand.

LINKS

Task ID 2068986
PR #38070

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-20 18:17:52 +01:00
Thibault Delavallée 361a9634c8 [REM] test_mail: remove now dead test classes
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in apps tests or force them to
write custom quick and dirty tools and asserts.

SPECIFICATIONS

Now that all tests using old ``BaseFunctionalTest`` and ``MockEmails``
classes are updated we can safely remove them.

LINKS

Task ID 2068986
PR #38070
2019-11-20 16:01:11 +00:00
Thibault Delavallée fa46590ed2 [REF] test_mail_full: update module to new common
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in apps tests or force them to
write custom quick and dirty tools and asserts.

SPECIFICATIONS

Update this module to new tools / asserts / helpers / classes defined in mail
and test_mail.

In this commit we remove the ``BaseFunctionalTest`` and replace it by a fresh
``TestSMSCommon`` that is the combination of ``TestMailCommon`` from mail and
mass mailing with SMS mocks capabilities. That way all mocks and asserts are
available in all sub test classes.

``MassSMSBaseFunctionalTest`` is not necessary anymore as everything is
available directly with ``TestSMSCommon``.

Coming from common update, we have notably

  * ``BaseFunctionalTest`` class is replaced by the new ``TestMailCommon``
    pimped one;
  * ``assertNotifications`` is replaced by ``assertSinglePostNotifications``
    (shortcut for a simple message_post) or ``assertPostNotifications``
    (complete asserts involving several messages and notifications);
  * correctly invoke ``mock_mail_gateway`` when mocking email sending;
  * replace manual check of sent emails or ``assertEmails`` by
    ``assertSentEmails``;
  * remove custom mocks / checks and replace them by now standard mocks
    and assertions (if any);

LINKS

Task ID 2068986
PR #38070
2019-11-20 16:01:08 +00:00
Thibault Delavallée b287504977 [REF] test_mass_mailing: update module to new common
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in apps tests or force them to
write custom quick and dirty tools and asserts.

SPECIFICATIONS

Update this module to new tools / asserts / helpers / classes defined in mail
and test_mail.

In this commit we remove the ``MassMailingCase`` and replace it by a fresh
``TestMailCommon`` that is simply updated to hold a marketing user by default.
That way all mocks and asserts are available in all sub test classes.

Coming from common update, we have notably

  * ``BaseFunctionalTest`` class is replaced by the new ``TestMailCommon``
    pimped one;
  * ``assertNotifications`` is replaced by ``assertSinglePostNotifications``
    (shortcut for a simple message_post) or ``assertPostNotifications``
    (complete asserts involving several messages and notifications);
  * correctly invoke ``mock_mail_gateway`` when mocking email sending;
  * replace manual check of sent emails or ``assertEmails`` by
    ``assertSentEmails``;
  * remove custom mocks / checks and replace them by now standard mocks
    and assertions (if any);

LINKS

Task ID 2068986
PR #38070
2019-11-20 16:01:06 +00:00
Thibault Delavallée 363bdc16c7 [REF] test_mail: update test message post to new common
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in apps tests or force them to
write custom quick and dirty tools and asserts.

SPECIFICATIONS

Update tests to new tools / asserts / helpers / classes defined in mail
and test_mail. Notably

  * ``BaseFunctionalTest`` class is replaced by the new ``TestMailCommon``
    pimped one;
  * ``assertNotifications`` is replaced by ``assertSinglePostNotifications``
    (shortcut for a simple message_post) or ``assertPostNotifications``
    (complete asserts involving several messages and notifications);
  * correctly invoke ``mock_mail_gateway`` when mocking email sending;
  * replace manual check of sent emails or ``assertEmails`` by
    ``assertSentEmails``;
  * remove custom mocks / checks and replace them by now standard mocks
    and assertions (if any);

In this commit we update: test message post

LINKS

Task ID 2068986
PR #38070
2019-11-20 16:01:03 +00:00
Thibault Delavallée 2ef5fc80ab [REF] test_mail: update test message management to new common
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in apps tests or force them to
write custom quick and dirty tools and asserts.

SPECIFICATIONS

Update tests to new tools / asserts / helpers / classes defined in mail
and test_mail. Notably

  * ``BaseFunctionalTest`` class is replaced by the new ``TestMailCommon``
    pimped one;
  * ``assertNotifications`` is replaced by ``assertSinglePostNotifications``
    (shortcut for a simple message_post) or ``assertPostNotifications``
    (complete asserts involving several messages and notifications);
  * correctly invoke ``mock_mail_gateway`` when mocking email sending;
  * replace manual check of sent emails or ``assertEmails`` by
    ``assertSentEmails``;
  * remove custom mocks / checks and replace them by now standard mocks
    and assertions (if any);
  * remove custom mocks / checks and replace them by now standard mocks
    and assertions (if any);

In this commit we update: test message management

LINKS

Task ID 2068986
PR #38070
2019-11-20 16:00:59 +00:00
Thibault Delavallée 656c11e4ec [REF] test_mail: update test mail message to new common
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in apps tests or force them to
write custom quick and dirty tools and asserts.

SPECIFICATIONS

Update tests to new tools / asserts / helpers / classes defined in mail
and test_mail. Notably

  * ``BaseFunctionalTest`` class is replaced by the new ``TestMailCommon``
    pimped one;
  * ``assertNotifications`` is replaced by ``assertSinglePostNotifications``
    (shortcut for a simple message_post) or ``assertPostNotifications``
    (complete asserts involving several messages and notifications);
  * correctly invoke ``mock_mail_gateway`` when mocking email sending;
  * replace manual check of sent emails or ``assertEmails`` by
    ``assertSentEmails``;
  * remove custom mocks / checks and replace them by now standard mocks
    and assertions (if any);

In this commit we update: test mail message

LINKS

Task ID 2068986
PR #38070
2019-11-20 16:00:57 +00:00
Thibault Delavallée 4bcb8cbda3 [REF] test_mail: update test mail gateway to new common
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in apps tests or force them to
write custom quick and dirty tools and asserts.

SPECIFICATIONS

Update tests to new tools / asserts / helpers / classes defined in mail
and test_mail. Notably

  * ``BaseFunctionalTest`` class is replaced by the new ``TestMailCommon``
    pimped one;
  * ``assertNotifications`` is replaced by ``assertSinglePostNotifications``
    (shortcut for a simple message_post) or ``assertPostNotifications``
    (complete asserts involving several messages and notifications);
  * correctly invoke ``mock_mail_gateway`` when mocking email sending;
  * replace manual check of sent emails or ``assertEmails`` by
    ``assertSentEmails``;
  * remove custom mocks / checks and replace them by now standard mocks
    and assertions (if any);

In this commit we update: test mail gateway

LINKS

Task ID 2068986
PR #38070
2019-11-20 16:00:54 +00:00
Thibault Delavallée c6cda88c78 [REF] test_mail: update test mail channel to new common
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in apps tests or force them to
write custom quick and dirty tools and asserts.

SPECIFICATIONS

Update tests to new tools / asserts / helpers / classes defined in mail
and test_mail. Notably

  * ``BaseFunctionalTest`` class is replaced by the new ``TestMailCommon``
    pimped one;
  * ``assertNotifications`` is replaced by ``assertSinglePostNotifications``
    (shortcut for a simple message_post) or ``assertPostNotifications``
    (complete asserts involving several messages and notifications);
  * correctly invoke ``mock_mail_gateway`` when mocking email sending;
  * replace manual check of sent emails or ``assertEmails`` by
    ``assertSentEmails``;
  * remove custom mocks / checks and replace them by now standard mocks
    and assertions (if any);

In this commit we update: test mail channel

LINKS

Task ID 2068986
PR #38070
2019-11-20 16:00:51 +00:00
Thibault Delavallée f926f63212 [REF] test_mail: update test message composer / message track / activity to new common
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in apps tests or force them to
write custom quick and dirty tools and asserts.

SPECIFICATIONS

Update tests to new tools / asserts / helpers / classes defined in mail
and test_mail. Notably

  * ``BaseFunctionalTest`` class is replaced by the new ``TestMailCommon``
    pimped one;
  * ``assertNotifications`` is replaced by ``assertSinglePostNotifications``
    (shortcut for a simple message_post) or ``assertPostNotifications``
    (complete asserts involving several messages and notifications);
  * correctly invoke ``mock_mail_gateway`` when mocking email sending;
  * replace manual check of sent emails or ``assertEmails`` by
    ``assertSentEmails``;
  * remove custom mocks / checks and replace them by now standard mocks
    and assertions (if any);

In this commit we update: test_message_composer, test_message_track and
test_mail_activity.

LINKS

Task ID 2068986
PR #38070
2019-11-20 16:00:47 +00:00
Thibault Delavallée 25d488707d [REF] test_mail: update test followers / template / mail mail to new common
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in apps tests or force them to
write custom quick and dirty tools and asserts.

SPECIFICATIONS

Update tests to new tools / asserts / helpers / classes defined in mail
and test_mail. Notably

  * ``BaseFunctionalTest`` class is replaced by the new ``TestMailCommon``
    pimped one;
  * ``assertNotifications`` is replaced by ``assertSinglePostNotifications``
    (shortcut for a simple message_post) or ``assertPostNotifications``
    (complete asserts involving several messages and notifications);
  * correctly invoke ``mock_mail_gateway`` when mocking email sending;
  * replace manual check of sent emails or ``assertEmails`` by
    ``assertSentEmails``;
  * remove custom mocks / checks and replace them by now standard mocks
    and assertions (if any);

In this commit we update: test_mail_followers, test_mail_mail,
test_mail_template.

LINKS

Task ID 2068986
PR #38070
2019-11-20 16:00:45 +00:00
Thibault Delavallée 46a6aed1c9 [REF] test_mail: update test discuss / invite / ir actions / odoobot to new common
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in apps tests or force them to
write custom quick and dirty tools and asserts.

SPECIFICATIONS

Update tests to new tools / asserts / helpers / classes defined in mail
and test_mail. Notably

  * ``BaseFunctionalTest`` class is replaced by the new ``TestMailCommon``
    pimped one;
  * ``assertNotifications`` is replaced by ``assertSinglePostNotifications``
    (shortcut for a simple message_post) or ``assertPostNotifications``
    (complete asserts involving several messages and notifications);
  * correctly invoke ``mock_mail_gateway`` when mocking email sending;
  * replace manual check of sent emails or ``assertEmails`` by
    ``assertSentEmails``;
  * remove custom mocks / checks and replace them by now standard mocks
    and assertions (if any);

In this commit we update: test_discuss, test_invite, test_ir_actions and
test_odoobot.

LINKS

Task ID 2068986
PR #38070
2019-11-20 16:00:38 +00:00
Thibault Delavallée 9b710e4ab6 [IMP] test_mail: add a new main TestMailCommon test class
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in application tests or force them
to write custom quick and dirty tools and asserts. Purpose of this merge
is therefore to move tools classes and mocks to mail directly and use them
in various sub modules.

SPECIFICATIONS

In this commit we add ``TestMailCommon`` that will be the class for all test_*
modules linked to mail features. It is build upon tools made available in
mail tests (mocks, tools, asserts) and give the functional basis for mail
tests.

This commit also introduces ``TestMailMultiCompanyCommon`` that is a small
multi company testing class build on ``TestMailCommon``.

``TestRecipients`` class is kept as it creates some testing partners, used
notably for notifications and recipients.

Future commits will gradually make tests use this class instead of the
``BaseFunctionalTest`` that will be set to retirement.

LINKS

Task ID 2068986
PR #38070
2019-11-20 16:00:36 +00:00
Thibault Delavallée c3be4c3bc6 [IMP][MOV] mail: move / pimp test tools and asserts to mail
PURPOSE

Currently tools and asserts for mail tests are located inside test_mail
module. It makes difficult to re-use them in application tests or force them
to write custom quick and dirty tools and asserts. Purpose of this merge
is therefore to move tools classes and mocks to mail directly and use them
in various sub modules.

SPECIFICATIONS

Have class, mocks, tools and asserts available in mail so that all modules
below from mail can use them.

Including

  * mock mail gateway in a clean way: mock server connection, email building
    and sending;
  * allow to simulate errors while sending emails to test corner cases;
  * provide tools to insert emails in mail gateway;
  * mock mail application to check record creation (message, notifications,
    mails, ...);
  * mock bus notification;
  * provide clearer assert methods for bus and mail notifications;
  * provide clearer emails sending and content methods;
  * provide a with_user tool context manager for tests allowing to quickly
    change current user given a login;

Most of those tools, asserts and mocks come from test_mail/tests/common.py.
They have been partially rewritten to be easier to use or to perform tests
more cleanly.

Future commits will gradually update existing tests in test_mail, test_mass
mailing and test_mail_full.

LINKS

Task ID 2068986
PR #38070
2019-11-20 16:00:32 +00:00
qdp-odoo fd5264c5a5 [REV] account: reverts tags of the Indirect Method Cash Flow
This reverts commit 4f524dbad6 that was merged with PR #36206.

Those tags are unused, were added in account module by mistake (could maybe be acceptable in a l10n_xx module) and were rejected in master (at PR #35522) because of https://github.com/odoo/enterprise/pull/5052#issuecomment-540456794...

closes odoo/odoo#40575

X-original-commit: ed981b02fe2cd000c53f1f995b31c3860e0781c3
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-11-20 15:47:36 +00:00
ryv-odoo 4c6a625f65 [REM] mass_mailing: remove useless db param in url
Methods _get_unsubscribe_url and _get_tracking_url
create url with a db parameter (GET), but it isn't used
in the targeted controller. Then we removed it.

task-2087379

closes odoo/odoo#40568

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-20 14:52:03 +00:00
laa 92cc770c90 [IMP] website_slides: indicate new content on courses to users
Purpose of this commit is to help users knowing there is new content in a
course by adding a visual insight. It is done through a new content arrow
displayed in courses homepage.

Regarding the file "website_slides_templates_homepage.xml", the choice to
incorporate the t-call attribute into a 't' balise was necessary to display
the customize option (part front) associated with the model course_card.

Side dish usability improvements raised during development

  * display completed courses as last instead of first in "my courses";
  * do not show promote strategy field for training courses as it has no
    use, only for documentation courses;

TASK ID 2025186
Closes PR #36703

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-20 14:59:07 +00:00
Thibault Delavallée a8449773dc [FIX] website_slides: add explicit depends on non stored computed fields
Even if it works in current flows it is better to give some fields their
right triggers (fields and uid).

PR #36703
2019-11-20 14:43:15 +00:00
Thibault Delavallée 7a3217f810 [MOV] website_slides: keep files well organized
Oversight of 9b38bcec12

PR #36703
2019-11-20 14:43:03 +00:00
Arnold Moyaux 3b7766ad83 [FIX] delivery: debug loger with new ORM
Using the debug mode on carrier and validate a picking with a
carrier will block and run until request's timeout.

It happens because log_xml create a new cursor and a new environement.
So it should be flush before the ir.logging creation since it's in
another env.

closes odoo/odoo#40561

X-original-commit: cdc09f5b70ad200014ac38f314bf1ec53cd5b8ca
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-11-20 13:21:05 +00:00
Ankita Raval 3651ab082d [IMP] Inventory: Usability improvements
In this commit,
-Modify the message shown when we try to delete a done picking.
-In transfers, in detailed operations, set default hide on on
"Reserved" and "Lot/Serial Number".

task-id : 2124115

closes odoo/odoo#40309

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-11-20 13:03:43 +00:00
Debauche Stéphane 249aad8f70 [IMP] website_slides: update demo data course responsible / attendee
Before
======
In the demo data, we manually add ``admin`` as an attendee of his course,
and then we remove it with ``_remove_membership`` because he will be added
automatically in python.

Now
===
We do not add ``admin`` as an attendee of the course, and we remove the
``_remove_membership`` call. We also change the responsible of some courses
so admin can join some courses.

Task ID 2120225
PR #39886

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-20 13:07:20 +00:00
Xavier Morel 5d0fce56a9 [IMP] core: view validation error reporting
* allow chaining tracebacks of exceptions when using view validation
  in order to provide better issue location
* provide actual error messages in get_domain_identifiers to pinpoint
  issues better than "expression is not a valid domain" which
  depending on the domain might not make it entirely clear *why* the
  expression is not a valid domain

closes odoo/odoo#40468

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-11-20 12:54:11 +00:00
Patrick Hoste 99b7605167 [IMP] gamification: bring back karma field to res_users form view
The karma field has been removed with this PR #35587 but before it
was displayed in the res_users form view through the website_forum
addon under the name "Forum Karma". This task adds it directly in
the gamification inherited view for more consistency.

Task ID : 2116759

closes odoo/odoo#40316

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-19 09:08:50 +00:00
svs-odoo ab3d9f9d08 [FIX] product: sequence on product vendor list
The sequence on product supplier info (vendor list) has the handle
widget to be adjusted but was readonly.

task-2123442

closes odoo/odoo#40552

X-original-commit: 79c439470084fa960360228ebe53e8ff13cf4ff5
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-11-20 11:11:28 +00:00
Ankita Raval 94ee1ed5ab [IMP] Inventory : Usability improvements
In this commit,
- Prevent the product type 'Services' to be selectable from detailed
 operations of a picking.
- Change the place of 'product_uom_id' field on the internal transfers.

closes odoo/odoo#40551

Task-id: 2124093
X-original-commit: 9209e7f2b842161eb1704cebc02675a0b5248750
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-11-20 11:11:10 +00:00
Aaron Bohy 8aba4cd406 [FIX] web: handle m2o whose comodel name field is an m2o
This is a weird situation, but the python handles it. Let's assume
a many2one field F1 on model M1 with comodel M2, and on M2 the name
field (which is the _rec_name) being itself a many2one, and the
following scenario:
 - create a new record for M1
 - for field F1, select 'Create and Edit': it opens a form view for
   M2 in a dialog
 - type something in F2 input, and click 'Quick create'
 - save the dialog

Before this rev., the value of F1 was [object Object]. Now, the new
value is properly displayed.

OPW 2091106

closes odoo/odoo#40549

X-original-commit: 5a04ea848abf50b1fb1f9893d1fcd98013bc025d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-11-20 10:39:29 +00:00
Thibault Delavallée d72070e986 [REM] mail: remove unreachable demo data
Mail contains demo data related to private discussions. However this kind of
use of mail has been removed since several versions. This demo data only
creates noise in mail.message without adding any real demo for any users.

As messages should be linked to existing business documents, existing
demo data in demo channel and additional messages coming in other applications
should be sufficient. Let us remove those demo you can see only in technical
menus.

Task ID 2121319
PR #39907

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-20 09:57:25 +00:00
Simon Lejeune df79800545 [REM] stock: forecast view not imported
rev[0] only removed the override by mrp. The new report was merged in
rev[1].

[0] dc35b88411
[1] b311d9ccba

closes odoo/odoo#40543

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-11-20 08:35:54 +00:00
Simon Lejeune 09f66f4885 [REM] stock: unused controller
This was a remnant of the old old barcode client action.
2019-11-20 08:35:31 +00:00
Jorge Pinna Puissant c9d08fb3ef [FIX] sale_timesheet: remove key from translation terms
Before this commit, the key from the sales_timesheet.progressbar was in
the translation terms, if one of this was translated, then an error was
raised, the translated key wasn't expected into the function.

Now, only the labels can be translated.

opw-2123570

closes odoo/odoo#40541

X-original-commit: 8b4a647c94a4ec334327de72af9594a8de183006
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-11-20 08:27:05 +00:00
Katherine Zaoral 698c1e3cc1 [ADD] l10n_ar: show country AFIP code in the form/tree view
Currently all the countries that match between odoo and AFIP list where
set with the respective value.

This commit add the AFIP code field to both tree (for consult) and form
view (in developer mode only) to let the user the posibility to set/edit this
field for any of the next cases:

* need to consult the code.
* need to be changed.
* need to create a new country that exist in AFIP list and not in odoo
  and need to add the related AFIP code

closes odoo/odoo#40532

X-original-commit: 1b95bfe202576583d6458c6bd1a707dd988e6d95
Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-11-19 17:39:03 +00:00
fw-bot d2b974d22a [FIX] l10n_eu_service: make use of the new tax model
closes odoo/odoo#40526

X-original-commit: 87f2aae6c91e70f4f4102bf7ea41858db7dee16f
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-11-19 16:08:16 +00:00
Goffin Simon a1ed7aa2ca [FIX] stock: Salesman not able to confirm an order
Steps to reproduce the bug:

- Install Inventory, Sales
- In General Settings/Inventory/Traceability tick "Lots & Serial Numbers"
- Create a stockable product A (e.g. duplicate Apple E-COM08)  tracked by lots
- Update Qty on Hand: put the quantity inside a lot
- Change Demo User's settings: remove Inventory access
- Connect as Demo, create a quotation with A, try to confirm sale

Bug:

An access error was raised.

opw:2092809

closes odoo/odoo#40499

X-original-commit: 1da97d4b842444dd69a54692de0d6edfc20d1123
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-11-19 12:57:25 +00:00
Jeremy Kersten 3ff6efac8d [FIX] website: set controller favicon.ico as nomultilang
Avoid redirect from /favicon.ico to /<lang>/facivon.ico at each request

closes odoo/odoo#40535

X-original-commit: 94bcbc92e5e5a6fd3de7267e3c01f8c11fb045f4
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-11-19 18:29:20 +00:00
ryv-odoo c7a1a2d964 [REF] rating, various: improve rating.rating ACLs
PURPOSE

Rating model should be available only for internal users. External users
access them only through dedicated routes or controllers using sudo and/or
granting access through tokens. Therefore simplifying ACLs should be feasible.

SPECIFICATIONS

Remove access to rating.rating for public and portal users. Only employees
can access it, with full access given to system admins.

Update various functional flows to use sudo() and check that access is
verified before using sudo.

Impacted modules

  * rating / mail: add groups on some rating related fields as only
    internal users should access them now;
  * rating / mail: set some statistics fields using compute_sudo as their
    value should be accessible for external people even without access to
    the underlying rating.rating records;
  * project: makes some use of rating and has to be updated, notably for
    the public rating page;
  * website_{livechat, rating, slides}: add sudo in public routes as access
    is already granted;
  * website_slides: set statistics field using compute_sudo as their
    value should be accessible for external people;

TASK ID 2053096
PR #36592

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-19 15:46:51 +00:00