Activate all modules at once?

When installing a greater number of Trytons with a greater number of modules, it’s a little time-consuming to double-click every single module in every single instance. So I’d like

  • either batch prepare all modules for activation in the GUI, or better
  • activate all modules from the command line with a trytond-admin command

I found this thread, but it seems not to apply to my question; a

trytond-admin -c trytond.conf -d mydatabase --activate-dependencies --all

seems not to work.

Cheers,
Wolf

When you do

trytond-admin --help

you will get a list of possible options to be used with the command. In that list you will discover that --all updates all activated modules so this won’t work for you. The --activate-dependencies must be used when installing a module with the -u and that module depends on other modules not installed already. For example when you have an empty database and want to install the sale module you have to use the --activate-dependencies because otherwise the install will fail because of missing dependencies.

<SHIFT> or <CTRL> select the different modules you want to install, click on the propeller and select Mark for activation.

You can use the -u option with a list of modules. For example

trytond-admin -c trytond.conf -d mydatabase --activate-dependencies -u stock_lot sale sale_opportunity

The list can also be generated if you want.

Hi @edbo, could you please elaborate on why I might want to generate the module list and what would generate it?

Thank you for your - as always - profound statement.

But did I get it right: Apart from generating a list of deactivated modules there is no possibility to batch activate modules with a simple command or simple action in the GUI ? -

Manually selecting each of 30 modules is not an option for professional work.

You can create a script that walks through your modules directory or takes the modules from the database.

You can <SHIFT> or <CTRL> select the different modules you want to install, then click on the propeller and select Mark for activation. This will mark the selected modules to be installed / upgraded. After that you can use the propeller again to execute the actual install / upgrade of the modules.

Using the mentioned method, it’s about 6 clicks and 1 press.

  1. Click the first module to be installed
  2. Press <SHIFT>
  3. Click the last module to be installed
  4. Click propeller to mark them to be installed
  5. Click Mark for activation
  6. Click propeller again
  7. Click Perform pending activation / upgrade

I think a pretty good performance improvement :laughing:

1 Like

Indeed, and thank you very much.
But AFAICS, this works in GTK client only. Luckily I noticed that right before falling into final despair and scream around and destroy my furniture. (;

Nevertheless, a “activate-at-trytond-admin-command” feature would be nice.

<SHIFT>+Click to extend selection works on the web client.
But also there is the select all checkbox for the web client and <CTRL>+a for desktop client.
But to be able to launch button actions, all the records must have been loaded (and not lazy loaded).

If Tryton was closed source, how much would you pay for adding this feature? There is always the question: “Is it worth the effort?”. Personally I don’t think so because it kind of already exists:

trytond-admin -c trytond.conf -d mydatabase --activate-dependencies -u <your-list-of-modules>

The only thing you have to do is to create your list of modules. Put the command in a script together with some logic to build a list of modules and you are good to go.

Below an example to fetch the list of standard modules of Tryton, pip install them and after that, update that database.

#!/bin/bash

modules="https://downloads-cdn.tryton.org/7.0/modules.txt"
mods=""
for i in $(curl -sS $modules); do
    pip install --upgrade trytond-$i==7.0.*
    mods=$mods" $i"
done

trytond-admin -c trytond.conf -d mydatabase -m
trytond-admin -c trytond.conf -d mydatabase --activate-dependencies -u $mods

You can of course disable the pip install, but you get the idea.

1 Like

Maybe a Proteus script is a better tool for this job:
https://docs.tryton.org/projects/client-library/en/latest/#activating-a-module

Thank you for this clarification. But it works only with clicking the list items, not with the checkboxes.

I would pay 20€. And maybe some other fellows as well. But maybe not. I dont know.

Generally speaking: I think it’s a major shortcoming in FOSS, that there are not mechanisms to collect money and fund developers - and this way find out which features really are important. Not being a strong market believer, nevertheless willingness to pay may a good indicator for importance.

2 posts were merged into an existing topic: Sponsoring features

On the checkboxes you just need to click, without the control.
The checkboxes act like normal web checkboxes.
When the checkbox is checked, then the line is selected.

If you click on the line (not the checkbox), then you need to Control+Click