Commit Graph
127230 Commits
Author SHA1 Message Date
Martin Trigaux c5bb52f33e [FIX] test_translation_import: avoid selection clash
export.selection.withdefault and export.selection both have a selection field
with Foo and Bar as possible selections.
When doing
self.env["base.update.translations"].create({'lang': 'fr_FR'}).act_update()
the base.update.translations wizard exports the translations of ALL modules,
including the ones of the test_impex module.

The generate po entry is something like:

#. modules: test_impex, test_translation_import
#: selection:export.selection,value:0
#: selection:export.selection.withdefault,value:0
#: selection:test.translation.import,import_type:0
msgid "Bar"
msgstr "Bar in french"

but may also be

#. modules: test_translation_import, test_impex
#: selection:export.selection,value:0
#: selection:export.selection.withdefault,value:0
#: selection:test.translation.import,import_type:0
msgid "Bar"
msgstr "Bar in french"

(not sure where the indeterminism comes from)

which creates 3 translation entries that are sometimes linked to the module
test_impex (ignored when exporting the translations of test_translation_import)
but are sometimes linked to the module test_translation_import instead

In the second case, this makes 3 more translations that is was supposed to
exist.

This commit hides the symptom by making sure there is no longer a clash
when exporting the translations of the module test_translation_import.
A real fix to avoid creating unnecessary translations during an execution of
the base.update.translations wizard must also be made in the future.

It is assumed the unnecessary translations problem was already present before
a7621137cb but polib introduced the indeterminism
making the test fails from time to time.

closes odoo/odoo#33958

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-06 14:10:08 +00:00
b14921d847 [FIX] website_sale: fix concurrent update
Since forward-port, `/sale/get_combination_info_website` and `_cart_update`
would lead to a concurrency error.

Indeed, the session would not have an order_id at first. Then both rpc would
be sent at the same time:
- `cart_update` would create an order and add it in the session
- `/sale/get_combination_info_website` would end up calling `_compute_cart_qty`
which would call `sale_get_order` and would set the `sale_order_id` to none,
just aftet the `_compute_cart_qty` would actually add an order in the
session, simultaneously.

closes odoo/odoo#33993

Signed-off-by: Christophe Simonis <chs@odoo.com>


Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Christophe Simonis <chs@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2019-06-08 10:14:52 +00:00
Romain Derie 8c7423298f [IMP] website_sale: move code from JS tour to python
In order to setup the tour environment, the tour would create and write on
some records.
This part of code could be moved from JS to python to avoid potential
concurrent error and to gain time.
2019-06-07 16:16:51 +00:00
Christophe Simonis 04d21a99d7 [FIX] account: avoid infinite recursion on account.move.line defaults
Now that `.new()` compute default values, calling `new()` from
`default_get` should avoid the recursion itself.
2019-06-07 12:37:49 +02:00
Christophe Simonis 83d0eaedc7 [FIX] web: temporary disable failing test 2019-06-07 12:37:49 +02:00
Christophe Simonis 8670584299 [FIX] core: in onchanges, verfiy that x2many are the same records
Comparing the length of the recordset is not enough for determining if
there is changes on m2m.

This also fix the merge of f14ae73a98 and
d0bb596f1d

Oversight of previous forward-port.
2019-06-07 12:37:49 +02:00
Sébastien Theys 3b63c7c2a6 [FIX] website_slides: fix typo introduced in cd4cd51 2019-06-07 11:17:10 +02:00
fja-odoo 5ab24668f4 [FIX] sale, website_sale: move #buy_now disable
Some code was not correctly merged during forward port.

commit introducing the new method
https://github.com/odoo/odoo/commit/51ef8514eaddaebbdfee73230cfe955735d02f67

commit introducing the issue:
https://github.com/odoo/odoo/commit/71a50a2214748fec413c5a0f042d0e7172ae6ea9
2019-06-07 11:16:20 +02:00
David Monjoie 83f0bc2280 [FIX] web: fix field signature xmlDependencies loading 2019-06-06 16:10:15 +02:00
Romain Derie d02c0eb4c9 [FIX] survey: fix forward port
d273bdfed7 got ported from 12.0 to master but this file does not exist as it
has been renamed with fdbf11643f
2019-06-06 15:08:04 +02:00
Romain Derie aebbd0317f [FIX] mail, web: directly load async debug.xml during QUnit tests
Before this commit, the test `list: edit view menu item` would sometimes crash
as now the debug manager loads its templates with an `xmlDependencies` where it
was not the case before (included in base.xml), see 73327db065.
2019-06-06 15:08:04 +02:00
Christophe Simonis 4f18c7c44b [FIX] test_mail: correct test
*/ Adapt test to new version
*/ do not use removed method `do_in_onchange`
*/ remove duplicated test
2019-06-06 13:33:16 +02:00
Christophe Simonis 71a50a2214 [MERGE] forward port branch saas-12.3 up to 409679866b 2019-06-06 11:54:35 +02:00
Robot Odoo a7621137cb [MERGE] Use polib to parse .po files
Remove ugly custom po files parser and use polib for reader and writer.
Refactor reader/writer to use a class and have an abstraction for csv or po files.

Task-id: 1986334

closes odoo/odoo#32165

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-06 09:45:37 +02:00
Martin Trigaux 55dd375c84 [FIX] tools: ensure 0 res_id are handled
if an POEntry has an occurrence with a 0 res_id
    >>> entry.occurrences.append(("selection:report.paper,format", 0))
    >>> str(entry)
    #: selection:report.paperformat,format
    ...

Use the string '0' to bypass this
2019-06-05 09:44:11 +00:00
Martin Trigaux 376f7983b0 [IMP] test_translation_import: reexport the .pot file
To be sure it is synchronized with the reality to make the maintenance easier
2019-06-05 09:44:11 +00:00
Martin Trigaux eab46cdca6 [IMP] tools: remove custom pofile writer
And create a generic class to handles it, using polib for po files
2019-06-05 09:44:11 +00:00
Martin Trigaux 632fa044c3 [IMP] tools: remove custom pofile reader
Use polib library that handles this correctly
The complexity of the parser is moved to the library
2019-06-05 09:44:11 +00:00
Martin Trigaux 3c568aec0b [FIX] base,website_sale,fleet: do not use a space in xmlid
This probably a bad idea for odoo but is definitly a bad idea for pofile

As shown in gettext reference, the spaces are used as separator in po files
https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html
For instance
    #: src/msgcmp.c:338 src/po-lex.c:699
    #, c-format
    msgid "found %d fatal error"
    msgstr "..."

The line "model_terms:ir.ui.view,arch_db:website_sale.search count"
was considered as two references:
- 'model_terms:ir.ui.view,arch_db:website_sale.search'
- 'count'

Correct external id of fleet, even if not translatable
2019-06-05 09:44:11 +00:00
Martin Trigaux d0805f2e6d [IMP] base: remove deprecated code
The types view, field or help no longer exists
2019-06-05 09:44:07 +00:00
Cedric Snauwaert 409679866b [FIX] l10n_hn: remove unused fields
fields account_id and refund_account_id on account_tax_template have been moved on the repartition line of the same model.

closes odoo/odoo#33829

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-06-03 10:53:09 +00:00
Kaushalya Mandaliya 7a3a1a43b3 [FIX] im_livechat: correctly display known partner name
When talking via the Live Chat to a known partner, should be able to see
his name in the chat window title, from the commit: c04b9c019e
the partner name wasn't showing in the title as sudo is being used.

After this commit, known partner name will be shown in the
Live Chat window title.

And improving a test case, in which we're checking for the known partner's
name in the chat window title.

task-1940407

closes odoo/odoo#33831

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-06-06 04:45:21 +00:00
Johan Demaret Rivarola 218d5ce6a8 [FIX] (website_)sale_coupon: avoid race condition on currency
Creating a new database with only website_sale_coupon installed will
make some (website_)sale_coupon tests fail. This is due to a race condition
messing with the value of the pricelist product.list0 currency.

The tests are failing due to amounts being compared after the USD
currency rate of 1.2834 has been applied.

Example on a 10% discount:

expected:
>>> 320 * 0.9
288.0

actual:
>>> 320 * 1.2834 * 0.9
369.62

This is due to
https://github.com/odoo/odoo/blob/3cf9cfc985950c30c6b76480f77f5ffe53650b24/addons/website_sale/data/demo.xml#L228
overriding the value to USD. The tests should not rely on this.

This commit aims to ensure the currency is enforced before each test run.

closes #4371

Signed-off-by: Christophe Simonis <chs@odoo.com>

X-port/Cherry-pick of odoo/enterprise@c1cc464c44
2019-06-05 18:18:52 +02:00
Christophe Simonis 0f9823e216 [FIX] lunch: correct forward-port of a5b56e5498
closes odoo/odoo#33878

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-06-05 14:58:20 +00:00
Christophe Simonis dad3043ccd [FIX] stock: reset return lines on picking change 2019-06-05 14:00:39 +00:00
Christophe Simonis ce4165780a [FIX] mail: avoid race condition in test 2019-06-05 09:08:31 +00:00
Christophe Simonis 76275c2c12 [FIX] web: correct forward-port of e9350993ca 2019-06-04 16:27:42 +00:00
Nicolas Lempereur 32f13fae14 [FIX] web: list editable test forward-port
Now in 12.3, when the a editable list view is grouped, the "Create"
button is no longer shown as was the case before (when it would open the
form view when clicked).
2019-06-04 16:16:41 +00:00
Nicolas Lempereur bbc8c9fc26 [FIX] web: fix form resequence test e61639723
In 12.3 when lines are resequenced, the position of the current line
does not take into account that it could have been changed (because of
drag and dropping a line before or after).

opw-1966589
closes #33878
2019-06-04 15:09:44 +00:00
Christophe Simonis a89a7b30a4 [FIX] web: correct forward-port of e9350993ca 2019-06-04 14:56:19 +00:00
Christophe Simonis 3a1bb663c7 [FIX] sale_product_configurator: remove duplicated method
Oversight of previous forward-port.
2019-06-04 14:56:19 +00:00
Christophe Simonis 2b0118b984 [FIX] sale: correctly adapt forward-port of 51ef8514ea 2019-06-04 14:56:19 +00:00
Christophe Simonis 47fefea909 [FIX] sale: propage new parameter to sub-function
Oversight of previous forward-port.
2019-06-03 20:10:34 +02:00
Christophe Simonis 43d133d504 [FIX] *: correct some javascript errors
Oversight of previous forward-port.
2019-06-03 19:06:03 +02:00
Christophe Simonis e6146b0b08 [FIX] website_sale_delivery: use defined variable
Oversight of previous forward-port.
2019-06-03 18:10:46 +02:00
Christophe Simonis eaa6198c9f [FIX] website_forum: remove extra closing xml tag
Oversight of previous forward-port.
2019-06-03 18:10:02 +02:00
Christophe Simonis c8d7ad9a6b [MERGE] forward port branch saas-12.2 up to 995aa1685e 2019-06-03 15:49:31 +02:00
Christophe Simonis 995aa1685e [FIX] purchase_stock: correctly set cost_method and valuation in tests
Oversight of previous forward-port.
2019-05-31 16:31:44 +02:00
Christophe Simonis b1970c6f08 [FIX] stock_account: correctly force cost_method in tests
Oversight of previous forward-port.
2019-05-31 16:13:49 +02:00
Christophe Simonis 6c16a1f3ba [FIX] product: correct variant image test
Oversight of previous forward-port.
2019-05-31 15:12:11 +02:00
Christophe Simonis cfe0523714 [MERGE] forward port branch 12.0 up to 8f21148e1a 2019-05-31 14:37:38 +02:00
Nicolas Martinelli 8f21148e1a [FIX] hr_contract: contract type name
Make the contract type name translatable.

opw-2003957

closes odoo/odoo#33781

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-31 05:41:25 +00:00
Toufik Ben Jaa 29762514ae [FIX] sale: singleton error when validating payments
- When validating a payment an "expected singleton" exception is
raised due to the fact that we are using a recordset with multiple
record instead of a recordset with a single record.

OPW-1981632

closes odoo/odoo#33767

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-05-29 16:16:18 +00:00
Nicolas Martinelli d92acc602c [FIX] event_sale: no currency
If the company is not set on the SO, the creation of a SO line crashes
because `currency` is empty.

opw-2005143

closes odoo/odoo#33783

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-31 06:36:55 +00:00
Sébastien Theys 7bb0c8b6c5 [IMP] website_sale: prevent new product from being published
Before this commit, new products created from the website backend were published
by default. This is a problem because the product manager might click on save
before he has finished configuring his new product. He should always be given
a chance to see it himself on the website before the publication.

closes odoo/odoo#32211

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-29 13:36:13 +00:00
Lucas Lefèvre 0b36687bc1 [FIX] resource: Avoid to set attendances twice
Don't set attendance_ids default value if the field
is not in the field list parameter.

closes odoo/odoo#33904

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-05 10:22:51 +00:00
Thanh Dodeur c212cfe899 [REF] *: removes datas_fname from ir.attachment
This commit removes the field `datas_fname` from `ir.attachment` as
it was unnecessary and most of the time the duplicate of `name` or
`url`.

Task #1909865

closes odoo/odoo#32976

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-06-05 09:12:13 +00:00
Robot Odoo d6847bacb1 [IMP] web, http, http_routing, *: new asset for test files
Coming with https://github.com/odoo/enterprise/pull/4281

This commit goal is to encapsulate every tour-test into a separate assets
bundle that would be called only during tests (command line) or by URL
(debug=tests). That way, a lot of .js files would not be loaded anymore
uselessly outside test mode and will speed up the page loads (especially in the
frontend as the backend do not reload the page anyway).

In order to do that, we needed to propagate the `debug` state from page to
page.
Otherwise, every page change during a test would simply lose the debug mode and
the test would stop as the test assets would not be loaded.
As we could not add the `&debug=tests` on every link (either hardcoded or
preprocess during the rendering), it has been decided to store it in session.

Technical summary:
1. `debug` state (currently only stored in URL) will be stored in session.
Either when adding the `debug` param in URL (handled with _dispatch) or by
starting Odoo with `test-enable` or `test-file` (handled by session init).
2. Once activated (and so set in session), debug mode will be remain activated
even if not visible in URL (after a page navigation eg).
To remove it,  set its value to nothing, `debug=`. That will exit debug mode
(whatever mode it is: debug, assets, tests).
3. As tour-test files are now in a separate bundle, every layout (when needed)
should `t-call="web.compiled_assets_tests"`.
As it would be redundant and verbose, no `t-if` is needed on the t-call to
load it only in test debug mode. That will be handled by
`compiled_assets_tests` that will actually do the conditionnal t-call-assets
to web.assets_tests, if tests debug mode is activated.
4. In addition to separating the tour-tests files in a separate bundle, we also
moved those files to a specific folder under /static/tests/tours next to
QUnit tests.
5. Also, tour files will be moved in a specific folder /static/src/js/tours for
cleanness purpose (those files will still be kept in their 'normal' assets
as needed outside test mode since it is tours).

closes odoo/odoo#33213

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-05 09:42:45 +02:00
Jeremy Kersten 7a3046a38f [IMP] tools: add DotDict helper
This function allow a quck dot.notation access to dictionary attributes

We need to make it re-usable for a future enterprise commit
2019-06-05 05:56:33 +00:00
Romain Derie 72f7139f52 [IMP] *: use new helper config.isDebug()
Before this commit, both config and session were aliases to odoo.debug.
Now, config.isDebug() should be call, with possibility to pass a parameter to
check if we are in a specific debug mode such as 'tests' or 'assets'.

task-1934445
Coming with https://github.com/odoo/enterprise/pull/4281
Closes https://github.com/odoo/odoo/pull/33213
2019-06-05 05:56:33 +00:00