Commit Graph
124195 Commits
Author SHA1 Message Date
Carlos Fonseca 2aeb6d6a29 [FIX] account: add enterprise widget on settings in taxcloud
The module account_taxcloud was moved to enterprise but it's being promoted on
account settings as a community feature

closes odoo/odoo#27647
2018-10-17 09:01:57 +00:00
Martin Trigaux e3ff3b14dd [FIX] mass_mailing_sale: use if condition
There was already an endif but no linked if clause making the rendering crash

closes odoo/odoo#27876
2018-10-17 08:56:47 +00:00
Jeremy Kersten 1ccd148775 [FIX] website: multi website - auto public user
Before this commit
When user was in company A and try to create a second website for company B an
error was raised, because the search from user in company A don't find a public
user in company B and the same default user (public-user@company-B.com) was
created again before to be catched and raised by the sql contraint login_key.

Now we use '-' instead of '_' to avoid parser of email to detect it as invalid

After this commit, we don't have anymore the error:
    - 'You can not have two users with the same login!'
 or - 'Login must be a valid email address'

opw-1891315

closes odoo/odoo#27873
2018-10-17 08:52:58 +00:00
Luis Torres a66d42ff34 [FIX] account, membership: Fix use of date.min() in place of '0000-00-00'
Avoid traceback by:

TypeError: '>' not supported between instances of 'datetime.date' and
'str'

After that was migrated the use of native date/datetime for
Date/Datetime fields.

Based on
https://github.com/odoo/odoo/commit/960360afe478a8f7b9c456721b5591154952a37d#diff-dd671a54296b170ea1393dca1a5f7798L348

closes odoo/odoo#27819
2018-10-15 21:34:37 +00:00
Romain Derie b48d2b6b5e [FIX] website: Remove related website menus on module uninstall
Commit 850e1675eb improved the website.menu creation on module install
(eg: /shop for website_sale).
This commit aims to do the same on module uninstall.

Before this commit:
Uninstalling a website module would uninstall its website.menu (/shop) stored
on the default menu tree.
But the copies of that default menu, on websites, would remains.
Indeed, there is no direct link between the default menus and its copies.

More annoyingly, installing that website module again after uninstalling it
would create a new copy of the default menu, resulting in multiple same menus
on website.

Now, if the menu to be uninstalled is in the default tree menu, we remove all
its copies (the website.menu having that same URL).

Closes #27488, closes #27721
2018-10-12 12:11:09 +00:00
Robot Odoo 2e8712f859 [MERGE] mail: fix some moderation issues
This fixes two issues:

1. non-working moderation in chat window

Moderation on chat windows were not working: it was displaying
the moderation checkbox and decisions next to pending moderation
messages, but none of them were working in a chat window.
Those features should only work with the Discuss app.

2. cannot see self-authored, pending moderation messages

When a non-moderator user was posting a message in a moderated
channel and refreshes the page, he would no longer see his messages
that are pending moderation. Those messages should stay visible for
the author until a moderator makes a decision, e.g. reject the message.

Task-ID 1887963

closes odoo/odoo#27640
2018-10-17 10:52:17 +02:00
qdp-odoo 14884a18b4 [FIX] account_bank_statement_import: fix traceback on bank accounts creation
This completes the patch landed at https://github.com/odoo/odoo/commit/ac65a6df6d8461173d4059d0c431c90ae0622218 which was correct, except for that condition.

Fixes #27423

closes odoo/odoo#27870
2018-10-17 06:54:23 +00:00
Julien (juc) Castiaux 9d470c2097 [FIX] mail: replace "create_user_id" by "user_id" in My Act & tree
opw-1886369

closes odoo/odoo#27849
2018-10-16 13:04:37 +00:00
Florent de Labarre a858e4956c [FIX] hr_holidays: singleton error
Closes #27862

closes odoo/odoo#27866
2018-10-17 06:19:54 +00:00
Christophe Simonis 6d3477cbb7 [FIX] base: do not enforce module state in module declaration in xml file
Modules are automatically created with adequate state by introspecting
the addons available in addons-path during database initialization.
Auto-installable modules are also marked as `to install` at the same
time.

However, forcing their state as `uninstallable` will forbid them to be
installed.

This is the case of `web_mobile`.

The solution is to simply let the modules created via xml to have a
default state of `uninstallable`.

Moreover, this is a better default value.

closes odoo/odoo#27852
2018-10-16 13:04:03 +00:00
Denis Ledoux 3823dcacef [FIX] http, server: cross-platform memory limit management
This revision aims to support the memory limits
on Linux, Windows and MacOSX according to their own spefication
regarding their memory management.

Among others, it brings the possibility to
use the multi-workers mode on Windows and MacOSX.

e.g.
- Windows does not support `resource`,
  and therefore we skip to set the hard limit
- MacOSX allocates a large virtual memory for each process
  even if the memory is not actually used,
  and therefore using the VMS to limit the memory is pointless
  as it will always exceeds the default soft memory limit.
  We therefore choose to use the RSS to limit the memory

closes odoo/odoo#27848
2018-10-16 15:37:40 +00:00
qsm-odoo 574450bad8 [FIX] theme_bootswatch, *: prevent website to interfer with bootswatch
* website

Default web_editor/website colors and other bootstrap related variables
took precedence over some bootswatch overriddes. While we have the
control with Odoo themes, theme bootswatch is a library we do not want
to modify. This commit removes the web_editor and website customizations
when bootswatch is installed.

Closes https://github.com/odoo/odoo/issues/27821

closes odoo/odoo#27855
2018-10-16 14:26:37 +00:00
Alexandre Kühn 7b91a6483a [FIX] mail: simplify channel domain for message_fetch
It was simplified by https://github.com/odoo/odoo/commit/84af9382e2315964209bb065945b5d9116ddb11a
but the forward-port somehow failed.
2018-10-16 07:29:08 +00:00
Alexandre Kühn d3ceaa3adc [FIX] mail: improved message_fetch for moderated channels
There was two issues with the previous code:

	1. It was using a weak heuristic to determine whether the
	   current thread is a channel (ID is a number)
	2. For any channel, it was always passing `moderated_channel_ids`
	   with some values to the server, even though the channel
	   is not moderated at all.

This commit solves both issues by passing `moderated_channel_ids`
only for moderated channel. Also, this logic has been moved from
SearchableThread to Channel, since moderation makes only sense for
channels and channels are aware of whether they are moderated or
not.
2018-10-16 07:29:08 +00:00
Alexandre Kühn 4531348ff0 [FIX] mail: fetch self-authored, pending moderation messages
Before this commit, when a non-moderator user posts a message in a
moderated channel and refreshes the page, he could no longer see his
messages that are pending moderation.
2018-10-16 07:29:07 +00:00
Alexandre Kühn c0c2590a40 [FIX] mail: no moderation in chat window
Before this commit, a moderator of a moderated channel could see
commands on 'pending moderation' messages in a chat window, although
none of them work in chat windows.

Those commands only work in Discuss. Making them work in chat windows
is not trivial, because some code must be redesigned for this.

This commit disables moderation commands in chat window. Moderators
of such channel now see 'Pending moderation' on such messages in
chat window, and mouse-hovering on this annotation tells the user
to moderate those messages in the Discuss app.

Task-ID 1887963
2018-10-16 07:29:07 +00:00
Alexandre Kühn 510065ab67 [FIX] mail: remove outdated parameter in static xml comment 2018-10-16 07:27:44 +00:00
qsm-odoo 3b4eeee5ca [FIX] website: restore carousel item behavior
The animation that made all the carousel items have the same height
automatically was broken. This commit fixes it and improves its behavior
during edition.

closes odoo/odoo#27801
2018-10-15 13:20:29 +00:00
Nirali Sapra 4595c1b2bc [FIX] crm: correct typo
Change text in Website Lead Generation view

opw-1893403

closes odoo/odoo#27717
2018-10-16 15:36:34 +00:00
Nicolas Martinelli 5f0be01323 [FIX] purchase_stock: no destination address
- Create a product sold by Dropshipping
- Create a SO, validate
- Validate the corresponding PO
- On the picking, print the 'Picking Operations' or the 'Delivery Slip'

There is no delivery address printed.

The root cause of the issue is that the field `dest_address_id` of the
PO is empty. This is because `partner_dest_id` is not used anymore since
1e160dffd3.

opw-1892990

closes odoo/odoo#27850
2018-10-16 13:12:41 +00:00
Dharmraj Jhala 50b506996d [FIX] website: hide 'DateRangeButtons' inside SearchView on small device
In website dashboard, 'DateRangeButtons' are pushed into control panel's
SearchView and breaks the UI in small devices.

This commit fixes the issue by hiding them in small devices.

task-1884038

closes odoo/odoo#27082
2018-10-16 12:08:54 +00:00
Sébastien Theys 96ef4885a7 [FIX] website_theme_install: fix theme install/upgrade/remove
The goal of this commit is to handle 3 cases:
===============================================================================

- Correct loading of downstream themes for existing themes at (auto)install

  eg. If we have `theme_A` loaded on a website and we install `website_sale`,
    then `theme_A_sale` must also be loaded automatically on that website.

- Allow migration of every theme/website from the command line -u

    When there is such an explicit upgrade, the Odoo framework was already
    handling the upgrade of the modules, but it did not take care of reloading
    the appropriate themes on the websites using them.

- Allow upgrade of only one theme from the interface

    When using the UI to upgrade a theme, we want the user to be able to upgrade
    only the current website and not any other. This will upgrade the modules
    of all themes in the stream, but reload them only for the current website.

===============================================================================

- Move install/upgrade logic into the `write` method to automatically take
    advantage of base features such as correct order of dependencies.

- Create methods to correctly compute the dependency stream of a theme:
    upstream, downstream, and both ways.

    Upstream: limited to modules with name starting with `theme_`.
    Downstream: limited to modules with name starting with current theme name.

- Change `_update_records` method to better look for dependencies

- Change `button_choose_theme`:
    - Always upgrade the stream before installing a new theme.

- Move `_convert_to_base_model` logic into `theme_models.py`

================================================================================

There are a lot of flows to take into account, some of which may be combined
with others.

- Dependencies such as website_sale or website_blog can be:
    - already installed when loading a theme
    - (auto)installed later when the theme is already in use

  theme_A_sale and/or theme_A_blog has to be loaded on every website using
  theme_A as soon as it is needed.

  Not all themes have such dependencies.

- A theme can have other themes as dependency.
    - The proper dependency chain must be taken into account when installing
      or upgrading.

- Some themes do not have any dependency at all (theme_default, theme_bootswatch).

- Different websites can use the same theme.
    - All of them have to be upgraded when using -u
    - Only the current website must be upgraded when doing it from the UI

- Different websites can use different themes, including intermediary themes.
    eg. - website1 may use theme_A
        - website2 may use theme_B (depending on theme_A)

  Moreover, theme_A and theme_B might have downstream themes such as
  theme_A_sale and theme_B_sale (which depends on theme_A_sale).

In that case it is important when manipulating theme_B to also take into account
the relation it has with theme_A_sale even though theme_A_sale doesn't start
with the same name as theme_B and it is not in the direct stream of theme_B.

Authored by @seb-odoo with contributions from @dbh-odoo and @JKE-be
and precious help from @rde-odoo

PR: #27511

closes odoo/odoo#27838
2018-10-15 10:45:36 +00:00
Nicolas Martinelli de9437dad7 [FIX] account: display Account Holder
Make sure to hide the Account Holder field only when coming from a
Parter view, where it is pre-filled thanks to the context key.

opw-1892758

closes odoo/odoo#27832
2018-10-16 08:02:15 +00:00
Adrien Dieudonne 59b7dec69c [FIX] web: line chart x ticks labels overlapp
Before this commit, we tried to hide some labels depending
of the available size of the graph.
However, it doesn't worked when the graph is updated.

A much simpler solution is to use the scale’s automatic tick
generator implemented in D3.
So, in this commit, we realized that 'tickValues' is unnecessary
because data are passed correctly (see 'svg.datum(data);') and
labels are defined in 'ticksLabels'. There is nothing else to do.

We had to remove the skipped test because 'renderEnd' is not triggered
for line chart. We need to update nv.d3.

We already tried to fix this issue in the following commit:
https://github.com/odoo-dev/odoo/commit/c4937132a38873761fa0ac0b41c983b917cb52f1

Documentation:
https://github.com/d3/d3-axis#axis_tickValues

closes odoo/odoo#27828
2018-10-16 06:37:27 +00:00
Humberto Arocha 77a5afb58e [IMP] l10n_mx: Add stock accounts on the chart template definition
Closes #27746

closes odoo/odoo#27824
2018-10-16 06:13:28 +00:00
qsm-odoo f31ce5dc5e [FIX] web_editor: snippet options were not working if not pure text
Some snippet options uses an image or icon as description instead of
text (like the gradient option in some themes). Those were not working
anymore as the user click was considered on the image/icon instead of
the option itself.

closes odoo/odoo#27807
2018-10-15 14:15:06 +00:00
Nicolas Martinelli b532af7932 [FIX] pos_sale: report currency
- Set the compay currency in USD
- Set the rate of USD to 1.0, the rate of EUR to 2.0
- Create a EUR pricelist and associate it to the POS
- Sell a product in the POS at 200 EUR (= 100 USD)
- Go to Sales > Reporting > Sales

The POS order is evaluated at 200 EUR instead of 100 USD.

Since the sales report has been merged among the various sales channels,
we must keep the same logic when it comes to currency conversion.

opw-1890778

closes odoo/odoo#27786
2018-10-15 11:28:20 +00:00
Denis Ledoux b34b7d4270 [FIX] server.py: resource is not available on Windows
Rev. dcb56412d6
introduces limits for the threadedserver

It uses `resource` to set the hard limit,
but unfortunately `resource` is not available on Windows.

As in the GeventServer, we therefore set the resource
hard limit within a `if os.name == 'posix'` block,
as in rev.
c68b41bff2
2018-10-16 12:14:46 +02:00
Humberto Arocha f472ea705a [FIX] l10n_mx: Base Tax Received Account
Added account to cash basis and assign. On taxes with Tax Due Based on
Payment has been added as now is compulsory.

Closes #27739

closes odoo/odoo#27823
2018-10-16 06:02:50 +00:00
Julien (juc) Castiaux 71f188082f [FIX] mail: unicode character in email cannot be parsed
Sending email to addresses containing unicode characters
cannot be parsed by python and result in a UnicodeEncodeError.

This PR catch that specific exception and output a meaningful
error message.

Decision has been taken to not trigger any error message
client-side has it would have needed modifications on some
sensitive low-level backend code.

To reproduce:
- Configure odoo so it uses an email server
- Send an invoice to a partner whoose email address contains
some unicode characters (exemple: æøåÇÀ@example.com)

opw-1892409

closes odoo/odoo#27804
2018-10-15 13:42:58 +00:00
Alexandre Kühn 661483c026 [FIX] web: no duplication function for change_menu_section
Revision on https://github.com/odoo/odoo/commit/b7cf456560dc4fd7c1217ba90f0b5609466ede50

The commit above assumed the function `change_menu_section` was
mistakenly removed. However, it was turned into a handler function
and renamed according to our JS guidelines `_onChangeMenuSection`.

This commit removes the duplicated logic by removing the
function `_onChangeMenuSection` and using `change_menu_section`
as the handler for the bus event `change_menu_section`.

closes odoo/odoo#27809
2018-10-15 14:37:21 +00:00
Lucas Perais (lpe) f2ff47403f [FIX] website: multiwebsite supports optional 'subviews'
on the webiste sale, have a category with a subcategory
Then in the customize menu, enable "ecommerce categories"

Before this commit, the option to have collapsible categories wasn't there
This was because, due to multi_website, the children views of the "categories"
that were inactive weren't written upon when copying their parent

After this commit, the functionality is back

OPW 1893169

closes odoo/odoo#27796
2018-10-15 12:46:16 +00:00
Nicolas Martinelli 42c6db5e01 [FIX] pos_sale, sale: wrong currency stored
- Set the compay currency in USD
- Set the rate of USD to 1.0, the rate of EUR to 2.0
- Create a SO for a product costing 100, validate
- Go to Sales > Reporting > Sales

The product is evaluated at 400.

This is because the currency rate sotred is incorrect. The rate stored
is 0.5 instead of 2.0.

opw-1890778

closes odoo/odoo#27769
2018-10-15 08:16:45 +00:00
Nicolas Seinlet 38f6983df7 [FIX] mass_mailing: don't forward context
Don't forward context from mass mailing to partners view.
When grouping mass mailing by state, passing context makes
Odoo trying to group partners by state, and then get a traceback.

closes odoo/odoo#27775
2018-10-15 08:54:52 +00:00
Romain Derie 2018d0be35 [FIX] website_sale: wrong form selector on shipping change
Class `.hide` was replaced by `.d-none` with BS4 7f10b55a50
But the JS selector was still trying to retrieve the `.hide` form which lead to
an unexisting element, thus sending empty form.

Fixes #27714, closes #27774
2018-10-15 09:03:10 +00:00
Denis Ledoux dcb56412d6 [IMP] server.py: implements limits (real) for multi-threading
The multi-threaded server graceful stop policy is now as follows:
 - shutdown the server so it does not accept new requests (the socket remains open),
 - wait for remaining requests to finish up to a certain time (e.g. 1 second)

Previously, the multi-threaded server waited indefinitely for requests to finish.

The reload policy when a thread reaches a limit is as following:
 - wait there is no other running requests, up to 1 minute
 - then stop the server (with the above graceful stop policy applied),
 - then reload the server, therefore accepting new requests again.
- The socket is not closed during this operation.
  This allows the inverse proxy to queue the requests arriving during
  the time the server is shutted down and therefore not accepting new requests.
  This allows a transparent restart for the users, as their
  requests done during the shutting down of the server are not rejected but queued.
- When a thread reaches a limit, we reload the whole threaded server instead of
  just killing this thread. Killing a thread is not a good practice as it could
  lead to dead locks in case these threads acquire locks.
  Killing a thread that acquired a lock would lead for this lock to never be
  released.

Regarding the override of `_handle_request_noblock`:
  In `socketserver`,
  when `shutdown` is called
  `__shutdown_request` is set to True,
  https://github.com/python/cpython/blob/6a7b3a77b4b2be0badd24ee5f0fdbaa2e0e79c3d/Lib/socketserver.py#L241-L249
  This tells the server to no longer accept requests. Callstack below:
  - https://github.com/python/cpython/blob/6a7b3a77b4b2be0badd24ee5f0fdbaa2e0e79c3d/Lib/socketserver.py#L231-L234
  - https://github.com/python/cpython/blob/6a7b3a77b4b2be0badd24ee5f0fdbaa2e0e79c3d/Lib/socketserver.py#L308
  - https://github.com/python/cpython/blob/6a7b3a77b4b2be0badd24ee5f0fdbaa2e0e79c3d/Lib/socketserver.py#L487

  Unfortunately, this is very possible the HTTP server is already polling for a request when this flag is set
  to `True` by the main thread:
  - https://github.com/python/cpython/blob/6a7b3a77b4b2be0badd24ee5f0fdbaa2e0e79c3d/Lib/socketserver.py#L232
  As the poll_interval is set to 0.5s:
  - https://github.com/python/cpython/blob/6a7b3a77b4b2be0badd24ee5f0fdbaa2e0e79c3d/Lib/socketserver.py#L215
  if a request arrives within 500ms after the server is shut down,
  the request is accepted, while the server is shutdown.

  We want to prevent this: Once the server is marked as shut down, we want it to no longer accept requests:
  so the inverse proxy knows it has to queue the request.

closes odoo/odoo#24982
2018-10-15 07:46:52 +00:00
qsm-odoo 4691c6be18 [FIX] website_blog: missing padding on s_latest_posts descriptions
closes odoo/odoo#27693
2018-10-11 16:41:08 +00:00
Odoo Translation Bot e774b2cb1c [I18N] Update translation terms from Transifex 2018-10-14 01:23:43 +02:00
Romain Derie 53f72dcab1 [FIX] website_sale: /shop 500 error if category is not model converter
The /shop route can take a `category` argument (a model converter).
  `/shop/category/<model("product.public.category"[..]):category>`

But if that `category` argument is passed through URL query string
(?category=9), it will raise an error when doing
  `category.can_access_from_current_website()`
as it is an integer since it did not went through the model converter

Note: Among probably others, that type of route is used when changing product
      order on shop

Closes #27490, closes #27724
2018-10-12 12:57:03 +00:00
Martin Trigaux 9649920987 [FIX] doc: add mention about rtlcss
Since 12.0, odoo support RTL interfaces but requires the package rtlcss

closes odoo/odoo#27729
2018-10-12 13:45:52 +00:00
Sébastien Theys c73efc27b7 [FIX] web: stabilize sequence for new records on last page
Before this commit, the compute sequence was relying on the fact the ID was used
as a secondary order key to get the right result.

This is necessary when adding items between pages because we don't resequence
the following elements.

However this was not necessary when adding new elements on the last page since
there are no following elements to resesquence in that case.

PR: #27639
2018-10-12 14:29:51 +00:00
Christophe Simonis a5772d4338 [MERGE] forward port branch 9.0 up to 75388edd9c 2018-10-09 16:23:35 +02:00
Lucas Perais (lpe) cba5f7a98f [FIX] web: fetch dependency fields in x2many
Image field widget need the __last_update field alongside them
for caching purposes, though that field should never be present explicitly
in the views

Before this commit, the dependencies of field widgets were not merged into
the model's fields definition, creating a traceback when adding an image field widget
into a x2many list

After this commit, there is no traceback and the image field works properly

closes #27545
2018-10-09 14:16:56 +02:00
Christophe Simonis f6ea6ce951 [MERGE] forward port branch 11.0 up to c576800813 2018-10-09 13:55:53 +02:00
TWA 983c7e8152 [IMP] mail,crm,...: Replace occurences of name_get()[0][1] by display_name
Purpose
=======

display_name is equal to doing name_get()[0][1]

Replacing name_get()[0][1] by display_name could be good for 2 things:
- Uniformization of the code
- Probable optimization if name_get is used inside a for loop on a recordset (as the values will be prefetched and put in the cache).

TaskID: 1849250

closes odoo/odoo#26341
2018-10-09 11:28:00 +00:00
Christophe Simonis a799b13292 [REL] bump alpha version 2018-10-09 11:40:02 +02:00
Christophe Simonis 835b77ba94 [MERGE] forward port branch 12.0 up to ebe43bad9e 2018-10-09 11:37:30 +02:00
Alexandre Kühn 5c12a664d5 [FIX] web: click on href inside kanban record
Before this commit, when clicking on a link in a kanban
record having `href` that is set, it was opening the record
and accessing the `href`.

The intended behaviour is to not open a record if any children
component of the record contains either a click event or is
a link with `href`. The former was correctly handled, but not
the latter.

This commit fixes the issue by preventing opening the record
when clicking on a inner link with href from a kanban record.

Closes #24664

closes odoo/odoo#27529
2018-10-09 08:39:50 +00:00
Lucas Perais (lpe) 62cbc5f240 [FIX] board: translate custom views according to current user
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 odoo/odoo#27574
2018-10-12 08:36:19 +00:00
Odoo Translation Bot 44069cc4bd [I18N] Update translation terms from Transifex 2018-10-14 03:21:07 +02:00