Commit Graph
118940 Commits
Author SHA1 Message Date
Christophe Monniez 07b855fccf [FIX] tests: remove chrome sandboxing
It appears that chrome headless with sandboxing is failing when running
containerized because it tries to use Linux namespaces.

With this commit, the no-sanbox optional arg is used to avoid this
issue.

Closes #26456
Closes #28053
2018-10-26 11:26:18 +02:00
Olivier Colson e6228402e7 [FIX] purchase: fix anglosaxon valuation
Before that, when receiving, then invoicing with price diff, the value in interim account corresponded to the price on the invoice instead of the original valuation one.

Scenario to reproduce the issue:

* create PO with 1 product, FIFO valuation, price=10
* receive PO: the entry in stock interim account has debit=credit=10
* create invoice, with price=15 instead of 10
* the invoice entry should be: payable: C=15 ; price diff: D=5 ; interim account: D=10
  ==> Instead, we had payable: C=20 ; price diff: D=5 ; interim account: D=15 => this was wrong

Also added a test case for the same scenario, verifying the amounts written in the different accounts (and refactored a bit ValuationReconciliationTestCase for easiness)

Closes #27394
2018-10-25 18:03:27 +02:00
Christophe Monniez f9ee8cff14 [FIX] tests: avoid remaining requests
From times to times, warning are seen on the runbot during HttpCase
tests with the chrome headless browser.

Those warning are about Odoo trying to join remaining requests threads.
In the dumpstack, the thread seems blocked in the werkzeug
handle_one_request method, when trying to read the HTTP request line.

One explanation could be that Chrome opens a pre-connect socket for
a future use. When the HttpTest cleans the browser, the page stops
loading but (probably) keeps the socket open for a while.

That could explain the problem.

With this commit, a timeout is set on the request handler,
in the hope that it closes the pre-connect socket too.
2018-10-25 17:16:34 +02:00
Christophe Simonis cc8e8237bf [MERGE] forward port branch 11.0 up to 84500c27b1 2018-10-25 13:59:45 +02:00
xmo-odoo 84500c27b1 [P3] payment_stripe: Exception.message removed
Apparently missed in 07ab8b6cd2

In Python 3, there is no Exception.message attribute anymore, this would
lead to cascading exceptions in the stripe_s2s_create handler.

closes odoo/odoo#28141
2018-10-25 09:13:17 +00:00
Nicolas Martinelli a4059804cc [FIX] stock: run scheduler on partially available moves
1. Product A - on stock 5 pcs.
2. SO - 7 pcs. of A
3. Generated picking has reserved 5 pcs.
4. Increase stock to 7 pcs. (Update qty on Hand)
5. Run procurement scheduler
6. Picking still has reserved 5 pcs.

The scheduler should take into account the moves partially available.

Fixes #27874

opw-1895622

closes odoo/odoo#28136
2018-10-25 08:35:42 +00:00
Arnold Moyaux 0ff1e5fab5 [FIX] mrp_bom_cost: bom cost / bom quantity
Use case to reproduce:
- create a BoM of 50 finished products:
- Add a routing with an operation time of 1h
- Set a 1$/h cost on workcenter
- Set unit price from BoM

It will be 1$ for one product. It should be 0.02$
since it will take 1h for 50 products, so the price
should be 1/50

It happens because the system add the operation time by unit instead
of adding it only once.

related to commit 17b6256955

opw-1890005
2018-10-24 11:10:29 +02:00
Christophe Simonis 80df540dd0 [FIX] hr_expense: correct group xmlid 2018-10-22 12:34:05 +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
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
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
Denis Ledoux b7937ab6b7 [FIX] web: re-introduce on_change="0" to prevent onchanges for customization
In 10.0, adding on_change="0" allowed to prevent
default onchanges to occur for the field on which was added this attribute.

In 11.0, the rev. eaa66d1156
added a regression by removing this possibility.
It was an oversight, it was not an expected change
in the web client.

In 10.0, it's this line which bring this possibility:
https://github.com/odoo/odoo/commit/e8a00bc50da435d3859118ca127d20a2eb9a0cab#diff-ff0e90fb0eb4418a7f66e618e4b51323R444

opw-1883366

closes odoo/odoo#27952
2018-10-18 15:37:42 +00:00
Christophe Simonis 2c0a76fc7a [FIX] web: correct attribute name
Oversight of previous forward-port.
2018-10-18 17:32:11 +02:00
Christophe Simonis 9c3ec026c5 [MERGE] forward port branch saas-15 up to 54db75396f 2018-10-18 17:16:03 +02:00
Christophe Simonis 54db75396f [MERGE] forward port branch saas-14 up to ef670016e6 2018-10-18 15:30:59 +02:00
Christophe Simonis ef670016e6 [MERGE] forward port branch 10.0 up to b8b33c6363 2018-10-18 14:52:51 +02:00
David Arnold b8b33c6363 [FIX] add res_company.sequence to base.sql
Seems like something similar to odoo/odoo#17111 can happen on Python 2.
The same change as #17111 is a bit involved for -stable, but this looks
pretty harmless.

Probably fixes #23781.
2018-10-18 14:24:37 +02:00
Wolfgang Taferner 66f8ffe729 [FIX] stock: do not crash move_lines return a tuple with empty list
Typically if you use an onchange method to retrieve values on the server
and convert them to write it will also try to write empty values like
[(6, 0, [])] and this will crash as it has also the length of 3 but no
dictionary but a list

closes odoo/odoo#27937
2018-10-18 12:05:35 +00:00
Julien (juc) Castiaux 4c65499cca [FIX] mail: Emails are sent in reverse order
The CRON job that sends email sends them in a LIFO order instead
of a FIFO order which can lead to confusion when the order is
important.

Exemple, when updating multiple time an appointement, the last
update should be the newest mail clients receive in their mail box
which was not the case before this PR.

opw-1888601

closes odoo/odoo#27888
2018-10-18 09:24:00 +00:00
Martin Trigaux 4945495401 [FIX] base: display correct ondelete value
The on_delete value on an ir.model.field did not reflect the value set on the
field loaded in the registry

Fixes odoo/odoo#24464

closes odoo/odoo#27906
2018-10-18 08:48:37 +00:00
Martin Trigaux 80fd5abd90 [IMP] sale_mrp: increase test delta
The test was comparing a scheduled date was correctly computed.
The runbot build 363053 failed because runbot12 is a bit slower and computed
the delay in 2 seconds instead of the 1 previously tolerated.

Increase the delta to 10 seconds.

The delay is a matter of days. Having a difference of 1, 10 or even 100 seconds
should be equivalent functionnaly.

Having a 100 seconds delay could indicate a serious performance issue though...
2018-10-18 10:07:10 +02:00
Gert Pellin c19f0a7a5d [FIX] point_of_sale: new table duplicates
Add new tables in POS screen, close the screen and resume the session
again, the tables you created duplicate

closes odoo/odoo#27924
2018-10-18 07:54:11 +00:00
William Henrotin 84481726dc [FIX] stock: add note field
Commit 37d20240a9 reintroduce lost note
field but not in a clean way.
This commit put the field in a proper tab.

Task : 1896143

closes odoo/odoo#28026
2018-10-25 07:54:42 +00:00
Odoo Translation Bot c2c88f359d [I18N] Update translation terms from Transifex 2018-10-25 10:21:44 +02:00
Yenthe V.G 992c4dbe38 [FIX] mail: set default _rec_name to avoid showing model with id
closes odoo/odoo#27186
2018-10-24 14:21:04 +00:00
David Arnold cbc72dba18 [FIX] purchase_requisition: traceback on validate
The subsequent code strongly suggests that pick_in can be None,
however, the raise_if_not_found has not been set properly.

closes odoo/odoo#27397
2018-10-20 21:22:37 +00:00
Christophe Simonis 58af18eb2f [FIX] account,sale_timesheet: don't enforce test journal currency
It was causing some tests failure due to 22f0da809e
2018-10-24 17:45:34 +02:00
Christophe Simonis 58525e29d8 [MERGE] forward port branch saas-15 up to bff43f0aa1 2018-10-24 16:14:52 +02:00
Christophe Simonis bff43f0aa1 [MERGE] forward port branch saas-14 up to 29e36457b2 2018-10-24 14:19:44 +02:00
Christophe Simonis 29e36457b2 [FIX] account: don't enforce test journal currency
It was causing some tests failure due to 22f0da809e
2018-10-24 11:57:42 +02:00