Commit Graph

95202 Commits

Author SHA1 Message Date
Denis Ledoux 759492167a [FIX] web: textarea of editable list above everything
When expanding a textarea of an editable list,
by putting a long description for instnace,
with multiple lines,
some elements were put above the textarea,
making the content partially hidden

opw-709894
Closes #16083
2017-04-03 17:23:58 +02:00
Cédric Pigeon a1aada9f76 [FIX] stock: new cursor for orderpoint
On large databases, the orderpoint calculation can fail due to the huge
cache used diring the process.

Instead of using one cursor for the transaction, we create a new cursor
every 100 orderpoints, to limit the cache size and speed up the
performances.

opw-726711
Closes #16158
2017-04-03 10:13:03 +02:00
Odoo Translation Bot 794c9f5118 [I18N] Update translation terms from Transifex 2017-04-02 02:56:31 +02:00
Odoo Translation Bot fb130ec5a4 [I18N] Update translation terms from Transifex 2017-04-01 02:56:03 +02:00
Jeremy Kersten d7c765f62f [FIX] openerp: fix traceback when no field in constrains
In case you don't have 'field', the first 'if' will raise a warning.
In this case the second 'if' will crash with:
    "'NoneType' object has no attribute 'store'"

This commit closes #16146
Courtesy of @kmetaxas
2017-03-31 11:52:31 +02:00
Joren Van Onder 7f260ab517
[FIX] point_of_sale: round product.product price analogous to backend
A rounding issue was resolved in
ee33593351. It however introduced
another issue.

Rounding functions (both round_precision in web.utils and float_round
in openerp.tools) are not perfect due to IEEE floating point
limitations. However both should produce the same output given the
same input. An example: rounding 13.95 to 2 digits yields
13.950000000000001.

The additional rounding introduced in
ee33593351 on price lead to issues in
certain cases. One example occurs when applying a 90% discount on a
product costing 13.95. The POS will do the following:

> 13.950000000000001 * 0.09999999999999998
1.3949999999999998
> round_pr(1.3949999999999998, .01)
1.4000000000000001

whereas the backend will do (as eg. in sale.order.line)

>>> 13.95 * 0.09999999999999998
1.3949999999999996
>>> round(1.3949999999999996, 2)
1.3900000000000001

Causing a difference of 0.01.

The core of the issue is that in the backend 13.95 is rounded
differently. When a Float gets written to the database doesn't just
pass through the regular float_round. It passes through
_symbol_set_float which truncates characters exceeding the precision.

This implements the same approach in the POS.

opw-715506
Closes #16119
2017-03-29 10:45:43 +02:00
Jairo Llopis 5fc3979262 [FIX] web: Avoid double-fetching many2many tags in list views
Before this patch, #15920 was happening. The problem was that calling `render_cell` produced a call to [`record.set(column.id + '__display', value)`][1], which triggers the `change` event, which called `render_record` the first time, which called again `render_cell` and produced the 2nd data fetch.

After this patch, `render_record` is only called if there is some place where to put the result, which does not happen in those situations.

There is still the problem that there is one call to name_get for each many2many widget found in a list view (instead of one per full view rendering), but at least they are not two calls!

[1]: 5d17749ff4/addons/web/static/src/js/view_list.js (L1125)
2017-03-28 15:12:56 +02:00
Wolfgang Taferner 8e7f34c323 [FIX] web: domains might be undefined, so we check
Introduced recently in b2d66d0c14

opw-726354
Closes #16068
2017-03-28 15:02:47 +02:00
Nicolas Martinelli 59a6397867 [FIX] stock: sort moves to do
- Activate the MTO route on SO lines
- Activate the route "Buy" on a Product A without quantity on hand, add
  a supplier
- Create a SO with 2 lines. First line is Product A, second line is
  Product A with route MTO
- Confirm the SO, run the procurement if necessary
- Confirm the PO, receive the products
- On the picking generated from the SO, you should have one line
  "Waiting Availability" (the line not MTO) and one line "Available"
  (the line MTO).
- Click "Recheck Availability". One reserved quant from line 2 is moved
  to line 1.

A trick is to assign first the move with ancestors, so we don't "steal"
the reservation on the other move.

Fixes #15950
opw-725373
2017-03-28 13:30:29 +02:00
Martin Trigaux e25dad4fed
[I18N] point_of_sale: missing source terms reference 2017-03-28 12:49:01 +02:00
Odoo Translation Bot 7aea6c9ad4 [I18N] Update translation terms from Transifex 2017-03-26 03:09:57 +02:00
Christophe Simonis 08213e831e [REM] useless empty sql file wrongly commited by 0b529cf3af 2017-03-24 17:03:11 +01:00
Christophe Simonis 5847de4aaf [FIX] web_calendar: remove attendee icons from event title 2017-03-24 15:12:39 +01:00
qsm-odoo b2d66d0c14 [FIX] web: properly combine domains with "OR" in CompoundDomain
The CompoundDomain class allows to regroup several domains with an
implicit "AND"; these domains can be either a string, an array or
another CompoundDomain. A CompoundDomain can then be converted to
an array thanks to pyeval.js.
For example, if a CompoundDomain is initialized with `[A, B]` and
`[C]`, the array conversion gave `[A, B, C]` (which is expected).

However, a hackish method was used with CompoundDomain. If one of the
domain of a CompoundDomain is equal to `["|"]` (an array with the
OR operator in it), the two next subdomains were supposed to be joined
by a OR operator. Indeed, for the case of a CompoundDomain initialized
with `["|"]`, `[A]` and `[B]`, the array conversion gave `["|", A, B]`
(which is expected). However, if initialized with `["|"]`, `[A, B]` and
`[C]`, the array conversion gave `["|", A, B, C]` which is very wrong
as what was expected is `["|", "&", A, B, C]`. The problem is that the
given `[A, B]` contains implicit "&" operators.

This commit fixes the problem by normalizing only if the CompoundDomain
starts with a ["|"] or ["!"] array which is the standard odoo case.
This allows to limit breaking custom code (e.g we want a simple "AND"
of `[A]` and `[B]` to stay `[A, B]`, not become `["&", A, B]`).

The commit also modifies a test so that it checks that the problem is
properly solved.
2017-03-24 15:03:54 +01:00
Fabien Meghazi 874c7aa2dd [FIX] web/mail: many2many_tags_email widget returns erratic values (opw: 693067)
The many2many_tags_email's internal value change logic fails to process
all its values. It is not concurrency proof either.

The internal value change logic is now replaced by a mutex and deferreds
are used for the partner's form view popups in order to allow concurrent
events.
2017-03-24 11:28:31 +01:00
Goffin Simon 0b529cf3af [FIX] http: setup_lang in Safari
Fine tuning of this commit: 5761b9a388

opw:716519
2017-03-22 17:03:23 +01:00
Goffin Simon 5761b9a388 [FIX] http: setup_lang in Safari
When not logged in the webstie on Safari and clicking on "Have a Question? Chat with us",
it creates a mail.channel from get_mail_channel and it also creates a translation.
But with Safari, the accept_languages is set with the value 'fr-fr', and this value was set
in the context as the lang='fr_fr'. So when the translation was created, a bad insert query was
raised in sql because the lang didn't exist in the res.lang table. When a translation is created,
the function _get_languages checked that the language is in the table.
So it was impossible to use the chatter when the user is not logged.

NB: interseting functions to see:

-setup_lang in odoo/http.py
-_dispatch in addons/website/models/ir_http.py
-get_mail_channel in addons/im_livechat/models/im_livechat_channel.py

opw:716519
2017-03-21 17:02:59 +01:00
Lucas Perais 1600216c1d [ADD] hw_screen: implement support for customer facing displays (#15303)
This adds the hw_screen module which is responsible for receiving
rendered HTML from a POS client and sending it to a running Chromium
browser. This is done by sending Remote Debugging Protocol messages over
a WebSocket provided by Chromium. This allows hw_screen to evaluate
arbitrary JS. This is used to seamlessly (without flickering) update the
browser.

This also includes changes to the POSBox. X, Chromium and some
miscellaneous other programs were added. Functionality was added that
automatically displays a fullscreen, UI-less Chromium browser when the
POSBox starts up. This is accomplished through x_application.sh, which
gets executed only when a display is detected. After the browser starts,
it will display a specific screen until it receives the first order update
from a POS client.
Creates a public controller to be able to display the interface on an external
device not connected to the posbox (e.g. tablet)

Courtesy of JOV, LPE, ODO and MAT
2017-03-21 11:50:12 +01:00
Odoo Translation Bot a09e4aa7aa [I18N] Update translation terms from Transifex 2017-03-19 02:55:34 +01:00
Martin Trigaux 8459860b02
[IMP] hw_escpos: more fault tolerant printer detection
In some cases, the description fails (unknow printer, udev issues,...) and while
the printer works fine, the description fails.

This is a cherry pick of 994d45f4 to 8.0 (as the posbox is built on top of it)
2017-03-16 13:37:20 +01:00
Christophe Simonis 7a15e52cea [FIX] base: check ir.ui.view recursion 2017-03-13 13:27:53 +01:00
Odoo Translation Bot 70cac4d474 [I18N] Update translation terms from Transifex 2017-03-12 02:54:51 +01:00
Christophe Simonis f9fa39a8c0 [FIX] board: correctly handle invalid actions
This may happen when a dashboard contain references to deleted actions.
2017-03-08 16:31:03 +01:00
Odoo Translation Bot 1246680756 [I18N] Update translation terms from Transifex 2017-03-05 02:55:35 +01:00
Denis Ledoux df5f0f2570 [FIX] sale: The order lines weight must change when the quantity change
This is a regression of
1cedcf6abb
and a following of
9a9720ac14

opw-709700
2017-03-03 10:57:46 +01:00
Christophe Simonis 2b8605c6e2 [FIX] google_drive: show icon via css instead of injecting html 2017-03-01 18:39:34 +01:00
Odoo Translation Bot 775022e01f [I18N] Update translation terms from Transifex 2017-03-01 02:54:50 +01:00
Martin Trigaux 18fd9fe0a8
[FIX] server: avoid cron thread death
In case an exception (programming, out of memory or any other unexpected
failure), the cron_thread would crash and not recover until server restart.

Issue #15666 was an example of failure.

Courtesy of Nils Hamerlinck
2017-02-28 18:00:50 +01:00
Martin Trigaux 69e91f6a7c
[FIX] base: recover thread from down postgresql
If postgresql database is temporarly down, the cron thread may fail.

The cursor creation fails when trying to connect to the server which leads to
the cron thread to die (uncatched exception) and will not restart when postgres
is back.

Fixes #15666
2017-02-28 18:00:00 +01:00
Isaac Gallart Bochons 48cebafdaf
[FIX] mrp: call message_post separately
message_post accepts only one id

CLA signature for igallart done at #15625

Closes #15625
2017-02-27 12:26:42 +01:00
Odoo Translation Bot 333e7d1f9e [I18N] Update translation terms from Transifex 2017-02-26 02:55:24 +01:00
Levent Karakaş a6c2210770 [FIX] hr_payroll: sum correctly category code
If amount = 1 and the category amount = -1, the sum is 0 and the returned
value was amount instead of zero (`0 or amount`)

Avoid this evalution error by splitting on multiple lines

Closes #15470
2017-02-20 16:19:12 +01:00
Odoo Translation Bot 0616016b47 [I18N] Update translation terms from Transifex 2017-02-19 02:54:42 +01:00
Adrien Peiffer (ACSONE) a587fde991
[FIX] web_calendar: translation for title on calendar form
The previous code (`parent.field_widget.string`) was returning the untranslated
action name (and why use parent anyway?)

Use the action name instead.

Closes #15207
opw-705938
2017-02-17 16:45:05 +01:00
Denis Ledoux 5de7500a41 [FIX] sale: stuck workflow in invoice before delivery
With a sale order with:
- a stockable product
- the `Create Invoice` policy set to `Before Delivery`

After the quotation validation and the invoice validation,
if the user:
 - cancelled the invoice,
 - then validated it again,
 - then hit `ignore exception` on the sale order
 - then registered the payment on the invoice

The picking of the sale order was not created automatically,
and the sale order was therefore stuck.

Actually, it was just a write trigger that was missing:
The condition for the sale order workflow to go to the next state
is that the `invoiced` boolean is set to True.

It was, when the invoice of the sale order was paid
(after having registered the payment), but since
this is a computed field, not stored, no write operation
was actually performed on the sale order, and the workflow
wasn't "notified" that a change occured for the `invoiced` boolean.

A simple write on the sale order (e.g. in its notes) would
have unblock the situation, though.

This trigger ensures the worfklow to be notified when
the invoice of the sale order is paid, and therefore
when the `invoiced` boolean is set to `True`.

opw-706591
2017-02-16 11:20:20 +01:00
Odoo Translation Bot 78be4cd1de [I18N] Update translation terms from Transifex 2017-02-12 02:53:52 +01:00
mge-odoo 8cb13c4e4c [FIX] openerp: quote read_group SQL query for case sensitive tables
In SQL, if there is no quote around the table/field, the result will
be returned as case insensitive.

This was causing a bug in the kanban view which was not displaying
the records because x_AA_count was named x_aa_count.
2017-02-08 15:55:47 +01:00
hurrinico 51cf2852d8 [CLA] signature for hurrinico
Done at #15340
2017-02-07 13:58:21 +01:00
Odoo Translation Bot 8ce1e51340 [I18N] Update translation terms from Transifex 2017-02-05 02:54:43 +01:00
Nicolas Martinelli 174d3fdd66 [FIX] account: bank account on invoice
In case of a supplier invoice or a customer refund, it is not possible
to set a bank account if the partner is not the commercial partner.

opw-705528
2017-02-03 10:24:01 +01:00
Joren Van Onder c0817016d2 [FIX] point_of_sale: fix country selection on touch events
The POS uses FastClick to circumvent the 300ms touch delay implemented
by browsers before a click event is fired. (Although this has since been
removed, probably we can get rid of this in the POS at some point as
well [1]).

The way FastClick works is simple: immediately fire a synthetic event
and block the one fired by the browser 300ms later.

Recently, browsers have started to only trust native events to trigger
default actions [2][3]. Chrome in particular has started not trusting
synthetic events since v53.

FastClick provides a solution for this with the needsclick class. It
will not interfere with events triggered on elements with this class.

[1] https://developers.google.com/web/updates/2013/12/300ms-tap-delay-gone-away
[2] https://w3c.github.io/uievents/#trusted-events
[3] https://www.chromestatus.com/features/5718803933560832

Fixes #14886
2017-02-02 09:46:48 -08:00
Nicolas Lempereur e3232c85b9 [FIX] mrp_byproduct: remove wrong move_dest_id link
A byproduct is a produced when producing another product (the targetted
product).

A move can be linked to another move. eg: we could have a manufacturing
order of 3 units linked to a move of a delivery order of these 3 units.

If we produce 2 units, the manufacturing order is split in 2 units and
1 units, and the delivery order is split similarily because of the link

1. [T manufacturing move split] -> [T delivery move split]

(T is the targetted product, B is the byproduct)

But in 8c307d7b1 a move_dest_id of a byproduct was linked to the targetted
product delivery move, thus in some situation the move of the delivery
order of the byproduct would erroneously be split 2 times instead of one.

1. [B manufacturing move split] -> [T delivery move split]
2. [T manufacturing move split] -> [T delivery move split]

This could also be the source of other issue, and since the byproduct
and targetted product are different, the link should anyway not be done.

opw-697151

note: this change is already in 10.0 (it is inside mrp refactoring 2ddc35a53)
2017-02-01 15:33:53 +01:00
Nicolas Martinelli e0222de3c2 [FIX] stock: update qty on hand
When the quantity on hand is updated from the wizard, it may result in
completely inconsistent results.

This happens for example in the following case:
- 10 Units in Stock/WH
- 18 Units in Stock/WH/Shelf 1

The "New Quantity on Hand" suggests a theoretical quantity by taking
into account the location and its sub-locations. It the example, that
would mean 28 Units in location 'Stock/WH'.

However, the `_get_quants` method of the `stock.inventory.line` model
doesn't take into account the children locations. Therefore, the
theoretical quantity would be 10 Units in location 'Stock/WH'.

This inconsistency confuses the user, and the new quantity added might
introduce unexpected results.

opw-703886
2017-02-01 13:07:06 +01:00
Hpar c5bda97494 [FIX] website_sale: fix promise website.ready
This closes #15266 and closes #15267
2017-01-30 11:50:07 +01:00
Odoo Translation Bot 66e2ddd670 [I18N] Update translation terms from Transifex 2017-01-29 02:55:31 +01:00
Olivier Dony 492d8ce4d0
[FIX] config: correctly bootstrap data_dir
Complements the patch in 15583a4813
in order to properly bootstrap a writeable data_dir when it is
(partially) nonexistant.
Depending on the startup parameters the data_dir might otherwise
have ended up read-only, preventing the creation of its necessary
components (session store, file store). Only the `addons` directory
of the data_dir needs to be read-only by default.
2017-01-28 00:53:20 +01:00
Olivier Dony f431cee99a
[FIX] hw_escpos: increase timeout for slow matrix printers
Some printers (e.g. matrix/impact printers) may have a hard time
keeping up with the text output, and may trigger timeout errors
because of this, even though they would otherwise produce a correct
result.

Increasing the default timeout to 5s (from the default 1s) should
take care of most slow printers out there.
2017-01-27 14:42:36 +01:00
Olivier Dony af381bf7ec
[I18N] base: update PO template for 15583a4 2017-01-27 14:40:34 +01:00
Olivier Dony 15583a4813
[FIX] module: allow disabling 1-click install
As discussed on issue #15225, it should be possible for system administrators
to disable the 1-click installation system.
The plan is to disable the feature by default, but make it relatively easy
to turn on when it is explicitly desired.

1. At the moment we cannot guarantee that all Apps published on the Odoo Apps
   Store are safe. And it is a security risk to let end-users deploy Python
   code on their Odoo servers without requiring any review/deployment by a
   competent system administrator.
   We will work on improving the validation process of the Store, but this
   will require time, and won't probably be a 100% safe process in any case.
2. The one-click install feature is however really useful to help
   non-technical users install Apps, as long as the feature has been
   explicitly allowed by the system administrator. This is a common feature
   in other software suites as well. So we'd like to keep it as an opt-in
   feature.
3. Administrators of multi-tenant servers, cloud hosting services, etc.
   understandably expect to be able to turn off the feature for
   security/control reasons.
4. By turning off the feature by default, but still exposing it in the UI,
   we keep it *discoverable* for users. The error message should be
   helpful to direct users to their sysadmins.
5. By using the permissions of the download folder as a flag for turning
   off the feature, we avoid introducing an extra server parameter.
   The folder is still created (read-only) by default, for the sole purpose
   of making it easier to locate.

Fixes #15225
2017-01-27 13:00:42 +01:00
Nicolas Lempereur cfcc37bca5 [FIX] expression: leaf in o2m with m2o inherits'd field
The reverse field of a one2many could be originating from an
inherits'd field, this was solved in some instance with f5e5bbda.

The issue could still happen in some instances when doing a comparison
of:

- the one2many field to a False value,
- the one2many with a negative operator and an empty set to negate,

With this change, the ORM is used in such a situation.

closes #15234
opw-704962
2017-01-26 16:47:52 +01:00