Commit Graph
116006 Commits
Author SHA1 Message Date
Martin Trigaux 9e1bb18101 [FIX] base: typo 2018-03-12 15:46:33 +01:00
Raphael Collet c04685e54e [FIX] models: update non-stored inverse field on several records
Issue: when the inverse method writes on a dependency of the first record, it
invalidates the cache of the field for the other records...  Solution: simply
evaluate the inverse method one record at a time.
2018-03-12 13:30:43 +01:00
Thibault Delavallée 42659dc70c [IMP] test_mail: add performance tests to cover more separate features
In test_mail there are performance tests involving several followers and give
counters for some heavy real-life-like use cases. Purpose of this commit is to
have more basic performance tests for main mail features, like simple post,
simple subscription of one follower. It allows to have an idea of the basic
cost of various features.

Adding use cases for message_post includes
 * posting without followers (aka, no notification)
 * posting with a ping (by email or by inbox)
 * logging a note with optimized method _message_log or with message_post

Adding use cases for activities includes setting an activity as done. This
action posts a message and is therefore interesting to evaluate.

Adding use cases for subscription includes
 * adding and re-adding one follower, with default or specified subtypes
 * updating responsible field triggering a simple tracking and an assignation
   email or notification (not completely supported in saas 11.2 meaning this
   counter will increase when forward-ported)
 * note that some subscription tests have already been added at a01933c9b4

Finally some heavier tests are added for assignation and tracking based
on QWeb view.

This commit is related to task ID 1824965 . This one is an ongoing task
and several commits may be linked to that task.
2018-03-09 12:34:21 +01:00
Aaron Bohy 6b9632effe [FIX] mail: adapt forwardported tests
The ChatManager has been refactored in saas-11.2 to make it fully
(and more easily) testable. This means that tests involving
messaging stuff written in previous versions need to be slightly
adapted when being forwardported to saas-11.2. In particular, the
3 tests adapted in this commit broke because of an include done in
the voip addon. Those tests have been added in 3809fc891.
2018-03-09 09:27:52 +01:00
Aaron Bohy 0a66ca3909 [FIX] web: ActionManager: push state of loaded actions
Actions loaded from the url are flagged with 'pushState: false', to
prevent them from pushing their state back to the url, thus
producing an infinite loop. However, if the state of a loaded
action changes in the future (e.g. load an action in kanban view,
then switch to a form view), this state should be pushed to update
the url. Before this rev., this wasn't the case.
2018-03-09 08:33:22 +01:00
Christophe Simonis 52a190dc09 [FIX] test_new_api: declare fields in correct model 2018-03-08 19:27:43 +01:00
Christophe Simonis a0aa939d9b [MERGE] forward port branch 11.0 up to fcb48b7241 2018-03-08 19:00:04 +01:00
Christophe Simonis fcb48b7241 [FIX] purchase,stock_dropshipping: keep current company currency
Changing it is not needed and generated missmatch against existing
entries (created by l10n_generic_coa demo data, thus depending on module
install order).
2018-03-08 18:16:55 +01:00
Géry Debongnie c7b5b12be6 [FIX] web: add the node attribute to the form view widget
This could (should?) be considered a refactoring, but this is actually
trying to restore lost functionality.  In v10, the custom form widgets
were created with access to the node element that define them.  We lost
that in v11, with the new views.

However, it is actually very useful for generic widgets.  Since this is
not really a risky fix, I think that it can be done in 11.0.

Note: this feature was already reintroduced in master in commit
https://github.com/odoo/odoo/commit/b7aa439826df6b3e442b3f60bb593ff28efc8679
2018-03-08 17:15:02 +01:00
Olivier Dony e366b0b6d4 [FIX] project: make default task order more natural
As of v11, project tasks and project issues have been merged.

Issues used to be ordered by:

        priority desc, create_date desc

whereas Tasks had the following historical ordering:

        priority desc, sequence, date_start, name, id

(where `date_start` corresponds to the creation date of the task, or the
time where task work began)

After the merge, the Task order was kept, but it became difficult to
understand for users, especially for converted issues.

This commit modifies the default order to a more obvious common order:

       priority desc, sequence, id desc

With the following goals in mind:
- the ordering does not change without obvious actions of the user
  (starring a record moves it at the top, manually reordering records
   reorders them within the same "stars category), and creating new
   records adds them at the top, where they are visible
- the ordering is easy to grasp, based on stars and chronological
  order, while still allowing manual reordering when really necessary
  (by default all records will have the default sequence of 10)
- sorting by "id desc" is similar to the previous "create_date desc"
  but it can be sorted more efficiently by the database

One could argue about sorting on chronological or reverse chronological
order. Like blogs and timelines, everyone has their preferences.
The latter option was selected because our UI for quickly adding records
is at the top of the kanban view, so it is more natural to see new
records at the top, instead of having them disappear at the bottom
immediately.

Hopefully this will not disrupt user workflows too much, and will remain
intuitive enough.
2018-03-08 17:11:12 +01:00
Olivier Dony 9b1009cd5a [FIX] payment_ogone: fix handling of validation tx
The validation transactions introduced in
7d428c871b were not working properly for
Ogone, due to several problems:

- The refund requests when being sent via the orderdirect.asp API, which
  does not support refunding previous transactions, according to the
  Ingenico helpdesk. It only support creating independent refund
  transactions, which is something that requires special pre-approval
  from the payment acquirer, and generally not permitted.
  In order to cancel/refund a previous transaction, the direct
  maintenance API must be used instead[1].

- Maintenance requests to refund a previous transaction fully should use
  the RFS code, as explained in the API documentation [1], and should
  always mention the PAYID of the refunded transaction.

- Such maintenance requests must always be SHA-signed, as usual.

- The various transaction status codes for refunded transactions need to
  be taken into account as well (typically those beginning with 8)

This commit fixes these various problems.

[1]
https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/directlink
(5.2 Direct Maintenance)
2018-03-08 17:11:12 +01:00
Olivier Dony c3769b2290 [FIX] payment_ogone: work around ingenico API bug
As of today, Ingenico platform 4.125 has non-uniform handling of the
PARAMPLUS parameters that can be passed as part of transaction metadata.

This parameter is documented as being parsed[1] as a series of
parameter-value pairs, to be passed as extra parameters to the feedback
transaction. Based on this, it seems that the PARAMPLUS value should not
be urlencoded globally, but each field value should be urlencoded, as
the Ingenico side will have to be able to parse and re-emit these
individual parameters.
In one case we were missing this urlencoding step, so this commit fixes
it.

Without this, the querydirect.asp API would return invalid XML data when
we retrieve the status of a transaction that used a PARAMPLUS value with
an '=' sign!

For example with PARAMPLUS passed as

        return_url=/payment/confirm?tx_id=123

the value returned by querydirect.asp would contain the following:
  (note the invalid extra quote character in the `return_url` param)

```
<?xml version="1.0"?>
<ncresponse
(...)
ED="1234"
return_url="/payment/confirm?tx_id="123"
SCORING=""
SCO_CATEGORY="G">
</ncresponse>
```

Url-encoding the value of the return_url in PARAMPLUS fixes this
nonsensical result.

However, the Ingenico API then fails to decode the parameter value when
passing it to the feedback URL, such as the ACCEPTURL we depend on.

As a workaround, since we only pass a single parameter inside
PARAMPLUS, we'll url-unquote it afterwards.

[1]
https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/e-commerce#feedbackparameters_variablefeedbackparameters
2018-03-08 17:11:12 +01:00
Romain Derie 247f7db088 [FIX] website: use absolute href location after page url change
Before this commit:
When editing a page URL through page properties it would redirect to that new
url afterward. If the url was not starting with '/' and had multiple level
before and after edition (eg: page/action to page/realaction) it would then
redirect to a wrong relative URL.

Now, we ensure that we redirect to the correct URL: the one slugified and
cleaned in the backend.

Step to reproduce:
  - Create a page '/page/action'
  - Go to that page and open Page Properties
  - Edit the URL to 'page/someaction'
  - You will be redirected to the incorrect relative URL /page/page/someaction
2018-03-08 16:25:50 +01:00
Goffin Simon 0bde7aa106 [FIX] sale_timesheet: AccessError on sale.order.line in multi-company
When the type of a product is changed by a user of company A, if this
product has been sold previously by company B, the user receives an
access error.

opw:1824548
2018-03-08 15:46:20 +01:00
Christophe Matthieu 070f1173da [FIX] odoo: onchange load the related field data
Configurations uses an onchange to populate the fields visible to the
user. However, the related fields are by default called sudo, when it is
an onchange, there may be a missmatch in the cache, the cache used being
empty, there is no value to return (cache fix is not currently possible).

Before this fix we must use 'related_sudo=False' to use the good cache but
it's an inconsistent fix because in some case we must use sudo to avoid
access error.

opw-1823363
2018-03-08 15:36:22 +01:00
Simon Lejeune 527b22b511 [FIX] stock: "Picking Moves" on quant
When looking for the move line associated to a quant, make sur to return
the move lines that took from the package or that put something in the
package.

opw-1824578
2018-03-08 15:27:46 +01:00
Christophe Simonis 8f118ad533 [FIX] purchase,stock_dropshipping: correct test
Oversight of previous forward-port
2018-03-08 14:37:13 +01:00
true-datura 67f67b5124 [FIX] web: 'image_small' field not displayed for non-latin translations
Before this commit, images in kanban view of the Contact app were not displayed
on non-latin languages, such as Russian.

This was caused by the is_bin_size helper that wrongly assumes that a certain
string is not a binary size, although it is (e.g. 64.2 Кб).

This commit fixes the issue by including such strings as valid binary sizes.

Bug found and fixed by @true-datura
Test by @alexkuhn

closes #23526
closes #22519
2018-03-08 14:29:36 +01:00
true-datura 6faf7784e6 Add CLA signature 2018-03-08 14:29:29 +01:00
Christophe Simonis 7d66953d17 [MERGE] forward port branch 11.0 up to bfe88c50e2 2018-03-08 14:06:54 +01:00
Nicolas Lempereur bd4f09fa72 [FIX] portal: no note in frontend chatter w/ token
When a chatter is displayed and the document is accessed with a valid
access_token, the message related to the document are searched in sudo.

This bypass valid filtering we may down the line.

This change apply the filtering so note type messages are not displayed
for user who are not employees.

note: before 11.0 this logic was in 1b5c2ced. In future version it would
      probably be better to have a method eg. _get_domain_based_on_user
      that would be called before sudo and if not sudo.

opw-1819702
closes #23544
2018-03-08 13:41:08 +01:00
Christophe Simonis bfe88c50e2 [MERGE] forward port branch saas-15 up to 0ae300e9e6 2018-03-08 13:22:28 +01:00
Christophe Simonis 0ae300e9e6 [MERGE] forward port branch saas-14 up to 85fd5cc147 2018-03-08 12:45:29 +01:00
Aaron Bohy 7fac801075 [FIX] web: mobile: display searchview toggler
There was an issue with the control panel in mobile since rev.
7b6056a. In the enterprise webclient, by default, the search view
is hidden, and a search icon should be displayed on the top right
corner of the control panel so that the user can toggle the
searchview.

Before this rev., the icon was invisible at the first rendering of
a view, and only appeared once the view was reloaded.

The change in rev. 7b6056a that produced the issue is that the
control panel is now updated twice when a view is rendered (once
by the view itself with the buttons, searchview..., and once by
the ActionManager with the breadcrumbs). The control panel didn't
handle correctly that scenario.

A test case will been added in web_enterprise.
2018-03-08 12:41:59 +01:00
Aaron Bohy 3809fc891f [FIX] web,mail: always reload widget mail_activity
Before this rev., the field widget 'mail_activity' kept an internal
cache of fetched activities (like the 'mail_thread' and
'mail_followers'). However, for activities, this cache may cause
issues.

For instance, create a new lead in 'My pipeline', schedule a
'Meeting' activity on that lead (it opens the Calendar view so
that real meetings can be created), create a meeting 2 weeks from
now, go back to the lead form view: the activity still diplays that
the meeting is today (when the view is refreshed, the correct date
is displayed).

This rev. removes the internal cache for this field widget, as the
activities can easily be updated in business flows (unlike messages
or followers).

This rev. also fixes a bug in the BasicModel, where the res_ids of
a list datapoint was altered in place to return a list of x2many
commands instead of the list of ids when being stringified. This
caused a traceback when opening a lead with activities, as soon
as the internal cache had been removed.
2018-03-08 12:39:21 +01:00
Christophe Simonis 85fd5cc147 [MERGE] forward port branch 10.0 up to 41af298d9d 2018-03-08 11:37:10 +01:00
Christophe Simonis 41af298d9d [FIX] hr_payroll: use defined variable
Oversight of previous forward-port
2018-03-08 11:11:44 +01:00
Christophe Simonis d7f4454694 [MERGE] forward port branch 9.0 up to 2f46f3bdb2 2018-03-08 10:50:20 +01:00
Goffin Simon 622399c796 [FIX] purchase: Changing the price of a confirmed PO before the receipt
Steps to reproduce the bug:
- Set your company in anglo-saxon
- Create a product P in a category which is in real price and perpetual
- Create a PO with P at 500$ and validate it
- Change the unit price of P in the PO line and set 100$
- Receive the product
Bug:
The two journal entries generated for the goods were created with the price unit
500$ instead of 100$.
Fix:
Now the right price is taken into account to generate the journal entries.

opw:1813946
2018-03-08 10:42:53 +01:00
Christophe Simonis 5fa4cc0d34 [FIX] stock_dropshipping: run accounting tests after install 2018-03-08 10:41:52 +01:00
Jeremy Kersten b4f8ca0a34 [FIX] base: fix dev mode for inherits view
Before this commit, model that create ir_ui_view via _inheritS was ignored in --dev xml
The arch_fs was not set. Because it was not ir.ui.view, and because xml_id was suffixed by _ir_ui_view.

Now we manage the case of inherits. So if model model.name inherits ir_ui_view

class MyClass(models.Model):
    _name = 'model.name'
    _inherits = {'ir.ui.view': 'view_id'}

    view_id = fields.Many2one('ir.ui.view', string='View', required=True, ondelete="cascade")
    ...

<record name='model.name' xmlid='pok'>
    <field name='arch' type='xml'>content</field>
</record>

will be read from xml in dev mode.

parsing the xml file for xml_id pok_ir_ui_view and pok.
The orm by default will add this suffix.

The 'dynamic' view created when we update the groups is a special case, which we don't want the arch_fs
for dev mode because the xml only contains by default and an empty container and btw the imd was wrong
since we had the res.group model a xml_id into the _inverse_arch.

The page create via a template (method new_page) will automatically remove the arch_fs since we don't
want to see the empty container if we are in dev_mode.
2018-03-08 10:22:21 +01:00
Goffin Simon 9f226528bd [FIX] stock_account: Force accounting date on validated inventory adjustment
When the inventory adjustement has been validated, changing accounting_date has no
impact on the stock moves created by the inventory adjustement.
This behavior cannot be changed in stable version.

opw:1817813
2018-03-08 10:17:52 +01:00
Alexandre Kühn 60bbce2e53 [FIX] mail: nocontent helper discuss (inbox & starred)
Revision on https://github.com/odoo/odoo/commit/a87d761fdbf345ada5dc93e0a686b08a0f5a0417

From the UX/UI changes above, we also changed the style for empty
inbox and starred in Discuss.

There are two issues with the empty boxes message:

    1. The text is not centered at all (one word per line,
       and everything is stuck on the left-side of the screen)
    2. The style is inconsistent with nocontent message on search

In this commit, inbox and starred use the same style as the no_content
message from a search. The style of the nocontent from a search has been
slightly changed to mimick the intended style for inbox and starred:

    - centered text
    - title is in bold 125% font size
    - other text is not in bold, 115% font size.
2018-03-08 09:30:37 +01:00
Nicolas Martinelli 1048fc6ed5 [FIX] purchase, stock_dropshipping: fix tests
Astonishingly, some people really need a green runbot to work.
2018-03-08 09:22:59 +01:00
len-odoo 9fdbbb816c [FIX] website_sale: display prices using public user pricelist on the shop
When a pricelist was set on the public user that was different from that of the
website, the prices were displayed using the public user default currency,
but the currency symbol displayed was the website default currency.
The issue was that in the template, the currency was accessed as a computed,
related field of website while the price was obtained using a function call.
In the first case the field was obtained using sudo, and thus the call would not
get the public user pricelist.

opw-1817761
2018-03-08 08:58:30 +01:00
Christophe Simonis 9db108c106 [FIX] delivery: remove extra unsourced file 2018-03-07 18:49:05 +01:00
Christophe Simonis 4aa5ec3fa5 [MERGE] forward port branch 11.0 up to d67b410dfc 2018-03-07 18:46:38 +01:00
Nicolas Martinelli d594fece4a [FIX] point_of_sale: return product
When a user returns a tracked product in the POS, it is not possible to
register the serial number. In case a customer returns 2 units of a
tracked product, the following error occurs:
'Cannot set the done quantity from this stock move...'

Since the serial number were not set, `qty_done` remains equal to zero
and `pack_lots` is empty. Therefore, we are trying to set a zero value,
which is actually useless.

opw-1817695
2018-03-07 18:18:57 +01:00
Christophe Simonis d67b410dfc [MERGE] forward port branch saas-15 up to cb87388d72 2018-03-07 17:42:02 +01:00
Denis Ledoux 2f46f3bdb2 [FIX] hr_payroll: generate payslips sets the employee company
In a multi-company environment,
if a user in company A
created a Payslips batch for an employee in the company B
and used the `generate payslips` button,
the created payslip was set with the user company (A) while
it must be the employee company (B).

opw-1820138
2018-03-07 16:16:52 +01:00
Denis Ledoux 43f0cbcc86 [FIX] hr_holidays: employee onchange when no employee set
When changing the employee to None in an allocation,
this onchange raised an error because it attempted
to set an employee browser record (empty but still)
in a department many2one.

- Create a new leave allocation
- Try to change the field Mode (holiday_type) from "By Employee" to "By Employee Tag"

Fixes #23345
opw-1820069
2018-03-07 15:52:16 +01:00
Alexandre Kühn 3c821d4035 [FIX] mail: no traceback with attach/detach (discuss mobile)
Revision on https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498

From the refactoring above, some snake_case attributes have been
converted into camelCase. That was the case in discuss.js, but
we missed to propagate the changes in discuss_mobile.js.

This commit fixes the traceback that came from the mistake above.
2018-03-07 15:11:01 +01:00
qsm-odoo b7b8634575 [FIX] web: statusbar buttons design when no statusbar status
When there were no status widget in the form view statusbar, the left
buttons appeared without any vertical space around them in a smaller
statusbar.

There also was a 1px mistake that made the buttons appear non-centered.
Now they appear centered in any case and a row of buttons is always
forcing the correct statusbar height.

Closes https://github.com/odoo/odoo/pull/22053
opw-(1)813479
2018-03-07 15:05:17 +01:00
Arnold Moyaux 98547bf0cd [FIX] barcodes: Do not trigger useless onchange server side.
This commit improve perf by not trigger onchange server
side on one2many field if the js could find a candidate.

opw-785425
2018-03-07 14:55:31 +01:00
Nicolas Martinelli cf3ed5e547 [FIX] l10n_be_hr_payroll_fleet: max cars
The field `max_unused_cars` is impossible to read in the configuration
view.

Closes #23412
opw-1819898
2018-03-07 14:50:02 +01:00
Christophe Simonis cb87388d72 [MERGE] forward port branch saas-14 up to b16129d108 2018-03-07 14:28:05 +01:00
Christophe Simonis b16129d108 [MERGE] forward port branch 10.0 up to 69c7d696d8 2018-03-07 14:27:15 +01:00
Romain Derie 1c01528375 [FIX] hr_expense: ensure message_new has only one record (singleton)
Before this commit:
Expense emails title are parsed to find a product that match the given [CODE].
For example, an email title like '[CARD] Graphic Card $900' will create an
expense for the product having 'CARD' as internal reference.
Since the search is done with an 'ilike' and with no 'limit', it could return
multiple product: all the one containing the CODE in their internal reference.
This would throw a singleton error when trying afterward to read product.id.
Then, the mail would not go through the mail.thread flow and it would return
a Mail System Delivery fail saying the address does not exist.
Users would get stuck with this, having no way to understand where the error
comes from.

Now, we ensure to find only 1 product.
To avoid breaking the ilike behavior that could be used by users only typing
the first caracters of a long CODE, we still use ilike but force exact match if
there is multiple results.

Closes #23419
opw-1816340
2018-03-07 14:25:16 +01:00
Pierre Masereel a2d554c0a5 [FIX] stock: fix various bug in picking views
The following bugs in detailed operations have been fixed in this
commit:
- Avoid to edit reserved quantity on move lines. When a picking is set
  in 'UNLOCK' mode you are able to edit the reserved quantity of move
  lines, even if it doesn't really causes problems it create confusion
  on what is the reserved quantity.
- Avoid to edit the product_id on a move if there is a move lines linked
  to it. This will cause inceonsistencies by having move lines with
  product_id different than the related moves.
- Avoid to edit the product_id on a move line if it has a linked move for
  the same reasons as above. We also avoid the edition when picking is
  done to avoid issues with the stock valuation
- Remove call to 'force_assign' method on demo data as this method is
  not used anymore and set some pickings in wierd states
- Adding a move line in the detailed operation view does not create an
  associated move.
- Don't allow editing moves when we are in detailed views and state is
  done, even if picking is unlocked.

TASK-1817931
2018-03-07 13:59:28 +01:00
Arnold Moyaux f95566f08a [FIX] barcode: set quantity with key press
Allow the user to set the quantity with barcode
scanning. This functionality was present in v9 but
didn't work in v11.

The code in order to make it work was already present in
_quantityListener however it makes a check on setQuantityWithKeypress
key on the obejct activeBarcode. Howver the key was never set during the
activeBarcode event.

This commit set the key on the activeBarcode if passed in the event data.
It also allow to trigger a barcode if the user is inside a modal.
2018-03-07 13:20:52 +01:00