Commit Graph
121927 Commits
Author SHA1 Message Date
Arnold Moyaux 4f080a6605 [FIX] mrp, purchase_stock: wrong company on rules
Usecase to reproduce:
- Install a database with demo date and mrp or purchase

The buy/manufacture rules have a wrong company for warehouses
in company 'My company, Chicago'

It happens because the warehouse is not specify in the create
values. In this case it creates the rules and set the user current
company as default.

This commit specify the company during the create call.

closes odoo/odoo#28682
2018-11-14 13:49:24 +00:00
Lucas Perais (lpe) 50e5f73b4e [FIX] fields, test_new_api: monetary related custom
This commit allows for not copying the currency_field attribute
of a monetary field when the monetary field is related,
and when the currency_field attribute is not explicit

Before this commit, the currency_field attribute on the related monetary
was set as the one on the distant model

After this commit, the currency_field attribute takes the field on the
current model

Though the test may appear like an incoherent use case,
it is on the contrary totally legit, as web_studio allows it

OPW 1903113

closes odoo/odoo#28144
2018-11-14 15:14:36 +00:00
Denis Ledoux c41902a21c [FIX] mail: mail queue is interrupted if a recipient is not ascii valid
This is related to revision
71f188082f

This is nice to have a meaningful explanation
for the user to understand why his mail is not sent,

this is better to not interrupt the mail queue when doing so.

Because of the above revision,
when the mail queue iterated on a mail failing because
of an ASCII encoding issue,
the mail queue was interrupted,
and on the next cron call it failed again and again
on the same mail, therefore leading to the mail queue
to never be processed.

Fixes #27804
2018-11-14 17:18:34 +01:00
Christophe Monniez c2827f6b72 [FIX] l10n_be_invoice_bba: remove warning at install
The malformed manifest is causing a warning when testing all l10n.

closes odoo/odoo#28680
2018-11-14 13:29:44 +00:00
Nicolas Seinlet 37306b85de [FIX] project: project var is not defined
closes odoo/odoo#28678
2018-11-14 13:22:55 +00:00
David Beguin 3715104e98 [FIX] mass_mailing : returns set of normalized email in _get_opt_out_list
If a recipient has a formatted email address like 'A <a@b.com>', the returned
opt_out list must contain normalized email ('a@b.com') in order to be comparable
during the get_mail_values of the mail.compose.message.
Otherwize, It won't match.

Task ID : 1909314
Closes PR #28667
2018-11-14 11:23:44 +00:00
qsm-odoo 6b9625e098 [FIX] website, *: enforce correct UI text-muted color
* web_editor

- Restore the preservation of Odoo text-muted color (the rule became
  !important with BS4 and had thus to become !important in the
  preservation mixin).
- Preserve base design in the "new content" menu (which now uses
  text-muted). Indeed, in some themes, the "new content" links were not
  even visible anymore.

closes odoo/odoo#28666
2018-11-14 10:59:34 +00:00
Géry Debongnie aa18aaa292 [FIX] web: restore formview mode when coming back (breadcrumbs)
Before this commit, when the user is in a form view (edit mode) and
click on a stat button, a new action is added to the action stack.  When
the user then comes back to the form view by clicking on the breadcrumb,
it is supposed to be in readonly mode.  Before this commit, this was not
the case.

This bug comes from the action manager refactoring, which removed the
view manager. With this commit, we add a new action lifecycle method
which is called when the action is restored.

Note that this commit implicitely changes the semantic of actions with
'target=inline'. As far as I can tell, this only applies to the settings
form view, which can easily be fixed by overriding the restore hook.

closes odoo/odoo#28663
2018-11-14 11:19:40 +00:00
Nicolas Martinelli 79d29c51df [FIX] base_import_module, cli: deploy
The use of the `deploy` command always fails because of an incorrect
CSRF token since commit 9bae56acd4. Indeed, the latter
re-introduces the session rotation, i.e. the session ID is changed at
authentication.

Practically, what happens server-side is:
- authentication
- generate CSRF token
- create the response with the token and a change of session ID

At this point, the token generated is not correct anymore since it is
based on the 'old' session ID. Therefore, when it is reused at
uploading, an error is raised.

It is actually possible to simplify the process by performing the
authentication and the file upload in a single request. There is indeed
no real use of extracting the authentication, since the request is then
only used to upload the module.

opw-1902863

closes odoo/odoo#28653
2018-11-14 09:40:17 +00:00
Aaron Bohy 4df0a1e31a [FIX] web: wrong tests
This commit fixes two tests that became meaningless after tweaks
in production code:

 - form_tests: use two char fields, as integer fields can't be
   unset since rev. c62a4edcb
 - pivot_tests: the button is disabled since rev. 4f4f111, but
   simulating a click with jQuery bypasses the disabled attribute

This commit also removes unecessary overrides of mockRPC. Those
overrides existed  because the attachments part of the sidebar
used to make a search_read RPC, but this has been removed at rev.
1dbb555.

closes odoo/odoo#28650
2018-11-13 19:56:55 +00:00
Arnold Moyaux a172166a8b [FIX] purchase_stock: merge po by default
Usecase to reproduce:
- Create a product with a vendor and mto/buy route checked.
- Create 2 SO and confirm them

The system generated 2 RDF instead of a single with 2po lines (same than
v11). It happens because the propagation option of buy rules is
leave empty in v11 and Propagate in v12. It was unintentionally removed
by commit 1e160dffd3

This commit set leave empty as default value for buy rules.

opw-1904165

closes odoo/odoo#28637
2018-11-13 14:22:51 +00:00
Nathan de Pryck 3af06bf47c [FIX] stock_account: view priority
In some case, this view was used to perform a search of product.product.
Before, this modificiation all the search view had the same priority
which means that depending on some situation, the wrong search view was
loaded.

opw-1903611

closes odoo/odoo#28634
2018-11-14 09:35:26 +00:00
len-odoo 93c6d22e01 [FIX] sale_timesheet: fix incoherent demo data
The uom unit of a product on a sale order line was not with the product uom.
As a result, an error would be triggered when trying to edit the SO, without the
possibility to fix it (as the field is not in the view).
Odoo takes a stand against incorrect demo data.

opw 1906315

closes odoo/odoo#28641
2018-11-13 15:11:40 +00:00
Goffin Simon 51982f9199 [FIX] website: Impossible to link an analytic account
Steps to reproduce the bug:

- Go to Website > Dashboard > Analytics and click on "Link my analytics account"
- Enter some data and save

Bug:

A traceback was raised: TypeError: website_set_ga_data() missing 1 required
positional argument: 'website_id'

opw:1905874

closes odoo/odoo#28636
2018-11-13 16:12:47 +00:00
Lucas Perais (lpe) 40b4584b00 [FIX] *: boolean in domains should have value True or False
Because the JS cannot handle 1 or 0 being equivalent to true or false, the views should comply
Issues specifically arise in the kanban view when, instead of reloading every record with python,
the JS actually computes which record should be displayed by reinterpreting the domain

From a user point of view, on a fresh db with CRM installed, go to the app kanban view
Click on the contextual menu of the CRM kanban label, click uninstall

The modal opens, but click cancel. The kanban label of the kanban view has disappeared

This is due to commit 33ba61bfdb, which prevents reloading all the view
for performance purposes

This commit prevents the label from disappearing

OPW 1903534

closes odoo/odoo#28484
2018-11-13 10:09:03 +00:00
Humberto Arocha 09fde26854 [FIX] account: Calling oldname cash_basis_account instead of new field
closes odoo/odoo#28594
2018-11-12 20:16:10 +00:00
Robot Odoo 5f8d3c61be [MERGE][FIX] mail: preview not linked to any document
This fixes two issues relating to previews in the systray messaging menu
that are not linked to any document:

1. Clicking on such preview now redirects to Inbox

There was a traceback, because it was attempting to open a document.

2. Marking a read one of those previews now only marks this preview

It was marking all previews not linked to a document as read.

Task-ID 1891350
Task-ID 1907159

closes odoo/odoo#28462
2018-11-14 08:13:29 +01:00
Goffin Simon 8efa9e5fe9 [FIX] website_sale: Impossible to modify text in "shipping" area on e-commerce
Inspired from this commit: 90219a7e0a

It's not possible to modify the shipping area description on a product in
the e-commorce.

opw:1908308

closes odoo/odoo#28624
2018-11-13 12:43:46 +00:00
Vincent Schippefilt fe7fd9c0d7 [FIX] web: fix qweb test that fails on windows
When the qunit tests runs they are expecting the new line to be the character 10,
but in windows the new line is 10+13.
The test has been updated to ignore the character 13.

closes odoo/odoo#28599
2018-11-13 08:14:07 +00:00
Alexandre Kühn 8af392865d [FIX] mail: mark as read per preview
Before this commit, when there was several previews
on the messaging menu that were not linked to any
document, marking one of them as read had the unintended
behaviour to mark all of them as read.

Steps to reproduce:

- Admin with notification management as 'Handle with Odoo'
- Demo assign Admin to two different tasks
- Admin mark one preview as read
> Both previews notifying assignment to a task have been
  marked as read

This is caused by the fact that messages of those previews
are not related to any document. As a result, when marking
one preview as read, it maps related messages to mark as
read, which was taking into account all messages that are
not related to any document.

With this commit, previews now tracks message IDs, so that
marking one preview as read only mark the related messages
as read.

Task-ID 1907159
2018-11-07 10:20:49 +00:00
Alexandre Kühn b3e450abca [FIX] mail: open inbox on preview click not linked to any document
Before this commit, when the user clicked on a preview in the systray
messaging menu that is not linked to any document, there was a
traceback.

Steps to reproduce:

- Admin sets notification management to "Handle with Odoo"
- Demo user assigns Admin to a task
- Admin clicks on preview from being assigned to a task

Those are previews from notifications received from the inbox,
which are not related to any document. It attempts to open a
document that does not exists (i.e. no model/id).

With this commit, when such a preview is not linked to any
document, it now opens Discuss with Inbox.

Task-ID 1891350
2018-11-07 09:35:54 +00:00
qsm-odoo 4f9a0cb4fc [FIX] website: add some compatibility for old BS3
This commit adds a compatibility file which can be added on demand by
enabling its associated view. This will basically map old BS3 classes
and structures to the related style with BS4.

closes odoo/odoo#27981
2018-10-23 08:53:19 +00:00
qsm-odoo 517d184107 [FIX] website: no text-primary in accordion snippet
For some unknown reasons, the text-primary class was added on each
card-header of that snippet... while the default link color is already
primary by default.

This was however breaking some themes whose primary color would not fit
in card-header while the link color (different from the primary one)
would.

closes odoo/odoo#28627
2018-11-13 13:06:42 +00:00
qsm-odoo f16bd3edca [FIX] website: restore theme contact us page
The page appeared broken in some themes as the "contact us" button was
against the bottom of the #wrap element.

closes odoo/odoo#28623
2018-11-13 12:29:12 +00:00
Goffin Simon b879dca025 [FIX] sale: Payment terms from SO
Let's consider a customer C with payment terms P1 set on it

Steps to reproduce the bug:

- Create a SO for C with payment terms P2
- Confirm the SO and generate the invoice

Bug:

The payment terms on the invoice was P1 instead of P2
This fix allows to keep the same behavior as in 11.0
Introduced by: f1b2d165fb

opw:1905710

closes odoo/odoo#28585
2018-11-13 10:36:58 +00:00
RomainLibert 58e4db6433 [FIX] hr_holidays: use department members as employees
In https://github.com/odoo/odoo/commit/04250cff1be32c115804dd2a55eb0242df6abf52 a typo was introduced, this commit
aims at fixing it.

closes odoo/odoo#28609
2018-11-13 10:06:09 +00:00
Nicolas Martinelli 22b979533a [FIX] product: dynamic variant creation
The new product configurator introduces the possibility to create
variants dynamically. One of the main goal is to be able to create
product templates with **many** attributes and values, but not generate
all variants automatically. Only the necessary variants are created
on-the-fly.

However, it turns out that **many** dynamic attributes and values still
fails. For example, create a product with 10 attributes, 10 values for
each. This allows 10^10 theoretical combinations; although the variants
are not created, the creation of the product template fails.

The reason is that the `variant_matrix` contains the list of all
combinations, which causes a `MemoryError`.

An easy modification to improve the process is to keep an iterator
instead of generating the list. This avoids the `MemoryError`, but it
remains necessary to go through all combinations three times, which
would take too much time.

Therefore, some refactoring is necessary in order to keep the same
logic, but avoid going through any huge list. Here are the improvements:

1. Skip the creation part if nothing will be created.
   If any attribute is dynamic, no variant is created. Therefore, we can
   perform the check upfront and skip the variant creation part if
   possible.

2. Stop the creation loop as soon as possible.
   There is an hardcoded limit of maximum 1000 variants to create. We
   can perform this check along with the list creation instead of
   checking at the end.

3. Determine if a product has valid attributes in a different way.
   The existing logic is safe but expensive: we check that all attribute
   values of a product are part of the possible combinations. This can
   be simplified by checking if (1) all attribute values of a variant
   are part of the accepted attribute values of the template and (2) a
   variant uses all attributes of the template. The second check is
   mandatory to delete existing variants when an attribute is added to
   the template.

Thanks to these modifications, we at worst go through 1000 possible
attribute values combinations. It might still be possible to optimize
step 3 with a fancy SQL query which would retrieve all (in)valid
products at once. Hopefully this won't be necessary and the optimized
logic will be enough.

opw-1902392

closes odoo/odoo#28530
2018-11-13 08:10:18 +00:00
Martin Trigaux 95ceedb7fa [FIX] test_main_flows: adapt tour
To reflect changes in enterprise

closes odoo/odoo#28600
2018-11-12 08:50:52 +00:00
Nicolas Seinlet 80cef9e8c5 [FIX] mail: faster blacklist search
For the special case of is_blacklisted, and due to
the size of the tablers to handle, it's faster to
filter some records rather than searching the whole
res.partner table

closes odoo/odoo#28028
2018-10-22 12:45:17 +00:00
qsm-odoo 273126ab34 [FIX] (website_)mass_mailing: restore popup design
Compatibility: rebuilding a correct modal from user database content.
Since the first version, the modal is saved in databases directly but
has never used a correct structure. While it was working with BS3, it is
not with BS4. This was breaking the design and prevented the modal to
be able to close.

task-1889341

closes odoo/odoo#28589
2018-11-12 14:50:17 +00:00
qsm-odoo 0170639262 [FIX] website: restore customize menu loading
When opening the customize menu as soon as the page became visible, an
RPC crashed and the toggable options did not appear anymore. This
happened:

1) DOM is ready.
2) The user click on the menu.
3) At the same time, the customize menu is initialized (`attachTo`),
   its event handlers are bound and the async `willStart` method is
   called.
4) The event handler for the user click is called... and crashes as
   requires a variable which would have been set in the `start` method.

The bug did not appear in previous versions as the handler was not using
the standard system and bound the event handler "by hand" in the `start`
method.

Maybe `attachTo` should not bind event handlers before the `willStart`
method is completed; this would be a subject for the master branch. This
commit solves the problem by setting the required variable in the
`willStart` method instead of the `start` method.

closes odoo/odoo#28578
2018-11-12 12:53:44 +00:00
Goffin Simon 253676da54 [FIX] product: Fields in the pricelist are not fully displayed
Steps to reproduce the bug:

-Activate the option "Prices computed from formulas (discounts, margins, roundings)" on the pricelist.
-On the pricelist, click on Edit and select a product item.
-Select "Formula" as Compute price

Bug:

The fields price_surcharge and price_max_margin were not fully displayed.

Introduced by: https://github.com/odoo/odoo/commit/9de1bc0eef6f5bfaa2a8d745431caa361ae91548#diff-e0b4a29125b1abccb0318498970342fcL61

opw:1907217

closes odoo/odoo#28514
2018-11-12 12:58:44 +00:00
Robot Odoo 5e987bc020 [FIX] event, mail: company in mail footer
closes odoo/odoo#28416
2018-11-12 14:59:24 +01:00
Swapnesh Shah 70a55a33c6 [FIX] point_of_sale: Tips product available in pos
From 12.0 tips product from pos moduleis not available in PoS by default

closes odoo/odoo#28569
2018-11-12 11:16:41 +00:00
Julien (juc) Castiaux de6a8cefd0 [FIX] mail: no company printed in footer
In a multiple company account, when a parter is doesn't have a
company, the mails he revieved have "Send by using odoo" as footer.

This PR correct that by setting the footer to "Send using odoo" when
there is no company.

opw-1894825
2018-11-06 15:11:07 +00:00
Nicolas Lempereur a403155dec [FIX] website: rtl on frontend when logged out
Before this commit, RTL on frontend was only enabled for connected user.

To have RTL, we add the direction on the element, and the RTL version of
the stylesheet for the applicable languages are generated thanks to rtlcss.

opw-1892757
closes #28434
2018-11-06 12:28:58 +00:00
Odoo Translation Bot dcc077afc5 [I18N] Update translation terms from Transifex 2018-11-11 01:26:46 +01:00
Nicolas Lempereur 5d5cd8c052 [FIX] website_partner: correct demo data root->admin
The root user is now the sudoable superuser. The demo data should be
over admin user and not root user.

opw-1907486
closes #28534
2018-11-09 18:26:04 +00:00
qsm-odoo 54a6783040 [FIX] website_sale: shop search with collapsible hierarchy
When the eCommerce /shop page was configured to use collapsible product
categories, performing a search on a product whose eCommerce category
was a child of another one produced an error.

This was due to a typo made with https://github.com/odoo/odoo/commit/8889d00f4f702bb22416b0751b46dac28411d46d

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

closes odoo/odoo#28532
2018-11-09 13:23:32 +00:00
Adrian Torres 2824efee4b [FIX] base: ensure python version >= 3.5
Odoo 12.0 does *not* officially support any python version below 3.5,
but no effort had been made to gracefully announce this to the end user
if they were to run Odoo in an unsupported python version.

This is done because Odoo 12.0 uses py3-only constructs which can
and will raise different errors if ran in python 2.

With this patch, Odoo will display an appropriate error message and won't
launch at all unless it is being run with python 3.5 or greater.

closes odoo/odoo#28502
2018-11-08 11:53:35 +00:00
Raphael Collet 7a0fb3de1e [FIX] account: speedup the creation of the chart of accounts
Make the CoA template instantiates accounts and other records in batch.

closes odoo/odoo#28480
2018-11-09 10:53:46 +00:00
Aaron Bohy 45bc7c92f8 [FIX] web: extend the fieldsInfo of a view with the origin view to evaluate extra fields
Suppose you are editing a SO to add a new line. Depending on the configuration,
a sale order line wizard may open (e.g. if packages are activated).
This wizard is a form view, opened from the tree view of the sale order lines.
We have commit 8e5156938a
that adds extra fields from the originating view.
(However it doesn't work if the other view is inlined, so we modify this part to
add the extra field even in this case.)
Then we need the field info from the origin view in the target view;
we do so by extending the former with the content of the latter.

opw 1904337

closes odoo/odoo#28441
2018-11-09 15:04:18 +00:00
Nicolas Lempereur 1620c5b69c [FIX] account: test typo forward-port 3e4b9d4d66
also reference_type is removed from the model b5bb5bd42

closes #28536
2018-11-09 15:54:04 +00:00
Christophe Simonis 3e4b9d4d66 [MERGE] forward port branch saas-11.4 up to 639bd89635 2018-11-09 14:51:55 +01:00
len-odoo 9e8c63e1ec [FIX] stock: always show the detailed operations icon if one technical group is active
Stock moves show a detailed operations icon if the tracking, locations, or
consignment allow to be configured.
However it did so on a per move basis, only displaying it if the considered move
has some of these features.

This fix makes it that the "detailed operations" icon is always displayed if at
least one group of group_tracking_lot, group_stock_multi_locations, or
group_tracking_owner is active, or the move is tracked,
unless the move picking type already does show detailed operations.

opw 1893106

closes odoo/odoo#28072
2018-11-09 09:52:18 +00:00
Christophe Simonis 639bd89635 [MERGE] forward port branch saas-11.3 up to 94a9fc9902 2018-11-08 17:08:03 +01:00
Christophe Simonis 94a9fc9902 [MERGE] forward port branch 11.0 up to e5c8071484 2018-11-08 14:13:52 +01:00
len-odoo d60f2ab0e2 [FIX] mail: only generate one next activity when setting automated actions at record update
Create an automated action to create a new activity on update of a record
(e.g. a CRM lead).
At update, many fields recompute may be triggered, triggering as many write.
Thus it would generate many activities.
We simply do nothing if we are in a recompute.

Coauthored by rco

opw 1904156

closes odoo/odoo#28498
2018-11-08 10:40:58 +00:00
Nicolas Lempereur 9799dd294d [FIX] mail: enable composer after message sent
c5dc0b2f39 disabled send button on composer sent.

But this is only needed for chatter composer, other composers directly
send the message and are not refreshed asynchronously.

So for other composer, the send button worked one time but then was
disabled and the only way to sent was ENTER (on basic composer) or
CTRL+ENTER (on extended composer).

With this fix, disabling the button is done only for chatter composer.
Also the behavior of not clearing the message if there was an error is
introduced back.

Without change in code, added test fails with:
 "Should keep unsent message in the composer on failure" (result: "")
 "Send button should be re-enabled on message post failure" (result: true)

issue found when checking opw-1904029
closes #28475
2018-11-09 08:10:24 +00:00
Toufik Ben Jaa fe518f1fea [FIX] website_sale: performance when creating a cart
- When creating an eCommerce cart using the Public User, the code tries
  to access all the sale orders linked to it.

  Depending on the count of sale orders linked to the partner, the
  loading can take a lot of time.

  To avoid this, we only search for the sale orders of connected users
  and we only retrieve the last one.
2018-11-08 11:16:02 +01:00