If the addons path does not contain enterprise, the industry module
cannot be installed since all of them rely on knowledge. The same
applies if there is a theme in the industry and that the design-themes
repository is not in the addons-path.
This commit raises a UserError in case the installation would fail due
to a missing repository in the addons-path.
closesodoo/odoo#147138
Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
uploadable modules latest_version are not fully defined (ex: 1.0 instead of
15.0.1.0), which lead to issues in the MigrationManager.
Steps (in 17.0):
- make sure you have the industry repository in the addons-path and the upgrade
one in the upgrade-path
- create an empty database
- On 'Hair Salon', click 'Activate'
- On the 'Install an App' popup window, click 'Install'
- Wait for the Hair Salon Industry to install > Once finished, go to the Website
- Click 'Edit' to open the website editor
- Click 'Theme'
- Next to the 'Theme' field under the 'Website' section, click 'Switch Theme'
- Click 'Ok' on the Confirmation popup window
- Click 'Use this theme' for the BEAUTY them
- The 'Building your website...' animation begins
An error is thrown
File "/home/odoo/src/odoo/17.0/odoo/addons/base/maintenance/migrations/theme_common/9.saas~13.1.1/pre-views.py", line 4, in <module>
from openerp.addons.base.maintenance.migrations import util
ModuleNotFoundError: No module named 'openerp'
opw-3589376
closesodoo/odoo#148955
X-original-commit: b96b34dc69458b165e8660520832bd8d02adec70
Signed-off-by: Raphael Collet <rco@odoo.com>
Currently, when you attempt to uninstall an industry module, you are met
with a 'record not found' error.
Cause
-----
The list of industry modules is fetched from `odoo.com`. Since they do not
exist in the database, they are all assigned an ID of `-1`.
This ends up causing an issue in case of uninstall because no record
with and ID of `-1` can be found.
Fix
---
When a module is installed, it gets a record in the database (and ID).
The fix simply uses that ID if it exists, instead of `-1`.
opw-3662239
closesodoo/odoo#148456
Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
Versions:
---------
- 17.0
Steps to reproduce:
-------------------
1. Install any custom module.
Issue:
------
Odoo raises the error "Connection to %s failed; the module %s cannot be
downloaded."
Cause:
------
The "activate" button on custom modules triggers the "button_immediate_install_app"
method instead of "button_immediate_install" because the "module_type" field is
empty for custom modules.
Solution:
---------
Display the "button_immediate_install" button on the modules kanban view when
the "module_type" is empty.
closesodoo/odoo#141744
Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
An ormcache has been added to a method that takes lists as parameters but
lists are not hashable.
steps to reproduce:
- go to apps and click on on 'Industries'
before this commit:
- a warning is raised in the logs:
WARNING industry odoo.tools.cache: cache lookup error on ('ir.module.module', <function IrModule._get_modules_from_apps at 0x7f99e842fc70>, ['icon', 'icon_flag', 'to_buy', 'name', 'state', 'summary', 'website', 'application', 'module_type', 'shortdesc'], 'industries', False, ['&', '!', ['name', '=like', 'theme_%'], '&', ['application', '=', True], ['module_type', '=', 'industries']], 80, 0)
Traceback (most recent call last):
File "/home/nda/dev/odoo/17.0/odoo/odoo/tools/cache.py", line 99, in lookup
r = d[key]
File "<decorator-gen-5>", line 2, in __getitem__
File "/home/nda/dev/odoo/17.0/odoo/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "/home/nda/dev/odoo/17.0/odoo/odoo/tools/lru.py", line 34, in __getitem__
a = self.d[obj]
TypeError: unhashable type: 'list'
after this commit:
- ormcache is properly used
opw-3660052
closesodoo/odoo#147730
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
Before this commit, the layout of the import module form view (in
the dialog) was broken. This was due to unnecessary and wrong use
of col/colspan attributes.
closesodoo/odoo#147271
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
The test tries to import data from an sql file.
The problem is that it is trying to import partners, but when
the test is ran with the l10n_co localization, one of the required
field is not filled.
We just change the model to import to avoid the issue with the
missing required field.
Linked to runbot error 32740, 32742, 32745, 32738
closesodoo/odoo#145708
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
A function that returns the list of missing modules is needed to know if
the the customer needs to changi his plan when importing an industry
module.
closesodoo/odoo#144241
Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
When we are importing a module and we need to create an attachment from
a file in static. We get an error if the file path of the file contains
a space.
We get this error becuase it takes the path to generate an xml id and
the name of an xml_id cannot contains spaces.
closesodoo/odoo#142113
Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
Since we have multiple categories for the Industries apps. We are now
getting them from apps.odoo.com. And we are using the ids from apps in
the domain that is sent back to apps.
closesodoo/odoo#141173
Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
With normal module, the icon is always loaded from the filesystem but
when importing a module that contains a module icon (by default in
static/description/icon.png) it crash with a `FileNotFound` exceptions
because the image is not available on the filesystem but as an
ir.attachment.
This ensure that for imported module we load the icon from the
corresponding imported attachment
closesodoo/odoo#141133
Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
Since we need to get the list of dependencies for the saas (and not noly
a Text of the module names, we split the function to be able to easily
get the list of dependencies.
closesodoo/odoo#140994
Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
We now have the possbility to publish modules that only contains XML on
apps.odoo.com and we want to display in the apps of the database to ease
the installation.
TASK-3186716
closesodoo/odoo#140245
Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
Fixes a large number of cases where strings are translated then
formatted, instead of letting `_()` do the formatting internally,
which allows it to recover from incorrect translations (missing,
broken, or extra placeholders).
Also
- removes translation markers entirely when there's nothing to
translate e.g. `_("%s - %s")` is not useful
- fixes a few messes which lead to only partial translatability
(DRY is generally a bad idea when translations are involved, even
more so when you don't make the variable part translatable)
- fixes a few nearby issues noticed at the same time
- replaces a few `"%s"` by `%r`, which should automatically quote
strings relatively appropriately
- fixes translated strings which use `\` to escape a newline (in order
to fill-paragraph): `\` escapes only the newline, if the
continuation string is indented this results in a bunch of spaces
ending in the string to translate, which is pretty garbage for the
translator, using implicit concatenation works much better
Note: some of the updates revert f-string parameters to %, because
babel (2.9) apparently has trouble with f-strings and blows up trying
to extract them.
Not in scope:
Helping translators fix translatable strings e.g. any translation
string with more than one placeholder probably should use keyword
placeholders
- Provides more context / data to the translator to make sense of the
sentence.
- Allows reordering the translated terms, which can be necessary
depending on the sentence and language.
closesodoo/odoo#139314
Related: odoo/enterprise#49311
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Replace all the calls to get_resource_path to the better file_path or
directly use file_open when not needed
Doing both a get_resource_path and file_open means checking twice that
the file exists.
Doing a simple path concatenation before a file_open is safe.
If given to another method (e.g. etree.parse), calling file_path is
the prefered method.
Note that get_resource_path used to return False when the file does
not exists while file_path/file_open raises a FileNotFoundException
closesodoo/odoo#135607
Related: odoo/upgrade#5187
Related: odoo/enterprise#47475
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
before this commit, in the import module wizard the
end user can select any type of file in the upload
file field and clicking import it will say only zip
format is supported.
after this commit, on clicking upload files, only
zip files will be shown to the end user to select,
which will make easy to select the files from
directory
closesodoo/odoo#128484
Related: odoo/enterprise#44089
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
This commit makes hotkey uses more coherent throughout the entire
codebase by setting alt+q as main shortcurt for confirm and default
actions and alt+x for cancel actions.
task-3370463
closesodoo/odoo#127469
Related: odoo/enterprise#43694
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
Revision odoo/odoo@cabb9e7e57 introduced a
regression: This is no longer possible to import a data module
using `<field file="..."/>` in their data file.
This revision targets to restore the feature as expected.
The unit tests added covers the feature, so that regression
no longer happens in the future.
It introduces a new concept of temporary directory `file_open`
can read from.
e.g.
```py
with odoo.tools.file_open_temporary_directory(self.env) as module_dir:
with zipfile.ZipFile('foo.zip', "r") as z:
z.extract('foo/__manifest__.py', module_dir)
with odoo.tools.file_open('foo/__manifest__.py', env=self.env) as f:
manifest = f.read()
```
Note that `file_open` will be allowed to read from that temporary
directory only if `env` is passed to `file_open`,
and if the `env` is part of the same transaction/request than the `env`
passed to `file_open_temporary_directory`.
This is to avoid having users, whether from other databases,
or even the same database,
trying to access these directories not belonging to them.
e.g. If an admin uploads sensitive data in this temporary directory,
no one than him must be allowed to read from these files, not even
another user from his database.
closesodoo/odoo#126326
X-original-commit: ea5cfe2e9493e4ef5a9b81851af452c8c51e407e
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
The revision dd3f918cafebe26e5aa9dff1b2e484b7ed662140
introduced a regression:
it was no longer possible to set an icon in the import module,
and if no icon is provided,
the icon should fall back to the base module icon,
which wasn't the case either.
In this last case, it even leaded to a crash:
```
File "/home/odoo/src/14.0/odoo/odoo/addons/base/models/ir_module.py", line 251, in _get_icon_image
with tools.file_open(path, 'rb') as image_file:
File "/home/odoo/src/14.0/odoo/odoo/tools/misc.py", line 176, in file_open
return _fileopen(name, mode=mode, basedir=base, pathinfo=pathinfo, basename=basename, filter_ext=filter_ext)
File "/home/odoo/src/14.0/odoo/odoo/tools/misc.py", line 211, in _fileopen
raise ValueError("Unknown path: %s" % name)
Exception
ValueError: Unknown path: /base/static/description/icon.png
```
opw-3340652
closesodoo/odoo#124661
X-original-commit: 12ccfcf8d2ee936ec066de81c2dce2dd17348cb6
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.
This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).
closesodoo/odoo#121629
Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
We no longer want to support importing data modules from within
the addons path.
Only modules imported with an archive and extracted in a temporary
folder are supported.
closesodoo/odoo#121881
For performance reasons, instead of extracting the whole
zip, extract only the files which are actually used
during in the `_import_module`, in case people
put additional crap in the archive which are ignored
during the import. That way, we avoid useless I/O.
Also, adding the temporary directory in the addons
path wasn't thread-safe.
This revision changes this to make the module
import feature thread-safe.
closesodoo/odoo#80120
Signed-off-by: Pierre Masereel <pim@odoo.com>
They dates from < 2027 and are quite outdated. Favour the nl
translation instead.
n_BE is not on Transifex so it was not possible to correct bad
translations.
closesodoo/odoo#115845
X-original-commit: d04c8b7e484db8306d858c891a7a2b11885fdcd9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
The type fields of actions already defaults to
the model name in the base model definition.
Therefore, specifying `ir.actions.server`, `ir.actions.act_window`
& so on as type is useless (and adds noise since it's the same as
the action model).
closesodoo/odoo#114539
Related: odoo/enterprise#37855
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
The goal of this revision is to re-use the environment among the
different steps of the registry loading,
instead of creating a new environment for each step.
1. Simply To avoid to repeat the line
`env = api.Environment(cr, SUPERUSER_ID, {})`
multiple times in the code
2. This also allows to share the context among the different
steps. This is not yet used in this revision, but it could
be, for instance to avoid the current repetition to add the keys
`install_module`, in `convert_csv_import` and `xml_import._tag_record`
Part-of: odoo/odoo#108254
The existing code was generating misleading errors for imported Odoo
modules that could not be loaded. Although there was a specific hack
for module 'studio_customization', imported modules were not handled
properly. This patch adds the right condition in the SQL query in the
module that introduces imported modules.
closesodoo/odoo#106098
X-original-commit: e1cfc1f74000e55473f7a26f0df5a13c4d5094c0
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
Signed-off-by: Raphael Collet <rco@odoo.com>
This commit fix 3 problem
Don't count studio field
------------------------
the commit https://github.com/odoo/odoo/commit/75b8c4eb1ed6e44f427886eea06ad216995e16c8
was supposed to stop counting count field generate by addins a smart
button with studio.
It works fine when base import module is not installed which is never
the case.
When base_import_module the field is counted as a field that belong
to a imported module installed : studio_customization
studio_customization should not be counted as an imported module
installed
Count Field with standard xml_id
--------------------------------
With https://github.com/odoo/odoo/commit/9afce4805fc8bac45fdba817488aa867fddff69b
Each manual can end up with an xml_id from a standard module:
the original module of the model
A standard module should never create a manual field so we can consider
they should be counted unless they match the criteria of the first
problem
If a field has a standard module xml_id and no other the module
should be odoo/studio and not the name of the standard module
Make possible to exclude some db record from cloc
-------------------------------------------------
It's possible to exclude some file in python module
but it's not possible to exclude some field or SA in
the database from the count
Make it possible if they are link to an xml_id
from the module __cloc_exclude__
The exclude record will be shown in cloc report with
the verbose mode
closesodoo/odoo#95028
X-original-commit: db52fb174461107e26b066147801f54a89d0dbf9
Related: odoo/enterprise#29007
Signed-off-by: Christophe Simonis <chs@odoo.com>
Issue:
Imported module is not able to search existing static files to replace them
Cause:
After changing the new loc calculation, ir.attachment will link to the
ir.model.data. However, those attachments will not able to search anymore
without sudo. Therefore, the system will try to create the attachment again.
It will return error because constraint "ir_model_data_module_name_uniq_index"
will prevent ir.model.data to create again.
Solution:
Use sudo to search the attachment.
closesodoo/odoo#93752
X-original-commit: 8f604847eb1ec96955ee724ad7b882c74160b9d7
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
Remove most values uselessly specified because giving the same value as
the default one (see _DEFAULT_MANIFEST in odoo/modules/module.py)
* auto_install is Falsy by default
* author is Odoo SA by default
* summary & description are empty strings by default
* application is False by default
* test, demo, depends and data are empty lists by default
This will reduce noise/inconsistencies between manifests specifications,
simplify analysis of manifests content, ...
closesodoo/odoo#90209
Related: odoo/enterprise#26807
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Since
https://github.com/odoo/odoo/commit/d2e0b48271dbd8cd7bbdbc5c2c1649c55c51417b,
qweb view from imported module are counted. the issue is that qweb view
created with the wysiwig editor of studio got an external ID from
studio_customization module which is declared as imported
So those views were wrongly counted for the maintenance fee.
Solution
--------
Exclude qweb view from studio_customization module
closesodoo/odoo#87424
X-original-commit: 77db024140e4f7c9ae8e6b5eb95de857afbab0da
Signed-off-by: Christophe Simonis <chs@odoo.com>
Context
-------
Web design specific require a lot of work and need maintenance.
So far the style files were not taken into account despite the
amount of maintenance they require.
With this commit they are going to be counted,
knowing they still can be excluded in the manifest.
Imported module allow to deploy frontend assets: stylesheet,
javascript, xml template and Qweb view that require
as well some maintenance. They are going to be counted
Implementation
--------------
- Add method to parse css and scss file
- Include .scss and .css file in the count
- Add external_id to attachment that store
frontend asset of imported module
- Find all attachment with .js, .css, .scss, .xml
from imported module
- Find qweb view from imported module
- cound the content of the attachment and the qweb view
closesodoo/odoo#86816
X-original-commit: d2e0b48271dbd8cd7bbdbc5c2c1649c55c51417b
Signed-off-by: Christophe Simonis <chs@odoo.com>
Signed-off-by: Thibault Francois <tfr@odoo.com>
* Studio generate computed field "count" when the user add a button
in the button box. Since those lines are written by studio with drag and drop
it should not be counted for the maintenance subscription.
We can detect them because field created by the user in studio start with x_studio
and fields created outside studio does not have studio_customization
xml_id
* Add test to make no standard module introduce customization in the
database during the install the will be counted by cloc
see https://github.com/odoo/enterprise/pull/22664closesodoo/odoo#85763
X-original-commit: 47ae24081fe5c0c86ce8507229dfb550ec585633
Signed-off-by: Christophe Simonis <chs@odoo.com>
Signed-off-by: Thibault Francois <tfr@odoo.com>
This commit is the 12th commit of a comprehensive refactor of our HTTP
framework. See odoo/odoo#78857 for complete historic, discussions and
rationnals.
The web module is twofold, on one side there are many controllers: /,
/web, /web/login, /web/database/selector, /web/dataset/call_kw, etc, on
the other side there is `session_info`: the method responsible to create
the web client's environ.
This module is kinda an exception as it is (with base) a server wide
module. In the case of the HTTP framework, it means that the controllers
of web are always accessible, i.e. going to / or /web/login will never
return a 404 Not Found even if the user is not connected to a database.
This is both a blessing and a curse. It is a blessing because the
controllers are always accessible it means that a new users can freely
access those routes. It is a curse because *any* user can access them,
even user who don't have a session yet thus who are not connected to a
database yet. From a developer standpoint, we have to put extra care to
correct serve users with and without a database. An example is the
/web/login route, the login/password pair is stored in a database,
without database it is impossible to validate a user login but users can
still access this route without db.
To solve this problem, there is the `ensure_db` function. This function
attempts to find a database using various sources (?db= query-string,
session db, mono db) and to save it on the user session. In case no db
is found, the user is redirected to the database selector. In a way,
this function grants a database to the user in a seamingly experience.
In a way, this function brings a welcome differentiation between
`auth='none'` with a database and `auth='none'` without a database. Such
differentiation only matters for the server wide modules as "regular"
module controllers are only accessible via the ir.http routing map, i.e.
it is not possible to declare a nodb controller outside of server wide
modules.
An important changement is the `session.authenticate` method, before it
was possible to call the method when the cursor was not yet initialized,
authenticate would open a cursor against the given database, setup a
registry and an environment and ultimately save everything on the
current request. Because the cursor is now greedily created, it is no
more possible to update the request environment when authenticating on
another database.
PR: odoo#78857
Task: 2571224