Commit Graph

8015 Commits

Author SHA1 Message Date
Martin Trigaux b7789771f0 [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
2021-11-03 21:33:06 +01:00
Stephen Medina 36ecb63f2c [FIX] support psutils >= 4.0 2019-06-03 18:21:25 +02: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
Olivier Dony e99358415a [FIX] tools: ignore unknown entities while parsing 2015-11-03 21:38:53 +01:00
Odoo Translation Bot 396181648c [I18N] Update translation terms from Transifex 2015-11-15 03:03:19 +01:00
Christophe Simonis afae197073 [IMP] base: timezone handling in server actions.
Give access to `pytz.timezone` (as `timezone`) in `ir.actions.server`
records. Usefull when dealing with date(time)s.
2015-11-12 12:23:27 +01:00
Denis Ledoux 56c08e486f [FIX] expression: `child_of` domain with `parent_store` & non-existing parent
In the `product.template` model,
when searching products within a category that doesn't exist,
all products were returned, while none should be returned.

For instance,
In Sales > Products,
In the search input, search with internal category:
"A category that doesn't exist",
all products were returned.

opw-649548
2015-11-10 16:35:55 +01:00
Odoo Translation Bot 7a0a649deb [I18N] Update translation terms from Transifex 2015-11-08 03:01:35 +01:00
Denis Ledoux 8558ecfdf3 [MERGE] forward port of branch saas-3 up to dd8cbf4 2015-11-06 16:08:30 +01:00
Christophe Simonis 27b38513b0 [MERGE] forward port of branch saas-3 up to 2e9b33b 2015-11-03 12:45:50 +01:00
Christophe Simonis 2e9b33b793 [MERGE] forward port of branch 7.0 up to 80c7209 2015-11-03 11:40:01 +01:00
Odoo Translation Bot 82cd86f181 [I18N] Update translation terms from Transifex 2015-11-01 03:03:27 +01:00
Odoo Translation Bot 80c7209d2e [I18N] Update translation terms from Transifex 2015-11-01 00:31:46 +01:00
Raphael Collet 845c10fef2 [FIX] res_lang: fix confusion between class variable and local variable 2015-10-26 17:27:01 +01:00
Raphael Collet 780cfba3c6 [FIX] fields: make overriding a property field by a function/computed field work
Contribution by Adrien Peiffer (ACSONE).
2015-10-26 17:25:47 +01:00
qsm-odoo fa6e8448d6 [IMP] base: description pages containers width
Containers inside description pages must be displayed as a
container-fluid since they are inside a box which has a
smaller width than a container.
2015-10-26 15:47:10 +01:00
Raphael Collet d5f35bf37d [FIX] res_lang: prevent modification of language code 2015-10-26 12:09:26 +01:00
Odoo Translation Bot e84c01ebc1 [I18N] Update translation terms from Transifex 2015-10-25 02:02:17 +01:00