Commit Graph
3175 Commits
Author SHA1 Message Date
Christophe Simonis ecd8c023b7 [MERGE] forward port branch 11.0 up to e5f93b83c6 2019-03-08 15:08:16 +01:00
Christophe Simonis e5f93b83c6 [IMP] base,account: unmute logger
Since 8da3750cee, logger does not need to
be muted anymore.

This reverts commits c3764265de and
1693a27f28.
2019-03-08 14:59:01 +01:00
Jairo Llopis 8da3750cee [FIX] core: remove extra exception log, redundant in P3
Reverts 2b1d3ff82d introduced in 10.0 via

It was relatively useful in Odoo 10.0 because in Python 2 the exception
was missing a root cause traceback. But Python 3 includes exception
chaining by default, so it comes for free.
See [PEP3134](https://legacy.python.org/dev/peps/pep-3134/)

On top of being redundant in P3, it can also break some testcases
by causing an extra ERROR log entry, even when the final exception is
expected and caught. So it's simpler to remove it.

closes odoo/odoo#31699

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-03-08 10:46:23 +00:00
Christophe Simonis 71faa19af0 [MERGE] forward port branch saas-12.1 up to 2b3296bbf8 2019-03-11 14:42:34 +01:00
Odoo Translation Bot ae8aac2a18 [I18N] Update translation terms from Transifex 2019-03-10 06:02:07 +01:00
Christophe Simonis 2c5c9b8342 [MERGE] forward port branch 12.0 up to c023d0784f 2019-03-08 17:56:14 +01:00
Christophe Simonis c023d0784f [MERGE] forward port branch saas-11.3 up to ecd8c023b7 2019-03-08 16:10:55 +01:00
Christophe Simonis 3e54704e66 [MERGE] forward port branch 11.0 up to 27081bf6f5 2019-03-05 17:26:04 +01:00
Martin Trigaux 1748b46718 [REV] orm: revert d855e3911f
This commit introduced a regression in web_studio, discovered at opw-1947380

A fix in web_studio will be integrated too but the regression is the proof this
commit should not have been integrated in 11.0.
While the new behaviour introduced at d855e3911f makes more sense, it is still
a change of behaviour that should not target a stable version.

For the problem raised at opw-1887162 that d855e3911f was trying to fix, a
workaround should be used instead.
For instance, setting a widget='html_frame' allows to translate in the website
editor that handles this correctly.

In master, the new behaviour can be maintained and eventual regressions will be
investigated there.

closes odoo/odoo#31585

Signed-off-by: "Martin Trigaux (mat)" <mat@odoo.com>
2019-03-05 10:18:11 +00:00
Odoo Translation Bot 29423872b1 [I18N] Update translation terms from Transifex 2019-03-17 01:22:27 +01:00
Nans Lefebvre 411603f4e3 [FIX] fields: safe check on ondelete cascade
In the case of attachment_ids, comodel._fields[inverse] can be res_id,
an integer field. Such fields do not have a default ondelete attribute.

opw 1945926

closes odoo/odoo#31864

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-15 09:49:13 +00:00
Christophe Simonis c3764265de [FIX] base: mute logger for expected Exceptions in tests 2019-03-04 16:33:38 +01:00
Christophe Simonis 1c712986c4 [MERGE] forward port branch saas-15 up to 1f1fa35c07 2019-03-04 15:49:35 +01:00
Christophe Simonis 1f1fa35c07 [MERGE] forward port branch saas-14 up to 232da9a0ec 2019-03-04 13:40:44 +01:00
Christophe Simonis 232da9a0ec [MERGE] forward port branch 10.0 up to 0f0c5db49d 2019-03-04 12:02:31 +01:00
Julien Legros 0f0c5db49d [FIX] base: fix parse_version import 2019-03-04 11:24:18 +01:00
Odoo Translation Bot 42469048d8 [I18N] Update translation terms from Transifex 2019-03-03 06:02:06 +01:00
Jorge Pinna Puissant e9c7fc0d93 [FIX] base: split _get_rendering_context to allow different models
Allowing to override the _get_rendering_context and call the new
function (_get_rendreing_context_model) with a different custom model
to render the html.

opw-1946792

closes odoo/odoo#32101

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-03-25 14:44:27 +00:00
Martin Geubelle f1c0530515 [FIX] base: do not rename binary fields column
When renaming a binary field name (through Studio for example), an error occurs
since rev. odoo/odoo@66f0e26

As the binary (custom) field is now created with `attachment=True` by default,
it has no associated column in the database ; this latter shouldn't be renamed
then.

Task 1942181

closes odoo/odoo#31504

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-02-28 13:36:08 +00:00
Thibault Delavallée 7836b99690 [REV] base: revert "Hide Save/Discard on Settings until there are modifications"
Why reverting ?

The fact that the control panel changes width on first edit is confusing to the
user. The whole form shifts down. We want to avoid having elements appearing
and disappearing. The issue that the user does not know if he has to save is
still up to date, and will be addressed in the next saas. We will most likely
use what has been done in this task to only display 'There are unsaved
changes'. Thank you all for your work here!

Original task and revert discussion can be found on task ID 1917637 .

This reverts commit 514d6fb90d.

closes odoo/odoo#31622

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-06 09:53:55 +00:00
Xavier Morel 925385fde6 [FIX] base: properly check werkzeug version
Werkzeug version was being checked to avoid passing quote=True to
werkzeug.utils.escape (as that parameter was changed to `True` *and
deprecated* in 0.9).

However because DeprecationWarning was made silent by default in
Python 3.2 and the way the check is implemented worked for 0.9 it
looks like nobody really noticed it's broken in the usual manner of
half-assed version checks: works for 0.9.0, doesn't work for
0.12.3 (because lexically 0.12.3 < 0.9.0).

Fix by using proper version parsing and comparing the result of that.

See also: odoo/odoo#28116

closes odoo/odoo#31553

Signed-off-by: "Xavier Morel (xmo)" <xmo@openerp.com>
2019-02-27 12:46:02 +00:00
Odoo Translation Bot 5a3ac7dece [I18N] Update translation terms from Transifex 2019-03-01 02:45:39 +01:00
Odoo Translation Bot f014204447 [I18N] Update translation terms from Transifex 2019-03-03 03:15:43 +01:00
gustavovalverde c812cc4ebc [I18N] *: remove es_DO translations
Include commit 572d628 again, as it was lost with a forward port.

closes odoo/odoo#31479
2019-02-28 12:39:03 +00:00
Christophe Simonis 023dfaeb6b [FIX] core: correct ir.rule domain generation
Since 934c001680, fasly domains are
correctly OR'ed.
Models without group binded rules were then wrongly reduced to an
`AND FALSE` condition.
2019-02-27 12:27:24 +01:00
Raphael Collet 8a7dc813af [FIX] base: copied views are delete too early
Install Invoicing (account) and uninstall it. It results to a an error
because some views required by `payment.acquirer` are deleted before
the acquirers.

The problem is due to the way copied views are deleted, since 1388b7f
they are removed before the module uninstallation. The related commit
faced a similar problem where copied views were deleted too late
during a module uninstallation.

The two problems are revealing that the copied views have to be removed
as part of the module uninstallation, more precisely after all records
refering to them has been deleted but before the schemas has been
cleaned.

opw-1943286

closes odoo/odoo#31443

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-02-27 10:38:50 +00:00
Odoo Translation Bot 9d4aad2d67 [I18N] Update translation terms from Transifex 2019-03-10 01:36:03 +01:00
Xavier Morel f9d3b5b7df [FIX] core: order of fields in onchange of SSF
When calling the initial (create / default_get) onchange, the SSF
would send the list of fields in whatever order was provided by the
fields map of fields_view_get.

The web client uses view ordering, and it turns out some uses / tests
have dependencies between onchanges (e.g. _create_payment in
test_account_reports) which break on some orderings of the fields.

Send the initial onchange using view-ordered fields in the SSF as
well.

closes odoo/odoo#31494
2019-02-28 10:58:33 +00:00
Christophe Simonis 4c46dd4f9d [MERGE] forward port branch 10.0 up to 2f139632d6 2019-02-27 10:42:03 +01:00
Martin Trigaux d855e3911f [FIX] orm: backport of 06d73eab62 to 11.0
[FIX] models: do not erase master version

For a translated field with a callable method (e.g. xml_translate), when
modifying the value of this field in another language than en_US, the master
version was lost.

Before this patch:

>>> record.arch = "<h1>Title</h1>"
>>> record.with_context(lang='fr_FR').arch = "<h1>Titre</h1>"
>>> record.with_context(lang='fr_FR').arch
"<h1>Titre</h1>"
>>> record.arch
"<h1>Titre</h1>"  # lost English version

After this patch:

>>> record.arch = "<h1>Title</h1>"
>>> record.with_context(lang='fr_FR').arch = "<h1>Titre</h1>"
>>> record.with_context(lang='fr_FR').arch
"<h1>Title</h1>"  # write had no effect
>>> record.arch
"<h1>Title</h1>"

When modifying a translated HTML field in English, a matching to detect the
difference and avoid losing the translations is done.
This is not supported for update in another language.
The main reason is the difficulty to detect changes in the architecture.

To update translations, the supported way is to go to the list of translations
and update them there.

Before this patch, the given value in another language was given to the SQL
query and made an update in database:
if single_lang or not (has_translation and field.translate is True)
-> True or not (True and False) -> True

If a field is callable, it should also be ignored, the same way than
translate=True fields

opw-1887162

closes odoo/odoo#31451
2019-02-28 07:33:03 +00:00
Adrian Torres 686e6e10ce Revert "[FIX] ir_model_fields: register selection options"
This reverts commit 5f5bb5e26b.

Not really a fix as this was never implemented, to be done in master...

Closes #31466
2019-02-27 18:00:28 +01:00
Adrian Torres 5f5bb5e26b [FIX] ir_model_fields: register selection options
Before this commit:
        -> Debug mode
        -> Settings
        -> Database structure
        -> Fields
        -> Any selection field
=> The field `selection` of the ir.model.fields form view does not
display the selection options of the field being viewed, this is because
the selection field is not registered at `_reflect_field_params` of
`ir.model.fields`.

After this commit:

The field is properly registered; for Selection fields with static
options, these are shown as-is, for fields with a lambda function as
options, the string 'function' is displayed, and for fields using a
function name as a string, the same string will be displayed.

Fixes #28360

closes odoo/odoo#31207
2019-02-26 13:12:05 +00:00
Christophe Simonis 06898fac3c [MERGE] forward port branch saas-12.1 up to f9d3b5b7df 2019-02-28 13:47:09 +01:00
Christophe Simonis 0e7675847f [MERGE] forward port branch saas-12.1 up to 0f4abc5c22 2019-02-22 16:25:02 +01:00
Christophe Simonis 7f9b7beed8 [MERGE] forward port branch 12.0 up to b2db72c9d1 2019-02-21 21:36:52 +01:00
Christophe Simonis b2db72c9d1 [FIX] core: handle multiple m2o levels in Form
closes odoo/odoo#31335
2019-02-21 17:03:27 +00:00
Christophe Simonis 644aeb2cd6 [FIX] test_testing_utilities: correct on_change
Avoid searching `[('name', 'ilike', False)]` as it doesn't make any
sense (and behavior changed in saas~12.1)
2019-02-21 17:47:46 +01:00
Christophe Simonis 1d2b6f1bef [MERGE] forward port branch 12.0 up to 84143a34b3 2019-02-21 15:37:19 +01:00
Martin Trigaux cdc6b598e3 [ADD] base: Filipino language
As odoo.com is going to be translated in Filipino
Date format source: https://lh.2xlibre.net/locale/fil_PH/

closes odoo/odoo#31276
2019-02-21 13:36:00 +00:00
Odoo Translation Bot fb01b7c952 [I18N] Update translation terms from Transifex 2019-02-24 06:02:40 +01:00
Nans Lefebvre 215c4a6b5d [FIX] base: check that the state matches the country at partner create
Import a list of partners with their addresses.
The state_id field is usually filled with the state codes.
E.g. 'CA' is used for California, but also for Cádiz (Spain), etc.
The import function (db_id_for) uses a name_search on the res.country.state,
and takes the first matching result.
It follows that the state does not necessarily match the country.

Therefore we add a _check_import_consistency in the create.
Here we check that the country matches the state's country,
try to find a correct match, and if we can't we put the state to False.
Note that if the country is not set both fields will end up set to False:
this is because only a state would mean using a code could give an abitrary
country.

opw 1943904

closes odoo/odoo#31599

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-13 14:27:56 +00:00
Christophe Matthieu b1d80841fc [FIX] base: allow to t-raw="0" with empty content
Before this commit, when doing `<t t-raw="0"/>` to print the t-called
content, it was printing "[]" if the content was left empty.

closes odoo/odoo#31668

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-07 15:06:41 +00:00
Baptiste Vergote f3f8430600 [FIX] base: use correct state name in res.partner import template
State from the template was 'CA' for California - not recognized on import
Changed it to 'California' to match with the db data

opw 1943904

closes odoo/odoo#31556

Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
2019-03-07 13:54:17 +00:00
Christophe Simonis f1ff55bca1 [MERGE] forward port branch 11.0 up to de8cefcef4 2019-02-20 13:40:48 +01:00
Adrian Torres 934c001680 [FIX] expression: properly handle {TRUE,FALSE}_LEAF
Before this commit, doing expression.OR() with only FALSE_LEAF would
yield [] which is equivalent to TRUE_LEAF and is therefore not correct.

The same happened (to a lesser extent) with expression.AND() within an
expression.OR(), since the former would return a [] which would be
ignored by expression.OR().

See tests for a clearer view of the use cases.

Fixes #30113, #26540

closes odoo/odoo#31202
2019-02-20 10:45:28 +00:00
Christophe Monniez db6e8f368c [REL] saas-12.2 2019-02-19 21:02:26 +01:00
Romain Derie e57f7734ca [IMP] base, website: QWeb, raise the caller on unexisting t-call
Before this commit, when a t-call was calling an unexisting template, a QWeb
exception would be raised with the callee and not the caller as template.

That would be an issue since there was clean way to retrieve the view that did
the wrong t-call, for instance to be able to repair that view.

Now, in such a case the caller view will be returned.
That will avoid crapy code to retrieve the caller, eg searching on every Qweb
view archs.

Coming from #32009 (task-1943001)
2019-03-29 18:56:47 +00:00
Romain Derie da5ebdeccd [IMP] base, website: add ir.ui.view action to reset arch (wizard)
This commit adds the possibility to reset a view arch in its form view.
It also include a diff viewer (github like).

Closes #32009 (task-1943001)
2019-03-29 18:56:24 +00:00
Romain Derie 81df3c5f22 [IMP] website: improve reset view feature
- Store previous arch to be able to reset it (soft reset)
- Add the possibility to reset from file if possible (hard reset)
- Adapt frontend reset page to these new fields
- `arch_fs` hack to check if view was modified got moved to new field
  `arch_updated` as we now need to keep track of the `arch_fs` to reset a
  broken view.

Closes #32009 (task-1943001)
2019-03-29 18:53:56 +00:00
Romain Derie 11222f504d [IMP]: base: add help string on ir.ui.view arch fields
As there is a lot of arch fields, and those are not documented, it is not
always obvious to get the purpose of each fields.

This commit simply adds string helper on those.

It will be even more pertinent with the new reset view feature which adds two
new arch fields.

Coming from #32009 (task-1943001)
2019-03-29 18:53:48 +00:00