Commit Graph
126133 Commits
Author SHA1 Message Date
Laurent Smet 10b9d06689 [ADD] account: allow forcing tax included tax in reconciliation widget
Before this commit, the only way to deal with the same tax either with price included or not was to duplicate it, one with the price included checked.

This commit add a new boolean on the reconciliation widget propositions to decide if the tax must be used like a price included tax or not.

PR: 17040
task: 32717
2018-08-08 13:45:11 +02:00
Martin Trigaux fb1a8cc19d [FIX] point_of_sale: set a date and not a datetime
last_session_closing_date is a date field but stop_at us a datetime
2018-08-08 12:24:59 +02:00
Lucas Perais (lpe) f2b2d87236 [FIX] account: default name for analytic line from aml
Create an account_move, with at least one move line having an analytic account on it
AND no label

Save and Post

Before this commit, the post failed because an analytic.line should have a label (required)

After this commit, we fill in a default name for the analytic line, composed of the data of the line,
if available, or '/'

OPW 1863418
closes #26013
2018-08-08 10:54:18 +02:00
Gert Pellin bb8bb3cbfe [FIX] point_of_sale: wrong behavior Price Control (#26232)
Before the fix price control only worked like should on initialisation of a pos section. On switching cashier during a setting manager would lose price change rights and normal users would gain them.
2018-08-08 09:59:20 +02:00
Wolfgang Taferner a4a9196c8d [FIX] account: regression - display partner_name as placeholder 2018-08-08 09:50:31 +02:00
Damien Bouvy c61cddf814 [FIX] hr_gamification: csv space EoL
Can cause some issues with importing the files
2018-08-08 09:40:16 +02:00
Nicolas Lempereur 8ff138a0da [FIX] barcodes: ok PageUp/Down/Home/End in firefox
Same reason as 8d948d92.

In firefox if barcode is installed, for example on a form view the keys
to navigate the possible scrolling PageUp/PageDown/Home/End don't work
at all.

This is caused by the interface barcode catching and differences of the
key event handling between firefox and other browser.

So in this change, we add these keys so they are not catched by barcode.

note: aso backport 5bc29744c so the code is the same between 10 and 11.

related to opw-706352
closes #26219
2018-08-08 09:11:06 +02:00
len-odoo 0ab71f1247 [FIX] stock, sale_stock: 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.

Essentially a backport of commit:
https://github.com/odoo/odoo/commit/c5ffca151160f9d99bec036330def108e4e91e0b

opw 1865324
2018-08-08 08:49:11 +02:00
Goffin Simon ceb5c03c93 [FIX] hr_holidays: Allocation Request not always in the Summary View
Steps to reproduce the bug:

- connect as the demo user

- go to the Leaves app

- check the Leaves Summary menu: by default, it is empty

- go to Allocation Request

- create one Allocation Request for 1.00 day using the Compensatory Days type

- repeat the operation several time

Bug:

Only the first Allocation Request appears in the Leaves Summary

opw:1872365
2018-08-08 08:42:08 +02:00
Damien Bouvy 663a6f19b2 [FIX] website_sale: badly formatted CSV
The gorup was evaluated to True and no group was set on the ACL
2018-08-08 08:16:57 +02:00
Damien Bouvy 19f477299b [FIX] hr_gamification: csv space EoL
Can cause some issues with importing the files
2018-08-08 07:59:45 +02:00
Christophe Simonis 476e1b5646 [MERGE] forward port branch saas-14 up to 2c942e5ff8 2018-08-07 19:14:24 +02:00
Christophe Simonis 2c942e5ff8 [MERGE] forward port branch 10.0 up to bec639c094 2018-08-07 19:12:16 +02:00
Christophe Simonis bec639c094 [MERGE] forward port branch 9.0 up to 5a64fffe9a 2018-08-07 19:10:25 +02:00
Christophe Simonis efe2dcd7ae [MERGE] forward port branch 11.0 up to ced9156a97 2018-08-07 19:08:07 +02:00
Christophe Simonis 5a64fffe9a [FIX] base: explicitly allow superuser to write on attachment's assets 2018-08-07 19:06:02 +02:00
Christophe Simonis ced9156a97 [MERGE] forward port branch saas-15 up to 65a80cf3fd 2018-08-07 18:11:15 +02:00
Swapnesh Shah 174bd3a7ac [FIX] website: remove unnecessary ensure_one
The write works on multiple records

Closes #26033
2018-08-07 17:47:57 +02:00
Nicolas Martinelli 6470ee74b8 [FIX] point_of_sale: return with rounding < 0.01
- Set the currency to a rounding of 0.001
- Create a POS order:
  Unit Price: 0.12
  Quantity: 0.1
- Pay and validate
- From the backend, return the products on the create order
- Click on 'Payment'

The proposed amount is 0.01, not 0.012. It is not possible to complete
the payment process since the field is rounded at DB level to 2 digits
of precision.

We make consistent the `amount` field with the various amounts on the
`pos.order`. By using a `digits=0` and forcing the rounding, we avoid
inconsistent rounding between the order and the payment.

opw-1864344
2018-08-07 17:33:57 +02:00
Olivier Colson 87f0d2eefb [REF] account, account_check_printing, payment, l10n_do, l10n_de, l10n_fr, l10n_nl, l10n_mx: chart templates installation: remove old useless wizards and move everything to account.chart.template
Was task 1858974
Was PR https://github.com/odoo/odoo/pull/25243
2018-08-07 17:11:08 +02:00
Christophe Simonis 65a80cf3fd [MERGE] forward port branch saas-14 up to 0c5cbbe0bb 2018-08-07 17:01:16 +02:00
Christophe Simonis 0c5cbbe0bb [MERGE] forward port branch 10.0 up to 692a32e780 2018-08-07 16:54:18 +02:00
Christophe Simonis 692a32e780 [MERGE] forward port branch 9.0 up to 1b76b6168f 2018-08-07 16:52:50 +02:00
Xavier Morel 36ee8a78ec [IMP] base_import: attempt to automatically guess the separator
It would probably be even better to iterate the file content and get
the non-quoted non-alphanumeric characters as separator
candidates (instead of a hard-coded list) however Python does not seem
to have a decoding iterator (taking bytes and yielding an iterator of
codepoints or even grapheme clusters) — incidentally uniseg seems to
require up-front decoding as well — so that's not really convenient as
we may be dealing with large-ish files and not want to load it
entirely in memory.

An alternative would be to use TextIOWrapper and iterate the file by
buffers of a few ks, and classify that based on either codepoints or
grapheme clusters.
2018-08-07 16:46:29 +02:00
Thibault Delavallée 8edae4200f [FIX] hr_holidays: yet another date/datetime fix
Still fixing some side effects of https://github.com/odoo-dev/odoo/commit/960360afe478a8f7b9c456721b5591154952a37d.
2018-08-07 16:45:16 +02:00
Thibault Delavallée 41eb02c218 [MERGE][REF] mail: optimize message notification process
This merge optimizes and lessens query count of notification process. When
posting a message some computation is done to fetch followers and/or people
and channels to notify, then notify them on their Inbox or by email. This
process now takes less queries thanks to several improvements :

 * fetching followers / recipients data is now done manually in SQL allowing
   to fetch data across several models in less queries;
 * computing recipients is now separated from notifying them. Notification
   better uses precomputed data in order to avoid fetching and browsing
   several time the same data;

When possible code has been made more readable through code inlining. Several
methods have been removed because they are not used in inheritance. Some code
is now more low-level. Optimizing part of the process can make it harder to
inherit or modify.

Performance counters are updated showing gain in nearly all tested cases.
An enterprise branch is linked to this one that also improve notification
process.

This merge is linked to task ID 47934 and closes PR #24033. No functional
change should occur with this merge.
2018-08-07 15:44:15 +02:00
Thibault Delavallée 689a496f1c [REF] mail: propagate recipient data through notification process
Purpose of this commit is to avoid browsing and prefetching data about
recipients when notifying a message to partners and channels. Mail message
_notify computes all necessary data in a single query. This commit allow
to re-use this data by propagating it through the call chain.

Addons inheriting from classification methods used when sending notification
emails are updated accordingly to the API and data update.

This commit is linked to task ID 47934 and PR #24033. No functional change
should occur with this commit.
2018-08-07 15:43:06 +02:00
Thibault Delavallée 89051058f4 [REF] mail: clean code related to notification email generation
This commit cleans code about sending email notification to recipients.
Purpose of this code is to prepare notification emails, group recipients
and finally send emails. In this commit we clean and optimize a bit by

 * propagating some additional parameter to simplify code, like record
   on which the notification process runs;
 * inlining some code currently located in sub-methods. It eases code
   understanding as there are less code jumps. As those methods are not
   inherited inlining them can be done;
 * simplifying a bit notification emails preparation and computation;

It allows to save a few query by avoiding to fetch and browse again some
data that were already computed.

This commit is linked to task ID 47934 and PR #24033. No functional change
should occur with this commit.
2018-08-07 15:43:06 +02:00
Thibault Delavallée df8130b2fa [REF] test_mail: update counters due to enterprise mail_push update
This commit is related to enterprise commit that updated mail_push. It is about
[REF] mail_push: optimize mail.message notification process override

It updates code of mail_push to lessen its impact on mail-related code. It
allows to change a few counters in test_mail. Indeed counters are impacted
by code located in enterprise because those are "maximum queries" counters.
As mail_push is an auto-install module enterprise runbot would be broken
if the counters weren't updated.

This commit is linked to task ID 47934 and PR #24033. No functional change
should occur with this commit.
2018-08-07 15:42:50 +02:00
Thibault Delavallée 6de76cc4f1 [REF] mail: optimize notification recipients data fetch through SQL query
In this commit we update _notify method of mail.message to fetch most data
related to notification process in a single query.  Indeed posting a
message can be a costly process, especially when involving several partners,
channels, depending on their notification status, user groups, ... Most
of the required data can be fetched in a single hand-tuned query.

Purpose is to lessen query count. Side effect of this commit is that code
is less recordset based and therefore more low-level. It is also harder to
customize the behavior through inheritance as it implies rewriting a bit
more of code.

This query is located in a private method on follower model. It takes
parameters allowing to either fetch data related to followers of a given
subtype, either related to some partners and channels. First use case is
related to the process of posting a message with a subtype that triggers
notification of followers. Second use case is related to notifying some
specific partners or channels of a given message. It takes notably into
consideration internal subtypes and active field of partners, allowing to
correctly handle corner case for deactivated followers and portal / share
partners.

Notification process is divided into two steps. First one is to compute
recipient data. Second one is to apply the result of this computation and
call the various notification mechanisms accordingly. Doing so allows to
easily re-call notification process or compute some data differently
if necessary.

API of notification methods is updated to allow passing notably the values
used to create the newly-posted message. It allows in some simple case to
avoid browsing message and partners when no notification is necessary. It
saves some queries in simple case like posting messages with specific
subtypes not often followed or logging notes without mentioning people.

This commit allows to save a few queries on several performance tests as
indicated by updated performance counters. Future commits will gradually
propagate the use of this data to further lessen query count.

This commit is linked to task ID 47934 and PR #24033. No functional change
should occur with this commit.
2018-08-07 15:42:45 +02:00
Thibault Delavallée 40922cc027 [FIX] hr_holidays: fix date computation
Since date / datetime refactoring done at 960360afe4 we cannot
encode new leave requests or new allocation requests anymore. This commit
fixes that by correctly setting date / datetime on date / datetime field
and correctly computing one from the other.
2018-08-07 15:39:36 +02:00
Martin Trigaux 3d3a9f3169 [FIX] event_sale: make action_confirm work with multi
The other overrides are working with multiple records but not event_sale.
The ensure_one() is not needed if you make a proper loop

Replaces and closes #26078
2018-08-07 14:58:40 +02:00
KolushovAlexandr a8465d5235 [IMP] point_of_sale saved_client_details method
closes odoo/odoo#26220

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2018-08-07 12:50:39 +00:00
qsm-odoo 240b338dd9 [FIX] mail: BS4, restore activity popover
Adapt SCSS which was BS3-specific and remove misuses of the
dropdown-item class.

Closes https://github.com/odoo/odoo/pull/24419
2018-08-07 14:50:06 +02:00
Xavier Morel 5f92f853e2 [FIX] base_import: trying to import an empty file
Various bits would lead to odd tracebacks or a complete lack of
actionable feedback.

Discover that a binary field set to b'' will return None when read back,
handle that, then handle reading an empty CSV file, then handle the
resulting iterator having no lines whatsoever when trying to match
headers.

At least for CSVs, we're now properly telling users that their file
seems to have no content when they literally upload an empty file.
2018-08-07 14:02:39 +02:00
Christophe Simonis 33e7479865 [MERGE] forward port branch saas-11.2 up to d7e2c767ce 2018-08-07 13:59:40 +02:00
Christophe Simonis d7e2c767ce [MERGE] forward port branch 11.0 up to 3513e599a7 2018-08-07 13:58:20 +02:00
Olivier Colson 3de7521174 [IMP] account: new setting to define a start for bank reconciliation
Payments older than the chosen date won't be proposed in the widget allowing to match payments with bank statements. This is useful if the db used invoicing for years and then installed accounting : users don't want to have to match all the old payments that were generated by invoicing with bank statements.

Was task 1829536
Was PR https://github.com/odoo/odoo/pull/24728
2018-08-07 13:39:02 +02:00
Xavier Morel 5aba5ac99e [IMP] base_import: reintroduce encoding selector & override guess
* if an encoding is explicitly specified, use it and don't guess
* otherwise guess and return the guessed encoding so it can be
  displayed in the configuration UI
* fix less-than-stellar configuration & behaviour of select2 inputs
  to properly reflect underlying values as they get modified, to
  correctly handle future configuration guesses
2018-08-07 13:07:05 +02:00
David Beguin 8c1805cdc6 [FIX] Crash Manager - Clipboard JS reference updated
The instanciation of the clipboard in the crash manager was not updated
in the fix that upgraded the clipboard.js
2018-08-07 10:37:55 +02:00
Hiral Bhavsar 3455acfdc5 [FIX] sale_coupon: fix indentation and stat button separation
Applied 'o_row' class instead of 'row' to avoid indentation issue and
also applied 'button_box' name attribute to group to fix stat button
separation issue.
2018-08-07 10:06:51 +02:00
Deep Patel 70df0bb586 [FIX] website, website_sale: BS4, adapt carousel controls
Completes https://github.com/odoo/odoo/commit/20d033a782f4d85fdd6f15df68d116b2fd7a7dfd

Closes https://github.com/odoo/odoo/pull/26077
2018-08-07 10:03:59 +02:00
Prakash Prajapati 5caa9a46a0 [FIX] stock: review some report layout
The 'table-responsive' class should not be used on <table/> elements
directly (this is allowed by BS4 but this is not good practice to me).

Closes https://github.com/odoo/odoo/pull/26148
2018-08-07 10:03:59 +02:00
Prakash Prajapati ba8a52972a [FIX] website_forum, website_forum_doc: BS4, fix some layout issues
Closes https://github.com/odoo/odoo/pull/26178
2018-08-07 10:03:59 +02:00
Siddarth Gajjar 0d8b1f5ba3 [FIX] web: BS4, fix tooltip flickering issues
Closes #26186
2018-08-07 10:03:59 +02:00
qsm-odoo 57400c1560 [FIX] mail: BS4, properly style followers list
Thanks to @hbh-odoo
2018-08-07 10:03:59 +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
Florent de Labarre b16a40721d [FIX] account: add countraints on account type
You cannot have more than one account with "Current Year Earnings" as type for a company.

opw:1868446
2018-08-07 09:43:04 +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