Commit Graph

8230 Commits

Author SHA1 Message Date
Nicolas Lempereur cfcc37bca5 [FIX] expression: leaf in o2m with m2o inherits'd field
The reverse field of a one2many could be originating from an
inherits'd field, this was solved in some instance with f5e5bbda.

The issue could still happen in some instances when doing a comparison
of:

- the one2many field to a False value,
- the one2many with a negative operator and an empty set to negate,

With this change, the ORM is used in such a situation.

closes #15234
opw-704962
2017-01-26 16:47:52 +01:00
Odoo Translation Bot 91f11f8bd6 [I18N] Update translation terms from Transifex 2017-01-22 03:25:31 +01:00
Odoo Translation Bot c150838bb5 [I18N] Update translation terms from Transifex 2017-01-19 17:28:33 +01:00
Martin Trigaux 254afc6c9d
[FIX] tools: colorize image with pillow 4.0
Introduced by python-pillow/Pillow@c3fe5d43 and integrated into pillow 4.0
The size of the image is ignored and must be set using an image or a mask.

This patch is retrocompatible with the previous versions as the changed code was
in the box size computation. With this patch a 4 points box size is given so the
modified code is not executed.

Fixes #14927
2017-01-19 10:36:21 +01:00
Odoo Translation Bot 082495240f [I18N] Update translation terms from Transifex 2017-01-15 02:55:40 +01:00
Nicolas Lempereur bf38fe4c5f [FIX] base: edge case of search on >/< and 0
The double inversion introduced by 6e063188 is done to catch default 0
values.

For example '>= -3' is transformed in "NOT what is found by < -3".

There was an issue with '> 0' and '< 0' since in these instance 0 don't
match and the inversion must not be done.

opw-703929
2017-01-12 15:15:51 +01:00
Odoo Translation Bot cc2af89454 [I188888888N] Update translation terms from Transifex 2017-01-04 14:54:07 +01:00
Odoo Translation Bot 2b8fcfc08b [I18N] Update translation terms from Transifex 2017-01-01 02:58:08 +01:00
Odoo Translation Bot 534eab0c3b [I18N] Update translation terms from Transifex 2016-12-25 02:57:37 +01:00
Odoo Translation Bot 4227082869 [I18N] Update translation terms from Transifex 2016-12-18 02:58:16 +01:00
Raphael Collet 64249936e8 [FIX] models: allow constraint methods triggered by function fields 2016-12-15 11:08:13 +01:00
Raphael Collet 8e3e7874ad [FIX] models: allow constraint methods triggered by function fields 2016-12-15 09:52:21 +01:00
Odoo Translation Bot 72a4229130 [I18N] Update translation terms from Transifex 2016-12-11 02:58:13 +01:00
Raphael Collet 4116ac2f1c [ADD] models: warning on non-stored @constrains parameter 2016-12-06 14:08:01 +01:00
Odoo Translation Bot efdeb6779f [I18N] Update translation terms from Transifex 2016-12-04 02:57:30 +01:00
Odoo Translation Bot 8d724924f7 [I18N] Update translation terms from Transifex 2016-11-27 02:57:09 +01:00
Odoo Translation Bot f9f562339f [I18N] Update translation terms from Transifex 2016-11-20 02:58:43 +01:00
Christophe Simonis 51561d3ac8 [FIX] base: restart server when installing module from apps
When a new module is installed, its controllers and static files should
be available. A restart is required to do so.
2016-11-14 13:45:24 +01:00
Odoo Translation Bot fa544c9da0 [I18N] Update translation terms from Transifex 2016-11-13 02:57:18 +01:00
Odoo Translation Bot 369e0bcb45 [I18N] Update translation terms from Transifex 2016-11-06 02:56:48 +01:00
Olivier Dony f2158e32c8
[FIX] http: permit debug mode on CORS-enabled routes
As of f814dd9908355465dd03735f4589dd1697b3658a, debug
mode causes an extra X-Debug-Mode header to be sent
by the rpc() JS method.

This custom header was not whitelisted in the accepted
CORS headers, therefore any cross-origin call to a route with
`cors=True` would fail in debug mode, with a console error
along those lines:
   "Request header field X-Debug-Mode is not allowed by
    Access-Control-Allow-Headers in preflight response"

This would prevent loading the POS GUI in debug mode,
for example.

This commit is necessary in the 8.0 branch because
the POSBox is currently based on a 8.0 server and may
be accessed by a 9.0 POS or later, thus with the extra header.
2016-11-02 14:03:19 +01:00
Christophe Simonis 86a9b7893e [IMP] tests: use long message in case of error 2016-11-02 11:45:29 +01:00
Odoo Translation Bot c340284a60 [I18N] Update translation terms from Transifex 2016-10-30 02:56:40 +02:00
Wolfgang Taferner c39ca45c6d [FIX] config: avoid to accept server-wide-modules with None as a module
Fixes #14048
Fixes #14045
Closes #14051
2016-10-28 15:02:52 +02:00
Leonardo Rochael Almeida 5ee4344efd [IMP] Allow configuration of server_wide_modules from file
Allow reading and saving the value of `server_wide_modules` from the
configuration file, instead of just the command line.
2016-10-25 15:23:41 +02:00
Odoo Translation Bot 8f484fd137 [I18N] Update translation terms from Transifex 2016-10-23 02:57:47 +02:00
Jairo Llopis 85b34f4be3 [FIX] openerp: tests: make failing PhantomJS tests actually fail 2016-10-17 13:45:23 +02:00
Odoo Translation Bot d1c81f136c [I18N] Update translation terms from Transifex 2016-10-16 02:57:56 +02:00
Richard Möhn cb581bc14f [FIX] api: in todo list, group records to recompute by environment (#11267)
The effect of this change is to trigger the recomputation of fields on larger
recordsets.  This takes advantage of batch computations within compute methods.
2016-10-13 10:13:33 +02:00
vnsoft 16430be566 [FIX] models: in method read_group(), allow orderby='id desc'
When orderby argument is 'id desc', an error occurs: "read_group order by 'id'
ignored, cannot sort on empty..."
2016-10-12 13:19:37 +02:00
Christophe Simonis ecb6055b0f [FIX] tools/config: avoid sharing init/demo config
Theses config options should not share the same dict as `init` dict
may be modified by migration scripts to handle new module dependencies.
2016-10-11 16:46:32 +02:00
Jairo Llopis dd312e0da2 [FIX] fields: make [(5,)] with computed domain work (#13480)
* Failing test for one2many [(5,)] action, when domain is callable.

The problem is that `self` inside a callable domain becomes the comodel when at [(5,)].

* [FIX][fields] Make [(5,)] with computed domain work.

To reproduce this failure, declare a field like:

```
child_ids = fields.One2many(
    comodel_name="other.model",
    domain=lambda self: [("id", "in", self._ids_to_find())],
)
```

Now set some value to it.

Now unset them. Impossible because ``self`` becomes ``other.model`` in domain evaluation.
2016-10-11 15:14:05 +02:00
Jeremy Kersten 4ca06e0255 [FIX] fields: add group_operator to be availble in get_description.
Web client use fields_get (which one call get_description) to know if
a group operator exists. But until now, group_operator are never returned.

Without it, the web client cannot display the sub-total except for sum
(the fallback in the web client).

This commit closes #13713

Todo: do the same on Class Monetary in next branch
2016-10-11 11:49:55 +02:00
Odoo Translation Bot d3c4ab23e4 [I18N] Update translation terms from Transifex 2016-10-09 02:56:21 +02:00
Olivier Dony 3d55aff1c8
[FIX] convert: properly catch Value/Name Errors 2016-10-03 23:41:44 +02:00
Olivier Dony ba7880a249
[FIX] base: force local cursor in case of mismatch 2016-10-03 19:48:09 +02:00
Olivier Dony 12634e1227
[FIX] base_import_module, tools: raise a clear error for unsupported file types
Also restrict XML data attribute evaluation context
even for real module data files. This will prevent
accidentally depending on context parameters that
would not be available inside base_import_module.
2016-10-03 19:48:09 +02:00
Odoo Translation Bot ca18a1699c [I18N] Update translation terms from Transifex 2016-10-02 02:57:59 +02:00
Jairo Llopis 295f62741d
[FIX] tools: cherry-pick of 0529a7f9
extract terms in correct folder

If two addons path have a common part in the folder name (e.g. `/home/alice/dev`
and `/home/alice/devodoo`), the `get_module_from_path` method may match the
wrong folder.
A file `/home/alice/devodoo/bob/models.py` would wrongly match `/home/alice/dev`
path (due to the lack of separator) and the returned module would be `odoo`
(`"odoo/bob/models.py".split('/')[0]`).

In such scenario, the translations of files (code, static folder, report) would
not be included in the exported translation file.

Force the module path to ends with a folder separator to avoid wrong matching.

Closes #13363
2016-09-28 13:43:41 +02:00
Odoo Translation Bot 6baef31c8f [I18N] Update translation terms from Transifex 2016-09-25 02:59:19 +02:00
Jeremy Kersten 0e7c7a80d8 [IMP] base: set_param log warning if group not found. 2016-09-22 15:03:34 +02:00
Odoo Translation Bot 6a1ecef775 [I18N] Update translation terms from Transifex 2016-09-18 03:05:57 +02:00
Fabien Meghazi 9874892b97 [FIX] module#get_module_path() does not check the manifest's presence (closes #13467) 2016-09-15 10:22:24 +02:00
Odoo Translation Bot 40691d31f3 [I18N] Update translation terms from Transifex 2016-09-11 03:04:01 +02:00
Odoo Translation Bot 75a196972e [I18N] Update translation terms from Transifex 2016-09-04 03:06:55 +02:00
Odoo Translation Bot 671fa0c7d4 [I18N] Update translation terms from Transifex 2016-08-29 11:48:02 +02:00
Odoo Translation Bot 29f5719254 [I18N] Update translation terms from Transifex 2016-08-21 03:05:30 +02:00
Christophe Simonis ee846fbff8 [FIX] core: exception are made to be raised 2016-08-19 15:59:10 +02:00
Raphael Collet d32871570a
[FIX] base: extrapolate table name on uninstall for ir_model_constraints
When uninstalling a module, the model *may* be removed from the registry
before the removal of the model constraints; to prevent crashing in
those cases, a simple replace('.','_') on the model name should allow to
obtain the table name in these cases.
2016-08-17 15:21:26 +02:00
Odoo Translation Bot 71594f5958 [I18N] Update translation terms from Transifex 2016-08-14 03:04:34 +02:00
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