acsone / click-odoo-contrib Goto Github PK
View Code? Open in Web Editor NEWUseful Odoo scripts and utility functions, based on click-odoo
License: GNU Lesser General Public License v3.0
Useful Odoo scripts and utility functions, based on click-odoo
License: GNU Lesser General Public License v3.0
I have an issue with click-odoo-update.
It seems that after 'Modules loaded' message, some actions are done that raise error. I have no error if I use 'odoo -u all' command.
I have these lines after 'Modules loaded':
And it seems that some post_init_hook actions are launched just after even if they have been done in update just before.
Where is command to just install module?
I am getting an error when running click-odoo-initdb
and passing a module to install.
The error occurs because it tries to run migrations even though the tables didn't exist in the DB.
click-odoo-dropdb devel
queue_job
module: click-odoo-initdb -n devel -m queue_job
Error:
2021-03-26 08:10:04,225 1 WARNING ? odoo.modules.registry: The option --unaccent was given but no unaccent() function was found in database.
2021-03-26 08:10:21,704 1 ERROR devel odoo.sql_db: bad query:
ALTER TABLE queue_job
ADD COLUMN records text;
ERROR: relation "queue_job" does not exist
2021-03-26 08:10:21,705 1 ERROR devel odoo.modules.registry: Failed to load registry
Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 488, in load_modules
loaded_modules, update_module, models_to_check, upg_registry)
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 368, in load_marked_modules
upg_registry=upg_registry,
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 190, in load_module_graph
migrations.migrate_module(package, 'pre')
File "/opt/odoo/custom/src/odoo/odoo/modules/migration.py", line 185, in migrate_module
migrate(self.cr, installed_version)
File "/opt/odoo/auto/addons/queue_job/migrations/13.0.3.2.0/pre-migration.py", line 16, in migrate
"""
File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 173, in wrapper
return f(self, *args, **kwargs)
File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 250, in execute
res = self._obj.execute(query, params)
psycopg2.ProgrammingError: relation "queue_job" does not exist
2021-03-26 08:10:21,705 1 ERROR devel click_odoo.env_options: exception
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/click_odoo/env_options.py", line 218, in _invoke
return self.org_invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click_odoo_contrib/initdb.py", line 432, in main
odoo_createdb(new_database, demo, module_names, True)
File "/usr/local/lib/python3.6/site-packages/click_odoo_contrib/initdb.py", line 77, in odoo_createdb
Registry.new(dbname, force_demo=demo, update_module=True)
File "/opt/odoo/custom/src/odoo/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 488, in load_modules
loaded_modules, update_module, models_to_check, upg_registry)
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 368, in load_marked_modules
upg_registry=upg_registry,
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 190, in load_module_graph
migrations.migrate_module(package, 'pre')
File "/opt/odoo/custom/src/odoo/odoo/modules/migration.py", line 185, in migrate_module
migrate(self.cr, installed_version)
File "/opt/odoo/auto/addons/queue_job/migrations/13.0.3.2.0/pre-migration.py", line 16, in migrate
"""
File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 173, in wrapper
return f(self, *args, **kwargs)
File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 250, in execute
res = self._obj.execute(query, params)
psycopg2.ProgrammingError: relation "queue_job" does not exist
Error: relation "queue_job" does not exist
ERROR: 1
If I do, OTOH:
click-odoo-dropdb devel
click-odoo-initdb -n devel -m base
queue_job
Everything works
Odoo version: 13.0
cc @yajo
Hi there,
any chance to search for installed module only? It will prevent error if module is not installed.
from:
modules = env["ir.module.module"].search([("name", "in", module_names)])
to:
modules = env["ir.module.module"].search([("name", "in", module_names),('state','=','installed')])
in
When using click-odoo-initdb
and click-odoo-dropdb
in v15, I am getting some new (old) warnings:
odoo@203c86acff58:/opt/odoo$ click-odoo-dropdb devel
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:358: SyntaxWarning: "is" with a literal. Did you mean "=="?
if token is '':
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:2437: SyntaxWarning: "is" with a literal. Did you mean "=="?
if options['min_type'] is 'min' and options['min_value'] == 0:
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:2440: SyntaxWarning: "is" with a literal. Did you mean "=="?
if options['max_type'] is 'max' and options['max_value'] == 0:
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:4999: SyntaxWarning: "is" with a literal. Did you mean "=="?
if props[i]['type'] is 'number':
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:6827: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if data_bar['bar_axis_position'] is not 'none':
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:6862: SyntaxWarning: "is" with a literal. Did you mean "=="?
if data_bar['bar_direction'] is 'left':
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:6865: SyntaxWarning: "is" with a literal. Did you mean "=="?
if data_bar['bar_direction'] is 'right':
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:6875: SyntaxWarning: "is" with a literal. Did you mean "=="?
if data_bar['bar_axis_position'] is 'middle':
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:6878: SyntaxWarning: "is" with a literal. Did you mean "=="?
if data_bar['bar_axis_position'] is 'none':
/usr/local/lib/python3.8/site-packages/xlsxwriter/chart.py:2497: SyntaxWarning: "is" with a literal. Did you mean "=="?
if val is 'right':
/usr/local/lib/python3.8/site-packages/xlsxwriter/chart.py:2500: SyntaxWarning: "is" with a literal. Did you mean "=="?
if val is 'left':
2021-10-08 09:31:54,688 26 WARNING ? py.warnings: /usr/local/lib/python3.8/contextlib.py:113: DeprecationWarning: Since Odoo 15.0, Environment.manage() is useless.
File "/usr/local/bin/click-odoo-dropdb", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click_odoo/env_options.py", line 213, in _invoke
with odoo.api.Environment.manage():
File "/usr/local/lib/python3.8/contextlib.py", line 113, in __enter__
return next(self.gen)
2021-10-08 09:31:54,691 26 WARNING ? py.warnings: /opt/odoo/custom/src/odoo/odoo/sql_db.py:89: DeprecationWarning: Since Odoo 13.0, the ORM delays UPDATE queries for performance reasons. Since then, using the ORM with autocommit(True) is unsafe, as computed fields may not be fully computed at commit.
File "/usr/local/bin/click-odoo-dropdb", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click_odoo/env_options.py", line 215, in _invoke
return self.org_invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click_odoo_contrib/dropdb.py", line 25, in main
if not db_exists(dbname):
File "/usr/local/lib/python3.8/site-packages/click_odoo_contrib/_dbutils.py", line 23, in db_exists
with pg_connect() as cr:
File "/usr/local/lib/python3.8/contextlib.py", line 113, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.8/site-packages/click_odoo_contrib/_dbutils.py", line 15, in pg_connect
cr.autocommit(True)
File "<decorator-gen-5>", line 2, in autocommit
File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 89, in check
return f(self, *args, **kwargs)
odoo@203c86acff58:/opt/odoo$ click-odoo-initdb -n devel -m base
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:358: SyntaxWarning: "is" with a literal. Did you mean "=="?
if token is '':
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:2437: SyntaxWarning: "is" with a literal. Did you mean "=="?
if options['min_type'] is 'min' and options['min_value'] == 0:
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:2440: SyntaxWarning: "is" with a literal. Did you mean "=="?
if options['max_type'] is 'max' and options['max_value'] == 0:
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:4999: SyntaxWarning: "is" with a literal. Did you mean "=="?
if props[i]['type'] is 'number':
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:6827: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if data_bar['bar_axis_position'] is not 'none':
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:6862: SyntaxWarning: "is" with a literal. Did you mean "=="?
if data_bar['bar_direction'] is 'left':
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:6865: SyntaxWarning: "is" with a literal. Did you mean "=="?
if data_bar['bar_direction'] is 'right':
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:6875: SyntaxWarning: "is" with a literal. Did you mean "=="?
if data_bar['bar_axis_position'] is 'middle':
/usr/local/lib/python3.8/site-packages/xlsxwriter/worksheet.py:6878: SyntaxWarning: "is" with a literal. Did you mean "=="?
if data_bar['bar_axis_position'] is 'none':
/usr/local/lib/python3.8/site-packages/xlsxwriter/chart.py:2497: SyntaxWarning: "is" with a literal. Did you mean "=="?
if val is 'right':
/usr/local/lib/python3.8/site-packages/xlsxwriter/chart.py:2500: SyntaxWarning: "is" with a literal. Did you mean "=="?
if val is 'left':
2021-10-08 09:32:23,694 31 WARNING ? py.warnings: /usr/local/lib/python3.8/contextlib.py:113: DeprecationWarning: Since Odoo 15.0, Environment.manage() is useless.
File "/usr/local/bin/click-odoo-initdb", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click_odoo/env_options.py", line 213, in _invoke
with odoo.api.Environment.manage():
File "/usr/local/lib/python3.8/contextlib.py", line 113, in __enter__
return next(self.gen)
2021-10-08 09:32:23,697 31 WARNING ? py.warnings: /opt/odoo/custom/src/odoo/odoo/sql_db.py:89: DeprecationWarning: Since Odoo 13.0, the ORM delays UPDATE queries for performance reasons. Since then, using the ORM with autocommit(True) is unsafe, as computed fields may not be fully computed at commit.
File "/usr/local/bin/click-odoo-initdb", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click_odoo/env_options.py", line 215, in _invoke
return self.org_invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click_odoo_contrib/initdb.py", line 419, in main
with DbCache(cache_prefix) as dbcache:
File "/usr/local/lib/python3.8/site-packages/click_odoo_contrib/initdb.py", line 142, in __init__
self.pgcr.autocommit(True)
File "<decorator-gen-5>", line 2, in autocommit
File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 89, in check
return f(self, *args, **kwargs)
2021-10-08 09:32:23,978 31 INFO ? click_odoo_contrib.initdb: Creating database devel from template cache-202110080840-30fdf287b61ca2901ee74440834ff160ab3a4ad4
2021-10-08 09:32:24,782 31 INFO ? click_odoo_contrib.initdb: Found matching database template! ✨ 🍰 ✨
The first one is already being fixed in acsone/click-odoo#45, but the second one needs to be fixed here AFAICS. See odoo/odoo@7a235c1 for reference
Scaffolding implementation has several shortcomings, and chances are that Odoo is not going to develop it further: odoo/odoo#26478 (comment)
Shortcomings:
Would it be worth the thought to implement a better scaffolding command on top of the odoo-click
framework?
Link to myself: https://github.com/acsone/bobtemplates.odoo
set base url in target
As click-odoo-initdb
is most useful for development, one good improvement IMHO would be to autodelete the chosen db if existing.
So, if I execute: click-odoo-initdb -rn devel -m web_responsive
and devel
exists, the script deletes it before re-creating it (maybe from cache, and all that stuff it does).
I think it would lower the barrier for development.
Should it call click-odoo-dropdb
behind the scenes? If so, is there an easy or supported way to do it with click without a subprocess?
Is it only possible to specify all options via config file?
In my case, I try to run click-odoo-[CMD]
via docker, where odoo config file is not fully set, meaning that many parameters come from environment variables or explicit options when starting Odoo. So if I use just config
file, command fails to run, because for example it can't connect to PostgreSQL, because connection parameters are indirectly (e.g. password is passed via POSTGRES_PASSWORD_FILE
).
What would be the best approach to run commands in such case? I should still store all options in config file?
Hi all ,
I need to apply the same the settings over multiple new db used for test/fix, etc.
settings = {
'group_discount_per_so_line': True,
'group_uom': True,
'group_sale_delivery_address': True,
....
}
this code is sufficient
config = settings_model.search(
[('company_id', '=', cpny.id)], limit=1, order='id desc')
if not config:
# first configuration
config = settings_model.create({'company_id': cpny.id})
config.write(settings)
# Execute the record in order to trigger save and to apply settings
config.execute()
Do you think this repo is a convenient place for this kind of script ?
Thanks
Getting following error, somehow connection get closed earlier than expected, any hint?
2020-10-25 19:57:36,957 19976 ERROR dbname odoo.sql_db: bad query: SELECT pg_advisory_unlock(39646140878765077::bigint)
ERROR: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
2020-10-25 19:57:36,957 19976 ERROR karedesign click_odoo.env_options: exception
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/click_odoo_contrib/update.py", line 244, in _update_db
ignore_addons,
File "/usr/lib/python3.6/contextlib.py", line 88, in __exit__
next(self.gen)
File "/usr/local/lib/python3.6/dist-packages/click_odoo_contrib/_dbutils.py", line 63, in advisory_lock
cr.execute("SELECT pg_advisory_unlock(%s::bigint)", (lock_id,))
File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 148, in wrapper
return f(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 225, in execute
res = self._obj.execute(query, params)
psycopg2.OperationalError: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/click_odoo/env_options.py", line 211, in _invoke
database=database, rollback=rollback, ctx=ctx
File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.6/dist-packages/click_odoo_contrib/update.py", line 272, in OdooEnvironmentWithUpdate
ignore_addons,
File "/usr/local/lib/python3.6/dist-packages/click_odoo_contrib/update.py", line 244, in _update_db
ignore_addons,
File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 401, in __exit__
self.close()
File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 148, in wrapper
return f(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 285, in close
return self._close(False)
File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 315, in _close
self._cnx.rollback()
psycopg2.InterfaceError: connection already closed
As far as I know, changes in .py files does not imply a module update for the changes to work. Would it not be optimal to detect changes only in XML files ?
The problem here is that a simple change in .py file triggers the module updates which takes additional time when running the server.
Maybe certain standard test components could be exposed in a better way in the click-library itself?
Possible criteria:
marabunta is a vanguard descriptive migration controller, however it lacks the framework approach of the click ecosystem.
For the sake of standardization of Odoo scripting a odoo-click port would be a powerful citizen.
Note: Not everyone likes auto_update (TM)
magic but rather prefers descriptive single sources of truth for (historic) migration paths.
If such port should be an option, I'd like to include an interface to the Odoo Enterprise upgrade API...
File "/home/lmi/.virtualenvs/tmp-d4bf541593aa657/bin/click-odoo-update", line 5, in <module>
from click_odoo_contrib.update import main
File "/home/lmi/.virtualenvs/tmp-d4bf541593aa657/local/lib/python2.7/site-packages/click_odoo_contrib/update.py", line 20, in <module>
from .core_addons import core_addons
File "/home/lmi/.virtualenvs/tmp-d4bf541593aa657/local/lib/python2.7/site-packages/click_odoo_contrib/core_addons/__init__.py", line 18, in <module>
"8.0": _addons("8c"),
File "/home/lmi/.virtualenvs/tmp-d4bf541593aa657/local/lib/python2.7/site-packages/click_odoo_contrib/core_addons/__init__.py", line 13, in _addons
with open_text("click_odoo_contrib.core_addons", "addons-%s.txt" % suffix) as f:
File "/home/lmi/.virtualenvs/tmp-d4bf541593aa657/local/lib/python2.7/site-packages/importlib_resources/_py2.py", line 73, in open_text
open_binary(package, resource), encoding=encoding, errors=errors)
File "/home/lmi/.virtualenvs/tmp-d4bf541593aa657/local/lib/python2.7/site-packages/importlib_resources/_py2.py", line 66, in open_binary
raise FileNotFoundError(message)
OSError: 'addons-8c.txt' resource not found in 'click_odoo_contrib.core_addons'
It may be desirable to ask click-odoo-update
to ignore some addons for which we know a database update is "never" necessary. It is the case (in theory at least) for core Odoo addons, and could be the case for some custom modules.
Proposal:
--ignore-core-addons
to ignore core Odoo addons. The list of core addons could be hard coded (similar mechanism as in setuptools-odoo).
--ignore-addons [ADDONS]
where ADDONS is a comma separated list of addons to ignore
Ignored addons would not have their checksum added in saved list and would be excluded from the update process.
It bothers me that: https://github.com/acsone/click-odoo-contrib/tree/master/tests/data/test_initdb/addon1
is not detected as an invalid addons directory, see odoo code (missing __init__.py
)
Otherwise databases created from cached templates are inconsistent.
restore an odoo backup and associated files extracted by backupdb. As for Odoo we must be able to specify if it's a copy or a move...
Hi,
I would like to know where are stored the logs?
I set up logfile option in the conf file but nothing is log inside.
Thanks for your feedback
reset uuid in target
Seems like a copy-paste that hasn't been updated:
Line 28 in f64f621
Hi @sbidoul ,
I installed with pip3.7 install click-odoo-contrib in my Odoo 13 virtual enveironment (virtualenveironment is activated) than try the command such as click-odoo --help or click-odoo-backupdb --help, always get error ....ModuleNotFoundError: No module named 'openerp' the error persist when i gave the odoo config file
is there any guide how to install and config this package before i able to use it? or please just give a little guide for it
Please help, thank you
i18n-overwrite
arg can only be used to launch odoo in update mode. odoo -u x --18n-overwrite
The problem with the new implementation is that we start odoo with this arg if specified https://github.com/acsone/click-odoo-contrib/blob/master/click_odoo_contrib/update.py#L77 and the update process is done into by the environment_manager .... (too late) https://github.com/acsone/click-odoo-contrib/blob/master/click_odoo_contrib/update.py#L103 I don't see how we can easily fix this bug into the current implementation since the click options are not available into the environment_manager.
A common scenario, mostly in multi-tenant environments, is to update a specific set of modules (or a single one) instead of all the modules that has been changed since the last update. Sometimes you don't even want to upgrade everything.
It could be a parameter like --modules
/ -m
If the addons dir contains symbolic links, makepot fails on commit with message:
fatal: pathspec '/x/y/odoo/addons/my_addon/i18n/my_addon.pot' is beyond a symbolic link
Unfortunately there is no way to exclude these addons.
In short:
Doing a click-odoo-update
just after a database was initialized by click-odoo-initdb
should not update any module since the check sum of all modules is already stored and is the same.
Hi there,
we're experiencing issue while creating new db on odoo v. 12.0 (12.0-20210831), actually it get stuck while trying to add mail cron jobs.
click-odoo-initdb -n test-db -m our_initial_setup --unless-exists --no-demo --no-cache -c /etc/odoo/odoo.conf
our_initial_setup
, installs a couple of modules by default.
log:
2021-09-23 16:28:14,324 30265 ERROR test-db odoo.sql_db: bad query: SELECT latest_version FROM ir_module_module WHERE name='base'
2021-09-23 16:28:14,324 30265 WARNING ? odoo.addons.base.models.ir_cron: Tried to poll an undefined table on database test-db.
2021-09-23 16:30:25,563 30265 WARNING ? odoo.addons.base.models.ir_cron: Skipping database test-db because of modules to install/upgrade/remove.
2021-09-23 16:31:31,198 30265 INFO test-db odoo.addons.base.models.ir_cron: Starting job `Base: Auto-vacuum internal data`.
2021-09-23 16:31:31,226 30265 INFO test-db odoo.modules.loading: loading 1 modules...
2021-09-23 16:31:31,270 30265 INFO test-db odoo.modules.loading: 1 modules loaded in 0.04s, 0 queries
2021-09-23 16:31:31,407 30265 INFO test-db odoo.modules.loading: loading 46 modules...
2021-09-23 16:31:31,999 30265 INFO test-db odoo.modules.loading: 46 modules loaded in 0.59s, 0 queries
2021-09-23 16:31:32,129 30265 INFO test-db odoo.modules.loading: Modules loaded.
2021-09-23 16:31:32,200 30265 INFO test-db odoo.addons.base.models.ir_attachment: filestore gc 252 checked, 0 removed
2021-09-23 16:31:32,262 30265 INFO test-db odoo.addons.base.models.ir_autovacuum: GC'd 0 user log entries
2021-09-23 16:31:32,273 30265 INFO test-db odoo.addons.muk_autovacuum.models.ir_autovacuum: GC domain: [('temporary','=',True), ('create_date', '<=', (datetime.datetime.utcnow() - datetime.timedelta(hours=24)).strftime('%Y-%m-%d %H:%M:%S'))]
2021-09-23 16:31:32,276 30265 INFO test-db odoo.addons.muk_autovacuum.models.ir_autovacuum: GC'd 0 ir.attachment records
2021-09-23 16:31:32,280 30265 INFO test-db odoo.addons.base.models.ir_cron: Job `Base: Auto-vacuum internal data` done.
2021-09-23 16:31:32,282 30265 INFO test-db odoo.addons.base.models.ir_cron: Starting job `Mail: Email Queue Manager`.
2021-09-23 16:31:32,303 30265 INFO test-db odoo.addons.base.models.ir_cron: Job `Mail: Email Queue Manager` done.
2021-09-23 16:31:32,306 30265 INFO test-db odoo.addons.base.models.ir_cron: Starting job `Partner Autocomplete : Sync with remote DB`.
2021-09-23 16:31:32,328 30265 INFO test-db odoo.addons.base.models.ir_cron: Job `Partner Autocomplete : Sync with remote DB` done.
2021-09-23 16:31:32,330 30265 INFO test-db odoo.addons.base.models.ir_cron: Starting job `Snailmail: process letters queue`.
2021-09-23 16:31:32,356 30265 INFO test-db odoo.addons.base.models.ir_cron: Job `Snailmail: process letters queue` done.
2021-09-23 16:31:32,358 30265 INFO test-db odoo.addons.base.models.ir_cron: Starting job `Digest Emails`.
2021-09-23 16:31:32,378 30265 INFO test-db odoo.addons.base.models.ir_cron: Job `Digest Emails` done.
2021-09-23 16:31:32,382 30265 INFO test-db odoo.addons.base.models.ir_cron: Starting job `Mail: Notify channel moderators`.
2021-09-23 16:31:32,403 30265 INFO test-db odoo.addons.base.models.ir_cron: Job `Mail: Notify channel moderators` done.
2021-09-23 16:31:32,405 30265 INFO ? odoo.sql_db: ConnectionPool(used=0/count=0/max=300): Closed 3 connections to 'user=odoo password=xxx dbname=test-db port=6432 sslmode=prefer'
2021-09-23 16:31:45,251 11362 WARNING test-db odoo.modules.loading: Transient module states were reset
2021-09-23 16:31:45,252 11362 ERROR test-db odoo.modules.registry: Failed to load registry
2021-09-23 16:31:45,258 11362 ERROR test-db click_odoo.env_options: exception
2021-09-23 16:32:20,002 30268 INFO ? odoo.sql_db: ConnectionPool(used=0/count=0/max=300): Closed 1 connections to 'user=odoo password=xxx dbname=test-db port=6432 sslmode=prefer'
2
error:
Error: "'<' not supported between instances of 'NoneType' and 'NoneType'" while parsing /usr/lib/python3/dist-packages/odoo/addons/mail/data/ir_cron_data.xml:4, near
<record forcecreate="True" id="ir_cron_mail_scheduler_action" model="ir.cron">
<field name="name">Mail: Email Queue Manager</field>
<field name="model_id" ref="model_mail_mail"/>
<field name="state">code</field>
<field name="code">model.process_email_queue()</field>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">1</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall"/>
</record>
Creating fron odoo ui, works with no issues. Any hint on how could be fixed?
I get an error here:
Error: Access denied
No logs are shown so I have no further details. Is there any special requirement in the Postgresql privileges?
AFAIU Module checksum depends on module path. Why? Can we just look at module content?
Sometimes you want to test the installation of a module, so you're interested in preinstalling all of its dependencies but not the module itself.
IMHO it would be great to be able to do it like click-odoo-initdb -dn devel -m module
.
Do we have a script that detects a module's dependencies? I guess that would be a good starting point after all...
Set base url in newly created db
Actually when I try to run click-odoo-makepot -m my_module
it only works when there is no existing .po files. Where there is already one .po file, I get this error :
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/click_odoo/env_options.py", line 211, in _invoke
return self.org_invoke(ctx)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/click_odoo_contrib/makepot.py", line 181, in main
purge_old_translations,
File "/usr/local/lib/python3.7/dist-packages/click_odoo_contrib/makepot.py", line 83, in export_pot
["msgmerge", "--quiet", lang_filepath, pot_filepath]
File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
**kwargs).stdout
File "/usr/lib/python3.7/subprocess.py", line 472, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'msgmerge': 'msgmerge'
Error: [Errno 2] No such file or directory: 'msgmerge': 'msgmerge'
I tried with Odoo v14.
If I run click-odoo-makepot -m my_module --no-msgmerge
I get the same error.
I never used this subprocess
package so I'm afraid I won't be a good contributor for this... but I loved the general idea of these click-odoo-contrib tools !
Thanks!
Working with this click-odoo framework, I really enjoyed the clarity of pytest reporting.
@sbisoul Is it a reasonable idea to run Odoo tests with pytest through a click-odoo-tester script?
It will be usefull to have --modules option to update only concrete modules pot files
... see this regex
I'm considering to abandon support for python < 3.6. This mean dropping Odoo 8, 9, 10, 11.
Previous click-odoo-contrib releases will continue to be installable as the package metadata of the new releases will have require-python>=3.6.
A standalone script to produce Weblate integration commits mainly run through CI, but also for ad-hoc local maintenance would be a great everyday's companion.
MQT tool related to this task are fine for travis et al, but does not have the superior UX of a standalone CLI tool. Transifex integration could be an option, too.
backup database and associated files to an archive or a folder
https://stackoverflow.com/questions/10169203/postgresql-9-1-pg-restore-error-regarding-plpgsql
debugging output:
/usr/bin/pg_restore --dbname=click-odoo-contrb-testbackupdb --no-owner /tmp/pytest-of-blaggacao/pytest-273/tests_backupdb_folder_restore1/backup/db.dump
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 4684; 0 0 COMMENT EXTENSION plpgsql
pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of extension plpgsql
Command was: COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
WARNING: errors ignored on restore: 1
Unlike initdb
, seed db
works towards pre-loading of custom data.
The usage scenario is after db creation to pre-seed mainly company data, like address, logo, etc. in an automated fashion.
While also useful on the command line, it's main use is automated deployment scripts. Specifically in the Odoo-Operator.
EDIT: I favor seed-db.py
over a modification to initdb.py
to keep components minimal (and avoid cancerous feature growth)
In some cases, it could be really useful to be able to load translations immediately while initialising a database.
e.g.: when you do a test suite with several tests loading some translations could cost some time. A A solution is to load the language during the init and check in the test's setup if the language is already installed.
This is a question to check opinions about merging back dodoo-* enhancements into click-odoo-*. At the time of forking I needed lifecycle control, especially over click-odoo.
I haven't checked, but that's maybe not a hindrance any more.
I'd like to contribute mainly those
Is there a chance I can sunset my fork and incorporate those things here?
cc/ @lmignon
Some people may want to have all pot generations gathered in only one commit. The first generation for a project may generates thousand commits if there are a lot of modules. One may lose commits readability.
Maybe this should be an option to makepot.
Hello: I've created a few template dbs in Odoo and I would like to get an example of using click-odoo-initdb to create a new database from one of these templates. If you have a working example syntax of it that would be great. I'm just a little confused on how to create/access the cache of template dbs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.