Commit Graph
118869 Commits
Author SHA1 Message Date
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
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
Christophe Simonis 0de06a4132 [FIX] board: remove duplicated test 2018-10-16 20:43:49 +02:00
Christophe Simonis e21ce71927 [FIX] board: use defined variable in newly added test
Oversight of previous forward-port
2018-10-16 19:14:19 +02:00
Christophe Simonis d23ddbd6ee [FIX] account: add missing field to view
This field is required since 1a99d22f19
2018-10-16 18:47:20 +02:00
Christophe Simonis 41bf8ce6d9 [MERGE] forward port branch 11.0 up to b29b545fe8 2018-10-16 17:53:26 +02:00
qsm-odoo a9f11fb477 [FIX] web_editor: properly remove all bg when choosing a bg color
The code which removed the background image of a snippet when choosing a
background color worked kinda by chance. Indeed, on the final click on
the color option, the snippet background-image was reset... to the
current background-image, which is none thanks to the color preview.
Unfortunately, in some themes, the gradient color option interferes:
the current background-image at a color choice is equal to the current
gradient, and thus, that gradient is being moved as an inline style.

The bug was introduced with https://github.com/odoo/odoo/commit/285d95e946e5a15139c961e30dbe3598e0d99f6a
(as, before, the background reset was done by simulating a click on the
'background: none' option item, which was removed).

Closes https://github.com/odoo/odoo/pull/27808
2018-10-16 13:32:23 +02:00
Nicolas Martinelli b29b545fe8 [FIX] sale_timesheet: project overview
Complement of commit fc1ba68c6a

opw-1893397

closes odoo/odoo#27835
2018-10-16 08:31:56 +00:00
Lucas Perais (lpe) 6e28e4f26c [FIX] account: display partner.bank on journals
Before this commit, when accessing journals through the menu item
Bank Account, one was able to enter an partner.bank account number
But, in case the partner.bank already exsited, there was no way to select it
and a cryptic unicity constraint was raised

After this commit, one can select an account already existing

OPW 1884515

closes odoo/odoo#27840
2018-10-16 10:24:16 +00:00
Goffin Simon 84e3ae140e [FIX] purchase_requisition: System pick wrong operation type in Purchase Agreement
When creating a "purchase.requisition" record, the default Operation Type was
always the one defined in the company 1 even if the user was not in the company 1.

opw:1890190

closes odoo/odoo#27830
2018-10-16 07:55:56 +00:00
Goffin Simon 7bee068a0f [FIX] sale: Sale channels duplicate field
Steps to reproduce the bug:

- In CRM, create an new Sales Channel
- Go to Reporting/Sales Channels
- Click in the new channel on "Click to define a target"

Bug:

Two input fields called "Set an invoicing target" appeared in the new channel

opw:1889406

closes odoo/odoo#27781
2018-10-16 07:41:50 +00:00
Florent de Labarre 57d9f9ee32 [FIX] qty_invoiced is wrong if uom_id in invoice line is updated
closes odoo/odoo#27837
2018-10-16 08:34:56 +00:00
Lucas Perais (lpe) a7732bb839 [FIX] board: translate custom views according to current user
forward port of 62cbc5f

Have a user in English, put a sale report as "favorite" (pinned to dashboard app)
Change the user's language

Before this commit, the pinned view was in English (because it was recorded that way)

After this commit, the pinned view is in the user's language.

OPW 1890664
closes #27799
2018-10-16 08:12:48 +02:00
William Henrotin f652c8d1da [FIX] mrp: done workorder on multiple reserved move lines
Producing a manufacturing order on components with more than one unit
could leads to multiple move line reserved on this component. Marking the
workorder as done, in that case, will trigger an error saying "Cannot set
the done quantity from this stock move, work directly with the move
lines". Instead of setting the quantity done directly, this commit
uses the magical function _set_quantity_done() that manage the case
of more than one move lines.

OPW-1888780

closes odoo/odoo#27773
2018-10-15 13:20:52 +00:00
Joren Van Onder 6c42ca8a7b [FIX] point_of_sale: make card readers work again on payment screen
Swiping a credit card through pos_mercury no longer worked on the
payment screen.

3a74afd21e introduced some special code
in BarcodeEvents for mobile Chrome. This code relies on an invisible
input being filled in by barcode device. On the payment screen the POS
uses a keypress event handler on body to manage input. This handler
preventsDefault which stops the input from being filled in.

It's worth noting that this new approach in
3a74afd21e is not fully equivalent to
the original barcode events handler. Events are not redispatched, so
this effectively disables keyboard input on the payment screen (or
anywhere where it is used).

opw-1888466

closes odoo/odoo#27820
2018-10-15 21:05:17 +00:00
William Henrotin 939b022ebf [FIX] mrp: done workorder on multiple reserved move lines
Producing a manufacturing order on components with more than one unit
could leads to multiple move line reserved on this component. Marking the
workorder as done, in that case, will trigger an error saying "Cannot set
the done quantity from this stock move, work directly with the move
lines". Instead of setting the quantity done directly, this commit
uses the magical function _set_quantity_done() that manage the case
of more than one move lines.

OPW-1888780

closes odoo/odoo#27773
2018-10-15 13:20:52 +00:00
Nicolas Martinelli 121fb6f1e7 [FIX] stock: incorrect translation
The translation was not ported in saas-11.3 by Transifex.

opw-1889820
opw-1893527
2018-10-15 15:20:37 +02:00
Arnold Moyaux dd501bbe37 [FIX] stock: replenish infinite loop with production
Usecase to reproduce:
- Create a BoM for a product with route Manufacture
- Use replenish wizard in order to fill your stock

It traceback due to an infinite loop.
It happens because when the production order creates the raw
moves, it does not set a product template. However a default_product
template is in the context and is used as default value. So it creates
a raw move with the component as product.product and the production product
as template. Since they are related it will modify the product_tmpl_id
of the product.product. It result by having a component with the
finished product as template and it will use the same stock rules and
bom again and again.

This commit clean the context before running procurement rules.

opw-1890661
2018-10-15 15:05:56 +02:00
Christophe Simonis 900db95457 [MERGE] forward port branch saas-15 up to f026255f12
closes odoo/odoo#27792
2018-10-15 12:21:50 +00:00
Arnold Moyaux 17b6256955 [FIX] mrp: bom structure in batch
Usecase to reproduce:
- Create a BoM that create more than 1 finished product
- Use a routing
- Open the BoM structure report

The operations time from the routing are multiplied by the quantity show
on the report.

It should not happen since routing's operations are not by unit.
If a user create a BoM that produce 50 finished products then the
operation time is always the same when the user produce between 1-50
units. It then double from 51-100,... (workorder use the same process
for the expected duration).

This commit fix this behavior by using a rounding up on the
quantity asked on the report / BoM product quantity.
It also take care of the workcenter capacity.

opw-1890005
2018-10-15 13:04:49 +02:00
Christophe Simonis f026255f12 [MERGE] forward port branch saas-14 up to 5f3739aebd 2018-10-15 11:40:20 +02:00
Christophe Simonis 5f3739aebd [MERGE] forward port branch 10.0 up to 8fb61cd830 2018-10-15 11:03:34 +02:00
Lucas Perais (lpe) 8fb61cd830 [FIX] product_margin: sales and purchase in invoice's currency
Invoice price should be adapted to the invoice currency
Before this commit, it was not.

OPW 1889997

closes #27710
2018-10-15 09:24:20 +02:00
Simon Lejeune 0b414cb814 [FIX] sale_stock: return of return and delivered quantity
The code ignored return of return when computing the delivered quantity
of a so line (in this part of the code, if a move has a destination
location set a customer, it'd be a return of return of a delivery).

We now update the delivered quantity is the return of return as the
`to_refund` flag enabled, meaning the user ticked the option to update
the quantity on the so line.

opw-1884683
2018-10-12 10:21:14 +02:00
Christophe Simonis 1ade6675c3 [MERGE] forward port branch 11.0 up to 717f458394 2018-10-11 16:29:46 +02:00
Christophe Simonis 717f458394 [MERGE] forward port branch saas-15 up to 93c22558f3 2018-10-11 14:48:49 +02:00
Joseph CaburnayandNicolas Martinelli 3df584f5a6 [FIX] website_sale: click first image in carousel does not work
- Activate the `group_website_multiimage` in the website settings
- Add several images on a product
- On the eCommerce, click on the second image, then the first one

The click on the first image doesn't work.

This is because `t-att-data-slide-to="0"` is removed from the attributes
(probably because evaluated as falsy).

opw-1884368

Co-authored-by: Nicolas Martinelli <nim@odoo.com>
2018-10-11 14:25:05 +02:00
Christophe Simonis 93c22558f3 [MERGE] forward port branch saas-14 up to 77286e4296 2018-10-11 12:15:02 +02:00
Christophe Simonis 77286e4296 [MERGE] forward port branch 10.0 up to c2688e45f3 2018-10-11 10:34:48 +02:00
tutran81 c2688e45f3 [FIX] maintenance: make write override multi-compliant
The write method called self.stage_id which caused singleton error when
self contains more than one record
2018-10-11 10:02:27 +02:00
Christophe Simonis 32b19115e9 [FIX] web,mrp: move test to adequate module 2018-10-10 18:50:37 +02:00
Christophe Simonis c8633bcc16 [FIX] board: correct test definition
Oversight of previous forward-port.
2018-10-10 18:05:22 +02:00
Julien (juc) Castiaux e6580e59a3 [I18N] calendar: correct bad email template translation
Complement 4558ca95cd

opw-1891825
2018-10-10 17:36:36 +02:00
Kishan Gajjar 227fc6408d [FIX] web_editor: properly allow to reset bg color
If resetting a background color was the only edition that was done on a
page and that this page was saved, the change was not properly saved
as the page was not marked as dirty.

Closes https://github.com/odoo/odoo/pull/27625
task-1879524
2018-10-10 17:22:37 +02:00
Nicolas Martinelli 3c4f853365 [FIX] account: aged partner report
Let's consider an aged partner balance with a period of 30 days as of
2019-02-08. The specific dates used in the report are:

``` python
bisou = datetime.strptime('2019-02-08', "%Y-%m-%d").date()
for x in [0, 1, 30, 31, 60, 61, 90, 91, 120, 121]:
    print(x, bisou + relativedelta(days=-x))

0   2019-02-08
1   2019-02-07
30  2019-01-09
31  2019-01-08
60  2018-12-10
61  2018-12-09
90  2018-11-10
91  2018-11-09
120 2018-10-11
121 2018-10-10
```

However, the current periods generated are incorrect:

```
{'name': '0-30', 'stop': '2019-02-08', 'start': '2019-01-09'}
{'name': '30-60', 'stop': '2019-01-08', 'start': '2018-12-09'}
{'name': '60-90', 'stop': '2018-12-08', 'start': '2018-11-08'}
{'name': '90-120', 'stop': '2018-11-07', 'start': '2018-10-08'}
{'name': '+120', 'stop': '2018-10-07', 'start': False}
```

There is a clear inconsistency between the name of the period and the
date used. Moreover, the name is misleading: 0-30 includes the -0 date,
while 30-60 doesn't include the -30 date.

After the fix, the name and the periods are consistent. We also change
the first period to 1-30 since including 0 would mean to include amounts
which are not due yet.

```
{'name': '1-30', 'stop': '2019-02-07', 'start': '2019-01-09'}
{'name': '31-60', 'stop': '2019-01-08', 'start': '2018-12-10'}
{'name': '61-90', 'stop': '2018-12-09', 'start': '2018-11-10'}
{'name': '91-120', 'stop': '2018-11-09', 'start': '2018-10-11'}
{'name': '+120', 'stop': '2018-10-10', 'start': False}
```

opw-1886633

closes odoo/odoo#27294
2018-10-10 15:21:24 +00:00
William Henrotin 37d20240a9 [FIX] stock: add forgotten note field
The stock refactoring between version 10.0 and 11.0 changes lots of views
in the inventory app. The picking form view lost in the refactoring the
'note' field.
This commit put it back in the view under the 'Additionnal info'. It was
not been removed from the pdf reports

closes odoo/odoo#27658
2018-10-11 08:01:01 +00:00
Martin Geubelle f249c5ef2a [FIX] web: restore broken datepicker input behavior
In Firefox, the input behavior and visual representation (navigation, caret
placement, value selection, etc.) was broken when using a datepicker (easily
reproductible on date and datetime widgets).

This was due to the `focus` event being stopped on the input, which doesn't
seem to be correctly supported by Firefox.

The deleted code was supposed to toggle the picker when the field was clicked
(see odoo/odoo@89093a1) (toggle on click and disable focus) but the lib
correctly supports on focus without extra code.

This also fixes the fact that the datepicker was not open on focus (only on
clicked). In some tests where the field was the first in the form view, it is
now correctly autofocused.

Forward-port: not useful from 12.0 because the code has changed with BS4 and
this has already been applied in odoo/odoo@6692919 and odoo/odoo@c63630d.

Closes #23438

closes odoo/odoo#27657
2018-10-11 08:41:48 +00:00
len-odoo 12a795a7a0 [FIX] website_links: unreadable axis labels on statistics graphs
When there are many values, the axis would be unreadable.
We also added a margin so that the values would be displayed entirely,
as opposed to cropped in the middle of a word.

opw 1890109

closes odoo/odoo#27656
2018-10-11 08:05:08 +00:00