Commit Graph
117975 Commits
Author SHA1 Message Date
Lucas Perais (lpe) 507b5cce3a [FIX] point_of_sale: repair cashier from localStorage on refresh page
open a pos,
change cashier
hit F5

Before this commit, the previous user was set as cashier, forgetting about the change we made
This was because of two things:
- The original fix to do just this use case was pushed in v9.0 as e14ab69772
- In v11.0 the commit f5f60599bf introduced full usage of Backbone's set and get
    which meant that self.cashier was no longer relevant
- In v10.0 the commit 475027b988
    (For v11.0: a9caef0ebb)
    Was intended to update the res.users objects at their loading to ensure that their access rights were loaded too
    But it did this using the wrong condition

After this commit, it reworks fine

OPW 1844006
closes #24762
2018-05-17 09:17:21 +02:00
Lucas Perais (lpe) 54d1b38844 [FIX] point_of_sale: repair cashier from localStorage on refresh page
open a pos,
change cashier
hit F5

Before this commit, the previous user was set as cashier, forgetting about the change we made
This was because of two things:
- The original fix to do just this use case was pushed in v9.0 as e14ab69
- In v10.0 the commit 475027b
    (For v11.0: a9caef0)
    Was intended to update the res.users objects at their loading to ensure that their access rights were loaded too
    But it did this using the wrong condition

After this commit, it reworks fine

OPW 1844006
related #24762

closes #24764
2018-05-17 09:15:24 +02:00
Joren Van Onder 65a589eb54 [FIX] website_quote: make 'Pay & Confirm' work without website_sale
When creating a db with only website_quote and payment_paypal you end
up with:

AttributeError: 'payment.transaction' object has no attribute '_check_or_create_sale_tx'

when clicking on 'Pay & Confirm' in an online quote.

This is because various controller methods in website_quote use this
method and it is defined by the sale_payment module.

opw-1847977
2018-05-16 10:19:07 -07:00
Jeremy Kersten 59a04f1510 [FIX] portal: search by - add margin
before this commit, carret touch the label
2018-05-16 17:57:39 +02:00
Jeremy Kersten f3229be332 [FIX] website_sale: move font-awesome inside the link
It sounds like a bad id to mix fa class with others class.
Some css rule change the style (eg: font family) for other class
and fa become ugly or just a square.
2018-05-16 17:57:39 +02:00
Christophe Simonis 9874adebb8 [MERGE] forward port branch saas-15 up to 40e74240e8 2018-05-16 17:48:37 +02:00
Toufik Benjaa 412892ceaf [FIX] hr_timesheet: Use correct company_id on timesheet analytic line
- When changing the project_id of an analytic line, the account_id is updated to the project's one, we need to update the company_id according the one set on project's analytic account.
2018-05-16 17:43:42 +02:00
Olivier Dony 86ffb549bf [FIX] base: log failed/successful logins with ip
We used to only log failed logins, and did not include the IP, which
makes it much less useful for intrusion detections systems (e.g. fail2ban)

For example, the following fail2ban filter definition should match a
failed login (in /etc/fail2ban/filter.d/odoo-login.local):

    [Definition]
    failregex = ^ \d+ INFO \S+ \S+ Login failed for db:\S+ login:\S+ from <HOST>
    ignoreregex =

This could be used with a jail definition to block the IP on HTTP(S).

Here is what it could look like for blocking the IP for 15 minutes when
10 failed login attempts are detected from the same IP within 1 minute:

    [odoo-login]
    enabled = true
    port = http,https
    bantime = 900  ; 15 min ban
    maxretry = 10  ; if 10 attempts
    findtime = 60  ; within 1 min
    logpath = /var/log/odoo.log  ;  set the actual odoo log path here
2018-05-16 17:39:32 +02:00
Christophe Simonis 40e74240e8 [MERGE] forward port branch saas-14 up to a1a03792b6 2018-05-16 17:11:39 +02:00
Christophe Simonis a1a03792b6 [MERGE] forward port branch 10.0 up to bcf20cfbec 2018-05-16 17:10:28 +02:00
Olivier Colson 87818f7fcc [FIX] purchase: anglosaxon accounting: use price difference account properly when making a refund
Before that, the following scenario failed due to FIFO handling of stock:

- make PO 1 for 10 x product A at 10€/piece, receive and invoice everything
- make PO 2 for 10 x product A at 20€/piece, receive and invoice everything
- refund and send back PO 2

=> With FIFO handling, it means the valuation corresponding to the return of product A consists of the first received products, hence 10x10=100€. The credit note, though, was made with the price of the invoice (200€) and did not (because of a too simple check) use the price difference account to post the missing amount (100€).
Test test_fifo_anglosaxon_return (purchase/tests/test_stockvaluation.py) failed because of that.
2018-05-16 16:38:46 +02:00
Toufik Benjaa adfab80c17 [FIX] account: If set, use analytic account's company on line creation
- When creating analytic account lines when posting account moves, the lines' company id were set to the current user's company.
  If the analytic account has a company set, the lines must be set on the same company (due to a python constraint).

  So when creating the lines, we now check if the analytic account has a company, if so, we use it to create the lines.
2018-05-16 16:38:26 +02:00
Raphael Collet bcf20cfbec [FIX] stock: use timedelta instead of relativedelta
Suppose we have a delta between two datetimes:

    delta = dt1 - dt0

If delta is negative but less than a day, ``delta.days`` returns -1 (which is
compensated by positive seconds).  In order to avoid this surprising effect,
use ``delta.total_seconds()`` to compute the number of days.
2018-05-16 16:25:03 +02:00
Xavier Dollé f555bfeca3 [FIX] mail: correctly filter needaction on unread notifications in message_format
Previously to this commit needaction used by JS was not taking into account
read notifications. It means notably Inbox counter could be higher than
expected as taking into account read messages while Inbox displays only
unread messages. This commit fixes that by checking notification state when
giving needaction_partner_ids to message_format result.

This fix has a small impact on performances as message_format is used in
notification process for chat or push. A better implementation of message
format and its postprocess could probably lessen this fix impact. As we
target stable version we avoid rewriting other part of the code. Optimization
will be done in development version.

Related to task ID 1841243. This is a manual forward port of commit 69714fbeee
done in saas-11.2.
2018-05-16 16:17:59 +02:00
Xavier Dollé 92abf95a87 [FIX] mail: correctly filter needaction on unread notifications in message_format
Previously to this commit needaction used by JS was not taking into account
read notifications. It means notably Inbox counter could be higher than
expected as taking into account read messages while Inbox displays only
unread messages. This commit fixes that by checking notification state when
giving needaction_partner_ids to message_format result.

This fix has a small impact on performances as message_format is used in
notification process for chat or push. A better implementation of message
format and its postprocess could probably lessen this fix impact. As we
target stable version we avoid rewriting other part of the code. Optimization
will be done in development version.

Related to task ID 1841243. This is a manual forward-port of commit 69714fbeee
done in saas-11.2.
2018-05-16 16:06:10 +02:00
Xavier Dollé 19fb650863 [FIX] mail: correctly filter needaction on unread notifications in message_format
Previously to this commit needaction used by JS was not taking into account
read notifications. It means notably Inbox counter could be higher than
expected as taking into account read messages while Inbox displays only
unread messages. This commit fixes that by checking notification state when
giving needaction_partner_ids to message_format result.

This fix has a small impact on performances as message_format is used in
notification process for chat or push. A better implementation of message
format and its postprocess could probably lessen this fix impact. As we
target stable version we avoid rewriting other part of the code. Optimization
will be done in development version.

Related to task ID 1841243. This is a manual backport of commit 69714fbeee
done in saas-11.2.
2018-05-16 16:00:43 +02:00
Xavier Dollé 69714fbeee [FIX] mail: correctly filter needaction on unread notifications in message_format
Previously to this commit needaction used by JS was not taking into account
read notifications. It means notably Inbox counter could be higher than
expected as taking into account read messages while Inbox displays only
unread messages. This commit fixes that by checking notification state when
giving needaction_partner_ids to message_format result.

This fix has a small impact on performances as message_format is used in
notification process for chat or push. A better implementation of message
format and its postprocess could probably lessen this fix impact. As we
target stable version we avoid rewriting other part of the code. Optimization
will be done in development version.

Related to task ID 1841243.
2018-05-16 16:00:06 +02:00
Christophe Simonis 82b15e06ce [MERGE] forward port branch 9.0 up to 9db6dfa25d 2018-05-16 15:54:08 +02:00
Yannick Tivisse 0984b2aadb [FIX] l10n_be_hr_payroll: Compute correcty employer cost for warrants 2018-05-16 15:13:46 +02:00
Alexandre Kühn 93f9131450 [REVERT] "[IMP] mail : display mentions in green color in edit mode"
This reverts commit c778de44c7.
2018-05-16 15:06:39 +02:00
Alexandre Kühn c52243794d [REVERT] "[FIX] mail: fix composer style for chat windows"
This reverts commit 0275c70f78.
2018-05-16 15:05:35 +02:00
Toufik Benjaa 1c6aa878cb [FIX] project: Access rights issue on /my/tasks
- Portal users do not have the rights to read on project.project.
  This causes issues on the page "/my/tasks" as it is trying to read the label_tasks and the name of the tasks' project.

  To address this issue we read those two fields using sudo
2018-05-16 14:51:42 +02:00
Nicolas Martinelli 491243d1ca [FIX] stock_account: partial reception with avg cost
- Create a product where the associated product category has Costing
  Method "Average Cost (AVCO)"
- Create a PO. Order 1 unit at $1000.
- Receive that unit. (System now has 1 unit at $1000).
- Create another PO. Order 3 units at $500 each.
- Receive only 1 unit and don’t create any back order.

System has 2 units @ $625, instead of $750.

The quantity computed should take into account the quantity actually
done.

opw-1843998
2018-05-16 14:21:15 +02:00
Xavier ALT c22d3f6732 [FIX] web: widget char_domain should pass context to selection dialog
In case we define a field like,

<field name="my_domain" widget="char_domain" context="{'active_test': False}"/>

when selecting records the dialog should display all records (as asked by the
context), but it's not the case.

This commit ensure the field context is passed to the selection dialog.

opw-1831902
2018-05-16 14:18:17 +02:00
Raphael Collet 6a601fe6dc [IMP] test-pylint: check for undefined variables 2018-05-16 13:58:39 +02:00
Olivier Dony cdabb9d74c [FIX] auth_signup: remove password from welcome message
Revision 054c68689b added by mistake the
password of the new user in the welcome message that is sent to users
who signed up with an invitation token.

There is no need for this, the user has just chosen their password, and
we should not send them a copy which could be compromised on the way to
their inbox or later in their inbox.
It may also give users the impression that their passwords is stored in
cleartext in the database, even when that is not the case.

This patch minimalizes changes to the template and its translations.
For existing databases where the code is updated without re-syncing the
template, the password will simply be missing in the message (until a
resync of auth_signup module is done)
2018-05-16 12:17:14 +02:00
Jeremy Kersten b8f5f17aed [FIX] event: don't block scheduler at first exception
Before this commit, when a scheduler fail for one event (eg: error in send_mail),
the cron stop and don't continue to process all others event's scheduler.

Now we try to warn (~ randomly once by hour) the responsible/organizer/write_uid
that an error occurs with this scheduler, and we continue to process the others.

opw-1840497
closes #24741
2018-05-16 11:58:11 +02:00
Nicolas Martinelli 6fce298d70 [FIX] account: tax computation at reconciliation
- Create a tax included of 7.7%
- Set the company rounding to 'Round Globally'
- Create a bank statement of 10.70, reconcile
- Add a manual line with the 7.7% tax

An extra line of 0.01 remains.

The remaining amount after subtracting the tax is `0.00499...`, which
is rounded to `0.005` by `Math.round(total*1000)/1000`, and finally
displayed as `0.01`.

The 'Round Globally' setting makes sense for objects containing multiple
lines, such as SO, PO or invoice. In the case of a reconciliation, we
can switch to the 'Round per line' config.

opw-1837986
2018-05-16 11:10:58 +02:00
Christophe Simonis 9db6dfa25d [FIX] event_sale: update registrations as sudo.
Consequence of 19878d011f

Backport of fb17edd0b0
2018-05-16 11:05:16 +02:00
Olivier Colson 75e965f4b0 [FIX] purchase: valuation tests: use reconcilable accounts for in and out accounts in anglosaxon accounting 2018-05-16 10:27:08 +02:00
len-odoo 47cc4fbbab [FIX] auth_signup: add missing dependency on the computation of the signup validity
The field signup_valid is a non stored computed field based on signup_token.
The cache is filled with prefetched values, so in a loop the field is read from
the cache and not recomputed due to the missing dependency.

opw 1843442
2018-05-16 09:01:14 +02:00
len-odoo 25548eb7e9 [FIX] web: sort relational fields by their names
When sorting records according to a many2one field in a list view
embedded in a form view, the js would sort according to their ids,
in a seemingly arbitrary order.
Thus sorting records according to a field with values in ("a", "b", "c")
could be sorted as "a", "a", "c", "b" instead of "a", "a", "b", "c".
We make the comparison on the name of the field instead.

opw 1838860
2018-05-16 08:04:53 +02:00
Christophe Simonis fa8a67ee5f [MERGE] forward port branch 11.0 up to 5a943390f2 2018-05-15 20:18:14 +02:00
Christophe Simonis 5a943390f2 [MERGE] forward port branch saas-15 up to fb17edd0b0 2018-05-15 20:03:18 +02:00
Christophe Simonis fb17edd0b0 [FIX] event_sale: update registrations as sudo.
Consequence of 19878d011f
2018-05-15 19:19:51 +02:00
Christophe Simonis df3b75a127 [MERGE] forward port branch saas-15 up to f1ae96e389 2018-05-15 18:58:20 +02:00
Christophe Simonis f1ae96e389 [MERGE] forward port branch saas-14 up to a50e7aa366 2018-05-15 18:36:16 +02:00
Toufik Benjaa 05ef2f24e0 [FIX] mail: Missing parenthesis to call "remove" on chatter spinner
- The code to remove the loading spinner from the chatter was missing parenthesis to actually do the function call.
2018-05-15 17:53:22 +02:00
Christophe Simonis a50e7aa366 [MERGE] forward port branch 10.0 up to 13fc77daf4 2018-05-15 17:44:34 +02:00
Jeremy Kersten 04ce6e84c2 [IMP] website_event: show physical event before online if country specific.
If a country is specified, we show also all our online events to promote it since
they can be followed from anywhere. But we show in priority the physical event.

opw-1845012
2018-05-15 17:24:50 +02:00
Olivier Colson 0f39ee9370 [FIX] purchase: anglosaxon: use currency rates to determine whether or not to post price difference amount
Before that, we compared the amounts naïvely, leading to possible errors in case the PO and invoices were made in different currencies.
2018-05-15 17:22:56 +02:00
Denis Ledoux e5fb990db1 [FIX] project: prevent to create recursive hierarchy of tasks
Until this revision,
this was possible to set as parent task the current task.

From then, it was impossible to compute the field
`subtask_count` because of an infinite loop.

This resulted to the inability to open the task
form, which contains this field.

opw-1847982
2018-05-15 17:10:30 +02:00
Goffin Simon 35c2a74480 [FIX] delivery: Delivery method name not translated
When adding a SO line with a delivery method (e.g. The Post) for a customer
with a different language that the one set on the current language, the description
of the SO line was not translated. Inspired from function 'product_id_change' in
model 'sale.order.line'

opw:1843934
2018-05-15 17:07:44 +02:00
Christophe Simonis 13fc77daf4 [MERGE] forward port branch 9.0 up to 19878d011f 2018-05-15 16:51:34 +02:00
Toufik Benjaa 84f0b4d934 [FIX] mail: Avoid crashing when removing link from chatter
- The code to remove mentionned users on the chatter isn't robust enough.
  It crashes when trying to remove a link added from a copy/paste as if it was a mention.
  Mentions have an id defined on their "a" html node, linked copied and pasted don't.
  Which crashes the javascript code because it is trying to use the id.

  This fix, make sure to delete the node without using its id (we already have the node) and make sure to remove it only if it starts with a '@' (meaning it is a mention).
2018-05-15 16:48:54 +02:00
qdp-odoo 6558d52e9b [FIX] account: adjustment wizard usability
This commits removes a disambiguation on the choices of the 'Adjustment Type' selection as 'in your favor' could be achieved by debitting the 'Collected Tax' account or creditting the 'Paid Tax' accounts (respectively for 'in favor of the Estate'). The choices now refers directly to the journal item where the tax is gonna be copied

Related to https://github.com/odoo/odoo/commit/c58ef14a01f600d75391f2a9c38bb2b30e0e2528
Related to OPW 1826242
2018-05-15 16:47:38 +02:00
Tejas Shahu 15a99338fb [FIX] note: correctly display chatter in note form view
Before this commit there was an unexpected behavior of chatter in Note module
on Zoomin/Zoomout. Putting the html field memo in the sheet solves it and
chatter now properly behaves.

Related to task ID 1837177. Closes #24295.
2018-05-15 15:49:54 +02:00
Thibault Delavallée 96a223a5f0 [IMP] mail: prevent creation of activities to users that have no access to document
This commit is related to task ID 58968 . Closes #24176.
2018-05-15 15:42:54 +02:00
Vincent Schippefilt 9148960174 [IMP] account_budget: complete review of the module
* budgetary position nor analytic account aren't required anymore (although one of the 2 have to be given)
* by extension, the computation of practical amount is not either based on the analytic lines or the account.move.line
* usability improved (for eaxmple: there's a button to open the list of items on which the practical amount computation is done)
* addition of a pivot and graph views of the budget lines

Was PR: #22342
Was task: 31995
2018-05-15 15:19:28 +02:00
qdp-odoo f53d9c369d [IMP] analytic: slightly improves demo data
by adding an analytic group to analytic accounts
2018-05-15 15:06:39 +02:00