Commit Graph
117156 Commits
Author SHA1 Message Date
Rémi Rahir ae57243dfb [FIX] iap: translation terms
Added missing translation on iap error modal.
2017-12-18 17:32:21 +01:00
Rémi Rahir a46b79f185 [FIX] iap: fixing display in the crash manager
Before this commit, there was a default behaviour reducing the padding of the qweb render
to 0 in order to display bakcground images correctly. Unfortunately, this doesn"t take in account
cases where images or more generally, qweb template were not provided in the InsufficientCreditError
message.

This commit solves this situation.
2017-12-18 17:32:21 +01:00
Géry Debongnie dbdd742d20 [FIX] web: better mode handling, prevent useless work in some cases
Before this commit, the way mode was handled was not optimal.  The end
result was correct (the widget were properly created/displayed in
edit/readonly as required), but useless work was done.  In particular,
if we have list/x2manys with widgets and modifiers, it could happen that
widgets were created in edit mode, then destroyed and recreated in
readonly mode.

This could happen in some important views, for example, any view with a
field many2many_tags with a readonly modifiers (pretty much all views
handling taxes)

In this commit, we add a 'editable' attribute to list renderer.  This is
necessary, because the list renderer is not actually editable when it is
in a x2many in a form view which is in readonly mode.  Also, we need to
manage the distinction between the fact that a list view is editable,
and the fact that some widgets are created in edit and other in readonly
mode, depending on modifiers, and on which line is being edited.

We also add a benchmark (courtesy of CHM) to be able to measure the
performance impact of edit/readonly/onchange in a larger form view.
Before this commit, running this form benchmark on my machine gave a
number of 0.4 op/sec, and after, it increases to 1.26 op/sec, so a
pretty large improvement.
2017-12-18 17:29:14 +01:00
Géry Debongnie 0c98951f1c [FIX] barcodes: use patch to prevent interactions between tests
There is a subtle issue happening in tests when we override a widget
property for the duration of the test and try to restore the initial state at
the end by rewriting on the property.  It actually changes the widget, by
having a function bound to the sub widget prototype instead of its ancestor.
This in turns can cause weird interactions with the class system.

We introduced a proper way to temporarily patch a class/widget by adding
a method in testUtils to do exactly that.  This commit simply uses that
method to prevent unwanted interactions in barcode tests
2017-12-18 17:29:14 +01:00
Géry Debongnie fa9f58d6ce [IMP] web: tests: add a way to properly mock Widgets
This rev. introduces two helper functions for the tests: patch
and unpatch. Those function allow patching an Odoo Widget (e.g.
AbstractField), and unpatch it at the end of the test with the
guarantee that the Widget's prototype is exactly the same as it
was before the test.

This was necessary because the way it was done before was a little
bit too naive, and could lead to unexpected behavior. Indeed, doing

 var someFunction = AbstractField.prototype.someFunction;
 // test content
 AbstractField.prototype.someFunction = someFunction;

is correct if someFunction is actually define (or overriden) in
AbstractField, as in that case, it really exists on its prototype.
Otherwise, it isn't correct if it is not directly defined on the
prototype before the test, as it will be after..
2017-12-18 17:29:13 +01:00
Géry Debongnie 5e70e949d5 [FIX] web: prevent double translation in kanban view
The kanban view uses a template which comes from the server, already
translated.  Before this commit, it tried to retranslate again the
template in qweb.js, which may be a problem (in addition to the useless
work): if some english string A is translated in B (french), but B is
also a valid english string which is translated into C in french, then
we will have a wrong result.

In this commit, we simply add a flag to disable the translation process, which
should also slightly improve the kanban view rendering performance.
2017-12-18 16:38:30 +01:00
qsm-odoo b1b13dbeed [FIX] web_editor: revert copy/paste feature of the editor
The feature was introduced and fixed by following commits:
- https://github.com/odoo/odoo/commit/906875fc78cb80f6c3d5f1f14f997008cd406473
- https://github.com/odoo/odoo/commit/76be5eed449c78eaf0b4208c381169132492ab4a
- https://github.com/odoo/odoo/commit/7401807510a103374fa8eb524ae5a5698ae21a39

The feature is however still buggy in lots of cases as it is a bad
heuristic that cannot handle simple pasting cases. The feature was
initially introduced to allow pasting PDF content without having to
remove all the unwanted line breaks this induces. As this feature is
not that important and introduced more bugs than it solved, the feature
is deleted by this commit. If we want that feature again, maybe it is
worth considering an "Import from PDF" button or something like that.

See https://github.com/odoo/odoo/issues/15665
2017-12-18 16:10:33 +01:00
Nicolas Martinelli 9b83b1ba64 [FIX] point_of_sale: prevent scanning on receipt
- Sell a Product A
- From receipt screen, scan the barcode of Product B
- B will be in tab along with A
- Pay and validate
- Close the session

Only an order with Product A is recorded in the session (order 1).

When performing this set of actions, a new order is not created: the POS
simply reuses the current order. However, `create_from_ui` (called in
the receipt screen) discards an order if the reference already exists.
This means that the first order is correctly synchronized at validation,
while the second order is silently discarded.

Closes #16781
opw-766459
2017-12-18 14:40:19 +01:00
tbe-odoo 2eb0180021 [FIX] payment: Do not display add card button if no s2s acquirer
> - On the route /my/payment_method if there's no s2s acquirers you cannot add a new card, so we hide the button if no s2s acquirers found.
2017-12-18 14:36:17 +01:00
Pierre Masereel 8a96885153 [FIX] stock: save the quantity done when move_line in readonly 2017-12-18 13:06:16 +01:00
Pierre Masereel 50d66c55f4 [FIX] stock: show packages when picking done or cancel 2017-12-18 13:06:16 +01:00
Stéphane Bidoul (ACSONE) 34ed42f16d [FIX] hr_expense: unbreak consistency check
Purpose
=======

Unbreak consistency check:

- on creation (check not done)
- when applied to a record set of several sheets belonging to different employees (reporting spurious errors)

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

- self.something() in a api.model method does not make sense, so I replaced it with a call on the newly created sheet.
- Iterate on sheets instead of mapping all the lines
2017-12-18 12:37:28 +01:00
Stéphane Bidoul (ACSONE) 5377f7b85c [FIX] hr_expense: Make _check_employee dependent on employee_id
Purpose
=======

Employee must match on sheet and lines

Since the employee_id field of hr.expense.sheet is modifiable in submit state, there is a possibility to modify a sheet in such a way that the employee does not match on the expense sheet and expense lines. This commit fixes this.
2017-12-18 12:32:17 +01:00
Arnold Moyaux 7e4b863fb3 [FIX] purchase_requisition: call for tender
When using requisition with a mto product the link
between moves coming from supplier and move going to
customer are not created.

It happens because creating a purchase order from a
requisition set automaticaaly a default requisition id
that trigger an onchange. However the onchange modify the
move dest ids but those are not present in the purchase order
view and thus not send to the server during the create call.

This commit includes the move dest ids as invisible in the view.
2017-12-18 11:46:32 +01:00
Arnold Moyaux 1f860fea38 [FIX] mrp: generate move_line with same lot
Usecase to reproduce:
- Set a product with the same lot in different locations
- Create a MO that will uses theses products and that require more than one location
- Produce it.
-> Traceback Expected singleton: stock.move.line

It happens because product produce only expect one move line
by lot. Howeever it could exist more than one move line if the
product for a specific lot are shared among multiple under location.

This commit try to fill the move line with the correct quantity
one by one and add the extra in a new move line.
2017-12-18 11:46:21 +01:00
Arnold Moyaux 08bf52f5db [FIX] mrp: final lot not passed between workorder
Use case to reproduce:
- Create a MO with a product tracked and a qty to produce greater than 1.
- The Bom should also use a routing with at least 2 operations.
- On the first workorder only produce 1 unit and record the production
- Go to the next workorder -> The final lot is not set.

It happens because the lot for the next workorder is only set if the
total quanity for the mo was produced.

This commit fixes the bug by removing the code for the workorder lot
assignation outside the wrong condition. This commit also update the
test test_00b_workorder_process that allows us to find the above bug.
2017-12-18 11:45:32 +01:00
Alexandre Kühn 6632822d14 [FIX] web_editor: html field commitchanges fully loaded
Fix over this one: https://github.com/odoo/odoo/commit/cae188514fa8b0a7c785a630ac4aff677b2071fa

The intent was to disable buttons in form views until html fields are fully loaded,
but it was not disabling the buttons for the following reasons:

   1. It is looking for buttons in the DOM, although they
      are not already attached into the body at this moment.
   2. It was disabling the buttons only at widget start(),
      so only once after "Empty Cache and Hard Reload".

We propose a better solution than disabling the buttons in the control panel:
when we click on "Save", the html field ensures that it is fully loaded while commiting the changes.
2017-12-18 11:27:11 +01:00
Goffin Simon 052323fae4 [FIX] l10n_in_hr_payroll: Unable to refund payslip
When no input line is found in get_payslip_lines, the input line with
amount_python_compute = 'result = inputs.ARS.amount', the function __getattr__
on BrowsableObject returns 0.0 for ARS and raises an error for amount because
a float has no attribute amount.

Inspired from 9a6e7799fe

opw:785033
2017-12-18 10:29:22 +01:00
Richard Mathot cea587e383 [FIX] *: wrong forward-ported imports 2017-12-18 09:52:24 +01:00
Nicolas Lempereur bed48ad960 [FIX] web: mobile tab wrong if "Undefined" column
If a kanban view is grouped on a many2one, records with the field unset
are displayed in a column "Undefined" displayed first.

But the tab in mobile view doesn't respect this, so we can get:

columns: Undefined colA colB
tabs: colA colB Undefined

So we always get always on the wrong column wrong when clicking on a
tab: clicking on colB we get on colA, clicking on Undefined we get on
colB, ...

note: in this commit the "false" tab has been set to a translatable
"Undefined" name.

issue found when working on #21199
2017-12-18 09:30:48 +01:00
Nicolas Lempereur 9518c51374 [FIX] web: kanban column sortability never removed
If at one time kanban column are sortable then they stay sortable for
ever even if they should not.

eg. kanban view is grouped by a many2one (sortable) then by selection
field (should not be sortable): the columns are still sortable.

issue found when working on #21199
2017-12-18 09:30:48 +01:00
Nicolas Lempereur 12048bd68a [FIX] web: kanban column id may be based on value
A kanban column has two identifiers:

- db_id: framework unique identifier for the column

- id: either the record res_id (grouped on x2o) or the value

The issue is that sometimes the value may be a any string which
would be source of issue unexpected for an ID (and there was one
issue in mobile renderer).

This code change this so "id" is either the record res_id or
`undefined` value, and when used in XML we use id or fallback on db_id
when we need an identifier.

So in the XML data-id on a colum is always either the ID of the record
the group is based on, or the db_id in the form.

opw-782433
closes #21199
2017-12-18 09:30:48 +01:00
Richard Mathot 8628cef167 [REV] "[FIX] base: language code for Khmer (Cambodia)"
This reverts commit 3830621075.

This patch was unstablie as updating language code is actually forbidden.
2017-12-18 09:26:06 +01:00
Richard Mathot 8ce7e826a5 [REV] "[FIX] base: language code for Khmer (Cambodia)"
This reverts commit 3830621075.

This patch was unstablie as updating language code is actually forbidden.
2017-12-18 09:25:34 +01:00
Richard Mathot b64d01f325 [REV] "[FIX] base: language code for Khmer (Cambodia)"
This reverts commit 3830621075.

This patch was unstablie as updating language code is actually forbidden.
2017-12-18 09:25:03 +01:00
Lucas Perais (lpe) 9de2bd54e5 [FIX] web: fix progress_bar if grouped by date:interval
Before this commit, when grouping a kanban by date with a modifier
e.g. crm.lead grouped by create_date:month

A traceback was thrown on the python side bacause create_date:month was literally not a field

After this commit, the progress bar in that situation displays well,
at the price of copying bits of the read_group infrastructure

OPW 785021
2017-12-18 09:16:11 +01:00
Odoo Translation Bot 38bde51563 [I18N] Update translation terms from Transifex 2017-12-17 04:25:52 +01:00
Odoo Translation Bot cfe0ebcc59 [I18N] Update translation terms from Transifex 2017-12-17 00:42:09 +01:00
qdp-odoo 78ae6f470b [MERGE] forward port branch 9.0 up to 9bba7fea42 2017-12-15 16:58:40 +01:00
qdp-odoo 9bba7fea42 [FIX] l10n_ch: update taxes for 2018
- Added taxes for year 2018 of sales and purchase with percentage 3.7 and 7.7
- Added tags to show newly added tax in VAT report(enterprise branch) for Switzerland

Was PR #20851. Was task 39082.
2017-12-15 15:50:43 +01:00
Jaykishan Solanki c12ff15985 [IMP] l10n_ch: update taxes for 2018, …
- Added latest taxes for year 2018 of sales and purchase with percentage 3.7 and 7.7
- Added tags to show newly added taxies in VAT report(enterprise branch with PR #1628) for Switzerland
- Added fiscal positions mapping as well.

Was PR #20851. Was task 39082
2017-12-15 15:10:39 +01:00
qsm-odoo 69d4383d7b [FIX] web_editor: browser-unify alignment editor option
Summernote uses `document.execCommand` to apply most styles when
editing, leveraging the implementation to the browser.

Summernote is configured to use HTML styling (`'styleWithSpan': false`),
and in this case, browsers such as Firefox use HTML attributes for
styling text align, while Chrome still uses CSS for that. In fact,
`document.execCommand` is browser-inconsistent... but so is the
`styleWithSpan` option. Indeed, setting the option to `true` will make
Firefox use CSS property for alignment too... but not Internet Explorer.
So we might consider changing this option's value but this would not
solve the current problem.

Indeed, any CSS `text-align` style in Firefox takes precedence above
the element's `align` attribute, so when users were trying to align text
on stuff that was pre-aligned, they were unable to do so.

We can better explain the situation with this example:
A user tries to left-align in Firefox a `p.text-center` element, and
produces this:

```html
<p class="text-center" align="left"/>
```

(`align` attribute is ignored because of the `text-center` class)

On Chrome, this would be produced with the same steps:

```html
<p class="text-center" style="text-align:left"/>
```

With this patch, we actually make that HTML look like expected by the
user, no matter the browser he's using, by forcing the editor to use
the text-align CSS property. Note that the implementation is quite
ugly but had to take care of compatibility.

See https://github.com/odoo/odoo/pull/20900
(thanks to @Yajo for original PR)
2017-12-15 14:06:04 +01:00
Pierre Masereel e794d80c98 [FIX] stock: move the quantity reserved of another move
The condition in `_free_reservation` explicitely ignore move lines
having a done quantity. Let's imagine the scenrario where two stock
moves reserve all the quantity available and the user chose to process
all the quantity in a move while another user already set half the
quantity as reserved. In this case, we should keep the processed
quantity on the other move but correctly remove its reservation.
2017-12-15 13:22:21 +01:00
Aaron Bohy 9bc465988c [FIX] hr_attendance: remove flickering in client actions 2017-12-15 13:10:49 +01:00
Nicolas Martinelli 601bf82ba9 [FIX] base_import: currency removal
Typo in the currency removal method.

opw-787873
2017-12-15 10:55:03 +01:00
Alexis de Lattre d223ba1484 [FIX] account: 'Due Payment' letter: overdue_msg in partner's lang
Was PR  #21352. Courtesy of Alexis de Lattre (Akretion)
2017-12-15 09:30:07 +01:00
Richard Mathot 2b32f52b48 [REV] "[FIX] base: language code for Khmer (Cambodia)"
This reverts commit 3830621075.

This patch was unstablie as updating language code is actually forbidden.
2017-12-15 09:11:52 +01:00
Christophe Simonis 5c093849b5 [MERGE] forward port branch saas-15 up to 58a86ab671 2017-12-14 15:53:40 +01:00
Christophe Simonis 58a86ab671 [MERGE] forward port branch saas-14 up to dcdbccbb6d 2017-12-14 15:46:54 +01:00
Christophe Simonis dcdbccbb6d [MERGE] forward port branch 10.0 up to e89fbb5c38 2017-12-14 15:41:04 +01:00
Christophe Simonis 5dee10b75c [FIX] l10n_fr_sale_closing: declare crons correctly 2017-12-14 15:38:50 +01:00
Christophe Simonis 25375efd5b [FIX] l10n_fr_certification: correct settings view 2017-12-14 15:38:06 +01:00
Nicolas Martinelli 063314b78a [FIX] account: switching chart of account
Backport of cf3235e134

opw-788228
2017-12-14 15:15:46 +01:00
Christophe Simonis e89fbb5c38 [FIX] l10n_fr_certification: correct view inheritance hook 2017-12-14 14:27:53 +01:00
Christophe Simonis 60c2fd3126 [MERGE] forward port branch saas-14 up to d91cf14689 2017-12-14 14:02:28 +01:00
nla-odoo 253b4398bf [FIX] website_sale: fix access right error while browse token (#21587) 2017-12-14 13:54:36 +01:00
Sanjay Jamod 3830621075 [FIX] base: language code for Khmer (Cambodia)
Closes #17633
2017-12-14 13:44:14 +01:00
Christophe Simonis d91cf14689 [MERGE] forward port branch 10.0 up to 767e2509f7 2017-12-14 13:32:57 +01:00
Christophe Simonis 767e2509f7 [MERGE] forward port branch 9.0 up to 228f6086b1 2017-12-14 13:24:01 +01:00
Nicolas Martinelli 7492c97bf4 [FIX] event_sale: confirm event
- Create an event with tickets
- Add the event in a SO
- Confim the SO
- Apply

An error occurs (record deleted).

Actually, the real error is hidden and is an insertion error in SQL on
`registration.editor.line` (`event_id` cannot be NULL).

`event_id` is mandatory but read-only, therefore it is not sent to the
server.

opw-787674
2017-12-14 13:19:45 +01:00