Commit Graph
126133 Commits
Author SHA1 Message Date
Alexandre Kühn 9eff26367f [FIX] mail: easily mention followers and employees in chatter
Revision on https://github.com/odoo/odoo/commit/cd34f6de727d5b3858420cff3c9d3c5995c4e75c

Resulting of the mail JS refactoring, the list of prefetched suggestions
has been changed as follow:

- before: list of list of mention suggestions `{Array<Object[]>}`
- after: list of mention suggestions `{Object[]}`

The change resulted in wrongly thinking that wrapping the list of
suggestions in a list was pointless, thus simplifying it as a simple
list of mention suggestions.

However, because of this change, it has become much harder to
mention employees and followers of documents from the chatter:
it now always fetches all partner suggestions at all time, whereas
before it was suggesting followers, then employees, and finally all
partners based on the input of the user.

In fact, there was a purpose of using a list of list of prefetched
mention suggestions, which is to group suggestions by "priority":
followers first, then employees, and all partners as a last resort.

This commit re-introduces prefetched mention suggestions as a list
of list of partners, so that it re-becomes easier to mention
followers and partners of a document from the chatter.

Task-ID 1910111
2018-11-16 13:43:41 +00:00
Christophe Simonis 5ac7557df2 [MERGE] forward port branch saas-11.3 up to a9f3cf76b93 2018-11-16 14:27:04 +01:00
Christophe Simonis 26f916cde5 [MERGE] forward port branch saas-11.3 up to a9f3cf76b93 2018-11-16 14:27:04 +01:00
Laurent Smet bce66c1a00 [FIX] account: Set the partner if missing in reconciliation model
- Suppose a bank statement line with partner_name = x and partner = None.
- Create a reconciliation model with write-off suggestion and auto-validate = True.
- Open the reconciliation Widget.
- Check the lines created automatically: The partner_id is missing.
2018-11-16 13:14:05 +00:00
Laurent Smet 671e243fe2 [IMP] account: Set partner from partner_map in the reconciliation widget
- Suppose a bank statement line with partner_name = x.
- Create a partner with name = x.
- Open the reconciliation widget: The partner is set by default thanks to this commit.
2018-11-16 12:45:22 +00:00
Toufik Ben Jaa 6f7262f508 [FIX] mail: do no try to send notification to inactive users
- This commit prevent to send notifications to inactive users.
- This fixes a bug where two partners have been merged and one of its
  users is archived.

  If one of the two users is inactive the code might use its `notification
  type` preferences instead of the active user's one.

closes odoo/odoo#28730
2018-11-16 11:13:56 +00:00
Olivier Dony 8ee02ad136 [FIX] digest: correct a few typos 2018-11-16 16:35:22 +01:00
Olivier Dony 8545e05fc0 [FIX] mass_mailing: fix slow contact number query
The query was computing the count for all mailing lists, not just the
one being requested. This prevents optimizing the SELECT with indexes.
In addition, using a subselect for the blacklist forced a full table
scan on the contacts - switching to a LEFT JOIN avoids that.

With a blacklist of a few hundred thousand entries, and a table of
mailing list contacts in the same order of magnitude, this brings the
SELECT from 3+ seconds down to 3 milliseconds - with the same result.

Bonus: no need to perform the regexp extraction of emails to test for
NULL values -> substring(x) is NULL iff x is NULL.
2018-11-16 16:35:22 +01:00
Olivier Dony a103d4a43e [FIX] mail: use strict email matching for bounces
When a bounce is received, we look for matching partners in order to
increment the bounce counter. However by using [`ilike','email`] we carry
the risk of matching emails that contain the bounce email:

   ['email', 'ilike', 'john@hitmail.com´]

will also match 'random.john@hitmail.com' for example.

Using strict equality is safer, and the worst that can happen is that
we fail to count one bounce.
2018-11-16 16:35:22 +01:00
Christophe Simonis eafda0469a [FIX] calendar: adapt test version 12
*/ Use existing partner name
 */ correctly compare dates
2018-11-16 16:29:21 +01:00
Christophe Simonis 4b8bd36219 [MERGE] forward port branch saas-11.3 up to bab2a191d2 2018-11-16 15:39:02 +01:00
Joseph Caburnay 108b43c60a [FIX] stock_account: corrected_value not considered as zero
The value of corrected_value can be very small, e.g. 1e-16, thus,
proper is_zero check should be used.

OPW: 1906519

closes odoo/odoo#28751
2018-11-16 10:28:58 +00:00
Odoo Translation Bot 1da3ff5a0a [I18N] Update translation terms from Transifex 2018-11-18 03:15:42 +01:00
Christophe Simonis 45d33f5357 [FIX] mail: correctly handle unset mimetype on safari
See 5e3b471f4a for more info
2018-11-16 17:25:55 +01:00
Raphael Collet f29df0f7a8 [FIX] stock: add index on stock.move.line.move_id
This field is a dependency of some computed fields, and has to be searched on
for triggering recomputations.  Without the index, the creation of stock moves
becomes slower as the table grows.

closes odoo/odoo#28757
2018-11-16 12:44:04 +00:00
Gert Pellin bc1c54dd7a [FIX] point_of_sale: barcode nomiclature required
set barcode_nomenclature_id as required field

barcode nomenclature must be required because the pos session needs it
to be able to work properly. Without this scanning barcodes will always
give an error.

closes odoo/odoo#28750
2018-11-16 10:14:08 +00:00
Géry Debongnie 5a97faab5b [DOC] doc: add information on javascript testing
The documentation on JS testing was almost completely useless.  With the
introduction of our new test utility functions, it is time to document
properly how the testing system works.

closes odoo/odoo#28834
2018-11-20 12:51:09 +00:00
RomainLibert ba63b44717 [IMP] hr_payroll: remove inheritance on hr_payslip_line
hr_payslip_line was inheriting from hr_payslip_rule which meant that we
were copying useless data from the rules on the lines (namely the
computation rules which are only used in _compute_rule on
hr_payslip_rule).

closes odoo/odoo#28711
2018-11-19 10:25:19 +00:00
Robot Odoo 43638b0b28 [MERGE][REF] mail : store normalized email addresses
Add a mixin that can be used to store a normalized version of the primary
email address of the parent model. The email_normalized field can
than be used on that model to search quickly on emails (by simple
comparison and not using time consuming regex anymore)

Apply the mail.address.mixin on blacklist mixin. So that every model
inheriting the blacklist.mixin will also inherit the address.mixin.
That simplify also the comparaison to - and the searches on - the
blacklist.

Use the email.normalized from mail.address.mixin to get always a normalized
email address in the unsubscribe link. That allows to simplify the search
on email address in the controllers -> Check blacklist, send feedback, etc..

This merge is linked to task ID 1896677

closes odoo/odoo#28205
2018-11-20 14:11:59 +01:00
David Beguin ede0f03e15 [IMP] mail : use email_normalized in mail_channel _notify_email_recipients
If recipient has email like 'A <a@a.com>', the email_to returned by this
method will be incorrectly formatted. -> 'A <A <a@a.com>>'
2018-11-20 11:37:06 +00:00
David Beguin 692f0062fb [IMP] mail, mass_mailing, crm : stringify _primary_email
_primary_email was an array to be able to use it directly in the
depends. Typically a 'depends' with a computed value (lambda) needs
an array. Otherwise, it will only take the first character of the
field name string.

By setting _primary_email as a string, the lambda should always get
an array. But it simplifies a lot the usage of the _primary_email.
also, having an array was confusing as we could think that more than
one field can be considered as the primary email. This is not the
goal hare. So having the _primary_email as a single string is more
'self describing'. Only one field should be the _primary_email.
2018-11-20 11:37:05 +00:00
David Beguin 1007df3dc3 [IMP] mass_mailing : apply email_normalized on _get_opt_out_list
To avoid sending mail to an opted-out mass_mailing_contact with email address
that is not strictly an email address (a <a@a.com> instead of a@a.com),
the the get_opt_out method must be adapted to use the email_normalized field,
as this method is only useful for that specific model.

Task ID : 1896677
2018-11-20 11:37:05 +00:00
David Beguin e69b89b8fa [IMP] tools, mail : adds email normalization method in mail tools
In order to normalize email independently from the
mail.address.mixin model.
2018-11-20 11:37:05 +00:00
David Beguin fc2a8d63ee [IMP] mail, mass_mailing, mass_mailing_crm : Use normalized email in unsubscribe link
Use the email_normalized from mail.address.mixin if available to get always
a normalized email address in the unsubscribe link. That allows to simplify
the search on email address in the controllers -> Check blacklist,
send feedback, etc..

Task ID 1896677
2018-11-20 11:37:05 +00:00
David Beguin 0fe50a01d2 [IMP] mail : apply mail.address.mixin on blacklist
Apply the mail.address.mixin on blacklist mixin. So that every model
inheriting the blacklist.mixin will also inherit the address.mixin.

That simplify also the comparaison to - and the searches on - the
blacklist.

Task ID 1896677
2018-11-20 11:37:05 +00:00
David Beguin 8d3fcf42c9 [IMP] mail : add mixin to normalize email address
This Mixin can be used to store a normalized version of the primary
email address of the parent model. The email_normalized field can
than be used on that model to search quickly on emails (by simple
comparison and not using time consuming regex anymore)

This commit will be usefull to simplify the email address comparison
in the blacklist mixin but also for any models storing non normalized
email address.

Task ID : 1896677
2018-11-20 10:39:11 +00:00
gde-odooandtwa-odoo 097c8afb74 [IMP] web: propagate "on_attach_callback" to all widgets in form renderer
Co-authored-by: twa-odoo <twa@odoo.com>

closes odoo/odoo#27711
2018-11-20 08:21:37 +00:00
Aaron Bohy de924f41ee [IMP] web: testUtils: ensure backward compatibility
Rev. 7c3d5dc0 recently added new helpers to use in the tests, and
moved some existing helpers to testUtils sub groups (like .dom or
.mock).

This rev. adds a compatibility layer to ease forwardports.

closes odoo/odoo#28824
2018-11-20 10:44:24 +00:00
Christophe Monniez 153c2a9f94 [FIX] web: remove testUtils helpers from click_everywhere
During the refactoring of the js test suite, in abf32b8b, the
click_everywhere test was inadvertently updated to use the helpers.

Some missing semi-colons were fixed too.

closes odoo/odoo#28820
2018-11-20 09:31:47 +00:00
Thibault Delavallée c95b14944a [REM] survey_crm: remove module
This module only adds an action allowing to send some invitations to surveys to
leads. It is safer to go through the survey module especially that its use is
about to be improved.

Commit linked to task ID 1910982.

closes odoo/odoo#28801
2018-11-20 09:05:57 +00:00
qsm-odoo ec7aa3c1f1 [FIX] website: properly enable a website view from its generic view
Before this commit, when enabling a generic view from a specific website
context and that view already had a specific view for this website, the
view was duplicated again instead of writing on the already existing
specific one.

This is because we did not consider inactive views when checking if a
view that is being written already has a website-specific view.

closes odoo/odoo#28743
2018-11-16 10:03:13 +00:00
Christophe Simonis bab2a191d2 [FIX] web: correct forward-ported test 2018-11-16 10:21:32 +01:00
Christophe Simonis 89ed115fe0 [MERGE] forward port branch 11.0 up to d2af0b13250 2018-11-15 20:41:29 +01:00
Christophe Simonis ce6b098df8 [MERGE] forward port branch 11.0 up to d2af0b13250 2018-11-15 20:41:29 +01:00
Christophe Simonis 15f686eef6 [MERGE] forward port branch 11.0 up to 468dab6748 2018-11-15 20:39:10 +01:00
Christophe Simonis f89eef2b60 [MERGE] forward port branch saas-15 up to a267fcbdf62 2018-11-15 19:20:15 +01:00
Christophe Simonis ab1b8dc3c1 [MERGE] forward port branch saas-15 up to a267fcbdf62 2018-11-15 19:20:15 +01:00
Christophe Simonis 468dab6748 [MERGE] forward port branch saas-15 up to 3c78026dc0 2018-11-15 18:57:09 +01:00
Christophe Simonis c4f95c9254 [MERGE] forward port branch saas-14 up to 6e254b8ae9c 2018-11-15 18:16:38 +01:00
Christophe Simonis 2e3795b238 [MERGE] forward port branch saas-14 up to 6e254b8ae9c 2018-11-15 18:16:38 +01:00
Christophe Simonis 3c78026dc0 [MERGE] forward port branch saas-14 up to 55104b915e 2018-11-15 18:15:47 +01:00
qsm-odoo 55104b915e [FIX] website_event: restore event list layout
Commit https://github.com/odoo/odoo/commit/b43364af7258e45ad846fbbf1f375ad26e58eb0d
introduced a row in a row. On a standard database, the bug is invisible.
When the user wants to edit that event list page, the right column... is
not on the right anymore.

Note: in 12.0, thanks to BS4, the bug was revealed even more as even on
a standard non-edited database, the bug is visible.

Closes https://github.com/odoo/odoo/pull/28693
2018-11-15 17:15:54 +01:00
qsm-odoo f1e999d33e [FIX] web_editor: properly post process document upload
When using the media dialog, when uploading an image, the image list
refreshes itself properly. This was not the case for documents as it
was... refreshing the image list too instead of the document list. Also,
when uploading a document, it is supposed to be added in the page
directly and the media dialog is supposed to close. This feature was
broken for the same reason: the iframe system of both tabs which were
using the same name.

Bug introduced with https://github.com/odoo/odoo/commit/abde8bddf8ec45cf12aab59e95c330321158cfba
(even though is was technically wrong for the same reason before).

Closes https://github.com/odoo/odoo/pull/28722
2018-11-15 17:07:32 +01:00
Christophe Simonis 5523e6b1c9 [MERGE] forward port branch 10.0 up to 8a9569b31e 2018-11-15 17:00:52 +01:00
Nicolas Lempereur 258eaa7a3c [FIX] web_editor: firefox `´ accent no break position
On firefox if we do for example:

ALT+GR + [ALT+GRable ´ key]

Firefox may send keys "AltGr" and "Dead" instead of just "AltGr".

This was possibly causing caret to go a position too low when writing
speedily with diacritical marks.

opw-1903865
closes #28739
2018-11-15 16:52:31 +01:00
Lucas Perais (lpe) de76e5e081 [FIX] purchase: wrongly written domain
closes odoo/odoo#28735
2018-11-15 15:09:04 +00:00
Nicolas Seinlet 1512f1d60a [IMP] web_tour: restrict tour access to own ones
Even if only admin can access all tours, retrict tour access
to own user

closes odoo/odoo#28736
2018-11-15 16:11:03 +00:00
Romain Derie 63131c2584 [FIX] sale_coupon: reset no more eligible applied coupon to Valid state
Before this commit:
When a coupon_program's coupon was giving a reward on a SO and then the
recompute was removing that reward (eg the SO did not met the requirements
anymore) the coupon would not be reset and would be lost.

Now:
If a coupon's reward got removed for some reason, the coupon got reset to a
valid state (`new`) so it can be used again.

Step to reproduce:
  - Generate a coupon from a coupon program that needs requirements (eg $300)
  - Add that coupon to a SO that has a total over $300
  - Coupon is set as `used` and the reward is granted
  - Remove some products to set the SO total below $300
  - Recompute coupon, the reward is correctly removed but the coupon is still
    set as `used` so it won't be usable again and is basically lost.

Closes #3062
2018-11-15 15:57:17 +01:00
Romain Derie 231669e332 [FIX] sale_coupon: remove coupon_program reward if req. not met anymore
Before this commit:
If a reward had been given on the SO with a coupon_program code and that the
program had requirements and that these requirements are not met anymore,
recomputing the SO would not remove the reward.

Now:
If the SO does not met the program requirements anymore, we remove the reward

Step to reproduce:
  - Create a coupon_program with quantity or amount requirements (eg: $200)
  - Generate a coupon for that program
  - Add $200 worth of products (matching the program domain) in the SO
  - Add the generated coupon to that SO
  - You should get the reward as you have $200 in the SO
  - Remove some products from the SO to go below $200
  - Recompute coupons, the reward won't be removed

Closes #3062
2018-11-15 15:57:12 +01:00
Romain Derie 5a75d1aeae [FIX] sale_coupon: unvalid next_order programs if needed
Before this commit:
We would never unvalid a `next_order` program (and thus it's generated coupon)

Now:
We also retrieve applied `next_order` programs as we need to check if they are
still valid too

Step to reproduce:
  - Create a program on `next_order` that require $300
  - Add $300 worth of product on a SO
  - Apply program, it will generate a coupon
  - Make the SO total go below $300
  - The generated coupon is still Valid and the client will receive that coupon
    even if it is not supposed to anymore

Closes #3062
2018-11-15 15:57:06 +01:00