Git Product home page Git Product logo

click-odoo-contrib's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

click-odoo-contrib's Issues

click-odoo-update: Some actions are done after 'Modules loaded'

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':

image

And it seems that some post_init_hook actions are launched just after even if they have been done in update just before.

click-odoo-initdb trying to apply module migrations

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.

Steps to reproduce:

  1. Drop any existing DB: click-odoo-dropdb devel
  2. Init the new DB with the 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:

  1. Drop any existing DB: click-odoo-dropdb devel
  2. Init the new DB without modules: click-odoo-initdb -n devel -m base
  3. Install queue_job

Everything works

Info

Odoo version: 13.0

cc @yajo

Warnings in v15

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

ping @sbidoul @yajo

Add --replace to click-odoo-initdb

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?

Using explicit odoo options, not just via config?

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?

RFC odoo bootstrap settings

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

[>1.8.0] click-odoo-update , raising error when updating checksum

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

[Proposal] improve click-odoo test "mini-framework"

Maybe certain standard test components could be exposed in a better way in the click-library itself?

Possible criteria:

  • What generic test idiom are valid for a glorified shell?
  • What generic test idiom are valid for Odoo API extensions?

[Proposal] marabunta wrapper / port

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...

Packaging on pypi seems to be wrong for vesion 1.10

  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'

click-odoo-update: ignore some modules

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.

restoredb

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...

Question regarding logging

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

Question: Is there a documentation how to install config and use?

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

  1. where do in need to install when my odoo using virtual environment? (now i installed it inside the virtual environment)
  2. do i need to run the command inside odoo root folder?
  3. in order to backup db and filestore to a directory, do we need to set directory owner to odoo?

Please help, thank you

[1.4.0] --i18n-overwrite not supported by click-odoo-update

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.

click-odoo-update: add option to filter modules to be updated

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

click-odoo-makepot not working with symbolic link

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.

Issue on click-odoo-initdb, error while installing mail cron?

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?

Add --dependencies to click-odoo-initdb

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...

click-odoo-makepot : blocking error when the i18n folder already contains some .po files

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!

[Proposal] click-odoo-tester with pytest

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?

Require python >= 3.6

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.

[Proposal] Weblate integration

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.

backupdb

backup database and associated files to an archive or a folder

click-odoo-backupdb: dump does not exlude non public data

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

[Proposal] seed-db.py script

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)

click-odoo-initdb: add parameter --load-language

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.

Merge back dodoo-* enhancements?

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

  • dodoo-migrator (descriptive migration option inspired by marabunta with integration to Odoo upgrade service)
  • dodoo-loader with helps in ETL taska
  • dodoo-snapshotter (which does - kind of - incremental backups for the filestore part)
  • improvements to initialized and copbydb to allow raw SQL.

Is there a chance I can sunset my fork and incorporate those things here?

[RFC] click-odoo-makepot: Make optional one commit for all pots

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.

click-odoo-initdb question

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.