Commit Graph
123307 Commits
Author SHA1 Message Date
Nans Lefebvre 2dbce5e6ff [FIX] hr_holidays: handle all holiday types in onchange
The holiday_type can be 'employee', 'company', 'department' or 'category'.
However in the onchange of holiday_type, for some reason nothing was done
in the case of the 'company' value.

As a result, the default 'employee' would set the employee_id,
but then changing the type to company would not remove the employee_id.
It follows that the lucky employee would get two allocations instead of one.

opw 1938498

closes odoo/odoo#31656

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-07 13:44:45 +00:00
Jeremy Kersten afd2019fd4 [FIX] website_blog: fix align in grid view mode
bug from bs4

opw-31574

closes odoo/odoo#31676

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-03-07 14:10:20 +00:00
Romain Derie edfa62bbae [FIX] website_sale: remove race condition on variant tour
Before this commit, there was a possible race condition in the
`tour_shop_dynamic_variants` tour. Indeed, the `click add to cart` would be
triggered before the `click on the second variant` RPCs are done.

Trigger on `.oe_price .oe_currency_value:contains("0.00")` was supposed to
check that condition but it was not strong enough.

Then, clicking on add to cart would not call `create_product_variant` as it
would still have the first variant id in the hidden input instead of "0".

closes odoo/odoo#31670

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-03-07 15:12:43 +00:00
Romain Derie 8c91670a77 [FIX] website_sale: remove useless search condition
Searching on website is enough. Plus, it will avoid bugs if admin
change sale team of the order or the sale team type.

closes odoo/odoo#31669

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-03-07 15:18:07 +00:00
Christophe Matthieu b1d80841fc [FIX] base: allow to t-raw="0" with empty content
Before this commit, when doing `<t t-raw="0"/>` to print the t-called
content, it was printing "[]" if the content was left empty.

closes odoo/odoo#31668

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-07 15:06:41 +00:00
Gorash 05c095a73b [FIX] website: edition of links on safari and firefox is now possible
closes odoo/odoo#31629

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-07 16:03:03 +00:00
Baptiste Vergote f3f8430600 [FIX] base: use correct state name in res.partner import template
State from the template was 'CA' for California - not recognized on import
Changed it to 'California' to match with the db data

opw 1943904

closes odoo/odoo#31556

Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
2019-03-07 13:54:17 +00:00
Romain Derie 3f5a6f423d [FIX] website: fix install theme error
Commit 5a81d8883 fixed the COW view deletion on module update but introduced an
error when installing a theme.

Indeed, when installing a theme, the first step is to remove the currently
installed theme from the website (by unlinking its ir.ui.view).

Commit 5a81d8883 introduced the fact that deleting an ir.ui.view during a
module uninstall also search and delete the COW views, calling
`_get_specific_views` (that expects a singleton).

When installing a theme, it calls `_theme_cleanup` which search COW views and
unlink them. If not cow view, unlink is called with an empty record set raising
the singleton error.

closes odoo/odoo#31662

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-03-07 13:36:10 +00:00
Nans Lefebvre ffbdea57f5 [FIX] sale: correctly propagate contexts
Commit d139e92c62 set the force_send to True
unless there is an explicit mail_notify_force_send set to False in the context.
The _get_eval_context puts mail_notify_force_send to False in the context,
but it might be lost before reaching that method call.

Launch a cron that starts a transaction, see if it goes through,
and rollback if it didn't,
then the mails send inbetween will be sent every time the cron restarts.
E.g. _cron_post_process_after_done.

opw 1921112
opw 1945953

closes odoo/odoo#31605

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-06 12:49:14 +00:00
Swapnesh Shah b8ff6754fb [FIX] purchase_requisition: Use correct UoM field
uom_po_id is the 'Purchase Unit of Measure' and is required so should be used
here.
This way, the onchange matches the behaviour of purchase module or the reset of
the purchase_requisition code

closes odoo/odoo#29717

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-07 08:45:42 +00:00
Martin Geubelle dcf8c67fe3 [FIX] web: hide CopyClipboard widget button when pointless
The widget has been moved in rev. odoo/odoo@15f3bbe but was not very generic.

In particular, there was a traceback when clicking on the button if the field
had no value (the button was displayed for readonly fields in create mode).

The button is now only appended in readonly mode (a `button` inside an `input`
or a `textarea` is not very DOM friendly) if the field has a value.

Task 1941996

closes odoo/odoo#31635

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-06 16:11:33 +00:00
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