Commit Graph
117156 Commits
Author SHA1 Message Date
Simon Lejeune d255628ecf [FIX] report: avoid local file resources
Make sure building reports using local resources are disabled.
This avoids get different report result based on the system if the
given resources are or not present (e.g. custom style)
2018-07-03 10:53:42 +02:00
Nicolas Lempereur 3513e599a7 [FIX] base: show char field size in form view
The char field has a size attribute that is displayed in the interface:

- if the field is added with code, the size is always 0 even tough the
  size limit is set correctly in the database.

- if the field is a custom field, the size is correct and can be updated

With this commit, a base field show the correct size.

opw-1869282
closes #26204
2018-08-07 09:54:47 +02:00
Andreas PerhabandNicolas Martinelli 52fef21d81 [FIX] web: re-add title attribute for many2many tags that got lost
Co-authored-by: Nicolas Martinelli <nim@odoo.com>

Closes #25693
2018-08-07 09:21:22 +02:00
Nicolas Martinelli b37416376b [FIX] google_calendar: rrule crash
Consider the following:
``` python
from datetime import datetime
from dateutil import rrule
import pytz

dt = pytz.UTC.localize(datetime(2016, 9, 2, 15, 42, 43, 205))
rset = rrule.rrulestr('FREQ=WEEKLY;INTERVAL=2;BYDAY=SU,FR,SA', dtstart=dt, forceset=True, tzinfos={})
test = [d for d in rset]
```

This will generate the following error:
```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/dateutil/rrule.py", line 1164, in _iter
    advance_iterator(ritem)
  File "/usr/lib/python2.7/dist-packages/dateutil/rrule.py", line 1091, in __next__
    self.dt = advance_iterator(self.gen)
  File "/usr/lib/python2.7/dist-packages/dateutil/rrule.py", line 649, in _iter
    date = datetime.date.fromordinal(ii.yearordinal+i)
ValueError: year is out of range
```

If such an event is received from Google Calendar, the synchronization
crashes. To avoid this, we enforce a `COUNT` condition if the latter or
`UNTIL` is not explicitly specified. This gives:
``` python
rset = rrule.rrulestr('FREQ=WEEKLY;INTERVAL=2;BYDAY=SU,FR,SA;COUNT=100', dtstart=dt, forceset=True, tzinfos={})
```

Note that this was supposed to be fixed in
https://github.com/odoo/odoo/blob/9dcc32c3041e7ad3549a09c5ed68ee3ef22c7a26/addons/calendar/models/calendar.py#L1287
However, this was working with the old API. The new API and its computed
fields does something different:

1. create the calendar event with the provided `rrule`
2. trigger the inverse method `_inverse_rrule` => `count=100` is added
   to the computed parameters
3. however, doing so won't recompute `rrule` for obvious reasons (it was
   the initial value provided, so we don't recompute it)
4. the crash is met in `_get_recurrent_date_by_event` when using
   `self.rrule`

The fundamental issue is that `_inverse_rrule` is not strictly the
inverse of `_compute_rrule`.

Fixes #25189
opw-1861658
2018-08-07 09:02:44 +02:00
Adrian Torres a4454fc7b1 [FIX] ir_model: stop crashing _prepare_update
If the field being checked in _prepare_update hasn't been loaded yet we
should skip it to avoid a KeyError.

OPW-1871180
OPW-1872236
2018-08-07 07:53:02 +02:00
Richard Mathot c5d95f1b37 [FIX] resource: don't lose minutes anymore
In resource.calendar.attendance, we store the start and end hour of an
interval as floats.

eg: 17 hours 9 minutes is stored as 17.15

When converting this float to a datetime object, the method
float_to_time always rounds down the value, which may be wrong if, due
to float imprecisions, 0.15 hours is converted to 8.999... minutes (and
was then rounded to 8).

We do fix this behaviour by rounding to the closest integer.

Thanks to @jem-odoo for his help troubleshooting this issue.

opw-1872166
2018-08-07 07:36:49 +02:00
Deep Patel 1369272f1a [FIX] base: inline buttons was breaking into multiple lines (outlook hack)
Because we converted buttons into tables so inline buttons was
breaking into multiple lines so we need to add display inline and vertical align
properties in tables.

We allowed display property from mail sensitizer whitelist.

Because in this commit https://github.com/odoo/odoo/commit/cf15030ed09f7479f5b2701ba101a5bed71f7409
we use display property for align items
2018-08-06 16:17:48 +02:00
Deep Patel c76c21d607 [FIX] mass_mailing: fixed multiple buttons transcoding issues (outlook hack fix)
Because of outlook hack node was not find next sibling of current element.
Due to this only first button is transcoded into inline css.
2018-08-06 16:17:48 +02:00
Arnold Moyaux 64a219bd06 [FIX] stock: multiple orderpoints for a same location
commit 47654e98e0 modified a defaultdict by an OrderedDict.
When multiple orderpoints use the same location the key is the same and
location_data dict entry is removed for the new one.

This commit only call makedefault when there is not current entry for
the dict.
2018-08-06 15:51:25 +02:00
len-odoo c5ffca1511 [FIX] stock_account: copy the to_refund field when splitting a move
The to_refund attribute is set to copy=False.
However when splitting a move to create a backorder, a new move is created as
a copy with the remaining work to do.
This attribute is needed so that the backorder refund is consistently applied.

opw 1865324
2018-08-06 15:23:27 +02:00
Martin Trigaux 180a970e44 [I18N] remove outated translation with errors
Contained bad %s and are out of sync with the reference
2018-08-06 14:45:40 +02:00
Goffin Simon 7d50f2e902 [FIX] mrp_repair: Access Rights for stock user
Due to this commit: 6e93fe0de1
the stock user has the all rights on model 'product.pricelist'
As the repair order model has the field pricelist_id on it,
the stock user must have the right to read it.

opw:1865814
2018-08-06 13:50:22 +02:00
Nicolas Lempereur 84abc9d06c [FIX] purchase: Receive Products ok context F5
The `active_id` when clicking on "Receive Products" on a purchase order
is the one of the purchase order.

But the action used has a context with:

```
{
    'search_default_picking_type_id': [active_id],
    'default_picking_type_id': active_id,
    'contact_display': 'partner_address',
}
```

So the active_id should be a stock.picking.type and not a purchase
order, thus:

- we could get an error at some instance (eg. a refresh) when loading
  the facet of the stock.picking.type with the ID of a purchase order

- we could erroneously show a facet for a stock.picking.type with the ID
  being the same as the purchase order

So this commit uses the same action without the offending `active_id` in
context.

opw-1870687
closes #26160
2018-08-06 13:18:26 +02:00
Christophe Simonis b29e053436 [MERGE] forward port branch saas-15 up to 43eca3079e 2018-08-06 11:32:12 +02:00
Christophe Simonis 4b19b84437 [FIX] web: better detection of non specify group_by in pivot views 2018-08-06 10:24:31 +02:00
Christophe Simonis efb896f915 [FIX] board: fallback to default view when not found in action
This can happen when action is modified after dashboard creation.
2018-08-06 10:24:31 +02:00
len-odoo 34d1ecd6f3 [FIX] stock, purchase: clean moves to merge
Purchase creates an activity when some stock move is deleted.
Howver when two moves are merged "behind the scenes", some moves may be deleted.
As a result it creates an activity "warning: some move has been deleted" for no
good reason.
We add a hook to clean moves before the merge.

opw 1826791
2018-08-06 10:17:25 +02:00
Andrea 85e8d13768 [FIX] sale: Amount Invoiced in Sales Analysis 2018-08-06 09:52:04 +02:00
Lucas Perais (lpe) 39f19d14f0 [FIX] crm: enable customizable pipeline action
On the pipeline action change the sequence of the view_ids to
change the order of the view_mode string
Put tree first instead of kanban for example

Before this commit, clicking on CRM menu app still displays the kanban
This was because the action window is wrapped around a server action that modifies it

After this commit, we recompute the view list to match what is on the original action

OPW 1863425
closes #26159
2018-08-06 09:41:49 +02:00
Lucas Perais (lpe) efa7f87cc8 [FIX] calendar: event from activity strip text from html
From a SO (for example), create an activity with type meeting
Create the calendar event

Access it as a guest with the route with the token

Before this commit, there was an error 500 because the description
of the event actually contained "\n" and was not parseable

After this commit, we strip the string at event creation, and no error occur

OPW 1867283
closes #25795
2018-08-06 09:31:06 +02:00
Odoo Translation Bot ea16b49e8c [I18N] Update translation terms from Transifex 2018-08-05 04:05:24 +02:00
Luis González b623695ee7 [FIX] website_sale_digital: portal files as digital products
Currently, when a digital product is purchased, the list of attachments
is incorrectly computed. Product template's portal files are retrieved
correctly, but all product variant's attachments are taken into account,
not only its portal files.

This commit causes the portal attachments to be computed correctly,
taking into account only portal files from both the product template and
product variant.

Closes #25609
2018-08-03 10:41:02 +02:00
Andreas Perhab b3bcfbde1b [FIX] sale_stock: fix msg argument in assertion
third positional argument is places not msg (which expects a number not a str)
https://docs.python.org/2/library/unittest.html#unittest.TestCase.assertAlmostEqual

fixes errors like these:
 if round(abs(second-first), places) == 0:
 TypeError: 'str' object cannot be interpreted as an integer

and gives the intended message when assertion is errornous
2018-08-03 09:36:44 +02:00
Richard Mathot 47654e98e0 [FIX] stock: make orderpoints run in a deterministic order
In Python 3.5, items() on a dictionary return keys in a randomized order.

location_data can thus be processed in different orders, leading to
different quantities in the MO's created by the procurement scheduler.

This fix makes the output of the scheduler deterministic.

(thanks to @odony for his help in troubleshooting this issue)

opw-1865711
2018-08-02 17:00:14 +02:00
Goffin Simon ec7109c919 [FIX] account: Wrong payment amount in multi-currency
Steps to reproduce:

- activate the EUR currency

- set a currency rate 1 USD = 1.2 EUR

- create a Bank journal in EUR with a EUR account

- create a Vendor Bill in EUR for 1200 EUR in total

- go in the Vendor Bill list view (Accounting > Purchase > Vendor Bills)

- select the created Vendor Bill

- click "Register Payment" in the action menu

- select the EUR Bank journal you created

Bug:

The payment amount is 1000 EUR instead of 1200 EUR.

opw:1870351
2018-08-02 16:27:34 +02:00
Martin Trigaux 8c07fd3c5a [FIX] barcodes: remove untranslated content
Since 6a3324a7 and 0c489cf1fa, a translation can not contain a \n
Previous text was not correct rst anyway.

Reexport base translations to include all missing modules
2018-08-02 11:49:32 +02:00
pigna74 9a48f67863 [CLA] international business hub signs Odoo's CCLA
Closes #26098
2018-08-01 17:02:08 +02:00
Lucas Perais (lpe) e35a972639 [FIX] web: kanban progressbar css fixup
fixup of dc253ff1c6
2018-08-01 14:24:54 +02:00
Christophe Simonis f9e0f6663f [MERGE] forward port branch saas-15 up to c2f220f977 2018-08-01 12:49:01 +02:00
Olivier Colson 1686ef8c04 Revert "[FIX] account: set 'multi' field to False for payments generated when choosing to register payment for multiple invoices with distinct partners"
This reverts commit 11a0dd58a7. It was made in wrong version.
2018-08-01 09:42:07 +02:00
Jothimani 06de947b6b [CLA] signature for jothimani-r
Closes #26079
2018-08-01 09:27:18 +02:00
Christophe Simonis cc0baa086a [FIX] base: adapt test expectation to python 3.7
Compare exception message to the exact one raised in all versions.
2018-07-31 20:31:46 +02:00
Christophe Simonis 8c81eaabe6 Revert "[FIX] models: make onchange return a smaller diff"
This reverts commit 2054b59285 which
already has been fixed multiple times [0].

However this change does not correctly handle successive onchange calls on
ony2many fields which alter existing rows.

i.e., in saas~11.4, an onchange has been added on move lines [1] in
order to create and/or update lines containing taxes amounts.
However, with diff-only onchange, a second call to onchange will discard
changes made by a first one as nothing change between the 2 calls.

Scenario: On an existing account.move, add a new credit line with a tax set.
The first onchange will update the tax line with new amount. Add a
second line (with debit amount balanced). The onchange will not change
the tax line, resulting as it value being reset to initial value. As a
result, the move is not balanced and cannot be saved.

[0] cd2ccc4110, 5e58ac16c3, 07023137cd
[1] d49ab568a2
2018-07-31 19:36:30 +02:00
Christophe Simonis 96de6756ab [MERGE] forward port branch saas-15 up to 42e5b322af 2018-07-31 19:11:33 +02:00
Olivier Colson 11a0dd58a7 [FIX] account: set 'multi' field to False for payments generated when choosing to register payment for multiple invoices with distinct partners
This field is used by the multiple payment wizard; the payments it generates are always individual and should never have multi=True. Before this commit, they did, because of the values given in context when calling the payment wizard.
2018-07-31 17:16:47 +02:00
len-odoo e57a1a8e6f [FIX] web: fix 'drag and drop' test function to work in both directions
The 'drag and drop' function defined in test_utils should be aware of four
different cases, moving up or down, above or below another row.
We need an offset of one pixel for the function to work when moving down
(this is a case of broken symmetry because of <=)

Related to opw 1867049 regarding sequences of resequence moves.
2018-07-31 16:18:26 +02:00
Goffin Simon c75f4fbcd1 [FIX] stock: Source and Destination on pickings
Steps to reproduce the bug:

- Go on a picking with an operation type of type "vendor" (e.g. a receipt) :
the field source location appears while it should be the destination location.

- Go on a picking with an operation type of type "customer " (e.g. a delivery) :
the field destination location appears while it should be the source location.

opw:1869145
2018-07-31 15:07:53 +02:00
Goffin Simon e1da65841a [FIX] stock: Display issue on product categ
This text is not written at the right place and it's useless.
So it's confusing for the users.

opw:1870443
2018-07-31 15:04:03 +02:00
Can Tecim bf332e2e08 [FIX] purchase: P3-style super call
3869cdf7d8 merged a fix which used a
P3-style super call, which is not compatible with Python 2.

While 11.0 is not really exactly officially supported on Python 2,
we originally decided not to break compatibility unless there were
very good reasons to do so.
2018-07-31 10:05:30 +02:00
Goffin Simon 47acea1523 [FIX] website_sale_wishlist: Wrong displayed currency in the wishlist
Steps to reproduce:

1. Activate multi-currency and associate a price list "Other list" with secondary currency as an alternative for "Public Price List".

2. Enable the price list to be selectable on the website.

3. Enable wishlist functionality on Website module

4. Navigate to website without logging in

5. Add a product to the wishlist (with the default price list)

6. Switch price lists.

Bug:

The wrong currency was displayed in the wishlist for the new price.

PS: In function "compute_new_price", price_new = website_price

opw:1867314
2018-07-31 09:44:03 +02:00
Lucas Perais (lpe) 93e71d181e [FIX] account: reconciliation widget: Don't loose pager on adding last line
Have a statement line with multiple pages of propositions
Go to the last page
Add everything

Before this commit, after clicking on the last item of the list,
a write-off creation was displayed, without any means to come back to the other
propositions

After this commit, we display the page before
2018-07-31 09:18:31 +02:00
Lucas Perais (lpe) aa7bc410f0 [FIX] account: reconciliation widget: empty line should open write off
In manual reconciliation, have an accound with no direct proposal.
An empty line should be present

Click on it

Before this commit, there was a traceback

After this commit, a write-off creation appears
2018-07-31 09:18:31 +02:00
Lucas Perais (lpe) ebca7c3d37 [FIX] account: reconciliation widget: remove prop to attain balance
In manual reconciliation (but probably automatic too)

Have 3 lines for one account
2 of them are balanced
the third is of an amount X

Add the three lines to the reconciliation
A write-off proposal of -X should appear

Now, remove the third line by clicking on it
Click on Reconcile

Before this commit, the values sent to the server were wrong, as the write-off
was still included

After this commit, we make sure we don't send lines that are not displayed
2018-07-31 09:18:31 +02:00
Lucas Perais (lpe) 862c245576 [FIX] account: default_get aml compute balance
Create an account.move, create a line, then add an item to start to add a second aml
The current balance of the move is put in debit (or credit) to help automatically making the second line

Save the move.
Edit the move
Delete a line
Add a new line

Before this commit, the balance was not correctly computed because the default_get did not compute
the balance on deleted lines
The move ended up with wrong unbalanced new lines

After this commit, the balance is computed with deleted lines taken into account
2018-07-31 09:18:31 +02:00
Nicolas Lempereur 5dc180a3ea [FIX] im_livechat: double click on :) => 1 message
Prevent sending multiple messages when multiple clicks on one feedback
icon.

opw-1863312
closes #26047
2018-07-30 17:03:57 +02:00
Lucas Perais (lpe) 44ea58234e [FIX] base, hr_timesheet: display negative float_time values
Before this commit, negative values in a float field interpreted as time
(i.e. unit_amount on analytic lines) were wrongly formatted

After this commit, not only we correct the hr_timesheet qweb templates
but we also correct the qweb widget to handle the case

OPW 1869986
closes #26024
2018-07-30 13:18:04 +02:00
Christophe Simonis 91d647ecf7 [FIX] website_sale_delivery: use -U+FEFF instead of U+2011 for negative numbers
See cb2a3afa7e and 7a519520f2
2018-07-30 12:57:26 +02:00
Christophe Simonis 248a59553d [MERGE] forward port branch saas-15 up to 535d50afbd 2018-07-30 12:53:34 +02:00
Lucas Perais (lpe) 4c1ebd0745 [FIX] point_of_sale: constrain pricelist belong to config's company
Have the Admin in company A
Create a pos.config for company B
Have its default pricelist to be one of company A's
Save

Log in with user B, in company B
Try to make a new pos session
When everything is loaded, the screen stays black, leaving the pos unusable

After this commit, we constrain the pricelists to either be of company B's
or to not have a company set on them

The black screen doesn't happen

OPW 1861757
closes #25996
2018-07-30 11:51:09 +02:00
Lucas Perais (lpe) 510fe712ee [FIX] account: transmit analytic tags in credit note
Have an invoice with analytic tags
Create a credit note

Before this commit, the tags on the invoice lines
are not transmitted to the credit note's lines

After this commit, they are

OPW 1866432
closes #26010
2018-07-30 10:06:13 +02:00