Commit Graph
118360 Commits
Author SHA1 Message Date
Jairo Llopis f2b7427fb4 [FIX] website_event_track: suggest recipient with an email
If an event track had a speaker assigned who had an email, and the
email field in the track itself was empty, Odoo was suggesting the
user to send an email to an empty recipient, making an error

Now it only suggests the email if there's one.

Fixes odoo/odoo#35941

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-22 08:05:47 +00:00
Nans Lefebvre ab8c564f44 [FIX] account: fix default_get of account move lines
Obvious typo of 67d82b875c.

opw 2046137

closes odoo/odoo#35939

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-08-22 07:07:27 +00:00
Shreya Modi 1b234b1be7 [IMP] l10n_uk: updated website link
-website link now redirects to accounting page of odoo.com portal

task-2040072
Closes #35513

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-07 05:59:52 +00:00
Christophe Simonis 77dca40215 [MERGE] forward port branch saas-15 up to d8524aadf8 2019-08-21 15:19:38 +02:00
Christophe Simonis d8524aadf8 [MERGE] forward port branch saas-14 up to e854f68393 2019-08-21 11:26:41 +02:00
Christophe Simonis e854f68393 [MERGE] forward port branch 10.0 up to b058f70941 2019-08-21 11:25:05 +02:00
Nicolas Lempereur b058f70941 [FIX] web_editor: font>a colorize a change font color
If you change the color of a link with the editor without using the link
edition menu, this do not work (which might be expected), but if the
text outside the font had been colorized, the font will be applied
outside of the link only.

This is unexpected since if we have: "hello <a>cruel</a> world!", if we
select only "cruel" and change color, the change only happen to "hello"
and "world!".

With this changeset, an anchor in the ancestor prevent to use an
ancestor font tag to change color (which prevent the issue).

opw-2044551
closes #35862

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-08-20 13:48:26 +00:00
Richard Mathot e6a1ac6e64 [FIX] models: avoid Unicode error when translating that error message
Same cause, error, rationale and fix than 0ec0a4a32e

#OneCharacterPatch, reloaded

opw-2056251

closes odoo/odoo#35857

Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
2019-08-20 13:16:07 +00:00
Nans Lefebvre 67d82b875c [FIX] account: round balance in the default_get of account move lines
Edit journal entries (account.move).
Create a new line. Credit and debit values are filled in with the default get.
Conveniently, if lines_ids is given in context this computes the right value to
balance existing move lines. However, this is done by float operations.
Let e be the resulting epsilon in balance.
As a result a new line may contain e, 0 for credit, debit (or respectively).
If the user fills in the 0 value with v, then the new line contains e, v.
This violates the constraint that exactly one of the two values should be nonzero.

We get the currency from the journal to round adequately the balance.

opw 2046137

closes odoo/odoo#35815

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-08-19 14:31:45 +00:00
Pieter Paulussen 9e57917376 [FIX] account: fix account_move_line's default_get()
Backport of 50ee1c964b.
Previous version was buggy, as it was already patched by 54c2c0874 and 862c2455.

When creating a journal entry manually, the computed value for the next line
was not taking into consideration all existing lines.
Was PR #25298. Courtesy of Pieter Paulussen (Dynapps)
2019-08-19 12:33:51 +00:00
Andrea Grazioso (agr-odoo) 3bc4d91e9b [FIX] website_sale_comparison: translate product attribute categories
Install the module "Product Comparison". Go to
Website>Configuration>Attribute Categories, then create or edit a category.

No translate button is present when editing the field, there should be one
on the right edge to enter the translation menu.

Adding the missing option in the model.

opw-2052331

closes odoo/odoo#35838

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-20 10:02:15 +00:00
Nans Lefebvre e34de5c565 [FIX] mail: preview of almost empty mail templates
The lxml.html.fromstring method does not accept an encoding parameter, so the
preview crash if the going through this branch, i.e. if the root is an empty tag.

opw 2054368

closes odoo/odoo#35817

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-08-20 09:19:10 +00:00
Nicolas Martinelli 7cbc088d84 [FIX] purchase: return dropship
Backport of 4da82776ff.
Because of e38ed7c7 the code moved between versions, but is otherwise identical.

- Set an internal location as a return location
- Create a SO with a dropship product, validate and deliver
- Return the product, and choose the internal location as the return
location.

The received quantity on the PO is counted twice.

Since the return is an 'in' move linked to a PO, it is automatically
counted as incoming quantity.

This case is quite specific, so we explicitly add an exception in case
the origin move was a dropship, but the return is not a returned
dropship.

opw-1958228

opw 2045685

closes odoo/odoo#35831

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-08-20 08:46:36 +00:00
Lucas Perais (lpe) 5e3d49bc47 [FIX] im_livechat: livechat rating computes well
Open a livechat session between a visitor and a user
That is, open the / controller as public user, and click,
on the bottom right corner, on "Have a question ? Chat with us."
Exchange at least one message to open the session

From the visitor side, close the window. There is a proposal to rate the discussion
Assign either the green face or the yellow one
(The red one is a bit trickier)

Now, on the user side, check the list view of LiveChat sessions

Before this commit, the rating of those sessions were 0
This is because:
The rating.rating < Many2One > mail.channel link is not a foreign key
(rather, it is composed by char::res_model; Integer::res_id)
and doesn't make the reciprocal field recompute, which in turn doesn't make
our relevant field compute

After this commit, the last_rating field field is recomputed and appear in the list view

OPW 2052964

closes odoo/odoo#35830

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-08-20 08:12:32 +00:00
Christophe Simonis c43de33643 [MERGE] forward port branch saas-14 up to fa26279014 2019-08-19 12:51:26 +02:00
Christophe Simonis fa26279014 [MERGE] forward port branch 10.0 up to 59c59cd8a0 2019-08-19 12:47:56 +02:00
Christophe Simonis b6deb72747 [MERGE] forward port branch 10.0 up to 2fc46a064d 2019-08-19 10:24:42 +02:00
Abridbus 2fc46a064d [FIX] mail: removing whitespace on message_id from incoming mail
Because of a whitespace character present at the beginning of the message_id of some mails,
they were fetched twice.

From the SQL side, we see that Outlook is formatting the header following the RFC822
by allowing the header to look like:

Header:<CRLF>
<whitespace><hash_of_msg_id>

From RFC822:
"Each header field can be viewed as a single, logical line of ASCII characters.
For convenience, the field-body portion of this conceptual entity can be split
into a multiple-line representation" (abr.)

It was also possible to find out by checking the logs.
One or two whitespace(s) can be seen before the hash of the msg_id.

The following commit is making sure we use and save the message_id without the whitespace
by stripping them off on the coming mail.

OPW-2006806

Applying CHS solution to avoid crash on empty header.

closes odoo/odoo#35682

Signed-off-by: bve-odoo <Abridbus@users.noreply.github.com>
2019-08-14 07:47:04 +00:00
Raphael Collet 59c59cd8a0 [FIX] field: compute transitive dependencies over non-stored fields
In other words, when a field F depends on a non-stored field G, it also depends
on G's dependencies.  This guarantees that whenever a dependency of G is
modified, F will be invalidated and marked to recompute (if necessary).

The transitive closure of dependencies is not computed over stored fields.
Anyway stored fields already trigger the recomputation of their dependent
fields during their recomputation.  The performance impact on the loading of a
registry is negligible (less than 1%), and the increase of recomputation
triggers is small (less than 10%).

(cherry picked from commit 3fbd86bcbe)

opw-2033493

closes odoo/odoo#35636

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-08-12 09:18:31 +00:00
Nicolas Martinelli 0f878e4839 [FIX] tools: epsilon magnitude
The following rounding is incorrect:
```
>>> float_round(6.6 * 0.175, precision_digits=2)
1.15
```

Indeed, 6.6 * 0.175 = 1.155 ≈ 1.16.

In this specific case, the `epsilon` computed is not sufficient. A
precision of 53 gives:
normalized_value = 115.49999999999997
epsilon = 1.2823075934420547e-14
=> new normalized_value = 115.49999999999999

Bad luck, this is just not enough to tip the value in the right
direction.

However, a precision of 52 is sufficient:
normalized_value = 115.49999999999997
epsilon = 2.5646151868841094e-14
=> new normalized_value = 115.5

The value of 53 was chosen from the `binary64` number format precision.
In case of Python, the corresponding machine epsilon is 2^-52 [1].
Therefore, using 52 instead of 53 does make sense.

It is worth noting that the value of the machine epsilon
2^-52 = 2.2204460492503131e-16, which is still 2 orders of magnitude
below our dynamic estimation.

[1] https://en.wikipedia.org/wiki/Machine_epsilon
[2] `numpy.finfo(float).eps = 2.2204460492503131e-16`

opw-2047368

closes odoo/odoo#35565

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-08 12:06:31 +00:00
Christophe Simonis 1e4de19cd4 [MERGE] forward port branch saas-15 up to c43de33643 2019-08-19 13:54:40 +02:00
Julien CastiauxandHugo Adan 855447fc77 [FIX] ir_rule: invalid user context propagation
Create two models, `object` and `category`. The object have a Many2One
to the category. Override the `search` on the category so it returns a
subset of the records if a context key is present. Create an IR Rule on
object with the following pseudo-domain: `categ_id in category.search([])`.
Search on object with the context key present. Even if the context
should only be applied to category, it is applied to object too thus
there are some object missing.

When evaluating the domain of IR Rules, the current user is propagated
with the current environment context. API calls triggered by the domain
are called with the given context, possibly populating the cache with
different records than it would normally does without the context (i.e.
at `addons/point_of_sale/models/account_journal.py#L19-L23`). Following
requests do use that invalid cache thus return invalid results.

Forcing an empty context on the user used during the evaluation of the
context ensures the IR Rules are working as they should and is
future-proof (cf `load_company` v13 context key)

opw-2041667

closes #35123
closes #35125

closes odoo/odoo#35667

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>


Co-authored-by: Hugo Adan <hugo@vauxoo.com>
2019-08-19 09:04:09 +00:00
Odoo Translation Bot 0458337bc3 [I18N] Update translation terms from Transifex 2019-08-18 03:08:13 +02:00
Nans Lefebvre 6a1e272ccd [FIX] stock: do not raise if writing the same value
Rewrite the product associated to a serial number.
There is a check to forbid this if some move lines already exist.
This check does not actually care what value is written,
so it can raise uselessly (and forbid a legitimate write).

opw 2049717

closes odoo/odoo#35736

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-08-14 15:24:06 +00:00
Sébastien Theys c2271c8740 [IMP] doc: add t-name t-extend to QWeb JS
task-2040835

closes odoo/odoo#35116

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-08-14 12:49:56 +00:00
Patrick Tombez a2b98e94be [FIX] website_sale_comparison: Fix category order
Use category sequence to order them instead of their order of appearance in
the list of sequence ordered attributes

closes odoo/odoo#35610

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-08-13 11:31:10 +00:00
Nans Lefebvre 119ca24d60 [FIX] account: fix invoice line default taxes at account onchange
If there is no product on an invoice line, there is an onchange to ease tax
input that prefills the line with the account default taxes.
Because this is a relational field (a many2many), field = recordset
is as valid as field = recordset.ids, but the semantics is different.
In the second case, the id list is added with 4 commands, not a 6.
So the default taxes are only added, and none are ever removed.
Note that the ORM behaviour changed; this .ids was historical,
but before (v10) it did remove other taxes.

opw 2046112

closes odoo/odoo#35657

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-08-12 13:49:08 +00:00
Odoo Translation Bot b59369d1e6 [I18N] Update translation terms from Transifex 2019-08-11 03:07:39 +02:00
qsm-odoo f7e83b69c6 [FIX] website_event: clean local events snippet before save
The local events snippets is an empty HTMLElement which is filled by
JavaScript on page loading. Before this commit, the filled content was
saved in database. This does not create a real problem as the content
is reloaded as soon as the page loads but you can see old events
flickering before the new events are actually loaded.

Now the snippet is cleaned before saving. This also allows to add
default content with a custo so that it is shown during the events
loading (as we are currently doing on odoo.com...).

closes odoo/odoo#35597

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-08-09 11:34:21 +00:00
Nicolas Martinelli dff2e242a5 [FIX] document: PDF indexing
Backport from 12.0, commit : 1b753b0d53
note: there was also report of PDF content blocking that when indexed
blocked an instance worker indefinitely

Since PyPDF2 gives bad results for PDF indexing, stop using it since it
raises more issues than it helps users.

opw-2044679

closes odoo/odoo#35310

closes odoo/odoo#35525

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-08-07 11:30:51 +00:00
Goffin Simon f93fcaffb5 [FIX] stock_dropshipping: Updating dropship product
Steps to reproduce the bug:
- Install stock_dropshipping module and enable Routes on SO lines
- Create a storable product P with a supplier S
- Create a SO with P and set this line with the route dropship
- Confirm the SO ( a PO has been created to S with P)
- Change P on the SO with an other product

Bug:

The product P stayed on the PO.
So a product linked to a PO line cannot be changed on a SO.

Do not forward-port in 12.0 and upper

opw:2040249

closes odoo/odoo#35454

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-08-06 08:23:44 +00:00
Lucas Perais (lpe) d91b1e5bd5 [FIX] account: payment cancel resets name
Make a transfer payment from bank to cash
validate, check the journal entries
You see that there are two moves, each with the name
given by their journal's sequence (one in bank, one in cash)

Now, unreconcile, and cancel the payment
set it to draft, re-confirm it

Before this commit, the entries created had the same name which was
the name of the previous journal entry
This was because, at cancel time, the move_name of the payment was not reset

After this commit, the move name is reset on cancel, and both
journal entries have a new sequence based name when
confirming the payment the second time

OPW 2046412

closes odoo/odoo#35478

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-08-06 08:01:29 +00:00
Christophe Simonis 6668f69822 [MERGE] forward port branch saas-14 up to 14547f847c 2019-08-05 14:58:14 +02:00
Christophe Simonis 14547f847c [MERGE] forward port branch 10.0 up to af3f6e596d 2019-08-05 14:50:37 +02:00
Christophe Simonis c0ffe50580 [MERGE] forward port branch saas-14 up to 841fa79c8a 2019-08-02 10:24:46 +02:00
Christophe Simonis 841fa79c8a [MERGE] forward port branch 10.0 up to a94b00e498 2019-08-02 10:18:36 +02:00
Odoo Translation Bot a94b00e498 [I18N] Update translation terms from Transifex 2019-08-01 02:41:11 +02:00
Lucas Perais (lpe) 0b13c3038f [FIX] l10n_be_intrastat: propagate country_id
Before this commit, the field intrastat_country_id was not propagated when refunding an invoice

After this commit, the refund invoice takes the same values for that field
as the invoice it is refunding

OPW 2028333

closes odoo/odoo#35309

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-30 15:35:14 +00:00
Anh Vu 3748ac5d17 [CLA] Signature for anhvu-sg
closes odoo/odoo#35235

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-30 12:52:07 +00:00
amoyaux af3f6e596d [FIX] stock : webplanner link to product does not work.
In the planner the url are generated by prepare_backend_url that takes
an action's xml id as argument. The id passed should have the format
'module_name_where_the_action_is.action_name'. In this case the id passed
was product.product_template_action_product but the action is defined in
stock thus the prepare_backend_url was not able to find the associate action
and return a wrong(default) url.

This commit change the action id passed with the correct module.

closes odoo/odoo#18812

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-07-29 12:49:26 +00:00
Nans Lefebvre 47587de19b [FIX] payment_authorize: save payment token from form validated transaction
https://docs.python.org/3/library/stdtypes.html#truth
By default, an object is considered true unless
its class defines either a __bool__() method that returns False
or a __len__() method that returns zero

Since etree elements are iterator, they define a len function.
However it turns out that customerProfileId has always no children.
So bool(find(x)) is always False; the intended meaning was find(x) is None.

opw 1999427

closes odoo/odoo#34922

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>

closes odoo/odoo#35246

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-29 08:10:42 +00:00
Stefan Andersen 6613611039 [CLA] signature for stfnndrsn
closes odoo/odoo#35156

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-25 12:00:09 +00:00
Christophe Simonis d649cab7b9 [MERGE] forward port branch saas-14 up to 39de3797f8 2019-07-25 11:42:01 +02:00
Christophe Simonis 39de3797f8 [MERGE] forward port branch 10.0 up to cb3bf5509f 2019-07-25 11:41:33 +02:00
Romain Derie cb3bf5509f [FIX] web_editor, website: avoid returning children of inactive view
Before this commit, for the following view tree:
P (active)
|
I (inactive)
|
II (active)
When calling `customize_template_get()` on 'P', it would wrongly return 'II'.
It shouldn't, since its parent 'I' is inactive.

Step to reproduce:
- Go to /shop
- Enable ecommerce categories
- Enable Collapsible Cateogories
- Disable ecommerce categories
- Collapsible categories is still shown even if its parent got archived

Test writen in 12.0 with #35154

closes odoo/odoo#35155

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-24 15:19:26 +00:00
Christophe Simonis fc80a9dae3 [MERGE] forward port branch saas-14 up to 36fdb2ff49 2019-07-24 14:01:48 +02:00
Romain Derie 36fdb2ff49 [FIX] website_sale: restore possibility to remove promo code pricelist
Since 5c9cea4ee7, it was not possible to remove an applied promo code
pricelist by adding an empty promo code on checkout (eg removing the one shown
in the promo code input).

Indeed, when sending an empty promo code, the `search()` done in the controller
would not find any pricelist as promo would be en empty string. For the rest,
check code on mentionned commit.

See `sale_get_order()` method docstring about `code` param: "If empty, it's a
special case to reset the pricelist with the first available else the default.".

Fixes #34633
2019-07-24 11:31:57 +02:00
Nicolas Lempereur 11fb681d2b [FIX] point_of_sale: list in Sale Details wizard
On mobile devices, by default Odoo will uses a kanban view instead of a
list view if avaiable.

In the case of "Point of Sale > Reporting > Sale Details", we can select
the list of point of sale configs. It works fine on desktop, but on
mobile we had the kanban view that does not allow to remove selected
configs (and there is "New Session", "Resume" and so on buttons that
make little to no sense).

With this changeset we force in the case usage of the list view.

opw-2040954
closes #35104

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-23 13:05:04 +00:00
Christophe Simonis b8be821058 [MERGE] forward port branch saas-15 up to 6668f69822 2019-08-05 16:15:38 +02:00
Alex Tuyls 3682232d1e [FIX] portal: zipcode field labelled as mandatory
Field zipcode is optional, while it is labelled
as mandatory.

closes odoo/odoo#35401

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-02 09:37:30 +00:00