Commit Graph
121616 Commits
Author SHA1 Message Date
Thibault Delavallée 0b8a409580 [IMP][FIX] test_mail: correctly simulate email send in performance tests
Commit 356a421660 introduced a hook to avoid sending emails while
installing application data. However we have to carefully re-activate email
sending in tests that depend on them especially performance tests.

This commit also update performance counters to match the current state of
counters as it was not totally updated.

Commit linked to task ID 1902307.
2018-10-23 08:44:03 +00:00
Gustavo Valverde d75de9ae53 [FIX] base: set Monday as first day in es_DO
This complies with ISO 8601 and it's also the first working day in the country.
Also used for payroll computations.

closes odoo/odoo#28041
2018-10-23 07:19:16 +00:00
Adrian Torres 2693918903 [FIX] xmlrpc: properly marshall date & datetime objects
Before this revision, trying to read a Date field using xmlrpc would
result in a marshalling error.

This is due to the fact that 960360afe4
changed the internal value of Date/Datetime fields to hold
datetime.date/datetime objects.

The xmlrpc layer is capable of converting datetimes to the XML
datetime representation, but this is not possible for datetime.date
objects.

In order to solve this, the Marshaller class used by python's
xmlrpc.client is overridden and monkey-patched, allowing to convert
datetime.date / datetime.datetime objects into properly formatted
strings.

opw-1896364

closes odoo/odoo#28022
2018-10-22 12:22:59 +00:00
Robot Odoo ddc531a35a [IMP] snailmail: Change formatting of address in snailmail
The previous format displayed the fields 'street' and 'street2' on two different line, making the address too big for the address area allowed by Pingen.

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#27841
2018-10-23 00:28:03 +02:00
Arnold Moyaux abb4b142ea [FIX] mrp: duplicate raw moves
Usecase to reproduce
- Enable multi locations, multi routes
- Check mrp 3 steps on warehouse
- Create a MO

Raw moves are duplicated. It happens due to commit aeb038747f
The purpose of the commit was to split the rules from SAM to stock.
The pull rule should be in manufacture route and the push rule on the
warehouse. However the push rule was not correctly copied and created a
push rule from prod to sam instead of sam to stock.

Fixes #27962

closes odoo/odoo#27965
2018-10-19 12:13:26 +00:00
Rémi Rahir 5032828d5a [FIX] snailmail: instable behaviour on print
Since commit b6a981405e we require a
certain key in the context to apply the custom snailmail report layout.
This was badly managed and would eventually confilt inside the modal
that links snailmail and the mail composer.

This fix stabilises the biehaviour by properly propagating the context
key.
2018-10-19 08:36:16 +00:00
Antoine Prieels (ANP) 218fbaf90b [IMP] snailmail: Change formatting of address in snailmail
The previos format displayed the fields 'street' and 'street2' on two different line, making the address too big for the address area allowed by Pingen.
2018-10-19 08:36:16 +00:00
Goffin Simon ff610cec4f [FIX] sale: Signature not displayed on report
The signature never appeared in the report_saleorder_document when printing
or downloading the document.

opw:1892612

closes odoo/odoo#27948
2018-10-18 14:43:45 +00:00
Christophe Simonis b81c2bce84 [MERGE] forward port branch saas-11.4 up to 3c108977c1 2018-10-22 16:59:51 +02:00
Christophe Simonis 3c108977c1 [MERGE] forward port branch saas-11.3 up to 80df540dd0 2018-10-22 14:13:33 +02:00
Christophe Simonis 80df540dd0 [FIX] hr_expense: correct group xmlid 2018-10-22 12:34:05 +02:00
Martin Trigaux 933165ec3a [FIX] models: restore warning on wrong record
Was lost during d5b687a48f

Set the module name in the context to be able to detect errors in xml and csv import

closes odoo/odoo#27680
2018-10-21 08:41:22 +00:00
Odoo Translation Bot 26da2e183b [I18N] Update translation terms from Transifex 2018-10-21 06:02:27 +02:00
Odoo Translation Bot de265ce63e [I18N] Update translation terms from Transifex 2018-10-21 01:25:56 +02:00
Xavier Morel 238e561ad9 [FIX] website: current website caching
Not taking fallback in account means incorrect values can get cached/retrieved
on fallback v not fallback cases

closes odoo/odoo#27989
2018-10-19 15:28:43 +00:00
Christophe Simonis d4c343588f [FIX] test_mail: bump query count margin
Needed to make test pass with `mail_push` (enterprise module) installed.
2018-10-19 16:13:05 +02:00
Christophe Simonis 0fcb28c97b [MERGE] forward port branch saas-11.3 up to d82a907728 2018-10-19 14:32:09 +02:00
Martin Geubelle 1dcddbd022 [FIX] account: allow invoice report modification
The invoice lines table in the invoice report was using a `t-attf-class` where
it is not needed. It could be simplified with `class` instead.

This small simplification allows the user to modify the table with the Report
designer in Studio.

closes odoo/odoo#27978
2018-10-19 12:20:50 +00:00
Robot Odoo 489408bf26 [MERGE] website, *: fix some snippet options
* web_editor

See sub-commits for details.

closes odoo/odoo#27969
2018-10-19 15:36:30 +02:00
Aaron Bohy d82a907728 [FIX] web: kanban quick create when grouped by selection
Rev. 42e1efded5 aimed to disable the quick create feature when
grouped by date(time) fields, by only enabling it for char, boolean
and many2one fields. However, the selection case is quite important
and must be handled as well. This is what this rev. does.

Task 1878254
2018-10-19 13:15:31 +02:00
Aaron Bohy 120709f807 [FIX] web: kanban quick create with correct default values
When a kanban view is grouped by a char or a boolean field, and the
quick create option is enabled, the correct default value for the
grouped field (i.e. the value of the column in which the record is
created) should be given (either in the context if that field isn't
in the quick create form view, or as a default value in that form
view otherwise).

Before this rev., it wasn't the case, as it was only working when
grouped by a many2one field.

Task 1878254
2018-10-19 13:15:30 +02:00
Christophe Simonis f2ada1560e [MERGE] forward port branch 11.0 up to 22a13073f0 2018-10-19 12:25:17 +02:00
qsm-odoo 932fdb4e24 [FIX] web_editor: hide link buttons duplicates instead of removing them
For example, if primary = alpha, the primary button option is removed
in the link dialog. When editing a primary button, this lead to broken
behaviors. Hiding the button does the trick.
2018-10-19 09:58:00 +00:00
qsm-odoo b154709645 [FIX] website: remove useless select-class class 2018-10-19 09:27:29 +00:00
qsm-odoo 74086da371 [FIX] website: clone correct slide on addition
When adding a new carousel item, the first one was duplicated instead of
the active one.
2018-10-19 09:27:28 +00:00
qsm-odoo 3704e9583b [FIX] web_editor, website: remove traces of CKE 2018-10-19 08:37:01 +00:00
qsm-odoo aa2f86b14c [FIX] website: border/rounded/shadow options were not working together 2018-10-19 08:37:01 +00:00
qsm-odoo 720a129544 [FIX] website: make rounded option work with jumbotron 2018-10-19 08:37:01 +00:00
qsm-odoo 2d4c3bf662 [FIX] website: increase compatibility with previous column system
Before 12.0, snippet columns were using col-md instead of col-lg.
Also, this improves efficiency and readability.
2018-10-19 08:37:01 +00:00
Aaron Bohy 22a13073f0 [FIX] web: kanban quick create properly disabled
when grouped on field types for which it isn't supported.

Rev. 42e1efd disabled the quick create feature when the view is
grouped by date(time) fields. However, it hasn't been correctly
forwardported to 11.0 (with the new views). Indeed, the check was
done only once, at the initilization of the view. So if the user
selected another field to group by afterwards, the quick create
feature wasn't enabled/disabled accordingly.

Moreover, we didn't check if it was available when the user clicked
on CREATE in the control panel. So even if it wasn't (and thus if
there were no '+' icon in the columns), when the user clicked on
CREATE, the quick create widget was inserted in the first column.

This rev. fixes both issues.

Task 1878254

closes odoo/odoo#27867
2018-10-19 06:56:40 +00:00
Arnold Moyaux 433666b2d9 [FIX] stock: free reservation over reserve
Usecase to reproduce:
- 6 units in stock
- reserve 3 units on a move
- reserve 3 units on another move
- validate a third move with 1 unit

It raise the error could not reserve more than you have in stock.
It happens because when free reservation stole reservation from
an exisiting move with too much quantity available, it continues the
loop instead of stopping.

This commit stop the loop once we have enough quantity taken.

opw-1895578

closes odoo/odoo#27935
2018-10-18 13:49:57 +00:00
XavierDo 8f9a767bbe [FIX] mail: avoid concurrent update of notifications
When sending notifications by batch one notification email can be send
up to 50 people. For one mail_mail entry to handle 50 emails can be sent
as those are sent independently for each recipient.

In some cases a bounce may occur while the whole batch of recipients is
not completely mailed. In that case the mailgateway will update the
notification status to bounced. When the cron finishes to send the whole
batch of emails it tries to update the notifications of all recipients.
However as a notification has already been updated due to the bounce we
face a concurrent update, meaning the transaction is rollbacked.

Emails have been sent but notifications are not considered as sent as they
have not been updated accordingly. Next time the cron runs it will send the
same batch again, with probably the same bounce and rollback. We could
therefore face an email loop.

This commit add test for this use case.

This commit is linked to task ID 1893054.
2018-10-18 15:49:28 +02:00
Christophe Simonis b66a37d2c5 [MERGE] Backport of chrome headless support
For unknown [1] reason, phantomjs starts to segfault when running qunit
tests.
Be radical with simply not using phantomjs anymore.

[1] Any guidance on tracking the root cause may help...
2018-10-18 14:26:26 +02:00
Raphael Collet e91b16b734 [FIX] base: renaming of x2many fields 2018-10-18 12:04:45 +02:00
Denis Ledoux 8f8060faae [FIX] tests: web tests, chromium fallback
On Ubuntu, the chromium executable is `chromium-browser`,
On other distributions, such as debian, it's `chromium`.

We therefore add another fallback
2018-10-18 11:59:44 +02:00
Denis Ledoux 0e388750c1 [FIX] tests: chromium executable is chromium-browser
When installing chromium using apt
e.g apt install chromium-browser
the executable is `chromium-browser`,
not just `chromium`
2018-10-18 11:59:44 +02:00
Christophe Monniez 2f63e1e973 [FIX] tests: detect coverage and adjust timeout
When computing coverage, the tests are slowed down and the timeout is
often exceeded.

With this commit, HttpCase headless Chrome tests timeout is increased if
coverage is detected.
2018-10-18 11:59:44 +02:00
Christophe Monniez 383ed26657 [FIX] tests: close Chrome and shutdown on SIGXCPU
When Odoo receive a SIGXCPU (CPU time limit reached), it shuts down
immediately. If a headless Chrome is running, it stays alive after the
Odoo shutdown.

With this commit, the signal is intercepeted and the Chrome browser is
properly closed before shutting down the Odoo server.
2018-10-18 11:59:43 +02:00
Christophe Monniez 5a523b06cd [FIX] tests: properly stop chrome when no tab found
In some situations, Chrome remote debugging is sending an empty list of
opened tabs. In that case, an orphan Chrome process stays alive.

With this commit, Chrome is stopped properly in those situations.
2018-10-18 11:59:43 +02:00
Christophe Monniez 0daf4536a6 [FIX] tests: disable screencast when no logfile
When an HttpCase browser_js test is started, the screencast is started
and is discarded at the end of the test if no logfile was provided by
the config.

This behavior can impact the performances.

With this commit, the screencast does not start at all if not needed.
2018-10-18 11:59:43 +02:00
Christophe Monniez 8a5e40b875 [FIX] tests: redirect chrome headless stdout and stderr to dev null
When executing a very long HttpCase browser_js test, it happens that one
of the chrome process PIPE is full (ie. clickEverywhere test).
In that case, the communication with Chrome is blocked.

With this commit the stdout and stderr of the Chrome process are
redirected to /dev/null.
2018-10-18 11:59:43 +02:00
XavierDo 22dc335803 [FIX] tests, web_tour: improve js error display in build details
Since chrome headless has been merged, js error messages are
difficult to read: some information was missing or only displayed in
full all log.

All console.error() will now be displayed in build details, and will
appear just before the python assertion.

XMO's improvement will also be used on all log: Using module and
classname of the class calling phantomJS.

Also: some small improvements on error messages to make them easier to read

Note: this commit also shown that some error were not detected:
now we will fail in any case if js log an error.
2018-10-18 11:59:43 +02:00
Christophe Simonis 42cfc72d5e [FIX] core: use actual chrome/chromium executable on macOs. 2018-10-18 11:59:42 +02:00
Christophe Monniez ecaa04ec82 [FIX] tests: increase browser_js ready code timeout
Before starting a JS test/tour the _wait_ready method evaluates if the
test is ready with a timeout of 10 sec. From times to times, it happens
that the page is not ready after this timeout but the problem is hidden.

In order to help fixing that kind of issue, the timeout is increased to
60 sec and a warning is logged to emphasis the fact that an
issue exists.

Also some unused imports are removed with this commit
2018-10-18 11:59:42 +02:00
Raphael Collet 614884928e [FIX] tests: clean up code
Closes #26467
2018-10-18 11:59:42 +02:00
Christophe Monniez 9973994660 [FIX] tests: clean the browser even on failure
When a Chrome headless test fails the browser is not cleaned and could
lead to a mix with other tests when the same method is called.

Also, the multiline assertions gives an unreadable message when the
assertion fails.
Finally, it happens that a thread does not have an 'url' attribute and lead to a crash when the logger tries to show the thread url.

With this commit, the browser is cleaned, even on failure and the
assertions are now one line.

Closes:  #26432
2018-10-18 11:59:42 +02:00
Christophe Monniez 9211121a57 [FIX] tests: avoid traceback when websocket-client is not installed
The account module needs to import Form from "tests.common" causing a
traceback when websocket-client module is not installed.

As this module is only required for the tests, there is no reason to add
it to the "requirements.txt" file.

With this commit, Odoo account can be installed even when
websocket-client is not installed, in that case, the HttpCase tests that
needs to run Chrome headless will be skipped with a warning.

Closes: #26404
2018-10-18 11:59:42 +02:00
antonylesuisse 1fe5145f0c [REF] tests: replace phantomjs by Chrome headless
As the phantomjs project was suspended[1], there was a need to change the js test
engine. Moreover, the engine was rather old and leading to non
deterministic crashes.

Chrome headless was choosen for simplicity and the long term vision of
the devtools protocol [2].

The 'phantom_js' method still exists but will be deprecated in
favor of 'browser_js' with the same parameters.

In order to communicate with the browser, the python websocket-client package
is needed.

[1] https://github.com/ariya/phantomjs/issues/15344
[2] https://chromedevtools.github.io/devtools-protocol/

closes #25991
2018-10-18 11:59:38 +02:00
Xavier Morel 35eaa523bd [IMP] tests logging
* Make phantomjs logging clearer by logging within the test case's
  module, not odoo.tests.common.

  This way, a tour in e.g. point of sale is clearly logged as that,
  rather than be logged as odoo.tests.common.phantomjs and require
  hunting which module/test we happen to be in.

* Clarify tagging causes for exclusion of selection of tests.
2018-10-18 11:59:08 +02:00
len-odoo e648f5fbe4 [FIX] sale: convert invoice values to the sale order currency
If the invoice is not in the same currency as the sale order, then there was an
inconsistency in the sales report, as it was considered to be the unit currency.
We keep the initial computation in case where the invoice currency is the same.

opw 1890381

closes odoo/odoo#27797
2018-10-18 08:31:19 +00:00