Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install only new Odoo modules #53

Merged
merged 1 commit into from
Jun 12, 2019
Merged

Conversation

enricostano
Copy link
Contributor

@enricostano enricostano commented May 29, 2019

Query to extract new or not installed modules from a list of modules:

SELECT name FROM (
    VALUES ('base'), ('web')
) AS t (name)
EXCEPT
SELECT name FROM ir_module_module WHERE state = 'installed';

@enricostano enricostano force-pushed the feature/install-only-new-modules branch from ae1b52f to 78c2765 Compare May 29, 2019 16:19
@enricostano enricostano force-pushed the feature/install-only-new-modules branch from 78c2765 to 64c15f7 Compare May 29, 2019 18:05
tasks/main.yml Outdated Show resolved Hide resolved
tasks/main.yml Outdated Show resolved Hide resolved
tasks/main.yml Outdated Show resolved Hide resolved
tasks/main.yml Outdated Show resolved Hide resolved
Co-Authored-By: raneq <46573858+raneq@users.noreply.github.com>
@enricostano enricostano force-pushed the feature/install-only-new-modules branch from 551e66b to 9671e0d Compare June 6, 2019 18:59
@enricostano enricostano removed the WIP label Jun 6, 2019
@enricostano
Copy link
Contributor Author

@raneq @danypr92 it's not WIP anymore, would you mind to review again and possibly test it? Thanks!

@raneq
Copy link
Collaborator

raneq commented Jun 11, 2019

@enricostano I've tested it and gives me some error. Scroll to the bottom:

TASK [coopdevs.odoo-role : Build the list of new modules to install] **********************************************************************************************************************************************
task path: /home/raneq/coopdevs/odoo/odoo-role/tasks/main.yml:136
 [WARNING]: Using world-readable permissions for temporary files Ansible needs to create when becoming an unprivileged user. This may be insecure. For information on securing this, see
https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user

changed: [odoo-test.local] => {
  "changed": true,
  "cmd":
  "psql odoo -tAc \"SELECT name FROM
    (VALUES ('sale_management'),
    ('account'), ('account_invoicing'), ('account_asset'),
    ('account_analytic_default'), ('account_bank_statement_import'),
    ('account_cancel'), ('analytic'), ('auth_crypt'), ('auth_signup'),
    ('base'), ('base_automation'), ('base_iban'), ('base_import'),
    ('base_setup'), ('base_vat'), ('base_vat_autocomplete'),
    ('contacts'), ('decimal_precision'), ('document'), ('product'),
    ('web'), ('web_diagram'), ('web_kanban_gauge'), ('web_planner'),
    ('web_settings_dashboard'), ('l10n_be'), ('account_banking_mandate'),
    ('account_banking_pain_base'), ('account_banking_sepa_credit_transfer'),
    ('account_banking_sepa_direct_debit'), ('account_due_list'),
    ('account_financial_report'), ('account_payment_order'),
    ('account_payment_partner'), ('base_bank_from_iban'),
    ('base_technical_features'), ('contract'), ('contract_sale_invoicing'),
    ('contract_variable_quantity'), ('web_favicon'), ('web_no_bubble'),
    ('web_responsive'), ('web_searchbar_full_width'), ('mis_builder_budget'))
  AS t (name) EXCEPT SELECT name
  FROM ir_module_module
  WHERE state = 'installed';\"",
"delta": "0:00:00.051544", "end": "2019-06-11 13:39:29.750333",
"rc": 0, "start": "2019-06-11 13:39:29.698789",
"stderr": "", "stderr_lines": [],
"stdout": "mis_builder_budget\nweb_favicon",
"stdout_lines": ["mis_builder_budget", "web_favicon"]}

TASK [coopdevs.odoo-role : Install only new Odoo modules] *********************************************************************************************************************************************************
task path: /home/raneq/coopdevs/odoo/odoo-role/tasks/main.yml:152
 [WARNING]: Using world-readable permissions for temporary files Ansible needs to create when becoming an unprivileged user. This may be insecure. For information on securing this, see
https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user

NOTIFIED HANDLER coopdevs.odoo-role : restart odoo for odoo-test.local
changed: [odoo-test.local] => {
  "changed": true,
  "cmd": [
    "/opt/.odoo_venv/bin/python",
    "/opt/odoo/odoo-bin",
    "-c", "/etc/odoo/odoo.conf",
    "-d", "odoo",
    "--init", "mis_builder_budget,web_favicon",
    "--stop-after-init", "--without-demo=all",
    "--logfile=/dev/stdout", "--log-level=warn"
  ],
  "delta": "0:00:03.337316", "end": "2019-06-11 13:39:33.545689",
  "rc": 0,
  "start": "2019-06-11 13:39:30.208373",
  "stderr":
    "ERROR: couldn't create the logfile directory. Logging to the standard output.\n
    2019-06-11 13:39:31,872 9164 WARNING odoo odoo.modules.loading: ❰❰invalid module names❱❱, ❰❰ignored: web_favicon, mis_builder_budget"❱❱,
  "stderr_lines": [
    "ERROR: couldn't create the logfile directory. Logging to the standard output.",
    "2019-06-11 13:39:31,872 9164 WARNING odoo odoo.modules.loading: ❰❰invalid module names❱❱, ❰❰ignored: web_favicon, mis_builder_budget"❱❱
  ],
"stdout": "", "stdout_lines": []}

@raneq
Copy link
Collaborator

raneq commented Jun 11, 2019

My local odoo now is broken, but I may have broken it by cancelling a provisioning. I'll try later with a new instance.

@raneq
Copy link
Collaborator

raneq commented Jun 11, 2019

Hi, fresh instance here. It works!

The provisioning installed well and I check that the issue with names was due to my inventory, so that files/requirements.txt was missing modules from the variables, implying that I tried to make odoo "install" things that I hadn't put there for it in the first place. Thus the "2019-06-11 13:39:31,872 9164 WARNING odoo odoo.modules.loading: invalid module names, ignored: web_favicon, mis_builder_budget"

When, after installing, I added one module to both requirements and module list, ansible/odoo installed it and only that, so it was fast.

Green light for me! If @danypr92 doesn't have any comment, I propose to merge this :)

@raneq raneq self-requested a review June 11, 2019 19:45
Copy link
Collaborator

@raneq raneq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good for me!
I'm happy that as a side effect of solving the problem of module initialization, we cut down again the provisioning time

@raneq raneq merged commit 8c84378 into master Jun 12, 2019
@raneq raneq deleted the feature/install-only-new-modules branch June 12, 2019 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants