Commit Graph
132100 Commits
Author SHA1 Message Date
William Henrotin 1efe2fc953 [FIX] mrp: load move_finished_ids in view
Issue: open a done production. Unlock it. Add a new raw stock move.
This action will called _compute_order_finished_lot_ids on the new
stock_move. This method uses
move.raw_material_production_id.move_finished_ids.
raw_material_production_id is available but not move_finished_ids. The
reason is move_finished_id is not loaded by the web client in the
production form view.

This commit added the one2many (invisible) in the view in order to
get all the information in the compute method.
2019-11-22 12:39:52 +00:00
William Henrotin 6b4f447de9 [FIX] mrp: consumption required 2019-11-22 12:39:52 +00:00
William Henrotin 043d706784 [IMP] mrp: beautify bom line form
This form is mostly used in the 'Cost Analisys report' (mrp_account_enterprise module)
and needed an update to better integrated with the report

Task : 2082448
2019-11-22 12:39:51 +00:00
William Henrotin 58df6c86e0 [FIX] mrp: new stock move line in traceability report
Before this commit, The addition of new stock move lines in a
finished production via the unlock button did not impact the
traceability report. This was due to the fact that the new sml
has not been linked to the finished_lot_id.
2019-11-22 12:39:51 +00:00
William Henrotin e1f518bb83 [IMP] mrp: add components in workorders
This commit extend the flexible consumption. On the workorder form view.
It's now possible to add directly new workorder line with any product
(even one not in any BoM line). For those new wo line. A confirmed stock
move is create in the record_production step.

Task : 2082448
2019-11-22 12:39:51 +00:00
Raphael Collet 9412b74986 [FIX] base: res.partner.display_name does not depend on context
closes odoo/odoo#40683

X-original-commit: 5a701758100d450f25566e0d1b3e4289583a2d01
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-11-22 12:24:45 +00:00
Raphael Collet 56d118e390 [FIX] fields: display_name when _rec_name is an inherited translated field
X-original-commit: bbbbee404c01bce22609f2d9cc1ac3a5c713b72a
2019-11-22 12:24:45 +00:00
Ankita Raval e859fa9112 [IMP] stock: Inventory Adjustment
In this commit set date field as a date and set it on the lower
right corner.

task-id:1970451

closes odoo/odoo#32968

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-11-22 06:49:26 +00:00
Yannick Tivisse 4da5d88403 [IMP] project: Display tags under deadline
closes odoo/odoo#40332

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-22 09:29:43 +00:00
Yannick Tivisse f34f6ee3b6 [IMP] project: Allow multi levels on sub-tasks
Purpose
=======

Currently, it is only possible to have 1 level of sub-tasks per task.
The user may want several levels of granurality.

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

Allow having multi levels of sub-tasks
- Move the parent_id field out of the debug mode and display it above the
  Deadline field
- Remove the 'parent task' stat button
- Add the parent_id field to the project.task optional list view
- Display the sub-tasks stat button on sub-tasks
- The 'sub-tasks' stat button should only count/display tasks from the
  first level of sub-tasks
- The name of the sub-task should be
  parent task: sub task level 1: sub task level 2: sub task level 3...
- The sub-task should be created in the sub-task project set on the
  parent task's project
- The subtask_planned_hours and the subtask_effective_hours fields should
  take into account the planned hours of all sub-level tasks

TaskID: 2107078
2019-11-22 09:29:43 +00:00
Martin Trigaux 342ffbc57e [FIX] base_gengo: do not crash if Gengo is not present
Before this commit, calling gengo_authentication (executed from the
cron _send_translation_terms) returns an error when the python library
gengo is not found on the system.
If tried to request a synchronisation, got an error "NameError: name
'Gengo' is not defined"
Gengo variable was undefined as no imported.

closes odoo/odoo#40686

X-original-commit: 675b355954522caf7d72ab20cc431d19c5a05a8f
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-11-22 10:26:39 +00:00
Martin Trigaux c854bca219 [REV] tools: partially revert 0ec6acc458
No justification, commit message not linked to the diff.
If there is an issue in the line_number extraction it must be
investigated.
I suspect an outdated polib version.

closes odoo/odoo#40684

X-original-commit: 0f92dae8eb76a47326bd2bb8924df8fa09645145
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-11-22 10:26:19 +00:00
Nicolas Martinelli f02bfd3daa [FIX] payment_stripe: avoid internal error
In case the Stripe API call fails, an Internal Server Error page is
displayed to the user, which is not user friendly.

opw-2126196

closes odoo/odoo#40678

X-original-commit: 95a452f6d928de2e8532027893a353167ffdd389
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-22 09:41:05 +00:00
oco-odoo 8700041ecd [FIX] account: reintroduce "Add a bank account" menu item
Removed by mistake by https://github.com/odoo/odoo/commit/ec603e2593131d462f578feda2e1fec3cfb59c53

closes odoo/odoo#40676

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-11-22 08:59:37 +00:00
Xavier Morel 9546a37599 [ADD] pyjs: support for conditional expressions
Conditional expressions were already parsed, but there was no support
for executing them (or stringifying them back though I'm not sure when
that's used).

closes odoo/odoo#40502

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-11-19 13:16:04 +00:00
Yannick Tivisse f3f75068c1 [IMP] hr_timesheet: Add demo data
Add a bunch of timesheets for the 2 main demo projects in the project module
+ for one of the billable projects in sale_timesheet

closes odoo/odoo#40280

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-22 09:13:52 +00:00
jbm-odoo 6b5bdbb476 [IMP] hr_[contract,employee,recruitment,work_entry]: Add multi edit in view
Make some fields editable in multi edit.
Some onchange are tranformed in compute fields.

id=2078674

closes odoo/odoo#39711

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-06 10:08:50 +00:00
Xavier Morel c83cac21a7 [IMP] core: simplify get_domain_identifier
* we can just get the variable names once for the entire expression,
  no need to bother doing it bit by bit
* avoid blowing up when the domain contains computations *around*
  segments.

closes odoo/odoo#40642

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-11-21 14:32:37 +00:00
Nicolas Martinelli 51f90541bf [FIX] calendar: round duration
When a calendar event is created with a duration of for example 20
minutes, the end time appears as the start time + 19 minutes.

Because of the rounding of the duration (20 minutes = 0.333... hours),
the end time is incorrectly set (xx:19:59.998...) then displayed. Since
the duration can only be set by the minute, we round it before computing
the end time.

opw-2122853

closes odoo/odoo#40655

X-original-commit: f6ae9f0aea5a250cbff6734de8a43a1b741394a7
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-21 17:04:47 +00:00
Denis Vermylen 4b1668abc3 [FIX] server.py: <threaded> avoid registry lock upon shutdown
A deadlock can occur between threads when concurrent requests
acquire the registry lock and conflicting database-level locks
in different orders. The database won't be able to detect and
break the deadlock because it involves an external, Python-level
lock. This situation is more likely to occur during module
installations [1].

If the server is started with the `limit_time_real` option,
it should be able to abort the deadlocked requests after the
timeout, and restart. However that could not work because
the recovery initiated by `reload()` is blocked at the end
of the `stop()` method, as it cannot acquire the registry
lock either, necessary for `Registry.delete_all()`.

Since that deletion step is in fact not necessary, it can
be skipped, avoiding the deadlock entirely.

Indeed there's no real reason anymore to delete the DB's
registry upon shutdown. This was introduced for 7.0 by
b5daffc115, in order to perform
other cleanups (including cron agent threads). These other
cleanups are not necessary anymore, and when the stop()
method of the ThreadedServer completes, the next step is
either a restart of the whole process (via execve() through
_reexec()), or a full process exit. Keeping the registry in
memory for a few cycles until this happens makes no difference.

When such a deadlock occurs, it's always possible to manually
kill the server with 2 `kill` commands, or 1 `kill -9`.

~~~~~~~~~~~~~~~~~~~~~~
[1] Reproduction info:

The following deadlock was observed in Odoo threaded server mode:

1. incoming request spawns a new thread A
   A starts a transaction and does a "SELECT ... FROM res_users ..."
   getting an ACCESS SHARE lock on the table
2. incoming request spawns a new thread B
   B is a request that calls `button_immediate_install`, that will
   install new modules and alter the res_users table.
3. B takes and holds the registry lock and executes "ALTER TABLE
   res_users ...", that waits to get the ACCESS EXCLUSIVE lock on the
   table until A's transaction releases the ACCESS SHARE lock.
4. A continues code execution and reaches a .sudo() call, it tries to
   create a new environment. The creation of the new environment
   requires to wait for the registry's lock to be release but it's held
   by B.

-> A waits for B's registry lock to be released
-> B waits for A's ACCESS SHARE lock to be released
-> Deadlock that can't be broken except by force-killing the server

closes odoo/odoo#40664

X-original-commit: 9e67525418b3b0a48a796044ef24b227946ceb8f
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-11-21 20:38:00 +00:00
Victor Feyens a27c7a59d4 [FIX] doc: remove support for IE 11.
Since Odoo V13, ES6 is supported and we therefore do not support IE 11
anymore.

closes odoo/odoo#40661

X-original-commit: 9071a25394aa7a1749dc497fccea095bc8261181
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2019-11-21 18:59:58 +00:00
Denis Ledoux a1fc9c0427 [FIX] scaffold: clean the templates:
- Add blank lines at end of python files (pep8)
 - Easier uncomment (entire blocks, and no remaining whitespaces in empty lines)
 - Add `_description` to model to avoid the warning telling it's missing
 - Correct compute field, `self.value` raised an `ensure_one` issue
 - Change access so the user can add/edit/delete records in the web interface
   by default
 - Correct the server action, `self` is not in the server action context.

closes odoo/odoo#40659

X-original-commit: 622615771d0a6f8544f6810f30df46aea0e0fb9c
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2019-11-21 18:21:40 +00:00
Jeremy Kersten eebe6ec8d4 [IMP] theme_default: remove autoinstall
closes odoo/odoo#40517

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-11-21 15:27:10 +00:00
Jeremy Kersten 4010a7445c [IMP] website: feedback choose theme
Move switchView according to FP request
2019-11-19 17:41:30 +00:00
Romain Derie 4178a383fd [IMP] http_routing, portal, website_*: clean 404 templates
A nicer 404 layout was introduced with e9106f8f98 but the specs got changed
just after it was merged.

It has been decided to make the 404 fully editable (before, everything was
fully editable except the popular page div).

In order to do this, the 404 template can't have inherited views, which brings
the following changes:
1. Remove every main website module xpath view adding their most popular page
2. Remove the xpath view in portal to add popular page part (was not needed
   in http_routing/web). It has been decided that having `Home` ('/' url) even
   without portal and/or website is not a big deal.

Those changes allow the 404 template to be written in a single view without any
inherited views.
The 404 will be the same for backend only databases, portal and website.

task-1966460

closes odoo/odoo#40637

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-11-21 14:12:47 +00:00
Andrea Grazioso (agr-odoo) 988f5c2443 [FIX] google_calendar: fixing request for exclusion
Activate Google Synchronization, create on OE a recurrent event (no allday)
synchronize the calendar, then delete an event of the recursion on OE,
sync again on OE.

An error will popup in the console. There is a typo in the variable
sent to the google API.
https://developers.google.com/calendar/v3/reference/events

closes odoo/odoo#40625

X-original-commit: 299bb8a995fb8058bbc0b9e4d71b67d3e765c6af
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-21 12:56:02 +00:00
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