Commit Graph
123296 Commits
Author SHA1 Message Date
Nicolas Lempereur a3489be331 [FIX] web: have link over whole many2one
The style of a link (color) of a many2one is only applied over the
first line (probably for eg. the partner on an invoice that has the
partner name and on following lines the address).

In some instance this make some sense, but on other (the name of a
product is too long from where it is) it makes no sense and seems buggy.

With this change, we have the link style over the whole link which seems
good enough.

opw-1947113
closes #31568

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-05 12:30:48 +00:00
Romain Derie 5a81d88837 [FIX] website: delete cow view on module update
Before this commit, when a view was removed during a module update (eg: the
record was deleted from the file), its COW views would not be deleted.

This could lead to unwanted behaviors including tracebacks(1).

This commit is somehow related/an extension of b5fe23055d that handle COW view
write during module update and 2e32cc5aa3 that remove COW views during module
uninstall.

task-1931683

Note: Some existing tests had to be run post install

(1) A view doing a t-call is COW'd, then that view and its t-called view are
    removed. If the cow view is not removed, the t-call will crash (see tests
    in this commit for detailed case).

closes odoo/odoo#31295

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-03-05 11:04:52 +00:00
Simon Lejeune dfb5e3791f [FIX] stock: duplicate route
Do not apply the duplicated route to the products/categories/warehouses
the original one was applied to.

Fixes #31610

closes odoo/odoo#31619

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-03-06 08:38:38 +00:00
mreficent e74f96ba06 [FIX] hr_holidays: leave_type_request_unit field was declared twice
closes odoo/odoo#31162

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-02-15 18:36:37 +00:00
Martin Trigaux 62a29dba2c [REV] models: do not erase master version
This commit has been backported in 11.0 [1] and then reverted [2],
because it introduced a regression in web_studio, discovered at opw-1947380

As no forward-port has been done between the backport and the revert,
the forward-port of the revert also contains the patch itself, resulting
in a noop.

Actually revert 06d73eab62 in branch `12.0`.

[1] d855e3911f
[2] 1748b46718

closes odoo/odoo#31637

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-06 14:45:21 +00:00
Lucas Perais (lpe) 1a9393c8d7 [FIX] account: invoice compute tax group amount correctly grouped
Before this commit, when printing an invoice, the taxes were grouped
by their tax group (NOT by their parent tax)
Summing the base of each tax in the process.

This was largely insufficient, as tax groups can have taxes
with different rates or computation method within them

The summing of the base of each tax for reach tax group was in this case plain wrong

This commit aims at grouping by
group > computation method > amount

Which makes more sense

OPW 1947202
OPW 1945353

closes odoo/odoo#31617

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-03-06 08:58:52 +00:00
Sébastien Theys 188ddec890 [FIX] website_sale: prevent compute_image on /shop
On /shop, we access the image field to generate the image widget, but we don't
actually need the image content, we just need its url. When `bin_size` is added
we don't compute all the resize for nothing.

opw-1923999
task-1922055
PR: #30274

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-02-15 10:17:04 +00:00
Sébastien Theys 15adbcab1b [FIX] sale,website_sale_stock: prevent compute stock from /shop
The `_get_combination_info` override in website_sale_stock is only necessary
when we want to get the stock, which is on the product page RPC.

Before this commit, the stock would be computed all the time, which slowed down
the requests for no reason.

opw-1923999
task-1922055
PR: #30274
2019-02-15 10:17:03 +00:00
Sébastien Theys 956b5cafdb [FIX] product, website_sale(_*): show only template data on /shop
In order to increase performance, it was decided to avoid computing the first
combination on the /shop page, because it has to be done for many products in a
loop. Instead, we only display the template data, which is faster to get.

This implies that when using only one variant, we need to always write on the
template image instead of the variant image. This is needed because when there
is only one variant, the user doesn't know there is a difference between
template and variant, he expects both images to be the same.

To achieve this, we also had to change how the quick buttons work on the /shop
page ("add to cart", "add to wishlist" and "add to compare"). Indeed it was
decided that their behavior should be the same, no matter how many combinations
existed or not on the template. Therefore, the standard behavior of those
buttons is to always do their action on the first possible variant, that is
cached so we can use this logic without ever needing to read anything else than
the template data (and the cache).

opw-1923999
task-1922055
PR: #30274
2019-02-15 10:17:03 +00:00
Sébastien Theys 5b32f1b5cd [FIX] product,(website_)sale: speed up _get_variant_for_combination
Change the domain to not include `.id` and to use `in` to prevent subqueries
to be ran by the ORM for each attribute value.

On the filter, directly use `attribute_value_ids` instead of the computed field
`product_template_attribute_value_ids` that leads to the same result, to prevent
unnecessary compute of that non-stored field.

Cache the result of the method. The cache is invalidated when the configuration
of attributes and values change.

We can remove all cache invalidation from the tests since it is done at the
appropriate times in the business code now.

opw-1923999
task-1922055
PR: #30274
2019-02-15 08:52:26 +00:00
Sébastien Theys cc985a2bc4 [FIX] product: fix product configurator speed using prefetch/compute
Take advantage of prefetch and api.multi, instead of calling plenty of methods
that didn't cache their result and did separate queries for each record.

opw-1923999
task-1922055
PR: #30274
2019-02-15 08:52:26 +00:00
Sébastien Theys b87a07c501 [FIX] product: fix speed of _set_product_template_value_ids compute
The method was doing an unnecessary sort since the _order has been fixed in
f8dad1bb4b

Moreover, it tried to find the ptav through the attribute_id related field and
a map on the other side, instead of directly relying on the ids of the ptv.

opw-1923999
task-1922055
PR: #30274
2019-02-15 08:52:26 +00:00
Sébastien Theys 26a35b6931 [FIX] product,website_sale: add generator for possible combinations
We replace `_get_first_possible_combination` by a generator. By iterating it, we
can find as many possible combinations as we want, as suggested in task 1936680.

So if we need to get or to know if any arbitrary number of combinations exists,
we can just iterate on the generator multiple times, without having to start
over from the start every time.

opw-1923999
task-1922055
PR: #30274
2019-02-15 08:52:26 +00:00
Sébastien Theys f2d4b118d0 [FIX] sale,website_sale: fix list view of variants price compute
Before this commit, the list view of variant didn't use `_get_combination_info`
so the displayed price was not taking into account important settings such as
B2B/B2C and currency convert.
2019-02-15 08:52:26 +00:00
Swapnesh Shah 6c9c871d08 [FIX] account: Use correct date based on user TZ
closes odoo/odoo#28335

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2018-11-01 17:06:32 +00:00
Christophe Simonis c6e7adfb95 [REV] web: revert f8b38f64 "keep col group by on 2nd reload"
It broke other pivot tests.

closes odoo/odoo#31630

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-06 12:28:02 +00:00
Olivier Dony ffc6df3c99 [REV] web: revert 08b2d1f9 "margin-top on top of report"
This reverts commit 08b2d1f9ac and the
subsequent commit a75533daf2be325e059f0d4badfb0cf3a2f7590f, because they
caused more problems than they solved.

Not only did we get issues with missing footers in some cases, but the
address box also gets misplaced on the left in many layouts.

See #31184, #31533, #31531
See opw-1925894 (reason for patch), opw-1948160 and similar ones (regressions)

Closes #31626
2019-03-06 12:23:36 +01:00
Christophe Simonis f5889303ef [FIX] hr_holidays: mute log of expected exception in test 2019-03-06 12:21:10 +01:00
Christophe Simonis afe0133302 [MERGE] forward port branch saas-11.3 up to 3e54704e66 2019-03-06 10:59:32 +01:00
Christophe Simonis 3e54704e66 [MERGE] forward port branch 11.0 up to 27081bf6f5 2019-03-05 17:26:04 +01:00
Christophe Simonis 27081bf6f5 [MERGE] forward port branch saas-15 up to c03f6db6ea 2019-03-05 16:45:22 +01:00
Christophe Simonis c03f6db6ea [MERGE] forward port branch saas-14 up to fdb9f8273b 2019-03-05 16:23:55 +01:00
jev b5885f0cb0 [FIX] mail: popover email icon without any customer email data
Before this commit, when hovering on a email icon of a message
in chatter without any customer email data, there was a crash
with the following error message:

"No enumerator given to foreach"

This was caused by `undefined` being passed to `t-foreach` when
there are no customer email data on the message. Since
`undefined == null`, it raised the error above.

closes odoo/odoo#31587

Signed-off-by: =?utf-8?b?QWxleGFuZHJlIEvDvGhuIChha3Up?= <aku@odoo.com>
2019-03-05 11:30:42 +00:00
Martin Trigaux 1748b46718 [REV] orm: revert d855e3911f
This commit introduced a regression in web_studio, discovered at opw-1947380

A fix in web_studio will be integrated too but the regression is the proof this
commit should not have been integrated in 11.0.
While the new behaviour introduced at d855e3911f makes more sense, it is still
a change of behaviour that should not target a stable version.

For the problem raised at opw-1887162 that d855e3911f was trying to fix, a
workaround should be used instead.
For instance, setting a widget='html_frame' allows to translate in the website
editor that handles this correctly.

In master, the new behaviour can be maintained and eventual regressions will be
investigated there.

closes odoo/odoo#31585

Signed-off-by: "Martin Trigaux (mat)" <mat@odoo.com>
2019-03-05 10:18:11 +00:00
Vincent Schippefilt 1f670ad81f [FIX] bus: longpolling clears its handlers correctly
`this._id` is overriden by the crosstab_bus, so the event handlers
weren't unbound at destroy.

closes odoo/odoo#31578

Signed-off-by: "Aaron Bohy (aab)" <aab@odoo.com>
2019-03-05 08:50:13 +00:00
qsm-odoo fdb9f8273b [FIX] web_editor: stop using translated versions in HTML editor
Since https://github.com/odoo/odoo/commit/5a030db3eb77b6d80187f8ae1a64303b2f50391d
the HTML editor displayed the translated versions of the templates it
allows to customize. So if the user edited and saved such a template,
the non-translated version was saved with translated-version content.

The behavior before the mentioned commit was:
1) Load all views the HTML editor allows to edit
2) Each time a view is displayed, re-make a RPC to load the view again

The mentioned commit made this simpler by making:
1) Load all views the HTML editor allows to edit
2) Each time a view is displayed, simply show the previously loaded view

... the problem was that the step (2) of the old behavior was
explicitly saying (client-side) to load the view's untranslated content.
This commit makes step (1) always load the untranslated versions of the
views (server-side).
2019-03-04 17:05:01 +01:00
Lucas Perais (lpe) 6aad8b2691 [FIX] l10n_fr_fec: dom-tom excluded from EU's fiscal territory
Sources:
https://www.service-public.fr/professionnels-entreprises/vosdroits/F23570
http://www.douane.gouv.fr/articles/a11024-tva-dans-les-dom

This commit allows a Dom-Tom based company to export the FEC file out
without needing to have a normalized French TVA set on the company

OPW 1946623

closes odoo/odoo#31543

Signed-off-by: "Lucas Perais (lpe)" <lpe@odoo.com>
2019-03-04 13:53:50 +00:00
Lucas Perais (lpe) 5dfb6e39af [FIX] l10n_fr_fec: no new line at the end of file
It seems that our beloved administration is not happy with the FEC file
ending with an empty new line

Hence, this commit makes the FEC file last line end without \r\n characters
and there is no empty new line

OPW 1943302
2019-03-04 13:53:48 +00:00
Christophe Simonis 1693a27f28 [FIX] account: mute logger on expected Exception in test 2019-03-04 17:09:21 +01:00
Christophe Simonis c3764265de [FIX] base: mute logger for expected Exceptions in tests 2019-03-04 16:33:38 +01:00
Christophe Simonis 1c712986c4 [MERGE] forward port branch saas-15 up to 1f1fa35c07 2019-03-04 15:49:35 +01:00
Christophe Simonis 1f1fa35c07 [MERGE] forward port branch saas-14 up to 232da9a0ec 2019-03-04 13:40:44 +01:00
Christophe Simonis 232da9a0ec [MERGE] forward port branch 10.0 up to 0f0c5db49d 2019-03-04 12:02:31 +01:00
Julien Legros 0f0c5db49d [FIX] base: fix parse_version import 2019-03-04 11:24:18 +01:00
Jorge Pinna Puissant d92eba3a19 [FIX] website_event_sale: pricelist discount product qty
Before this commit, a pricelist discount based on the product qty could
be created and the user may believe that it will work also for event
tickets.

Now: when configuring a pricelist discount based on the product qty a
warning message is show to alert that this kind of discount don't work
in event tickets.

opw-1940368

closes odoo/odoo#31459

Signed-off-by: "Lucas Perais (lpe)" <lpe@odoo.com>
2019-02-28 08:59:25 +00:00
Lucas Perais (lpe) 12df5a9325 [FIX] base_automation, mail: automated action on computed fields
Together d60f2ab0e2 and
24ca67b545
corrected the triggering of automated actions at *each* recompute of a field

It is problematic since, maybe, the field that should trigger an action
*is* a computed one. It often happens with "state"-like fields

This commit aims at applying the logic of those two commits,
except in the case we do want the action to be triggered
even in a recompute case

OPW 1935727

closes odoo/odoo#31422

Signed-off-by: "Lucas Perais (lpe)" <lpe@odoo.com>
2019-02-27 13:55:49 +00:00
Martin Trigaux 8dd456cb82 [FIX] l10n_multilang: ensure order with record and template
On some chart of accounts, some records (e.g. account.tax on l10n_be) have
children and some are deactivated when the chart of account is created.
The children on the account.tax and templates were not created in the same order
The deactivated records were not found in the search.

Before this commit the translations did not match the right record on the
account.tax (e.g. 21% tax translated with a 12% name in Dutch)

Bug noticed with avw

closes odoo/odoo#31510

Signed-off-by: "Martin Trigaux (mat)" <mat@odoo.com>
2019-03-04 12:38:33 +00:00
Jorge Pinna Puissant 4613d0a80b [FIX] event_sale: on change of events product in SO
Have a product that is an event, with the price of 1500.
Create a ticket for this product in an event, with the price of 600.
In a SO, add a line with this ticket.

Before this commit, when you change the product, to another product that
is also an event, the event, the ticket and the price stayed the ones of
the first product.

Now, the event, the ticket and the price are updated when the product is
modified.

opw-1940368
2019-02-27 12:54:53 +00:00
Xavier Morel 925385fde6 [FIX] base: properly check werkzeug version
Werkzeug version was being checked to avoid passing quote=True to
werkzeug.utils.escape (as that parameter was changed to `True` *and
deprecated* in 0.9).

However because DeprecationWarning was made silent by default in
Python 3.2 and the way the check is implemented worked for 0.9 it
looks like nobody really noticed it's broken in the usual manner of
half-assed version checks: works for 0.9.0, doesn't work for
0.12.3 (because lexically 0.12.3 < 0.9.0).

Fix by using proper version parsing and comparing the result of that.

See also: odoo/odoo#28116

closes odoo/odoo#31553

Signed-off-by: "Xavier Morel (xmo)" <xmo@openerp.com>
2019-02-27 12:46:02 +00:00
Odoo Translation Bot 5a3ac7dece [I18N] Update translation terms from Transifex 2019-03-01 02:45:39 +01:00
Nicolas Lempereur 15ea753a0f [FIX] stock: show product qty on searched location
The location_id and warehouse_id fields on product.template are just
dummy field intended to add something in the context that will be used
to compute the data being rendered (eg. for location, the quantity
displayed is the quantity of the product in the searched location).

But the feature was broken at a point, and has been solved in 11.0 with
7c7b099273.

This solution was not implemented in 10.0 up to saas-15 since this is
not acceptable for a stable version.

This changeset is only for 10.0 up to saas-15 to implement the fix
differently.

opw-1945417
closes #31475
2019-02-28 12:42:18 +00:00
Jorge Pinna Puissant ee184bcf58 [FIX] event_sale: unit price changes with the qty
Have a product that is an event, with the price of 1500.
Create a ticket for this product in an event, with the price of 600.
In a SO, add a line with this ticket.

Before this commit, when you change the tickets qty in the SO the price
change from 600 to 1500.

Now, the unit price stays the one of the ticket.

opw-1940368
2019-02-27 12:40:39 +00:00
Odoo Translation Bot f014204447 [I18N] Update translation terms from Transifex 2019-03-03 03:15:43 +01:00
Can Tecim 3eeb34318a [CLA] backport of 5028507ea2 to 11.0
Remove the corporate CLA (only cantecim has contributed in the past) and signs
an individual CLA file instead

closes odoo/odoo#31495
2019-03-01 14:13:50 +00:00
qsm-odoo 395c169db9 [FIX] web_editor: wait for animation end before covering snippets
Part of https://github.com/odoo/odoo/pull/31440
opw-1929133

closes odoo/odoo#31440
2019-03-01 13:52:14 +00:00
qsm-odoo 8405c7f5fa [FIX] web_editor: properly check snippet options
Commit https://github.com/odoo/odoo/commit/c2b8d2a3017256e4ea60a3710bdaab6d1f693d81
made the mistake of considering each dropdown-menu individually while
all are considered to be the same when enabling a class. From saas-11.x,
commit https://github.com/odoo/odoo/commit/8ca92330b367d54fddf1c02089ee9d0bc3edbfdc
will group by dropdown menu but that will be another fix to make.

Part of https://github.com/odoo/odoo/pull/31440
opw-1929133
2019-03-01 13:52:14 +00:00
gustavovalverde c812cc4ebc [I18N] *: remove es_DO translations
Include commit 572d628 again, as it was lost with a forward port.

closes odoo/odoo#31479
2019-02-28 12:39:03 +00:00
Christophe Simonis 023dfaeb6b [FIX] core: correct ir.rule domain generation
Since 934c001680, fasly domains are
correctly OR'ed.
Models without group binded rules were then wrongly reduced to an
`AND FALSE` condition.
2019-02-27 12:27:24 +01:00
Christophe Simonis 4c46dd4f9d [MERGE] forward port branch 10.0 up to 2f139632d6 2019-02-27 10:42:03 +01:00
Nicolas Lempereur f8b38f64d3 [FIX] web: keep col group by on 2nd reload
In 187c32c2 some improvements were made for conserving/restoring group
bys on the pivot view.

This introduced an issue on the column group by:

- before reload, if we set manually a column group by (+ icon in the
  header) it would be saved and not lost (unless a context or filter
  in the search view override it)

- after reload, the following manually set column group by are not saved
  anymore on subsequent reload (the column group by at the first reload
  are set back)

This behavior is not normal since the behavior (conserving or losing
column group bys) should be the same at first reload or second reload.

The issue was caused by the duplication of group bys that were not
synchronized (one on the column root header, one on the pivot model
instance).

Without the change, the added test failed with: "Column groupby not lost
after second reload" and product_id is hidding from the object
pivot_column_groupby dictionary (having only "customer").

Using _.clone on initialRowGroupBys was necessary change because without
duplication of "groupbys", the initialRowGroupBys would be changed on
expandHeader which is unexpected.

opw-1941095
closes #31407
2019-02-26 14:54:46 +00:00