Commit Graph
103218 Commits
Author SHA1 Message Date
SEINLET Nicolas ded636eae1 [FIX] ir.rule: use rules at most once (#15843)
When a user belongs to multiple groups, and an ir.rule is applicable for some of
them, the rule is added multiple times in the domain. Just do it once. This
makes the query shorter and easier to debug.
2017-04-11 09:27:58 +02:00
Tran Thanh Phuc 6108778497 [FIX] point_of_sale: wrong group by
Both group by filters are the same
Closes #16338
2017-04-10 12:07:00 +02:00
Tran Thanh Phuc 8600ae34df [CLA] signature for ttpphuctran
Done at #16337
2017-04-10 11:51:43 +02:00
Odoo Translation Bot 8f7791fcee [I18N] Update translation terms from Transifex 2017-04-09 02:54:13 +02:00
Odoo Translation Bot 086723152e [I18N] Update translation terms from Transifex 2017-04-09 00:30:47 +02:00
Christophe Simonis 51fe54dd8d [MERGE] forward port branch saas-6 up to d92c048f9a 2017-04-07 16:30:03 +02:00
Christophe Simonis d92c048f9a [MERGE] forward port branch 8.0 up to 6595cfdf0c 2017-04-07 16:16:03 +02:00
Jérome Maes b99311b0e9 [FIX] mass_mailing: use correct regex to detect href content
link_tracker use a regex to determine the content of
a 'href' tag, taking the 'mailto:xxxx@yyyy.zz' case
into account. mass_mailing use another regex that simply
don't.
So when sending a mass mailing containing email link,
the email will be appended by url path of tracking
url '/m/<stat_id>'.

This commit makes mass_mailing use the same regex as
link_tracker (which is in the dependencies of mass_mailing).

opw-727779
2017-04-07 15:52:13 +02:00
Christophe Simonis d4d5181285 [MERGE] forward port branch saas-6 up to 271067f50c 2017-04-07 15:11:50 +02:00
Nicolas Martinelli 606712a5d2 [FIX] web: refuse DB name with space
In v8, it was not allowed to create a DB with a name containing a space.
This should still be the case from v9 since it causes issuesfor backup
scripts, for example.

Reintroduces 1a0e9063d4

opw-727613
2017-04-07 14:53:01 +02:00
Fabien Meghazi a859c3b6b3 [REM] Remove 'state' group_by filter in purchase order line search view (opw: 727796)
The group by on state in this search view cannot be used due to a typo
in the 'state' field's attribute "stored=True" dbe3d8035f

It can't be fixed in 9.0 as it would change the schema, hence the only
option is to disable this filter in 9.0

This should not to be forward ported to 10.0 as it is already fixed for
this version in 3451ac5254
2017-04-07 13:17:36 +02:00
Joren Van Onder d17c302c0a [FIX] point_of_sale: undo mobile browser autoscroll in client list
Mobile browsers attempt to scroll invisible input elements into
view (eg. when they end up hidden behind the on-screen keyboard). The
browser does not always correctly undo this. This is problematic
because the main window in the client list is not actually scrollable
for the user, so you ended up with part of the widget cut off. This
implements a workaround that scrolls to top when input elements are
blurred. Removing the blur handlers is not necessary because the input
elements get removed.

opw-706781
2017-04-06 17:01:22 -07:00
Goffin Simon c8a434306f [FIX] website_sale: Updating price on Optional Products
When changing the quantity of a product in Optional Products modal
in the shop, the price was not updated according to the pricelist.

opw:726686
2017-04-06 17:37:19 +02:00
Raphael Collet 6595cfdf0c [FIX] expression: avoid useless query when searching on x2many sub-field
Searching on a domain like `[('m2m.sub', operator, value)]` currently does
something like:

    right_ids = comodel.search([('sub', operator, value)]).ids
    table_ids = model.search([('m2m', 'in', right_ids)]).ids

and reduces the domain triple to `('id', 'in', table_ids)`.

The domain triple can actually be reduced to `('m2m', 'in', right_ids)`.  With
this reduction, the search on the field `m2m` will be done as part of the main
query.  And this will also enable the optimization of the former fix!
2017-04-06 16:46:46 +02:00
Raphael Collet 3c2065c89d [FIX] expression: use sub-select when searching on many2many field
Avoid pathological performance issue caused by injecting ids retrieved with
another query.

Consider a domain like `[('m2m', 'in', ids)]` on a many2many field.  The
current implementation will perform the subquery:

    SELECT m2m_id1 FROM m2m_table WHERE m2m_id2 IN (ids)

and inject its result into the main query as:

    SELECT id FROM ... WHERE id IN (result_ids)

The latter may be very slow if `result_ids` is a huge list of ids.

The fix injects the first query into the main query as:

    SELECT id FROM ... WHERE id IN (
        SELECT m2m_id1 FROM m2m_table WHERE m2m_id2 IN (ids)
    )

As a result, the database will typically JOIN both tables, and avoid generating
the whole list from the subquery.
2017-04-06 15:59:50 +02:00
Thomas Binsfeld 01add1fe15 [FIX] account: browse only one record
Part of #16282
2017-04-06 15:11:31 +02:00
Christophe Simonis 271067f50c [MERGE] forward port branch 8.0 up to 3128e84243 2017-04-06 14:46:56 +02:00
Goffin Simon d444fbcc1a [FIX] l10n_at: Vorsteuer 2500 account
The type of account Vorsteuer 2500 is Non-current Assets(like in l10n_be).
In this way, the amount due will include the taxes Vorsteuer 10%
and Vorsteuer 20% when computing the amount due with _compute_residual
because the account is not receivable or payable.

opw:725619
2017-04-06 09:21:21 +02:00
Nicolas Martinelli 3128e84243 [FIX] account: aged receivable
- Create an invoice of 10000 at date 2016-11-30, due 2017-02-28
- Make a partial payment of 1500 at date 2016-11-09
- Make a partial payment of 1000 at date 2016-11-30
- Make a partial payment of 2000 at date 2017-01-30

At current date (e.g. 2017-04-04), run the Aged Partner Balance. 5500 is
still due, but set to the +120 days period instead of 30-60.

opw-725890
2017-04-05 11:50:03 +02:00
Jerther 33076f7394 [FIX] stock: set AML date same as move date
Based on v9 fix: f6b6eb906d

Closes #16217
2017-04-05 11:31:19 +02:00
Nicolas Martinelli 8f39ad2be6 [FIX] point_of_sale: action_assign before force_assign
This allows the reservation in sub-locations before forcing the
availability.

opw-726060
2017-04-05 11:09:26 +02:00
Jerther 52c58fd218 [CLA] backport signature to 8.0
Done at #16240
2017-04-05 10:48:35 +02:00
Nicolas Lempereur 0b2fd60041 [FIX] web: editable list view regression bc031379 (9.0)
In 9.0 in some particular instances with embedded views, if:

- an x2many list view is editable,
- we go from a form view of an existing record to creating a record,
- the timings of deferred resolving are in a certain order

the x2many list view could be tought as loaded whilst in reality it is
the 'editable list view' row editing 'form view' that has been loaded.

This could cause sometimes issues after bc031379 because the onchange
computation would happen before the list view is really loaded.

This is probably an issue with the deferred system in one of the views,
but it would be rather hard and dangerous to change it.

So this fix introduce an additional test which ignore relational views
if there is an embedded view.

opw-726701
opw-726768

note: only needed for 9.0, the relational views have been changed as of
saas-11 and this issue is not present.
2017-04-04 17:29:53 +02:00
Thibault Delavallée 4d3fc120e7 [FIX] event: correctly compute 'done' state of mail scheduler
Currently line was incorrect as the purpose is to ensure all lines of
the scheduler are sent. Currently not send lines are filetered and therefore
not taken into account. This commits fixes it.
2017-04-04 10:43:22 +02:00
Denis Ledoux 759492167a [FIX] web: textarea of editable list above everything
When expanding a textarea of an editable list,
by putting a long description for instnace,
with multiple lines,
some elements were put above the textarea,
making the content partially hidden

opw-709894
Closes #16083
2017-04-03 17:23:58 +02:00
Pedro M. Baeza 659103718f [FIX] account: determinist view swticher order
Both tree and form view have the same sequence, which haas, at best no effect,
at worst, shows the form before the tree view.
In the second case, making that clicking on the bank journal name drives you to
a new bank statement instead of the list of existing ones.

Closes #16187
2017-04-03 10:30:12 +02:00
Cédric Pigeon a1aada9f76 [FIX] stock: new cursor for orderpoint
On large databases, the orderpoint calculation can fail due to the huge
cache used diring the process.

Instead of using one cursor for the transaction, we create a new cursor
every 100 orderpoints, to limit the cache size and speed up the
performances.

opw-726711
Closes #16158
2017-04-03 10:13:03 +02:00
Jeremy Kersten 7db14bbe69 [FIX] res_users: show the computed base.user_groups_view view in dev mode
Before this commit, in dev mode, the view was read from xml with the dummy
template. Set arch_fs to False will force to use the view in database and so
the automatically computed view.

This commit closes #16179
2017-04-03 09:34:26 +02:00
Odoo Translation Bot 794c9f5118 [I18N] Update translation terms from Transifex 2017-04-02 02:56:31 +02:00
Odoo Translation Bot 963c9ffa4a [I18N] Update translation terms from Transifex 2017-04-02 00:32:12 +02:00
Odoo Translation Bot fb130ec5a4 [I18N] Update translation terms from Transifex 2017-04-01 02:56:03 +02:00
Cedric Snauwaert 8221310e4d [ADD] l10n_in_schedule6: required coa for india that was lost during migration to v9 2017-03-31 12:10:22 +02:00
Jeremy Kersten d7c765f62f [FIX] openerp: fix traceback when no field in constrains
In case you don't have 'field', the first 'if' will raise a warning.
In this case the second 'if' will crash with:
    "'NoneType' object has no attribute 'store'"

This commit closes #16146
Courtesy of @kmetaxas
2017-03-31 11:52:31 +02:00
Nicolas Lempereur 4cfd03d056 [FIX] calendar: no add Contact when no useContacts
On a form view the attribute `use_contacts` will:

- when set to True: enable us to add contacts which will be available on
  any time in the calendar,

- when unset: the list of contact is only the contact currently beeing
  seen directly in the calendar.

The feature for adding contact is thus not necessary when
`use_contacts` is unset. But it still appeared without having any effect
(which is unexpected).

This commit remove the contact adding feature when it has no necessity.

opw-715932
2017-03-31 09:24:51 +02:00
Nicolas Martinelli bbb3bd876a [FIX] account_extra_reports: Partner Ledger report
- Activate multi-currency
- Create an invoice in a currency different from the company currency
- Go to Accounting > Reporting > Management > Partner Ledger
- Activate the option "With Currency"

The report printed doesn't contain the amount currency.

opw-726440
2017-03-30 15:50:45 +02:00
Nicolas Martinelli cc6a5110ee [FIX] mrp_repair: description language
The description should be in the partner's language, as in a SO.

opw-725060
2017-03-30 14:46:32 +02:00
Goffin Simon 50591ac0b2 [FIX] stock: Customer address in deliveryslip
When there is no move line linked to the picking, the customer address must
be the address of the partner linked to the stock.pick
Backport of this commit: 79d8849

opw:725721
2017-03-29 22:59:11 +02:00
Nicolas Lempereur 105243afa6 [FIX] web_editor: fix select and modify video
There was an issue when selecting a video tag:

- a tag inside the video tag would be selected instead of the video tag
  so video could not be removed or modified (modifying it would add a
  video or image inside the video itself and so on).

- the selection was not conveyed to the editor so it would be lost
  consequently due to some code who restored it to what was saved on
  the editor.

This fix solves this by changing how the video tag was selected and
saving the selected range on the editor.

opw-724701
2017-03-29 16:35:39 +02:00
Martin Trigaux 1b5dcf29f5 [FIX] report: remove duplicated dict key
Bad forward port, added at 2c90fad and fe7b3c66
Replaces and closes #16130
2017-03-29 15:39:14 +02:00
Nicolas Martinelli 14989806a6 [FIX] event: email schedule
- In "Events > Configuration", set "Email Scheduling" to "No automated
  emails"
- Create an event
- Register an attendee

An email is sent.

opw-724787
2017-03-29 13:46:24 +02:00
Nicolas Martinelli 989d7068e9 [FIX] account_asset: multi-currency depreciation
- Create an asset category with a journal of type "Purchase" or
  "Miscellaneous".
- Create an asset in a currency different from the company currency
- Validate and post the first entry.

The error "The amount expressed in the secondary currency must be
positive..." is raised.

The sign is determined by the journal type. However, in case of an asset
depreciation or a deferred revenue, the amount is always positive. The
amount is negative in case of an asset created from a refund invoice
(see commit c844534f8a).

There is actually no need of a `sign` variable. In case amount is
positive:
- first move is a credit, therefore `amount_currency` is negative
- second move is a debit, therefore `amount_currency` is positive

In case amoutn is negative:
- first move is a debit, therefore `amount_currency` is positive
- second move is a credit, therefore `amount_currency` is negative

opw-725358
2017-03-29 12:57:52 +02:00
Joren Van Onder 7f260ab517 [FIX] point_of_sale: round product.product price analogous to backend
A rounding issue was resolved in
ee33593351. It however introduced
another issue.

Rounding functions (both round_precision in web.utils and float_round
in openerp.tools) are not perfect due to IEEE floating point
limitations. However both should produce the same output given the
same input. An example: rounding 13.95 to 2 digits yields
13.950000000000001.

The additional rounding introduced in
ee33593351 on price lead to issues in
certain cases. One example occurs when applying a 90% discount on a
product costing 13.95. The POS will do the following:

> 13.950000000000001 * 0.09999999999999998
1.3949999999999998
> round_pr(1.3949999999999998, .01)
1.4000000000000001

whereas the backend will do (as eg. in sale.order.line)

>>> 13.95 * 0.09999999999999998
1.3949999999999996
>>> round(1.3949999999999996, 2)
1.3900000000000001

Causing a difference of 0.01.

The core of the issue is that in the backend 13.95 is rounded
differently. When a Float gets written to the database doesn't just
pass through the regular float_round. It passes through
_symbol_set_float which truncates characters exceeding the precision.

This implements the same approach in the POS.

opw-715506
Closes #16119
2017-03-29 10:45:43 +02:00
Nicolas Martinelli a4bc731f04 [FIX] mrp_repair: repair order
- Have a contact in language A
- Be connected in language B
- Go to repair and create a repair order for contact with language A

When printing repair order report (quotation), it is printed in language
B.

opw-725060
2017-03-28 16:34:24 +02:00
Christophe Simonis e876becada [MERGE] forward port branch saas-6 up to 7bcfa2b52a 2017-03-28 16:01:05 +02:00
Christophe Simonis 7bcfa2b52a [MERGE] forward port branch 8.0 up to 5fc3979262 2017-03-28 15:22:58 +02:00
Jairo Llopis 5fc3979262 [FIX] web: Avoid double-fetching many2many tags in list views
Before this patch, #15920 was happening. The problem was that calling `render_cell` produced a call to [`record.set(column.id + '__display', value)`][1], which triggers the `change` event, which called `render_record` the first time, which called again `render_cell` and produced the 2nd data fetch.

After this patch, `render_record` is only called if there is some place where to put the result, which does not happen in those situations.

There is still the problem that there is one call to name_get for each many2many widget found in a list view (instead of one per full view rendering), but at least they are not two calls!

[1]: https://github.com/odoo/odoo/blob/5d17749ff47c02294d5ff2ae56bbcef9d082562e/addons/web/static/src/js/view_list.js#L1125
2017-03-28 15:12:56 +02:00
Wolfgang Taferner 8e7f34c323 [FIX] web: domains might be undefined, so we check
Introduced recently in b2d66d0c14

opw-726354
Closes #16068
2017-03-28 15:02:47 +02:00
Nicolas Martinelli 59a6397867 [FIX] stock: sort moves to do
- Activate the MTO route on SO lines
- Activate the route "Buy" on a Product A without quantity on hand, add
  a supplier
- Create a SO with 2 lines. First line is Product A, second line is
  Product A with route MTO
- Confirm the SO, run the procurement if necessary
- Confirm the PO, receive the products
- On the picking generated from the SO, you should have one line
  "Waiting Availability" (the line not MTO) and one line "Available"
  (the line MTO).
- Click "Recheck Availability". One reserved quant from line 2 is moved
  to line 1.

A trick is to assign first the move with ancestors, so we don't "steal"
the reservation on the other move.

Fixes #15950
opw-725373
2017-03-28 13:30:29 +02:00
Christophe Simonis 30dda3faee [MERGE] forward port branch saas-6 up to 8fd0f8664b 2017-03-28 13:16:16 +02:00
Martin Trigaux e25dad4fed [I18N] point_of_sale: missing source terms reference 2017-03-28 12:49:01 +02:00