Commit Graph
173 Commits
Author SHA1 Message Date
Romain Derie 8292b04735 [IMP] website_theme_install: add customize_show on theme.ir.ui.view
Before this commit, having a `customize_show` on an ir.ui.view record in a
theme module would be ignored when creating the theme.ir.ui.view as the field
would not exists.
Actually it would log a warning on create (module install) and raise a
traceback on module update (theme update).

closes odoo/odoo#39216

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-10-22 23:35:08 +00:00
Martin Trigaux 3a7bb6aefd [I18N] *: export 13.0 source terms
closes odoo/odoo#39118

X-original-commit: cfc887dc2032aac4f5894ade017dadab7a413557
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-10-21 12:12:48 +00:00
RomainLibert 14681a346e [FIX] website_theme_install: avoid crashing if install_filename not in context
closes odoo/odoo#38888

X-original-commit: 28dce41599bf0dcef5feb17ce9a33b8ed600a55c
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-10-16 14:17:29 +00:00
Sébastien Theys ab4a59b0ea [FIX] website, website_theme_install: fix theme selection in settings
Follow up of commit a3845ae3f0

Issue
=====

Since the above commit there is a confirmation dialog when clicking on a button,
for which the only options are to Discard or Cancel.

The problem is that when discarding it will revert the selected website back to
the default value. Therefore before the current commit it is impossible to
install a theme on a website other than the first.

Solution
========

The solution is to avoid showing this dialog when clicking on buttons for which
the result depends on the currently selected website. This leads to the same
behavior as what existed before the mentioned commit: the settings are
implicitly discarded because they are not saved, but at the time of the click
the transient model still holds the non-discarded value that the user selected.

This restores the "select a theme" feature, but also restores the unfortunate
side effect that the user might unknowingly loose all of his pending changes
when clicking on the button, but only for those two specific buttons.

Other considerations
====================

Saving instead of Discarding was considered but it is impossible to do because
saving might do a lot of changes that might even lead to the installation of
modules, so the settings page has to be reloaded to apply them, and then the
website field will be reset to its default value again.

Instead of changing website specific settings from the main settings, it was
considered to update them through a form view, but it is apparently too
complicated for on-boarding.

The last consideration was that the settings view should actually mark the
corresponding fields as unchanged when changing the website, but it is too
complex to implement for a case that is not supported in the first place,
especially for a fix in a stable version.

task-2083198

closes odoo/odoo#38745

X-original-commit: 2298ef19bcd9e7a14958dce9a93cea69258064d8
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2019-10-14 17:55:58 +00:00
Raphael ColletandSébastien Theys 8218642541 [FIX] website_theme_install: theme installation
Group the upgrade of upstream dependencies with the installation of a
new theme into a single install/upgrade operation.  This fixes cache
misses occurring when accessing the state of a module after having
upgraded other modules.

closes odoo/odoo#38331

X-original-commit: 03b796b9e92e6eeeee877beaea133bdb6de0c6a3
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2019-10-10 06:33:16 +00:00
Christophe Simonis d74b451805 [MERGE] forward port branch 13.0 up to f4105eb9c7 2019-10-09 02:08:17 +02:00
Odoo Translation Bot b6e7ed6c7b [I18N] Update translation terms from Transifex 2019-10-07 09:11:11 +02:00
fw-botandRomain Derie b77d8a0974 [FIX] website_theme_install: properly attach new views to specific views
When a theme declares a view (a 'theme.ir.ui.view') with an inherit_id,
on installation, a view (a 'ir.ui.view') will be created with the
corresponding inherit_id. The problem is that this inherit_id may
reference a view that has been cow'ed at some point and thus the new
theme view will be attached to the non specific view by mistake.

Part of https://github.com/odoo/odoo/pull/37142

closes odoo/odoo#37750

X-original-commit: https://github.com/odoo/odoo/commit/f30b4dfdb90515bc54e691302f894184c9b1c55b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Romain Derie <rde@odoo.com>
2019-10-02 01:02:56 +00:00
Romain Derie 15e3646b4f [FIX] website_theme_install,*: redirect to frontend after theme install
*: theme_bootswatch, theme_default

Before this commit, the first time a website was loading a theme, it would
not be redirected to the frontend afterward (even if that theme was already
installed on another website).
Any other theme installation on that website would redirect to frontend as it
should.

Indeed, the first time it would use the `act_url` returned by `next()` which
would only be called during the first time installation on the website.

All the `ir.action.todo` related to themes can be removed anyway, as you can't
install directly a theme. It can only be installed through website settings >
load a theme.
In which case we will always want to redirect to frontend.

task-2070463

closes odoo/odoo#37306

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-10-01 16:14:57 +00:00
Odoo Translation Bot 40deff7cbe [I18N] Update translation terms from Transifex 2019-10-01 21:21:46 +02:00
qsm-odoo bd701e1e03 [REF] website_theme_install: remove dead code in theme install code
closes odoo/odoo#37569

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-09-30 10:00:51 +00:00
Odoo Translation Bot d7b8831ea8 [I18N] Update translation terms from Transifex 2019-09-29 01:22:33 +02:00
Victor Feyens 07631a5185 [IMP] * : manifest module categories cleanup
closes odoo/odoo#35754

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-09-25 14:03:45 +00:00
Odoo Translation Bot e80b81dca1 [I18N] Update translation terms from Transifex 2019-09-15 01:30:37 +02:00
Odoo Translation Bot 0d51520083 [I18N] Update translation terms from Transifex 2019-09-08 01:29:12 +02:00
Christophe Simonis 64e43808b7 [MERGE] forward port branch saas-12.5 up to 58a83d1222 2019-09-20 17:34:45 +02:00
Julien Castiaux 4f03a5f136 [FIX] *: remove old deprecated modules/functions
PEP-594 is deprecating a bunch of modules. As part of the cleanup, we
are also dealing with long deprecated modules, functions and aliases.

* `assert_` -> `assertTrue`
* `assertEquals` -> `assertEqual`
* `assertNotEquals` -> `assertNotEqual`
* `assertAlmostEquals` -> `assertAlmostEqual`
* `assertRaisesRegexp` -> `assertRaisesRegex`
* `assertRegexpMatches` -> `assertRegex`
* `base64.encodestring` -> `base64.encodebytes`
* `base64.decodestring` -> `base64.decodebytes`
* `inspect.getargspec` -> `inspect.signature`
* `inspect.formatargspec` -> `inspect.signature`
* `logging.warn` -> `logging.warning`

closes odoo/odoo#36863

Task: 2003936
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-09-17 11:36:42 +00:00
Odoo Translation Bot 86809804f9 [I18N] Update translation terms from Transifex 2019-09-01 01:28:13 +02:00
Raphael Collet 9920f20e4c [IMP] models: ORM speedup
This branch is the combination of several optimizations in the ORM:

* store field values once in the cache: the cache reflects more
faithfully the database, only fields that explicitly depend on the
context have an extra indirection in the cache;

* delay recomputations by default: use method `recompute` to explicitly
flush out pending recomputations;

* delay updates in method `write`: updates are stored in a data
structure that can be flushed efficiently to the database with method
`flush` (which also flush out recomputations);

* make method `modified` take advantage of inverse fields to inverse
dependencies;

* filter records by evaluating a domain on records in Python;

* a computed field with `readonly=False` behaves like a normal field
with an onchange method;

* computed fields are computed in superuser mode by default.

Work done by Toufik Ben Jaa, Raphael Collet, Denis Ledoux and Fabien
Pinckaers.

closes odoo/odoo#35659

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-08-20 12:43:59 +00:00
Naglis Jonaitis f17f2e8336 [IMP] website_theme_install: typo in model class name
closes odoo/odoo#35389

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-01 20:27:30 +00:00
Andrea Ullianaandqsm-odoo 7deceae18c [IMP] website, *: use "auto" widget for font customization
* theme_bootswatch, theme_default, website_theme_install

This commit makes use of the new 'auto' widget for font selection:
instead of enabling a template which will enable a scss file which sets
a font variable to a specific value... we directly allow to do a scss
custo which sets that value.

The code in charge of resetting font customizations on theme switching
is also moved and refactored here in website (instead of being specific
to each theme).

Part of https://github.com/odoo/odoo/pull/33442
task-1974659

Co-authored-by: qsm-odoo <qsm@odoo.com>
2019-07-30 09:59:28 +00:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00
Martin Trigaux beba36416f [MERGE] Forward port of saas-12.3 to saas-12.4 up to 40421be73c 2019-07-16 16:36:40 +02:00
Odoo Translation Bot 4fc83f62fa [I18N] Update translation terms from Transifex 2019-07-14 06:08:03 +02:00
Thanh Dodeur c212cfe899 [REF] *: removes datas_fname from ir.attachment
This commit removes the field `datas_fname` from `ir.attachment` as
it was unnecessary and most of the time the duplicate of `name` or
`url`.

Task #1909865

closes odoo/odoo#32976

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-06-05 09:12:13 +00:00
Christophe Simonis 71faa19af0 [MERGE] forward port branch saas-12.1 up to 2b3296bbf8 2019-03-11 14:42:34 +01:00
Christophe Simonis 2c5c9b8342 [MERGE] forward port branch 12.0 up to c023d0784f 2019-03-08 17:56:14 +01:00
Romain Derie 3f5a6f423d [FIX] website: fix install theme error
Commit 5a81d8883 fixed the COW view deletion on module update but introduced an
error when installing a theme.

Indeed, when installing a theme, the first step is to remove the currently
installed theme from the website (by unlinking its ir.ui.view).

Commit 5a81d8883 introduced the fact that deleting an ir.ui.view during a
module uninstall also search and delete the COW views, calling
`_get_specific_views` (that expects a singleton).

When installing a theme, it calls `_theme_cleanup` which search COW views and
unlink them. If not cow view, unlink is called with an empty record set raising
the singleton error.

closes odoo/odoo#31662

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-03-07 13:36:10 +00:00
qsm-odoo 9d5fa81ba3 [REF] website_theme_install: update theme install screen design
task-1907934

closes odoo/odoo#31114
2019-02-18 09:50:03 +00:00
Christophe Simonis 93d736e905 [MERGE] forward port branch 12.0 up to 6e8dff1952 2019-02-11 16:17:02 +01:00
Odoo Translation Bot 1bec017c15 [I18N] Update translation terms from Transifex 2019-02-10 01:32:20 +01:00
Martin Trigaux 288b5e3a41 [FIX] website_theme: translate website themes
Inspired by l10n_multilang
When a theme is installed, the theme.* records are used to generate actual records.
The same was as we use account.account.template to create account.account, the
translations of  the theme records should be propagated to the new records.

opw-1918120

closes odoo/odoo#29748
2019-02-08 12:27:15 +00:00
Odoo Translation Bot 69dbbea09a [I18N] Update translation terms from Transifex 2019-02-03 01:38:30 +01:00
Odoo Translation Bot 127fdea764 [I18N] Update translation terms from Transifex 2019-01-21 17:38:09 +01:00
Sébastien Theys c4ee25fb7f [FIX] base,*: add MODULE_UNINSTALL_FLAG to cleanup views
* website_theme_install

This commit will add MODULE_UNINSTALL_FLAG to the cleanup methods of themes and
modules.

This is necessary to also unlink inherited views of those we try to unlink.

Before this commit, an error would be raised when trying to delete a view that
still had other inherited views (either created manually by the user, or with
just bad luck in the order of which the views are deleted).

PR: #29753
2019-01-09 12:54:47 +00:00
Sébastien Theys 9918e75b2c [FIX] website_theme_install: remove obsolete comment
This comment is not true, we originally wanted to code it this way but we changed
our mind and forgot to remove the comment.

PR: #29753
2019-01-09 12:51:56 +00:00
Odoo Translation Bot 652cecffde [I18N] Update translation terms from Transifex 2019-01-06 01:32:05 +01:00
Christophe Simonis 3cbc9dd6c0 [MERGE] forward port branch 12.0 up to 6a0675d36d 2019-01-14 10:34:50 +01:00
Christophe Simonis 8aa8548d8a [MERGE] forward port branch 12.0 up to 3e4138deaa
closes odoo/odoo#30045
2019-01-09 15:56:53 +00:00
Odoo Translation Bot 91382f691d [I18N] Update translation terms from Transifex 2018-12-30 01:30:16 +01:00
Odoo Translation Bot 47aae6faba [I18N] Update translation terms from Transifex 2018-12-23 01:29:13 +01:00
Romain Derie f7df35540b [FIX] web_editor, website(_theme_install): avoid theme.ir.ui.view crash
In a particular case, `_views_get` was mixing apples and oranges, ir.ui.view
and theme.ir.ui.view.

This was the case if a theme has a theme.ir.ui.view t-calling another
theme.ir.ui.view.
(Only theme's sale bridge cause this issue, eg theme_kea_sale.products)
Then, having that theme installed on a website would make all other website
without that theme to crash when opening the /shop customize menu.

Indeed, the theme.ir.ui.view would have the xml_id theme_kea_sale.search.
The generic view `website_sale.products` would have `theme_kea_sale.products`
as inherit child which is website specific and t-call `theme_kea_sale.search`.

Then, on a website witout theme_kea installed, opening the customize menu would
call `get_related_views` that would call `_views_get` that would loop through
inherit children calling `_view_obj` that would not find a view with that key
and would fallback on self.env.ref, finding the theme.ir.ui.view.

Note: `_views_get` might return specific view for another website but that will
      be filtered on `get_related_views` override in website.

Step to reproduce:
  - Have at least 2 websites and website_sale installed
  - Install theme_kea on a website, it will also install theme_kea_sale
  - Go on the website that has not theme_kea installed
  - Go to /shop
  - Open Customize menu, it won't load because of python crash

opw-1914576
Closes #29347
2018-12-19 18:23:36 +00:00
Odoo Translation Bot ec4ee14c89 [I18N] Update translation terms from Transifex 2018-12-09 01:16:26 +01:00
Martin Trigaux fa98749154 [I18N] export 12.0 source terms
Update to reflect the recent code changes

closes odoo/odoo#29636
2018-12-19 08:50:10 +00:00
Odoo Translation Bot 3ce5c8bebd [I18N] Update translation terms from Transifex 2018-12-16 01:18:51 +01:00
Odoo Translation Bot 1208ac6ce3 [I18N] Update translation terms from Transifex 2018-12-02 01:25:05 +01:00
Odoo Translation Bot 77692a84be [I18N] Update translation terms from Transifex 2019-03-03 01:36:23 +01:00
Odoo Translation Bot 917ad03026 [I18N] Update translation terms from Transifex 2019-02-24 01:37:50 +01:00
Odoo Translation Bot a463a87189 [I18N] Update translation terms from Transifex 2019-02-17 01:33:04 +01:00
Odoo Translation Bot 07f6b8ef57 [I18N] Update translation terms from Transifex 2018-11-25 01:26:32 +01:00