Commit Graph
108118 Commits
Author SHA1 Message Date
Odoo Translation Bot 87caeb3605 [I18N] Update translation terms from Transifex 2017-03-28 14:17:22 +02:00
Olivier Dony ca989b6548 [FIX] mass_mailing: prevent duplicates and sending to opted-out
The mass-mailing App suffered from severe issues due to its inability
to detect and handle duplicates "at the email level", and the absence
of any global blacklist system, leading to lack of user trust.

Mailing-lists typically include multiple records with the same email,
and it is critical to avoid sending them the same email several times.
A related problem is the unsubscription of an email that is present
in other records (duplicates). Opting out the first email should
automatically blacklist it for other records as well.

Ideally we should have a global blacklist table in order to
share the unsubscription requests globally across models (Leads,
Partners, Mailing-list contacts). It would also allow importing
it from other blacklist systems. (TODO for master)

This commit introduces a partial solution, made of several
small changes:

- In mail.mail: double-check that an outgoing email has the
correct status (`outgoing`) before sending it. This allows
adding emails in the queue and cancelling them before they
actually get sent.
- In crm.lead: force predictable recipients for mass-mailing,
by always using the email of the lead rather than the email
of the linked partner when there is one. This simplifies the
computation of the blacklist and seen list. Other areas in
the codebase already assume as much.
- In mass.mailing:

 + Before sending out a mailing-list batch, compute the
   blacklist (all opted-out emails) and the seen_list
   (emails who previously received this mail) to make
   sure we only ever target valid recipients.
 + While delivering the mass-mailing, any email targeting
   an address that is in the blacklist or "seen list" is
   canceled before being sent. The corresponding statistics
   entry is considered "not delivered".
   Also updates the "seen list" continuously.
 + When a mass-mail belongs to a campaign with the
   "unique AB/B testing" flag, the "seen list" is
   common to the whole campaign, as an extra safety.
 + Auto-delete mass-mailing test messages sent with the
   test wizard, to avoid polluting the mail_mail table

Note: this fix uses a simple regex for efficiently extracting
the blacklist in pure SQL from different models, and doing so,
assumes that each record only holds a single email
(no comma-separated adresses). This should be sufficient for
most cases. The regex:

                   ([^ ,;<@]+@[^> ,;]+)
2017-03-27 18:47:59 +02:00
Olivier Dony 6d16915d39 [FIX] web: no frames on login/preferences screen
We generally consider this a low priority issue
as it is social-engineering based and many easier
options exist for targeting gullible users.
Nevertheless, protecting a couple of obvious pages
does not hurt.
2017-03-27 18:47:45 +02:00
Martin Trigaux 4d7d234ed5 [I18N] base: export master translations
Was not containing the description of all enterprise modules
2017-03-27 13:58:45 +02:00
Denis Vermylen be385da36e [FIX] website_project: wrong term quote -> task 2017-03-27 11:45:33 +02:00
Odoo Translation Bot 4c772faf12 [I18N] Update translation terms from Transifex 2017-03-26 07:12:58 +02:00
Martin Trigaux dca85f6498 [I18N] sale: missing terms in sale 2017-03-24 16:56:17 +01:00
Olivier Dony adf9875ee7 [IMP] website_mass_mailing: make wording clearer after unsub 2017-03-23 15:09:50 +01:00
Thibault Delavallée 9442d69edb [MERGE] mail, project*, sales*: improve activity types use and definition 2017-03-23 11:45:07 +01:00
Mahendra Barad 83e8ae43b0 [IMP] sales_*: add menu to configure sales-related activity types
Activity types are currently hard to find and define. In this commit we
add a menu under sales configuration to access generic or sales
related activity types (contact, lead, product, sale order).

This commit is an improvement considered as an usability fix, therefore
targeting stable version.
2017-03-23 10:40:54 +01:00
Mahendra Barad 0f17d3a348 [IMP] project: add menu to configure project-related activity types
Activity types are currently hard to find and define. In this commit we
add a menu under project configuration to access generic or project
related activity types (task, issue).

This commit is an improvement considered as an usability fix, therefore
targeting stable version.
2017-03-23 10:32:56 +01:00
Mahendra barad 78e0c08b03 [IMP] mail: add activity types configuration that is missing to use activities efficiently
Currently tweaking or defining new activity types is difficult to achieve
as menu is hidden under technical settings. This commit eases the activity
types configuration by adding a menu allowing to customize them directly
under Emails section of General Settings. By the way it is renamed to
Discuss to better reflect its purpose.

This is an improvement but considered as an usability fix, therefore
targeting a stable version.
2017-03-23 10:25:56 +01:00
Mahendra barad 6987c5adf0 [IMP] mail: set model field of activity types in technical features
Using activity types cross applications and having some specific to
a given app is considered as an advanced way of defining them.
2017-03-23 10:25:53 +01:00
Nicolas Martinelli 67706d8410 [FIX] account: # of digits
The field "# of Digits" is not accessible as soon as a chart of account
has been chosen. This should not be the case since the method
`reflect_code_digits_change` handles it.

opw-724619
2017-03-22 15:29:09 +01:00
Martin Trigaux 21fd506955 [I18N] crm: correct bad %s translation
Not forward ported
2017-03-22 15:20:55 +01:00
Simon Lejeune fcbfe47695 [FIX] base: lighten default values validation in ir.values
Rev acd8c4de18 prevents the creation of default values for fields that
are not defined. This is too restrictive because of the following
points:
    - one may want to create default values for fields that are yet to be
      defined
    - "fake" default fields used in res.config that do not point to real
      fields

The initial scenario this revision was trying to fix is the creation of
wrong default values through studio. This scenario is still fixed, as it
concerns the last `except` branch.

The tests have been updated to reflect these changes.
2017-03-22 12:48:56 +01:00
Odoo Translation Bot 915e07bcac [I18N] Update translation terms from Transifex 2017-03-22 11:30:05 +01:00
Thibault Delavallée ff0053b416 [FIX] crm: fix behavior of 'Emails' checkbox in settings
Currently there are several issues with this configuration box

 * default_<field> does not generate automatically ir.values anymore.
   Defining default_model does not work since it is not linked to an
   existing <field> in current model sale.config.settings. Checkbox
   value is therefore not saved and lost at reload;
 * box label is not clear as user may understand unchecking it drops
   all aliases or email support. This is not the case as it is only used
   to define an alias creating unassigned leads. This is a rare use case
   where leads assignation is done manually;
 * checking / unchecking the 'Emails' box does not have any effect on
   default info alias. This is counter-intuitive as user asks to remove
   the feature but it still works in background;

This commit fixes those issues by

 * correctly setting the checkbox value in an ir.config_parameter so that
   it is not lost anymore at reload;
 * inactivating info alias by default;
 * adding onchanges so that values are reset when unchecking checkboxes;
 * updating string and displayed label and helps for the 'Emails' section;
 * putting that Emails checkbox in advanced mode as it is a rare use case;
2017-03-21 17:20:50 +01:00
Denis Vermylen b512c65181 [FIX] website_crm_partner_assign: implemented_count
Fix onchange dependencies for implemented_count field of res.partner.
Use that field in the template and use t-esc instead of t-raw.
2017-03-21 16:43:36 +01:00
Raphael Collet c9edb9dccb [FIX] registry: use a weak dictionary for model_cache to avoid memory leaks
The class attribute `model_cache` refers to model classes, which refer to their
own registry.  This cache potentially keeps all past registries alive!
2017-03-21 15:50:20 +01:00
Laurent Smet 3b774ee329 [FIX] l10n_mx: fix bad reference to account.account skiping the mapping to templates
Hardcoded reference skips the mapping (company, template) -> account.account leading to key error.
2017-03-21 10:13:11 +01:00
Goffin Simon 348535630b [FIX] product: get_names with empty record set
Steps to reproduce:

-Go to accounting dashboard
-Click on "More" in vendor bills dashboard
-Click on "bills analysis"

Bug: it opened the account.invoice.report view, which crashed.

Reason: The function get_names in addons/product/models/product.py got an empty record set
product.category(None,) and returned [False] so when joining " \ " with [False], it crashed.
The empty record set was returned  when the categ_id of an account.invoice.report() was None.

opw:724783
2017-03-20 14:41:52 +01:00
Christophe Simonis 6b41d59ca8 [MERGE] forward port branch 10.0 up to 7043fd529f 2017-03-18 23:38:24 +01:00
Christophe Simonis 7043fd529f [FIX] test_converter: use unicode string for comparison 2017-03-18 23:35:58 +01:00
Christophe Simonis b2fa9f2ad1 [MERGE] forward port branch 10.0 up to 31ebb07773 2017-03-17 17:57:52 +01:00
Christophe Simonis 31ebb07773 [MERGE] forward port branch saas-11 up to aefdf96c25 2017-03-17 17:55:30 +01:00
Christophe Simonis aefdf96c25 [MERGE] forward port branch 9.0 up to af64780a2d 2017-03-17 17:06:32 +01:00
Martin Trigaux 2c1257fe88 wow 2017-03-17 14:40:45 +01:00
Martin Trigaux 13bfc8ee50 [FIX] crm: remove unused field from fields to merge
The field email is no longer present on the crm.lead object

opw-725112
2017-03-17 14:33:44 +01:00
qsm-odoo 7401807510 [FIX] web_editor: copy/paste in the editor
Commit 906875fc78 (followed by commit
76be5eed44) tried to tweak to copy/paste
functionality of the editor.
Indeed, in PDF file, when copying a paragraph, a line feed is added at
each forced line break (page width end). This forced a line feed and
a new paragraph in the pasted text. The goal was to get rid of those
useless linebreaks when pasting.

The ideal solution would be to detect that the text was copied from
a PDF but it is not possible. However, this commit improves the
heuristic: if this is not plain text, then nothing is done, the content
is pasted normally. If it is plain text (like when copying from pdf),
then each line break which is surrounded by letters or numbers is
considered an useless line break and replaced by a space. This is
obviously not perfect but the previous implementation was really wrong
(it was removing line breaks which were not preceeded by punctuation in
all cases, which was removing lots of useful line breaks).

Note: this commit also fixes a bug -> text was not able to be pasted
with Internet Explorer.

opw-715920
2017-03-17 11:44:28 +01:00
Martin Geubelle 22e7b6befb [FIX] web_kanban: only give fields in view to record
This commit partially reverts 5b4f7c1 where `fields_view.fields`
had been replaced by `fields`, which could have been set to all
fields in the model.

This modification can sometimes lead to a problem, during the
fields value transformation. The ID, which wasn't given previously
is now parsed. When creating a new record, the field ID is not an
integer but a string (representing the virtual ID). If the field
is in the arch, it will be postprocessed
(see https://github.com/odoo/odoo/blob/saas-11/addons/web/static/src/js/framework/data_manager.js#L201)
and its type will become `id`. As this postprocessing is not done
if the field in the view, the parsing was on the original type
(integer) and not the special id type.
2017-03-17 11:13:49 +01:00
Nicolas Martinelli af64780a2d [FIX] base: no-break hyphen
- Create an invoice with two products
- Each line has a long description (spread on 2 lines)
- The second line has a negative value
- Print the invoice (PDF)

The amount spreads on two lines, split as:
$ -
1,000.00

This is due to the wkhtmltopdf version with patched QT. Unfortunately,
upgrading to the latest version 0.12.4 doesn't solve the problem.

The solution is to replace the '-' by a non-breakable hyphen.

opw-711002
2017-03-17 09:07:15 +01:00
Nicolas Lempereur 508a002e69 [FIX] web_editor: glitch english several times
When using the iframed editor with multilang selector (present if there
is another lang installed than en_US) an "English" language was present
before each translation language.

opw-696891
2017-03-17 08:10:52 +01:00
Nicolas Lempereur fb05d8845d [FIX] web_calendar: events not appearing in arabic
Fullcalendar expect as `start` and `end` property of an event object:

> When specifying Event Objects for events or eventSources, you may
> specify a string in IETF format (ex: "Wed, 18 Oct 2009 13:00:00 EST"),
> a string in ISO8601 format (ex: "2009-11-05T13:15:30Z") or a UNIX
> timestamp.

(as seen in https://fullcalendar.io/docs1/event_data/Event_Object/)

Before this commit we could for example in arabic provide an invalid
date string "٢٠١٧-٠٣-١٦ ١٦:٠٠:٠٦" instead of "2017-03-16 16:00:06".

This commit solves this by always providing fullcalendar an ISO8601 date
string.

opw-705752
2017-03-16 22:07:29 +01:00
Nicolas Lempereur f50ba68be7 [FIX] web_editor: handle margin:initial correctly
The transcoder (which transforms stylesheet rules to inline style) did
some compression of the padding and margin css properties to not always
have margin-top + margin-right + margin-bottom + margin-left.

This could cause an issue when the value of margin or padding contained
an initial or inherit value because browsers (at least firefox and
google chrome) doesn't allow it. Thus the preview could for example have
bigger veritcal spaces arround `<p />` tag than what was seen when
editing.

With this fix instead of invalid:

    margin:initial initial initial initial

we have:

    margin:initial

And instead of invalid:

    margin:initial 5px 6px 7px

we have:

    margin-top: initial; margin-right: 5px; margin-bottom: 6px; margin-left: 7px;

opw-706535
2017-03-16 18:26:32 +01:00
Simon Lejeune be9dce625c [FIX] stock: inventory adjustment and negative quants
It is still possible to have negative and positive quants in the same
location because of returns: if you send something to the customer that
is not there and you return it, you will still be able to reserve the
returned goods to send to another client.

Before, if you would do an inventory adjustment, it would not take into
account these returned quants and their negative counterpart, which made
them difficult to get out of the system.

This fix takes them into account by creating two movements for one
inventory line: move the positive counterpart to the inventory location
before getting back from this location the same quantity.

This way, even if you have 0 as quantity on hand but you have those 2
quants, it will eliminate them. (if you are increasing the stock, part
of the process might have done it automatically already).

Test cases contributed by @jir-odoo
2017-03-16 17:30:02 +01:00
Christophe Simonis 5f9d382ed4 [MERGE] forward port branch 9.0 up to e542b450a3 2017-03-16 16:01:56 +01:00
Nicolas Martinelli 0590af8b3f [FIX] mrp_repair: tax included
- Create a product with price tax included
- Create Repair order
- Add the product in tabs "Operation" or "Invoicing"

The tax is added twice in the total.

opw-709608
2017-03-16 13:23:33 +01:00
Nicolas Martinelli e542b450a3 [FIX] sale_stock: duplicate qty
- Create a stockable product, create a SO selling 1 unit.
- Confirm the SO, validate the Picking 1 => delivered qty is 1
- Return Picking 1 and validate Picking 2 => delivered qty is 1
- Return Picking 2 and validate Picking 3 => delivered qty is 2

The delivered quantity should remain 1.

opw-715685
2017-03-16 13:15:46 +01:00
Nicolas Lempereur cc1c15327c [FIX] expression: improve o2m with m2o integer
We sometimes use in Odoo a One2many field with an inverse Integer
field instead of a usual Many2one.

This allow for example in several instances to have a "Many2one" which
can be reference from several models, eg:

Model Ranking:
	name = String field
	res_id = Integer field
	res_model = String field

Model Toy:
	rank = One2many [inverse: Ranking -> res_id]
                        [domain: res_model == Toy]

Model Tool:
	rank = One2many [inverse: Ranking -> res_id]
                        [domain: res_model == Tool]

This enable us to have a shared feature between otherwise unrelated models.

But there was several issue when searching on these One2many:

1) if the Integer Many2one was not stored (eg. it came from an inherits) on
   the searched model, this could lead to an error.

2) when we searched:

   - by IDs (rank in ['55']) with at least one id not respecting the domain
   - by IDs with a negative operator
   - with a negative operator on unfound string (rank != "no rank has this")
   - with a false value (rank = False)

   we would not apply the One2many domain (eg. res_model == Toy) and thus
   possibly getting Toy 3 errenously because a Tool 3 was found without
   the domain being applied.

This fix modify the search on One2many and for:

1. if the inverse is an Integer not stored field instead of Many2one
   manage it.

2. if the field is an Integer field instead of Many2one and there is a
   domain on the One2many: apply the domain on the inverse model found.

So only some search on One2many with a domain whose inverse field is an
Integer could be impacted.

This would also be nice to have for all One2many with a domain but the
probability of it being useful versus risk for performance is not judged
high enough.

opw-710508
2017-03-16 11:57:04 +01:00
Thibault Delavallée cee15f7d90 [FIX] mail: improve exception management when sending emails
Commit 00bd7274c4 introduced speed improvements when
sending emails through batching and reusing an SMTP connection for a
given batch.

However exception management was slightly changed during that patch.
Previously to this patch all errors in the sending process were considered
as MailDeliveryException, except for MemoryError and psycopg errors.
However now mail_mail.send() may raise another kind of exception in the
SMTP connect process. Moreover a raise_exception parameter allows to
choose to either raise an exception, or just set emails in exception
state without raising an error. However since the patch it is not taken
into account correctly.

This leads to several issues, notably

 * auth_signup waits for a MailDeliveryException when sending a password
   request email. A badly configured SMTP server leads to a connection
   error that is not caught. This prevents creating users, which could
   be annoying.
 * chatter does not handle exceptions as notification emails are sent
   using raise_exception being False. Having an issue in the connect
   process crashes the chatter.

This commit fixes the exception management so that it behaves like
before the patch.
2017-03-16 10:06:24 +01:00
Nicolas Martinelli 27f656a23e [FIX] mrp: duplicated raw materials
- Create Product A with a BOM which depends on a product with tracking
  "By Unique Serial Number" (Product B).
- Create a MO for Product A
- In the "Register lots" wizard, add two lines for "Product B", with the
  same serial number.

Nothing prevents the user to do it, even when the inventory is posted.

opw-709888
2017-03-15 14:01:04 +01:00
Goffin Simon 73de39150a [FIX] crm: Translation in crm.opportunity.report
The opportunity analyses displayed the stages always in English.

opw:708380
2017-03-15 10:50:12 +01:00
Yannick Tivisse 6027e9370d [FIX] account, base_setup, sale, crm: do not create ir.values for unknown fields 2017-03-15 10:49:53 +01:00
Raphael Collet aa68e3e0d7 [FIX] base: in res.lang, invalidate ormcache after modifying languages
The method `write` calls `env['res.lang']._get_installed`, which is ormcached.
After activating a language with `write`, one must invalidate the ormcache.
2017-03-15 10:49:53 +01:00
Raphael Collet acd8c4de18 [FIX] base: validate default values in ir.values 2017-03-15 10:49:53 +01:00
Denis Vermylen 9995deda86 [FIX] website_sale: fix extra-step
truly fix 328a5a7ea3
sudo() was applied at the wrong step.

mea culpa
2017-03-15 10:44:52 +01:00
Goffin Simon 9f9657c04b [FIX] base: unlinking ir.model.constraint
When unlinking an ir.model, all the ir.model.constraint linked to this
ir.model must be removed to avoid to call unexisting model.

In stable version, the right fix would be to put an attribute ondelete=cascade
on the field model of ir.model.constraint.

In 10.0, the ir.model.constraint are created with module = the module where the related field
has been declared. But when unlinking the ir.model in function _module_data_uninstall, the related
ir.model.constraint to remove were chosen according to the removed modules. So with models
declaring constraints on inherited fields, some problems occured because the model could be removed
and not all the related constraints.

opw:716032
2017-03-15 09:17:53 +01:00
Denis Vermylen 328a5a7ea3 [FIX] website_sale: extra step access rights
Public users were stuck at the extra step during the checkout
process if enabled due to not having the access rights to write on
the sale.order.
2017-03-14 17:49:44 +01:00
Pierre Masereel 945679176a [FIX] stock: warehouse check_reception_resupply
When we are trying to change the reception route of a warehouse when
there are existing resupply routes, we are getting a traceback.

This bug comes from a migration error introduced in rev: https://github.com/odoo-dev/odoo/commit/70e1d5d5bc1a3cb325dbcb091fc2135e23084145
2017-03-14 16:46:42 +01:00