Commit Graph
123535 Commits
Author SHA1 Message Date
Thibault Delavallée cc3ca63544 [FIX] sale: fix wording of link when sending a quotation by email
Since commit 34c47eecd3 wording of link when
sending a quotation by email is broken. Indeed has document in draft is
not correctly considered as having to be signed and/or paid the link is
not labelled correctly.

This commit fixes it. Parameter is also renamed to be more understandable.
This commit is linked to task ID 1910532 and PR #29849 .

closes odoo/odoo#30953
2019-02-08 12:49:03 +00:00
Hetal Dhanak ef61713418 [IMP] sales: make sign and pay in portal a continuous flow
Purpose of this commit is to make a single flow to sign and pay in the
customer portal. When having signed its document popup for payment is
automatically opened.

This is much better for usability and avoid to have orders being signed
and not paid because the customer did not see it was still to be paid.

This commit is related to task ID 1910532 and PR #29849 .
2019-02-08 12:48:54 +00:00
Christophe Simonis 87924cb5ad [MERGE] forward port branch 12.0 up to a46138cb01 2019-02-07 13:14:02 +01:00
Lucas Perais (lpe) a46138cb01 [FIX] mail: create partner from template in right company
Before this commit, when creating a partner automatically when creating
a message with a template, the company on the partner was wrongly set

After this commit, we try to retrieve the company from the model on the template

OPW 1934392

closes odoo/odoo#30893
2019-02-06 16:48:23 +00:00
Lucas Perais (lpe) 314088a5ec [FIX] point_of_sale: resuscitate onchange amount all
Make a return on a pos_order. A new pos_order is created.
On the latter, remove a pos_orde_line.

Before this commit, there was a traceback, due to a KeyError
It was introduced by 5f6a491265
which intended to optimize migration process

We keep the logic of that commit here, in a new helper method
while restoring the original onchange,
since it wasn't compliant with onchange specs

OPW 1934129

closes odoo/odoo#30897
2019-02-06 15:11:48 +00:00
qsm-odoo 1a299e8833 [FIX] auth_signup: properly disable sign up button on click
The feature introduced with https://github.com/odoo/odoo/commit/67d1173bf381befc136d840e232514c2c9ef7e1b
was broken by https://github.com/odoo/odoo/commit/b78b9c87c95acdf6fcf4f4eb3a80efa0e90eae09#diff-2d8ecbf95567bb339109e9552cbc68a3
because a class was removed by mistake.

This commit does not reintroduce the class so that no view is modified
in stable versions but rather review the JS to target the same button
another way.

Bug revealed while working on https://github.com/odoo/odoo/pull/29442

closes odoo/odoo#30896
2019-02-06 15:03:04 +00:00
Toufik Ben Jaa fe03f7b6b8 [FIX] crm: avoid crash when merging leads
- When merging leads that creates a partner, an error could be thrown
  due to the `res.partner` `default_get` method that reads values from the
  lead that creates the partner.
  The issue is due to the fact that the `crm.lead` record is merged (and
  unlinked), trying to read it will cause an error since the records
  doesn't exists anymore.

  This fix checks that the `crm.lead` we are trying to read from exists.

closes odoo/odoo#30895
2019-02-06 14:54:25 +00:00
Nans Lefebvre 98d0424848 [FIX] survey: support custom server date format in (frontend) surveys
The library moment.js does not support custom date formats anymore.
The following warning is given:
Deprecation warning: value provided is not in a recognized ISO format.
As a result, the moment contains 'Invalid Date',
which would remove possibility to complete a survey containing a date
in any format different than the default.

opw 1930152

closes odoo/odoo#30894
2019-02-06 14:39:04 +00:00
Aaron Bohy 495d475d1d [FIX] web: only call name_get when necessary
For many2one fields, 'default_get' only returns the id, whereas
'onchange' (like 'read') returns an array with id and display_name.

Before this rev., when creating a new record, we always called
'name_get' for all many2ones, whether or not their value was
obtained by 'default_get' or 'onchange', i.e. even if their
display_name was already known.

It may just look like unnecessary RPCs, but those RPCs could
actually cause a crash when the user has access to the main model
(and thus can access the display_name of the many2one thanks to
related sudo), but doesn't have access to the many2one comodel.

closes odoo/odoo#30892
2019-02-06 14:03:25 +00:00
RomainLibert 5fcf891e07 [IMP] various: optimize _name_search
In the overrides of _name_search we should avoid creating domains with
huge lists of ids as it is inefficient.
We can also make sure that we optimize the empty search as in this case
the custom domain doesn't make sense, we can simply search on an empty
domain and, thanks to the limit argument, still keep a fast query.

Linked to task 1918906

Thanks to @odony and @nseinlet

closes odoo/odoo#30155

closes odoo/odoo#30887
2019-02-06 13:26:33 +00:00
Nans Lefebvre c0ffeeb417 [FIX] website_sale: select cart recovery mail template in action
Fine-tuning of commit 50217184d2
The selection of the cart recovery mail template would fail if there was more
than one sale order selected.

opw 1921714

closes odoo/odoo#30885
2019-02-06 14:51:44 +00:00
Vincent Schippefilt 7d1957da8f [FIX] web: hang when saving then discarding
When editing a record, if it cannot be saved (b.e. due to required
fields) and the user clicks on save, then on discard

Before this fix, the window did nothing (seems like it is unresponsive)

After this fix, the user is able to discard the form.

task-id: 1937142

closes odoo/odoo#30871
2019-02-06 11:57:58 +00:00
qsm-odoo 930839c76b [FIX] website: remove data-editor-message attributes on save
When the edit mode is entered, some elements receive
data-editor-message attributes. These were not removed on save which
could in some cases make the attributes be saved in the database. For
this to happen it would require an `.oe_structure.oe_empty` element to
be put *inside* an editable element (instead of being the one which is
editable). In that case the `.oe_structure` content would be saved in an
inheriting view but the parent view would also be COW'd for no reason
because of that attribute.

Difficult to say if such a case exist in the current views but as it
technically possible and that some of our tests use that configuration,
it is worth fixing.
Note: this fix was in fact done in the new editor in master and allowed
to detect that one of our test was not testing a feature correctly
because of that. This will be adapted in a different commit of this PR.

closes odoo/odoo#30834
2019-02-06 09:49:11 +00:00
Romain Derie aef6a5aaed [FIX] website: specific view ID might also change on save
Commit https://github.com/odoo/odoo/commit/29075a8e2c734624cec4f6009185616634f70dea
was written while there was an incorrect behavior related to
multi-website, oe_structure_ID and edit mode in a rare specific case
(see the second commit from this PR for detailed explanation
https://github.com/odoo/odoo/pull/30834).

That rare case was detected in 12.0 since the tour did not work on
master with the new editor (that fixed the incorrect behavior).
Basically, it was COWing the edited view even if only an oe_structure_ID
was touched.

Indeed, when saving a specific view in the HTML editor, we should also
search for its possible new ID as it could change if we also edited its
generic parent. In that case, the view will be copied and then unlinked
to preserve inherit order on the new specific tree.
2019-02-06 09:49:11 +00:00
Christophe Simonis 530f364547 [MERGE] forward port branch saas-11.3 up to 0c42a607ec 2019-02-06 11:59:44 +01:00
Christophe Simonis 0c42a607ec [FIX] base: correct TestCursor test to explicitly close the cursor 2019-02-05 18:38:19 +01:00
Christophe Simonis 9c6acbaaa0 [MERGE] forward port branch 11.0 up to e0b14bf9a7 2019-02-05 17:53:35 +01:00
Nicolas Seinlet aa9fb85102 [FIX] hr_holidays: cache direct access
Sometimes, cache returns an empty tuple, which makes
the .get hit and the [0] to miss, which leads to a
traceback.

closes odoo/odoo#30843
2019-02-05 15:08:33 +00:00
Simon Lejeune e0b14bf9a7 [REF] stock: allow returns in another warehouse
Previously, it was only possible to make a return in
- the location the move was coming
- a return location that is child of the parent_location, actually
  meaning a return location in the warehouse

This commit now allows making return in all return location, even one
located in another warehouses.

closes odoo/odoo#30836
2019-02-05 12:13:57 +00:00
Christophe Simonis 8263547468 [MERGE] forward port branch saas-15 up to 66efbf2b5b 2019-02-05 15:22:04 +01:00
Christophe Simonis 66efbf2b5b [MERGE] forward port branch saas-14 up to 53ba83579b 2019-02-05 12:36:15 +01:00
Christophe Simonis 53ba83579b [MERGE] forward port branch 10.0 up to 8cb2965e23 2019-02-05 11:41:23 +01:00
Lucas Lefèvre 3e9ec9aac6 [IMP] hr_payroll: improve benefits error managment
Purpose
=======

When a lot of benefits are generated (for Odoo: ~1200 benefits/month), it can be
difficult to manage conflicts and errors.

Specification
=============

Add a filter to display only benefits with errors.

In the list view:
- sort by error,status
- show Name| benefits Type | Beginning | Duration | Status | Error

closes odoo/odoo#30339
2019-02-05 09:30:32 +00:00
Lucas Perais (lpe) 44da9c91f9 [FIX] hr_recruitment, receive email for applicant creation in right company
Before this commit, the email aliases on hr.jobs did not take into
account the department.
Hence, when receiving an email for an applicant through an alias,
the object applicant was created in the wrong company

after this commit, the alias is created with the right values, and the
applicant is created in the right company and department

OPW 1920085

closes odoo/odoo#30818
2019-02-04 15:48:24 +00:00
Lucas Perais (lpe) 703263ad45 [FIX] mail: activity model js: pass context to get activity data
Go on the crm activity view
Have your user operate in another language than en_US

Bafore this commit, the activity types were not translated
This was because the context was not passed to the function

After this commit, the terms are translated

OPW 1924232

closes odoo/odoo#30837
2019-02-05 13:37:08 +00:00
eLBati 9d0b441013 [FIX] crm: hide "email" title if not debug mode
Before this commit, an empty block "email" was displayed when not in debug mode
Move the group to upper level

closes odoo/odoo#30761
2019-02-06 04:56:57 +00:00
Nicolas Lempereur d730f66964 [FIX] mail: mention special char=>link partner
This is a regression from: 10f0766b3. In it the visual side was solved,
but unexpectedly the functional side still worked on unescaped content.

Thus visually a @partnèr could be seen as a link, but it was no anymore
added as follower.

Without change, modified test fails with:

 mentioned partners are sent to server (expected: [1], result: [])

note: change is partial backport of 12.2 e2f20ffa9

opw-1931247
closes #30846
2019-02-05 17:24:19 +00:00
Nicolas Martinelli b9e3c15315 [FIX] stock_dropshipping: consolidated lines
- Create a SO with 2 lines of the same product (set route as Drop Ship)
- At validation, both lines are merged into a single line in the PO

As a result, one SO line will be over-delivered, and the other
under-delivered.

Two lines should be kept in the PO.

opw-1928702

closes odoo/odoo#30800
2019-02-04 10:16:54 +00:00
Thanh Dodeur a86b726a27 [FIX] base: fixes http redirection
The 7d85ab1eac refactor of 'ir.http' introduced changes in `web/image` that
caused the route to no longer return early (to avoid data processing steps)
in the case of redirection and that caused `binary_content` to not set the
mimetype of the `ir.attachment` when it was an URL.

This commit fixes those issues, allowing `web/image` to redirect properly.

closes odoo/odoo#30777
2019-02-04 10:16:12 +00:00
Pierre Masereel 240df8225c [FIX] payment_paypal: tests
To avoid trouble when the company name is changed in demo data, we use
the company name variable in the test

closes odoo/odoo#30612
2019-02-04 10:18:47 +00:00
Géry Debongnie 1f5807f1c8 [FIX] web: allow user to move cursor in search bar
With the control panel refactoring, the auto_complete widget was set on
a different target, which caused issues with the search bar: the event
handlers for the search bar were triggered before the handlers for the
auto_complete widget.

With this commit, we make sure they are handled in the proper order.

Also, a small piece of code that was supposed to check the position of
the cursor was lost.

closes odoo/odoo#30795
2019-02-04 08:22:34 +00:00
Aurélien Warnon dcd79a543a [FIX] survey: fix empty date in survey could not be submitted
Purpose
=======

A date field not marked as "mandatory" could not be left blank in the survey.

That was caused by the form returning "Invalid date" instead of an
empty value when submitting.

closes odoo/odoo#30788
2019-02-04 07:53:47 +00:00
Rishabh Jadia 13e058c573 [FIX] web: prevent footer linebreak.
The purpose is, prevent the linebreak in the phone when using the
document layouts 'background' in the footer.

opw-1920752

closes odoo/odoo#30812
2019-02-05 10:37:01 +00:00
Robot Odoo b13a220295 [FIX] hr_holidays: fasten creation of leaves by company
When creating a leave, we usually check/create activities for the
concerned users, this is fine when creating one leave.
However it starts to become a problem when trying to create leaves in
batch using the by company or by department holiday_type as the number
of leaves created in batch can become quite big.

Now when we create leaves in batch, we do not check for the activities,
which will fasten a lot the creation.

Another problem is that when someone defined a leave on the very day you
want to create such a request, then it will crash, this can lead to
waste of time and resources.

Now we raise an error before trying to create the leaves in case of
conflict.

NB: Tested with +- 320 records, took 20 seconds instead of more than 10 minutes.

Task: 1934383

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#30625
2019-02-05 10:36:34 +01:00
RomainLibert 9c1b932489 [IMP] hr_holidays: improve performances
going from 3X seconds for 320 leaves to 20 seconds for 320 leaves
2019-02-05 10:06:55 +01:00
RomainLibert 8ab8881167 [FIX] hr_holidays: fasten creation of leaves by company
When creating a leave, we usually check/create activities for the
concerned users, this is fine when creating one leave.
However it starts to become a problem when trying to create leaves in
batch using the by company or by department holiday_type as the number
of leaves created in batch can become quite big.

Now when we create leaves in batch, we do not check for the activities,
which will fasten a lot the creation.

Another problem is that when someone defined a leave on the very day you
want to create such a request, then it will crash, this can lead to
waste of time and resources.

Now we raise an error before trying to create the leaves in case of
conflict.

Task: 1934383
2019-02-05 10:06:55 +01:00
Julien (juc) Castiaux 262e001086 [FIX] mail: delete messages on module uninstallation
When uninstalling a module, the messages linked to the records
of that module are not deleted leading to ghost messages when
reinstalling the module.

This is due to the lack of foreign keys in the definition of the
chatter making it impossible to cascade delete.

opw-1928208

closes odoo/odoo#30798
2019-02-04 14:16:47 +00:00
Nans Lefebvre 1746112794 [FIX] purchase: fix mail templates for multi-company use
Activate multi-company, deactivate the common contact book.
Create a PO P with user U1 in company A. Switch to company B.
User U2 in company A tries to send P by email.
Rendering of the template fails, because it tries to access object.create_uid,
which breaks multi-company record rules.

We add a sudo in the template so that it works as intended.

opw 1930521

closes odoo/odoo#30789
2019-02-04 09:09:49 +00:00
Martin Trigaux c189a7c37e [FIX] base: correct case in Swedish language
Was with a lowercase S while it should be uppercase

closes odoo/odoo#30814
2019-02-04 13:34:28 +00:00
Nicolas Martinelli 8cb2965e23 [FIX] stock_account: AVCO with MRP
- Create a product P with:
  Costing Method       Average Price
  Inventory Valuation  Perpetual (automated)
- Create a component C with, costing 10.
- Create a BOM for P:
  1 Unit of C
- Create a MO for P, validate
  => a journal entry of 10 is created
- Modify the BOM for P:
  2 Units of C
- Create a MO for P, validate
  => a journal entry of 15 is created

The journal entry should be 20.

opw-1928342

closes odoo/odoo#30766
2019-02-01 13:22:32 +00:00
Raphael Collet 266f99f545 [FIX] tools: use of savepoints in TestCursor
closes odoo/odoo#30768
2019-02-01 14:09:38 +00:00
Nans Lefebvre 9d1b07f97b [FIX] project, rating: use rating last update to compute satisfaction percentage
The function _compute_parent_rating_percentage_satisfaction used the creation
date of the rating to compute the percentage.
However when a client give a new rating, it updates the old one.
As a result it doesn't give the recent satisfaction percentage,
but the satisfaction percentage of recently created tickets.
In other words recently angry clients from old projects would not appear.

Similarly this method is somewhat reimplemented directly in SQL in the rating
route, which happens to be in the project controller.

opw 1921486

closes odoo/odoo#30752
2019-02-01 09:01:27 +00:00
Pierre Paridans 220644785c [FIX] project: state, priority and title alignment
Priority's star, Kanban State's bullet and name fields should be well aligned
and take less space (specially for small devices).

Related to task 1929034

closes odoo/odoo#28965
2019-02-04 13:08:40 +00:00
eLBati 942930e11c [CLA] update eLBati email address
closes odoo/odoo#30781
2019-02-04 10:41:15 +00:00
Lucas Lefèvre dccd37d4e4 [FIX] web: fix tabs padding and min height
No padding is applied to tab content panels in Community.
Also the minimum height selector does not correctly target tabs.

Related Enterprise PR: https://github.com/odoo/enterprise/pull/3568/

closes odoo/odoo#30771
2019-02-04 09:33:42 +00:00
Sanjay Jamod 2b844a7f6c [FIX] account: add fallback value
there was a traceback, when value of amount_total is None

closes odoo/odoo#30797
2019-02-04 09:47:47 +00:00
Pierre Paridans 4687faefbf [FIX] hr_timesheet: timesheet rows in task have broken mobile layout
This commit https://github.com/odoo/odoo/commit/91fb15510ff549e7544f6858f7979b57fae875e7 hasn't been forward ported correclty.
Should use .col-6 instead of .col-xs-6 since Bootstrap 4.

Related to task 1929034

closes odoo/odoo#30787
2019-02-04 08:25:31 +00:00
Laurent Smet e56b891bbf [FIX] account: Fix amount matching in matching rules
-task: 1934494

closes odoo/odoo#30755
2019-02-04 07:32:17 +00:00
Alexandre Kühn e8f7770a13 [FIX] mail: do not open chat window twice
Revision on https://github.com/odoo/odoo/commit/0d87b1ccea07b952d9079008cfa3cddaf1ccdbee

The commit above prevents opening a chat window when we do not have
access to messages of the conversation. This may happen when
receiving a notification from a document we do not have access
rights.

However, the changes in the code above has an unintended side-effect
of opening a chat window twice when clicking on a channel preview
from the systray messaging menu.

This happens because when clicking on a preview, it detaches the
thread and opens the chat window. Meanwhile, there is a RPC to
notify that the chat window is detached, and the new window state of
the channel is received on the longpolling. Two concurrent attempts
to open a chat window occur at the same.
It was working fine before the commit above, because the registering
of a newly open chat window was synchronous.
This is however no longer the case, because it fetches messages
beforehand: it has become a requirement to open a chat window. Since
the registering of a newly open chat window is now asynchronous,
it was fetching messages and opening the chat window twice.

This commit fixes the issue by aborting attempt to open a chat
window if it's currently opening a chat window, as this process may
take some time due to the `message_fetch` RPC.

closes odoo/odoo#30741
2019-02-01 14:21:47 +00:00
Nicolas Martinelli 9ff018a2b7 [FIX] mrp: field for kit BoM
LAP was wrong.

opw-1936161

closes odoo/odoo#30786
2019-02-04 07:16:58 +00:00