Commit Graph

5122 Commits

Author SHA1 Message Date
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
Odoo Translation Bot 0093372184 [I18N] Update translation terms from Transifex 2015-12-20 02:54:53 +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
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
Odoo Translation Bot 0de99dd2c8 [I18N] Update translation terms from Transifex 2015-12-06 02:56:34 +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
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
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
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
Xavier Morel c6d6ae8aec [FIX] qweb: handle unicode tags and attributes
closes #8895
2015-11-19 14:59:44 +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
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
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
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
Jesús Alan Ramos Rodríguez 248d4a32d9 [FIX] base: position of MXN currency 2015-10-20 16:31:37 +02:00
Martin Trigaux 92e921bed2 [FIX] project: untranslated terms
Were not present in .pot files
Re-export all project related modules
Fixes #9119
2015-10-19 08:50:05 +02:00
Odoo Translation Bot a7c474b3a7 [I18N] Update translation terms from Transifex 2015-10-18 03:00:56 +02:00
Goffin Simon b00f0185a2 [FIX] models: read_group on many2one fields
When making on model A a read_group with groupby equal to a many2one field F1 to a model B
which is ordered by a inherited not stored field F2, the group containing all the
records from A with F1 not set was not returned.

Example:
model A= "hr.applicant"
model B= "res.users" (_order = "name,login")
inherited model= "res.partner"
field F1= "user_id"(to "res.users)
field F2= "name"(inherited from "res.partner")

In this example, the query generated by the function "read_group" was:

SELECT min(hr_applicant.id) AS id, count(hr_applicant.id) AS user_id_count , "hr_applicant"."user_id" as "user_id"
FROM "hr_applicant" LEFT JOIN "res_users" as "hr_applicant__user_id" ON ("hr_applicant"."user_id" = "hr_applicant__user_id"."id"),"res_partner" as "hr_applicant__user_id__partner_id"
WHERE ("hr_applicant"."active" = true) AND ("hr_applicant__user_id"."partner_id" = "hr_applicant__user_id__partner_id"."id")
GROUP BY "hr_applicant"."user_id","hr_applicant__user_id__partner_id"."name","hr_applicant__user_id"."login"
ORDER BY  "hr_applicant__user_id__partner_id"."name" ,"hr_applicant__user_id"."login"

which always returned "hr.applicant" groups of records with a "user_id" set due to the inner join maked on res_partners.

This inner join on "res_partner" is coming from function "add_join" calling by "_inherits_join_add"
in _generate_order_by_inner.

Introduced by dac52e344c

opw:651949
2015-10-16 12:11:31 +02:00
Carlos Almeida 1fdd5cf975 [FIX] base: BRL currency position to before value
Closes #9098
2015-10-16 11:35:55 +02:00
Odoo Translation Bot 5dd33e8ca6 [I18N] Update translation terms from Transifex 2015-10-11 03:04:31 +02:00
Odoo Translation Bot 57b993ffad [I18N] Update translation terms from Transifex 2015-10-04 01:59:01 +02:00
Raphael Collet a9c43bba82 [FIX] fields: fix assignment of related field on several records 2015-10-02 17:05:35 +02:00
Raphael Collet cca7a7a051 [FIX] ir_model_fields: fix and simplify update on custom fields
Avoid "patching" the registry, as this introduces inconsistencies (some field
attributes are lost).  Instead, proceed as follows:
 - update the definition of custom fields in database;
 - clear the corresponding cache on the registry (this was missing);
 - setup the models in registry (this reloads the custom models and fields);
 - update the database schema of the models based on the registry.

This makes the update of custom fields simpler and more robust.
2015-10-01 15:26:07 +02:00
Odoo Translation Bot 78450f2769 [I18N] Update translation terms from Transifex 2015-10-01 00:32:02 +02:00
Leonardo Rochael Almeida 1005299955 [FIX] YAML: `!menuitem` tag handling
The fetched ID was the one of the parent instead of the ID of the imported menu.
2015-09-28 17:15:38 +02:00
Leonardo Rochael Almeida 39745a4290 [FIX] YAML: Add support for `reference` fields in YAML
YAML import was missing support for loading values into fields
where `field.type == 'reference'`.
2015-09-28 17:15:38 +02:00
Odoo Translation Bot c764b703ca [I18N] Update translation terms from Transifex 2015-09-27 01:58:59 +02:00
Christophe Simonis 33bb8db05e [FIX] base: do not validate deactived custom views 2015-09-22 15:33:01 +02:00
Odoo Translation Bot 7ed58916df [I18N] Update translation terms from Transifex 2015-09-13 01:55:09 +02:00
Christophe Simonis 1a8569095e [MERGE] forward port of branch saas-3 up to d48aa27 2015-09-11 16:38:00 +02:00
Christophe Simonis d48aa27cce [MERGE] forward port of branch 7.0 up to a7ff110 2015-09-11 16:16:27 +02:00
Christophe Simonis a7ff1104bc [FIX] base: sanitize module description 2015-09-11 14:58:44 +02:00