Commit Graph

8230 Commits

Author SHA1 Message Date
Odoo Translation Bot 0606247a8b [I18N] Update translation terms from Transifex 2016-08-07 03:07:40 +02:00
Martin Trigaux d56b03465f
[I18N] Update translation terms from Transifex
Last one before dropping a few non-active languages
2016-08-05 16:12:06 +02:00
Odoo Translation Bot 337049baa8 [I18N] Update translation terms from Transifex 2016-07-31 03:07:08 +02:00
Olivier Dony 8245c1d1d8
[FIX] service.server: drop idle connection attempts
Avoid wasting HTTP workers (in prefork server mode)
for pending/idle connections.
HTTP connections that have not sent anything for 500ms
will be dropped.

In particular, wkhtmltopdf uses a connection pool
to load remote resources. It opens more HTTP connections
than necessary and uses a random subset of them, leaving
the other idle.

On a server that has little available workers this
may significantly delay report rendering, and could
even lead to a deadlock.

OPW-667870
2016-07-25 13:06:31 +02:00
Olivier Dony 43cff22950
[FIX] base: fix broken URLs when redirecting
Similarly to werkzeug.urls.url_fix(), attempt to
correct some leftover special characters that
should have been URL-encoded.

We cannot actually use `werkzeug.urls.url_fix` or
`werkzeug.urls.url_quote`, as they expect more/most
characters to be un-encoded.
We have many existing cases where the redirect URL is
already fully encoded or mostly encoded, and those
functions would cause double-encoding, breaking the
final URL.
2016-07-25 13:06:31 +02:00
Odoo Translation Bot 84f9cdd1d9 [I18N] Update translation terms from Transifex 2016-07-24 02:59:48 +02:00
Nicolas Martinelli 2c19e9be96
[FIX] base: cherry-pick 55fa0912 to 8.0
Backported to 8.0 following report at #12648

[FIX] base: use datetime instead of date

The variable `date` is compared to the field `name` in the selection
query. `name` is filled in with datetime data. In particular, in the
module currency_rate_live, datetime.now() is used in the name. It is
necessary to make an appropriate comparison to make sure we select the
updated rate right away.

Fixes #12648
2016-07-19 12:58:13 +02:00
Odoo Translation Bot c3dd308913 [I18N] Update translation terms from Transifex 2016-07-19 12:10:41 +02:00
Odoo Translation Bot ef83f798d5 [I18N] Update translation terms from Transifex 2016-07-10 03:01:32 +02:00
Martin Trigaux 0df7a1ca2f
[FIX] base: decode params_store content
The parameter bin_size=True will display the size of the binary field.

Fixes #12681
2016-07-06 16:24:50 +02:00
Odoo Translation Bot 1986980a51 [I18N] Update translation terms from Transifex 2016-07-03 02:59:06 +02:00
Odoo Translation Bot 3e965ecf58 [I18N] Update translation terms from Transifex 2016-06-26 02:57:50 +02:00
Raphael Collet ff93777099 [FIX] models: inverse several computed fields based on a common computed field
Consider fields G1 and G2 being computed fields with inverse methods that
require the value of a common dependency F, which is also a computed field.
For inversing G1 and G2, their values are put in cache, then their inverse
method is called.  If the inverse method of G1 requires the computation of F,
setting F's value will invalidate both G1 and G2 in cache.  Hence the value of
G2 is lost when invoking its inverse method!

The fix consists in marking G1 and G2 as being computed before invoking their
inverse method, which prevents them from being invalidated by field F.
2016-06-22 14:01:59 +02:00
Odoo Translation Bot 41ec7eec56 [I18N] Update translation terms from Transifex 2016-06-22 07:12:57 +02:00
Christophe Simonis 5b1beec1f2 [FIX] models: commit *before* trying to set NOT NULL constraint
Setting NOT NULL constraints on required fields may fail if there are
any row with unset value for this column.
The ORM handle this case by catching the exception raised and warning
user.

However, not commiting the current transaction before, will rollback
changes made before like setting default values or renaming a column.
2016-06-20 11:53:59 +02:00
Odoo Translation Bot cd369396d9 [I18N] Update translation terms from Transifex 2016-06-19 02:59:13 +02:00
Xavier ALT f02b23006b [FIX] fields: during an onchange(), do not invalidate *2many fields because of their domain
Our usage of domain on fields One2many seems to trigger an obscure behaviour on
onchange.

With the following (simplified) config:

    Message(models.Model):
        _name = 'test_new_api.message'
        important = fields.Boolean('Important')

    Discussion(models.Model):
        _name = 'test_new_api.discussion'
        name = fields.Char('Name')
        important_emails = fields.One2Many('test_new_api.emailmessage', 'discussion',
                                           domain=[('important', '=', True)])

    Email(models.Model):
        _name = 'test_new_api.emailmessage'
        _inherits = {'test_new_api.message': 'message'}

        discussion = fields.Many2one('test_new_api.discussion', 'Discussion')
        message = fields.Many2one('test_new_api.message', 'Message')

Steps:
- We change 'name' on discussion, triggers an `onchange()` call
- we ends up filling cache on virtual record (on secondary fields, we calling
  record.mapped('important_emails.important'))
- we get a cache miss ('important' field not provided, only 'important_emails' ids,
  i.e with no change on existing records)
- we fill the cache, this mark 'important' field as modified
- because of commit 5676d81 and because 'important' is that case is a related (i.e
  computed) field we triggers cache recomputation
- as there is no way to recompute 'important_emails' for virtual record (no real
  ID) we ends up with empty 'important_emails' generating removal of existing records.

=> Finally changing any value for 'test_new_api.discussion' that trigger an onchange
will always reset 'important_emails' to empty

Fixed by Raphael Collet <rco@odoo.com>, and test by Xavier Alt <xal@odoo.com>.
2016-06-17 17:50:25 +02:00
Martin Trigaux de78b1b3da
[FIX] http: force removing the debug in redirection
In case of local_redirect with
* forward_debug=False
* qwery={'debug': True}

the debug mode should be removed.

cf discusion on #12107 and dd4980b0
2016-06-13 15:18:09 +02:00
Odoo Translation Bot 3215a81bab [I18N] Update translation terms from Transifex 2016-06-12 03:06:37 +02:00
Martin Trigaux dd4980b0a8
[FIX] http: keep debug mode in rediction
The parameter forward_debug is used to keep the debug mode during redirection.
Previous code was setting the debug to None which is ignored by werkzeug, making
the option useless.

Closes #12107
2016-06-10 16:51:41 +02:00
Denis Ledoux 950fd97d06 [FIX] fields: translations of the help of inherited fields
This is similar to revision 54140331f3

opw-673716
2016-06-06 11:44:34 +02:00
Odoo Translation Bot eb48b94cea [I18N] Update translation terms from Transifex 2016-06-05 03:01:35 +02:00
Odoo Translation Bot cb70a8ff98 [I18N] Update translation terms from Transifex 2016-05-29 02:58:42 +02:00
Ondřej Kuzník dbdc8e1cef
[FIX] server: Do not listen when --no-xmlrpc is set
This is a fix for f04f409943, which only
prevented the workers from being spawned in Prefork mode, while the
socket was still being bound to - this is a problem when starting a
worker-only server as it cannot coexist with the XMLRPC server on the
same machine.

Closes #1828
2016-05-26 11:01:42 +02:00
Martin Trigaux 0af32f3f84
Revert "[FIX] res.currency: allow duplication"
This reverts commit d780f9476d.

Did not work due to the size=3 on name field that strips the code to the first
three letters only (removing the " (copy)" part).
Copying a currency has a few business cases as the rates are not copied.
As can not increase the size of a field in stable, remove the method that had no
effect.

Fixes #11036
2016-05-23 10:39:15 +02:00
Odoo Translation Bot 95c9036aef [I18N] Update translation terms from Transifex 2016-05-22 02:57:09 +02:00
Christophe Simonis 393c14d31a [MERGE] forward port of branch 7.0 up to f4cb884 2016-05-17 13:16:50 +02:00
Sylvain GARANCHER f4cb884cdc [FIX] base: Add missing return values
The _auto_init method was overriden without keeping the return value of
the super on some models.
This break the new stored computed fields computation at field creation.

Closes #11985
opw-677232
2016-05-17 10:39:54 +02:00
Odoo Translation Bot 8f46a6fe73 [I18N] Update translation terms from Transifex 2016-05-15 02:56:59 +02:00
Christophe Simonis 5e18f5a080 [FIX] tools: correct Burmese locale 2016-05-13 12:53:17 +02:00
Nicolas Seinlet 3a32021122 [IMP] models: mark records as recomputed as soon as they are
When recomputing stored function fields, the `write` may trigger a
cache invalidation which lead to a recompute of all the recordset
values, even the ones already saved in database.
2016-05-12 11:44:57 +02:00
Martin Trigaux e93cf3f3dd
[ADD] tools: Burmese language 2016-05-11 11:42:02 +02:00
Andreas Stauder 9b70650adc
[ADD] tools: Swiss German language
Closes #4722
2016-05-11 11:41:32 +02:00
Olivier Dony ac8b7e90b5 [FIX] http: clear environment/caches on transaction rollback
Backport of 8423a0df3482567b0e2f77852dda14b80a029401

Clear the cache/environment in addition to rolling back
the cursor, in order to retry the transaction with fresh
data, not partially stale data.
2016-05-11 01:01:54 +02:00
Raphael Collet 5676d8121d [FIX] fields: invalidate x2many fields with a domain
Invalidate the cache of a x2many field when any of the fields appearing in its
domain is modified.  Use the invalidation triggers mechanism for that purpose.
2016-05-09 12:10:23 +02:00
Odoo Translation Bot 859fe655d2 [I18N] Update translation terms from Transifex 2016-05-08 02:57:57 +02:00
Olivier Dony a0484cbe45 [FIX] import: broken translation cache for absent translation of 'false'
Backport of 7d732b1011

Fixes #979
2016-05-05 03:39:54 +02:00
Odoo Translation Bot 8651d0815d [I18N] Update translation terms from Transifex 2016-05-01 02:57:51 +02:00
Odoo Translation Bot 534b7c5553 [I18N] Update translation terms from Transifex 2016-05-01 00:28:37 +02:00
Raphael Collet ba5f5614f3 [FIX] expression: fix missing results in direct search on many2many fields
This case corresponds to searches like `[(field, 'ilike', name)]` where `field`
is a many2many field.  The domain processing performs a `name_search` on the
field's comodel, then makes the relation match the returned record ids.

Problem: the call to `name_search` uses the default limit (100), and this makes
the search return less results than expected.  Make the search complete by
forcing `limit=None`.
2016-04-29 15:48:19 +02:00
Raphael Collet c7baab6789 [FIX] expression: fix missing results in direct search on many2many fields
This case corresponds to searches like `[(field, 'ilike', name)]` where `field`
is a many2many field.  The domain processing performs a `name_search` on the
field's comodel, then makes the relation match the returned record ids.

Problem: the call to `name_search` uses the default limit (100), and this makes
the search return less results than expected.  Make the search complete by
forcing `limit=None`.
2016-04-29 15:45:21 +02:00
Raphael Collet 233c7780e6 [FIX] fields: filter result of 2many related fields with related_sudo
When traversing relational fields as superuser, you end up with a recordset for
which only a subset is accessible to the current user.  An earlier fix to this
issue completely dropped the `related_sudo` feature; change its implementation
to keep the feature.
2016-04-28 11:46:44 +02:00
Stefan Rijnhart 0c2f7bdbc2 [FIX] tools: export translated fields not included in _columns
Non-stored new API computed fields are only defined in _fields
but not in _columns, and they were never exported within translation
files.

Closes #9081
2016-04-26 19:12:51 +02:00
Denis Ledoux dc1b8a5a51 [FIX] res_company: some information missed on company creation
On the `res.company` model, the fields
`name`, `phone`, `email`, `website`, `vat` are
related field on the `partner_id` of the company.

When creating a new company, the partner
associated to the company is created automatically,
it's handled in the overrided `create` method
of the model, but it forgots the values
`phone`, `email`, `website`, `vat` at the moment
the partner is being created.

opw-675526
2016-04-25 12:37:06 +02:00
Odoo Translation Bot 0410d1187b [I18N] Update translation terms from Transifex 2016-04-24 02:59:16 +02:00
Raphael Collet 86d276b4bb [FIX] models: fix *2many multi-onchange bug
This fixes the case where the lines of a one2many field are modified several
times by onchange methods: instead of retrieving the most recent updates, we
merge them with former updates.

This solution was written as an improvement of a proposal made by Alexis
Delattre and Sébastien Beau as #11620.
2016-04-22 16:25:11 +02:00
Martin Trigaux fd7a7207ac
[FIX] orm: do not save empty translation as 'false'
When writting a value on a translatable field in a different language than
English, the submitted *raw* value was saved in the database.

This could cause the following issues:
- empty value (provided as `False` by the web client) saved as the string
  'false' in the translations table
- no encoding or sanitization convertion
- ignore size parameter on the translatable field

Process the submitted translation through symbol_set method to clean it before
storing it blindly in the database.

This allows to convert `False` into `''` for empty value and fixes #10862
2016-04-22 16:14:19 +02:00
Denis Ledoux 28e0a1771c [FIX] ir_qweb: regression of 8395f0d217
This revision corrects a regression introduced by
8395f0d217e16df18fcc6f4309fe74b0dd8d50a2:
the possibility to call
`ir.qweb.field.datetime`.`value_to_html` with
a datetime string directly, instead of calling
`ir.qweb.field.datetime`.`record_to_html`
(which call `value_to_html` as well).

opw-675427
2016-04-21 18:35:25 +02:00
Denis Ledoux 8395f0d217 [FIX] website_event: event dates within event timezone
The dates of an event on the website was always
within the user timezone. If not signed in,
it was within the public user timezone
(which is quite not user-friendly to change)

For this purpose, we weed get the context
from the record (the context used when using
`record.with_context`), and therefore
the QWeb field
`ir.qweb.field.datetime` is slightly altered,
to use the context from the record.

opw-675427
2016-04-21 17:52:36 +02:00
Stephen Medina 92f1cbeb6f
[FIX] server: support psutils >= 4.0
In version 3, process.memory_info() returns only rss and vms
In version 4, it now returns rss, vms, shared, text, lib, data and dirty
Automatic unpacking is no longer possible in 4.0

Fixes #11052, Closes #11459
2016-04-20 09:13:27 +02:00
Olivier Dony bf163700e4 [MERGE] Forward-port 7.0 up to 38905d686f 2016-04-11 14:23:02 +02:00
Olivier Dony 38905d686f [FIX] res.partner: relax condition in 3ab436fb7b
Users may sometimes need to edit their own partner records directly,
although indirect access by writing on `res.users` directly works
fine in most cases.
2016-04-11 13:33:49 +02:00
Odoo Translation Bot 05223f558d [I18N] Update translation terms from Transifex 2016-04-10 02:59:08 +02:00
Alexandre Fayolle cc60504bff [FIX] base: only run postinstall tests for installed or updated modules
Uninstalled modules are skipped with the filtering on the state.
Fixes #9768, Closes #11378
2016-04-04 14:32:20 +02:00
Odoo Translation Bot 678a84e626 [I18N] Update translation terms from Transifex 2016-04-03 02:59:02 +02:00
Olivier Dony bf75f51ddb [FIX] base: require wizard for passwd change 2016-04-01 20:30:57 +02:00
Olivier Dony 08b7e5ab63 [FIX] res.users: better compatibility of read() override with new API 2016-04-01 20:30:57 +02:00
Olivier Dony a7c2377500 [FIX] res.partner: modifying users requires extra access 2016-04-01 20:30:56 +02:00
Olivier Dony 97a96bc96b [FIX] base: require wizard for passwd change 2016-04-01 20:28:00 +02:00
Olivier Dony 3ab436fb7b [FIX] res.partner: modifying users requires extra access 2016-04-01 20:16:11 +02:00
Odoo Translation Bot 6aa601da2a [I18N] Update translation terms from Transifex 2016-04-01 00:28:28 +02:00
Christophe Matthieu d3557de746 [FIX] ir.qweb: branding breaks editing/inheritance
Could not edit t-field content if modified by inherit xpath,
and could not inherit qweb views with non "xpath" nodes with
`position="attributes"`.

Examples:
Can't edit: `<data><xpath expr="div[@t-field='object.test']"
position="replace"><div t-field="object.test"/></xpath></data>`

Inherit doesn't work: `<data><h1 position="replace"/><h1
class="test">tata</h1></data>`

Closes #11561
Closes #11547
2016-03-31 18:11:02 +02:00
Odoo Translation Bot 8d9b309f9a [I18N] Update translation terms from Transifex 2016-03-27 03:14:28 +02:00
Odoo Translation Bot f5cc04caa7 [I18N] Update translation terms from Transifex 2016-03-20 02:58:59 +01:00
xmo-odoo c824e50b3f [FIX] scaffold: correctly decode utf8 templates
As its documentation notes[0], Jinja2 only processes unicode template
data (or pure ASCII, which will implicitly decode to unicode).

The scaffolding system would read raw scaffolding data in memory (both
templates and passthrough non-templates), but fail to decode templates
before handing them to Jinja, blowing rendering up if templates
contained non-ascii.

Fix #11331 by always decoding templates from UTF8 before handing them
to jinja. This is backwards-compatible, ascii templates work as they
used to, non-ascii UTF8 templates now work correctly, non-ascii
non-UTF8 templates what are you doing?

[0] http://jinja.pocoo.org/docs/dev/api/#unicode
2016-03-15 11:25:16 +01:00
Odoo Translation Bot 345c83a9d0 [I18N] Update translation terms from Transifex 2016-03-13 02:59:06 +01:00
Jairo Llopis 906bf16a76 [8.0][FIX] Make on_change in address_format divs work
To reproduce the bug:

- Create a partner.
- Set it state "Alaska".
- Country becomes "United States".
- Set a country for YourCompany, such as Spain.
- Create a partner.
- Set it state "Alaska".
- Country remains blank.

Also, `node.xpath("//field")` was running over every `<field>` in the
view, not just those inside the `<div class="address_format">`. Now it
only traverses the right nodes, which renders every affected view
faster.
2016-03-08 13:40:40 +01:00
Nicolas Lempereur 4309bd311f [FIX] base: don't unlink base.open_menu but reset it
The ir.actions.todo record base.open_menu is used to redirect the user
to a menu after installing a module.

To do so, a new module override the record changing its action (toward a
menu) and setting its state to "open".

But with f7fe753 when one such changed action is removed after
uninstalling a module (or removing the action by any other way) the
base.open_menu would also be removed. Thus thereafter the open_menu will
not work anymore (since type "automatic" is lost).

With this commit, when whenever base.open_menu is removed, instead its
action will be replaced by base.action_client_base_menu which is the
original action.

closes #11224
related to: #11216, opw-660269
2016-03-07 14:03:28 +01:00
Odoo Translation Bot aca8a8bebc [I18N] Update translation terms from Transifex 2016-03-06 02:59:52 +01:00
Denis Ledoux 3913667396 [FIX] website: backport of 8d2a3ba12dcec61c7e6afcfd34d00c4167de3baa 2016-03-01 10:53:44 +01:00
Odoo Translation Bot 8c278a4e4a [I18N] Update translation terms from Transifex 2016-03-01 00:29:04 +01:00
Odoo Translation Bot 9f073102ef [I18N] Update translation terms from Transifex 2016-02-28 03:00:41 +01:00
Nicolas Martinelli 68f9f99ed3 [FIX] models: export of booleans
In the case of a `raw_data` export, a boolean which has the value
`False` will not be exported correctly.

The fix handles the `False` value as a valid value for a field.

opw-666142
2016-02-23 15:06:14 +01:00
Odoo Translation Bot 488c693109 [I18N] Update translation terms from Transifex 2016-02-21 02:59:19 +01:00
Odoo Translation Bot f35fd798f1 [I18N] Update translation terms from Transifex 2016-02-14 02:59:46 +01:00
Raphael Collet 5763c32a6d [FIX] addons: fix usage of decorators `api.v7`/`api.v8`
Specifically, when one API implementation calls the other one, it has to call
the method *from the same class*.  Otherwise, overriding the method may result
in an infinite recursion.  Consider:

    class A(Model):
        _name = 'stuff'

        @api.v8
        def foo(self):
            return 42

        @api.v7
        def foo(self, cr, uid, context=None):
            return self.browse(cr, uid, [], context).foo()

    class B(Model):
        _inherit = 'stuff'

        def foo(self, cr, uid, context=None):
            return super(B, self).foo(cr, uid, context=context) + 1

and now call: `env['stuff'].foo()`.  This invokes `B.foo` (new-API), which
calls `B.foo` (old-API), which calls `A.foo` (old-API), which calls `B.foo`
(new-API) instead of `A.foo`!

This issue would not be present if old-API `A.foo` was defined as:

        @api.v7
        def foo(self, cr, uid, context=None):
            return A.foo(self.browse(cr, uid, [], context))
2016-02-09 10:01:43 +01:00
Laurent Mignon d82e489add [FIX] models: use `column._symbol_c` as placeholder for the column value
When generating SQL queries, `column._symbol_c` must be used as placeholder as
for the method 'set' of the column itself.  Otherwise it is not possible to
define specialized columns.
2016-02-09 09:20:17 +01:00
Denis Ledoux ff915dd96e [FIX] import: import new records without xml_ids
This is related to revision 80b373f.

The above revision leads to the inability
to import new records without any `xml_id` set

Technically speaking, this is because
you cannot concatenate `False` with `'_'`, in
`xml_id + '_'`

opw-668962
2016-02-08 16:54:24 +01:00
Odoo Translation Bot 3ff4dae5b0 [I18N] Update translation terms from Transifex 2016-02-07 02:58:52 +01:00
Olivier Dony bc26a49194 [MERGE] Forward-port 7.0 up to 4de3f4c4ba 2016-02-05 15:42:12 +01:00
Cedric Snauwaert 4de3f4c4ba [FIX] expression: fix search for o2m with non existing id
The result of searching on a o2m field for a missing ID was
the whole set of records which do not have any lines in the
o2m fields. This is definitely not the desired behavior,
and could lead to disatrous performance, because the
returned set could be extremely large.

One example of such behavior is for recomputing fields
in the env cache in 8.0+. When a o2m line gets deleted,
it triggers the recompute of any dependent fields.

In order to locate the records to recompute, the ORM
searches for the 'parent' records in the comodel table.
When this operation is done by 2 users concurrently
the o2m line may not exist anymore, and the bug
is triggered: dependent fields are recomputed on a possibly
very large set of records that did not need any recompute!
2016-02-04 17:10:08 +01:00
Raphael Collet a3ec5a35a5 [FIX] fields: in `copy_cache`, add single records to set `todo` 2016-02-04 14:33:53 +01:00
Raphael Collet 0f2e7d783e [FIX] fields: make `copy_cache` use a todo list instead of recursion
The recursion was based on an incorrect assumption: the cache of the target
environment is initially empty.  If another computation left some value there,
the copying is incomplete, and that causes bugs in onchanges.
2016-02-04 13:48:28 +01:00
Olivier Dony 67a63e2cc9 [MERGE] Forward-port 7.0 up to rev. cb609bd425 2016-02-03 16:42:29 +01:00
Olivier Dony cb609bd425 [FIX] tools.misc: log errors when parsing fails 2016-02-03 02:25:09 +01:00
Olivier Dony e8d06f7b20 [MERGE] Forward-port 7.0 up to bdbcbea285 2016-02-03 00:40:27 +01:00
Olivier Dony cc724c2e61 [FIX] base: centralize custom data serialization for builtin types only 2016-02-02 22:42:31 +01:00
Olivier Dony 000c681f1e [FIX] ir.values: remove redundant deduplication logic
Handling update/create of existing values is already
handled by ir.values.set() itself.
2016-02-02 19:49:09 +01:00
Xavier Morel 8848af76f0 [IMP] account: recordset calling conventions for fixed has_group 2016-02-02 18:28:23 +01:00
Xavier Morel ccb0f6db61 [FIX] base: has_group behaviour under the new API
While the signature makes sense in an old API context (sort-of) it's
very easy to misuse in a new API context as one'd expect `has_group` to
use the subject (recordset), not the user in the environment, compounded
by ``env.user`` being browsed as administrator, resulting in the
"obvious" ``env.user.has_group(foo)`` checking if the
administrator (rather than the current user) has the specified group.

Adds a divergent v8 version of has_group which first checks if it's
called on a non-empty recordset, and in that case use the recordset id,
otherwise fallback on the context user (to handle new API conversions
which used the "correct" call convention rather than the obvious one).

fixes #9649
2016-02-02 18:28:23 +01:00
Raphael Collet a688bcdbbd [FIX] fields: make `copy_cache` not invalidate the cache! 2016-02-01 18:01:02 +01:00
Goffin Simon 08b286111c [FIX] models: `MissingError` when writing on recordset with duplicates
When writing on a recordset with duplicates, the ORM raises a `MissingError`
because the rowcount gives a difference with the injected ids.  The fix simply
eliminates duplicates from ids.
2016-02-01 14:56:49 +01:00
Martin Trigaux a46f8bb9c5 [FIX] tools: do not generate translations for exported records
When a record is exported, an external ID, in the form of __export__.<model>_<id>
is created on this record.

When the translations are generated (e.g. "synchronise terms" wizard), the
translations may be duplicated for records that have been exported. If a
translation is submitted before the export (when the record had no external ID
yet), a new empty translation is created as the module differs in the import.

Creating a new translation may be a problem as the new term (equal to the source
term) will be used as the translation value.

Fixes 9480
2016-02-01 14:13:34 +01:00
Odoo Translation Bot 72983cac8e [I18N] Update translation terms from Transifex 2016-02-01 00:29:03 +01:00
xmo-odoo edeb5a8c0f [FIX] module finder path parameter should be optional
According to PEP302, the signature of `Finder.find_module` should be 
`find_module(fullname, path=None)`.

Ever since it was introduced in 64ec5f36df the addons import hook 
defines the second parameter as mandatory, which is an issue for
systems relying on the specified behaviour (and not needing to
provide a path) like the stdlib's `pkgutil.find_loader`.

fixes #10670
2016-01-29 10:20:08 +01:00
Raphael Collet 812332855a [IMP] fields: speedup `Float.convert_to_cache` by not rounding the value 2016-01-29 09:37:27 +01:00
Raphael Collet f0646cb51b [IMP] fields: use a "lazy" cursor to compute attribute `digits`
Borrowing a cursor each time you access `field.digits` may be costly, because
of the connection reset.  Moreover, in most cases, the cursor is not used at
all, since the decimal precision are kept in cache.

For the installation of module `product` with its demo data, the number of
cursor allocations was reduced from ~1500 to about 50!
2016-01-29 09:37:27 +01:00
Raphael Collet 995b257a6c [FIX] fields: make `related_sudo` work for draft records (2)
Traversing new records in a different cache requires that all new records on
the path are copied across caches.  Make the copy across caches recursive when
the first record on the path is a new record.
2016-01-28 16:33:09 +01:00
Yuriy A. Apollov 098c084eae [FIX] orm: iteration on `browse_null` object lasts forever 2016-01-26 17:34:39 +01:00
Holger Brunn 6fd57c2188 [FIX] allow searching for new style function
fields in a search path
2016-01-26 14:15:22 +01:00
Odoo Translation Bot dc48744bf7 [I18N] Update translation terms from Transifex 2016-01-24 03:00:37 +01:00
Raphael Collet 748a719fd9 [FIX] fields: make `related_sudo` work for draft records (used by onchange)
Accessing a related field with `related_sudo=True` on a draft record should
effectively traverse the fields as the admin user.

This fixes #5121, #7138.
2016-01-22 16:06:27 +01:00
Goffin Simon c0571d4066 [FIX] base: by default a company is not a customer
When creating a company, a new partner is created with his field
'customer' = True. But by default a company doesn't have to be
a customer.

opw:667130
2016-01-19 17:02:32 +01:00
Odoo Translation Bot 2efa359e41 [I18N] Update translation terms from Transifex 2016-01-17 03:01:54 +01:00
Raphael Collet b4debe9539 [FIX] test_inherit: wrong model passed to default function on field 2016-01-15 13:54:29 +01:00
Sathors 903cde0522 [IMP] doc: dotted names not supported in @constrains
or in @onchange for that matter. They should already generate a warning,
but only the first time they're used.

This is done lazily because it introspects the instance/class which can
be costly when performed during the repeated setup of registry setup.

closes #5595
2016-01-11 10:59:56 +01:00
Odoo Translation Bot 1c33197828 [I18N] Update translation terms from Transifex 2016-01-10 03:04:15 +01:00
Raphael Collet 152d9de6cf [FIX] fields: in many2many fields, command `5` removes accessible records only 2016-01-08 16:56:02 +01:00
Raphael Collet ece592dbf7 [FIX] fields: in many2many fields, avoid inserting duplicate entries in table 2016-01-08 16:55:43 +01:00
Raphael Collet 22d125fe96 [FIX] fields: in many2many fields, command `5` removes accessible records only 2016-01-08 16:53:18 +01:00
Raphael Collet 51e66711a9 [FIX] fields: in many2many fields, avoid inserting duplicate entries in table 2016-01-08 16:53:18 +01:00
Raphael Collet 40be041ae7 [ADD] test_access_rights: add test writing on many2many field with access rules 2016-01-08 11:58:34 +01:00
Eric Antones 1d97ddfd81 [FIX] Collateral effect merging query params
The keep_query() function has to **keep** all or selected query parameters
or add new ones but not change them by merging those with the same name.

That unnecessary parameter merge breaks the *Change language* feature in the
website_sale module when *Website -> Customize -> Product Attribute's filters*
is enabled and there's 2 or more select type attributes created and at least
one of them is selected.

Merging params was added in:
* 8.0: commit 7759af7c4c
* 9.0: commit daf8bdf688
2016-01-05 17:21:01 +01:00
Odoo Translation Bot 8000181772 [I18N] Update translation terms from Transifex 2016-01-03 02:54:27 +01:00
Odoo Translation Bot 4f1bd899ef [I18N] Update translation terms from Transifex 2016-01-01 00:25:46 +01:00
Jeremy Kersten be7019ee7d [IMP] base: fix usability for country group
Add label
Remove widget (bug in popup, and hard to use to exclude one country)
2015-12-28 14:14:25 +01:00
Odoo Translation Bot 8fe876cae7 [I18N] Update translation terms from Transifex 2015-12-27 02:54:48 +01:00
Sylvain GARANCHER 11cd22711c [FIX] Fix check_xml when inheriting from views created in the same module
When inheriting from a view in extension mode created in the same module, this
view was not loaded during check_xml of the last view.
This caused an error when the last view wants to modify elements added
by its direct parent view.

Example :
- View1, created in module "account"
- View2, mode extension, created in module "customer", inherits View1
- View3, created in module "customer", inherits View2

During update of module "customer", when loading View3, the check_xml
call didn't load View2, because it's defined in the same module (and,
obviously, this module has not be totally loaded at this point)

This is fixed by adding direct parent of each loaded view in the
check_view_ids list in context, to force them to be loaded.

Closes #9135
2015-12-22 14:14:59 +01:00
xmo-odoo 7c0e734785 [FIX] strip group name before calling has_group
user_has_groups is used to check for groups in e.g. view attributes (`@groups`).
When trying to format lists of groups in views, it would break down as it would 
pass e.g. `\n        some.group` to `res.users.has_group`, which would look for 
an xid with the module `\n        some` and (oddly enough) not find it.

Theoretically could also handle that inside res.users.has_group but it seems
ever-so-slightly more risky, and has_group is only used programmatically and 
should thus already be called correctly.

fixes #9797
2015-12-21 10:30:37 +01:00
Odoo Translation Bot 0093372184 [I18N] Update translation terms from Transifex 2015-12-20 02:54:53 +01:00
Denis Ledoux 7f29a23118 [FIX] tools: email TLDs can be longer than 6 chars
According to the RFC1034
https://tools.ietf.org/html/rfc1034

A TLD can use up to 63 octets.

The regex checking that an email address is valid
should there allow emails using a TLD with such a length.

Besides, the use of TLD domains exceeding 6 characters is more
and more common, nowadays.

e.g. using a domain `.amsterdam`

opw-660014
2015-12-16 17:11:08 +01:00
Sylvain GARANCHER 80b373f1e5 [FIX] ir_model: Fixed XML data recreation when inherited part are not deleted
Description: When updating the product module, if the "Service"
product.product has been deleted, but not the corresponding
"product.template" part, the update will crash on a "duplicate xml id"
error.

This commit fixes the bug by :
- Adding the link to existing inherited model xml id in values
- Avoid creating the duplicated XML ID

If the XML ID is found, but orphan, it's simply deleted.

Closes #8966
opw-658454
2015-12-14 11:46:49 +01:00
Odoo Translation Bot 63414bef54 [I18N] Update translation terms from Transifex 2015-12-13 02:56:20 +01:00
Thibault Delavallée 3f758e2fab [FIX] tools, mail: do not strip name from email_to
When sending a mail.mail with email_to, the processing split the email_to into
a list of addresses. However if the found addresses use the form name <email>
the name if lost in the process. A new email_split_and_format method is introduced
in tools and used to avoid loosing that information.
2015-12-11 11:22:40 +01:00
andreparames 6b9b2274e5 [FIX] doc: http.route auth=public instead of admin
Removed the `admin` option, since it was removed on 04a5264, and added the
option `public`.

Fixes #9688
2015-12-11 10:52:52 +01:00
Frédéric Garbely ff2910f8f2 [FIX] ir_translation: prevent `overwrite` propagation
Once set for the loading of terms for a lang,
the flag `overwrite` was propagated to all
other following languages, even if not actually needed.

Use case:
 - Installed languages: en_US, de, fr_CH, it
 - Update of the `sale` module
 - In `load_module_terms`, the system iterates through the languages:
   1. en_US: No problem
   2. de: No problem
   3. fr_CH: The flag `overwrite` is set to `True`,
      because the sub-language `fr_CH` should overwrite the `fr` terms
   4. it: The flag is still set to `True`, because of the previous iteration,
      while it must not.

opw-654042
2015-12-09 17:24:15 +01:00
Christophe Simonis 83a4a582fa [MERGE] forward port of branch saas-3 up to 513cea6 2015-12-08 12:28:41 +01:00
Christophe Simonis 47b2f7ea9e [MERGE] forward port of branch 7.0 up to 3a1c693 2015-12-08 12:16:00 +01:00
Odoo Translation Bot 0de99dd2c8 [I18N] Update translation terms from Transifex 2015-12-06 02:56:34 +01:00
Jeremy Kersten 3a1c693259 [FIX] osv: fix boolean in domain for custom field
When a new column has been added after that some data already exists,
the old lines will keep an empty/null value. So when we search is the new field
is equals to False or if it is different of True, we need to match the null
values.

Backport of de3b64018a
2015-12-04 18:22:32 +01:00
Jeremy Kersten de3b64018a [FIX] osv: fix boolean in domain for custom field
When a new column has been added after that some data already exists,
the old lines will keep an empty/null value. So when we search is the new field
is equals to False or if it is different of True, we need to match the null
values.

close #9925
2015-12-04 16:31:31 +01:00
Martin Trigaux 27d439901c [FIX] base: create translations of a duplicated record
When creating translations (click on blue flag) of a duplicated record, it used
to have the module information of the duplicated record.
It is also not useful to check the module when trying to find if a translation
exists on this record as the res_id is present in the query.

Fixes #9480
2015-12-02 10:57:46 +01:00
Odoo Translation Bot cc82f7518f [I18N] Update translation terms from Transifex 2015-12-01 00:28:25 +01:00
Martin Trigaux 1f07b9429c [FIX] base: update translations should not duplicate the terms
When a translated term is modified (e.g. content of an email.template),
reloading the translations of the module (e.g. when updating the module) used to
recreate a new, duplicare translation for the modified term (instead of ignoring
the existing one).

This was due to the fact the matching expression (find_expr), when loading
translations, used the field 'src' (source term) as criteria for (almost) all
ir.translation records.

While this is true for type 'code' or 'selection', this is not true for 'model'
where the source content may have been changed.
In case of translation of type 'model', matching on the name and res_id should be
enough for the matching expression and then, avoid creating duplicated
translations.

Note: this patch must NOT be present in 9.0 due to the xml_translate
attribute that splits an xml content into small parts.

opw 654031
2015-11-30 16:41:56 +01:00
Martin Trigaux a70287d42c [FIX] base: set module when creating translation
When creating missing translations on an object (e.g. using blue flag icon on a
field), the value of the module was not set.
This was problematic as could create a duplicated translation when the module
was updated or the translation reloaded (as the module is used in find_expr).

opw 654036
2015-11-30 16:41:56 +01:00
Denis Ledoux 31e8bb8e9d [FIX] mail: better signature detection
This revision back-ports revisions
983d5eb9fa
&
ccbb8e09a6
regarding this signature regex.

Besides, it adds the fact the dashes have to
be at the beginning of the line
to make them detected as a signature.

opw-655834
2015-11-30 14:48:59 +01:00
Martin Trigaux 44248a07a5 [FIX] base,share: error in_group_xx on user form
res.users form contains virtual fields in_group_ID to be added in res.groups.
Groups with boolean share=True (added by share module) must not be displayed in
the form and should not be modifiable through the user interface.
However, if a module adding/modifying a res.group is earlier in the dependency
graph than 'share' (e.g. only depends from 'base'), the update of the user view
is done before share is loaded and the overrride of 'get_application_groups' is
never executed.

As we can not guarantee that the module is share loaded, put the logic of
hidding the module in base instead of share.

This workaround is quite hacky but is necessary in stable version.
Better fix in 9.0 at cf63d4d

Fixes #6324
Fixes #5820
2015-11-30 13:11:02 +01:00
Odoo Translation Bot b8dfa91613 [I18N] Update translation terms from Transifex 2015-11-29 02:58:05 +01:00
Denis Ledoux 03ec39d36b [FIX] models: custom models must add the table/column in database
This revision is related to 1b8c9aed9f

As `manual` is now the default value of the `state`,
if `state` is not given in the values when passed to
`create` or `write` of `ir.model` and `ir.model.fields`,
we must assume the value is `manual`, so the columns and tables
are instanciated in database

opw-657750
2015-11-27 13:58:28 +01:00
Denis Ledoux 1b8c9aed9f [FIX] models: custom fields seen as base fields
This was possible to create custom fields `x_*`
but seen as base fields.

For instance,
 - Go to Settings > Technical > Database Structure > Fields
 - Select a field (any)
 - Click on the model link, to be redirected to the model form
 - Edit & add a custom field from there.
 - Save
 - Notice that the field you just added is saved as a base field.

We solve this issue by assuming that all created fields and models
are customs, except the ones created by the ORM, by the database
initialization, the fields coming from the modules in python.

We therefore remove the mechanism on which a field was set
as custom according to the fact `manual` was set to True within
the context: This is now the case by default.

No change was required for the base fields: The `state` `base`
was already forced for those fields, that are created using
direct SQL requests `INSERT INTO`.

opw-657312
2015-11-26 15:44:29 +01:00
Christophe Simonis 78ea8eb058 [FIX] core: correcly handle pidfile deletion.
As atexit function are inherited by subprocess, the pidfile was always
deleted when the first worker (http or cron) died. Now, only the
process that created the pidfile will delete it.
2015-11-26 10:40:59 +01:00
Raphael Collet 8e1a5add38 [FIX] api: improve decorator `returns` to handle special cases, like method `search`
Add the possibility in the decorator to specify the `upgrade` and `downgrade`
functions that convert values between APIs.  Both function have the same API:

    upgrade(self, value, *args, **kwargs)
    downgrade(self, value, *args, **kwargs)

The arguments ``self``, ``*args`` and ``**kwargs`` are the ones passed to the
method, following its new-API signature.

Fixes #4944, #7830.
2015-11-25 09:59:35 +01:00
Denis Ledoux 6f29cbe3ac [FIX] website,ir_qweb: prevent inherit_branding for assets
The attribute `data-oe-*` (`data-oe-id`, `data-oe-model`, ...)
must not be added when rendering the assets, to avoid
having different assets content,
e.g. a different content for the assets_common,
according if the user is signed in or not,
if the user can edit the website or not.

A different content for an assets according to the
users rights or the user being signed in or not means
that the assets are permanently re-written in the filestore,
which is against the point of the assets.

The content of the assets (assets_common) must not be
different from time to time, it must always be the same
(except when installing a new module, obviously).
Adding the `data-oe` attributes was pointless for the assets
anyway, and prevented having an identical content all
the time, therefore rewritting the assets all the time
in the filestore.

opw-657046
2015-11-23 17:01:03 +01:00
Lionel Sausin 6188bc6e9d [DOC] Add words of caution about `sudo`
Closes #9655
2015-11-20 13:52:36 +01:00
Xavier Morel c6d6ae8aec [FIX] qweb: handle unicode tags and attributes
closes #8895
2015-11-19 14:59:44 +01:00
Olivier Dony d117d6645e [MERGE] Forward-port 7.0 up to 051b2ce539 2015-11-17 17:55:17 +01:00
Denis Ledoux dd8cbf49ac [MERGE] forward port of branch 7.0 up to d24fcd1 2015-11-06 16:04:21 +01:00
Nicolas Lempereur d24fcd1d2e [IMP] base: test for expression distribute_not
Testing the use case of c28a28e, in which distribute_not was refactored
with iteration instead of recursion.
2015-11-05 17:13:55 +01:00
Raphael Collet c28a28e69e [IMP] osv: use iteration for expression negating
The current code when applying negative operator on an expression used
recursion which in extreme case is not best friend with python.

e.g: on instance with a lot of wharehouse, some simple action could lead
to a domain with lot of elements which could easiliy go over the python
maximum recursion limit.

This commit fixes this by replacing recursion with iteration.

We have a stack of negation flags and loop on each token of the domain
as follow :

- when we iterate on a leaf, it consumes the top negation flag,

- after a '!' operator, the top token negation is inversed,

- after an '&' or '|' operator, the top negation flag is duplicated on
  the top of the stack.

closes #9433
opw-653802
2015-11-05 17:13:28 +01:00
Olivier Dony 051b2ce539 [FIX] tools: ignore unknown entities while parsing 2015-11-03 21:38:53 +01:00