Still Unable to Deploy SAO (webui) in Dev

Hi,

I like to continue my problem in this new topic. so to start over.. I basically follow every step in this creating module tutorial → here

Up to the point of Display Records (no 5).. and according to the tutorial, I would be able to see the UI of my module (opportunity) in the dashboard..

But I didn’t able to see, since the SAO is not installed by default.. so me and Cedric has a discussion in here but until today I still failed in deploying sao into my development environment. Even though I already follows the readme.md of sao repo → here

My latest progress in sao is: I managed to build the project successfully with tips from Cedric.. which is: npx grunt --gruntfile Gruntfile.js --force from vscode console inside sao folder inside the tryton project at my development environment.

next step should be: how my trytond server able to serve that nodejs app rite?

I need this badly, and if someone has done this before (I believe there are).. can you please share the link?

regards
Bromo

If you already have SAO installed, you only need to setup the [web] section in your config file: Configuration file for Tryton — Tryton server then launching Tryton with trytond -c trytond.conf should be enough to use the web client.
You may also find this helpful: Install Sao in a production environment there is some parts you may don’t want as you are in a dev environment but it does explain almost everything.

1 Like

Hi @Xavi

Thank you very very much for your guide, now I am able to see the module I developed in your tutorial from the dashboard. :sweat_smile:

Now I got some problem again:

  1. Currently My custom module would require integration with other module, such as company and project management, and others later on.. the problem now.. I cannot see those modules listed in my development dashboard (see below screenshot)

  1. while from the directory pov, I can see those modules are exists. (see below screenshot)

My 1st question: how can I activate those modules in my dev environment?

Any links would be greatly appreciated

Regards
Bromo

Normally, if the module files/folders are there, they should be available in the web UI in the module list. Can you confirm that the folder you are showing in your screenshot is indeed the folder where trytond is looking for modules?

1 Like

Im not really sure but I think you are missing to execute .hooks/link_modules.
The module list should be available in trytond/trytond/modules.

1 Like

Hi @Xavi

I did try to execute from tryton folder as below:

link_mods_1

Then I try to run the web again.. by command below:

link_mods_2

But when I open the dashboard there still no mods but the one I develop

So I try to execute the link_modules from within .hook folder but came error like below..

I checked if the destination folders… and there are modules folder!!.. but the command says error..

@Xavi any advice?

Thank you in advance

Regards
Bromo

If you followed the tutorial, it means that you have setup a virtualenv in which you have installed your custom module in editable mode.
So you will have only the depending modules also installed. If you want more module you must install them in the virtualenv.

Hi @ced

I execute the ./link_modules command as @Xavi advice from virtual env .. as u can see from my screenshot, there is a prefix (.vemv) before the command.

Or is there any other way?

Please advice, or provides a link..

Thank you in advance

Regards

Bromo

Try installing the modules you need the same way you did with your custom module but without the editable mode (pip install…).
See: How to install Tryton — Tryton server

1 Like

After you have installed new modules, you have to update the database in order to let Tryton know that there are new modules. You can do this with trytond-admin -c <your trytond conf> -d <your database name> -m -vv. The last -vv is not really needed but it gives you more information about the process.

1 Like

Hi @Xavi

So I execute below commands based on installation ref here

$ trytond-admin -c trytond.conf -d tryton --update-modules-list
$ trytond-admin -c trytond.conf -d tryton -u company --activate-dependencies

but I got error after the 2nd command like below.

Traceback (most recent call last):
  File "/moddev/.venv/bin/trytond-admin", line 33, in <module>
    admin.run(options)
  File "/moddev/.venv/lib/python3.10/site-packages/trytond/admin.py", line 59, in run
    pool.init(update=options.update, lang=list(lang),
  File "/moddev/.venv/lib/python3.10/site-packages/trytond/pool.py", line 144, in init
    restart = not load_modules(
  File "/moddev/.venv/lib/python3.10/site-packages/trytond/modules/__init__.py", line 402, in load_modules
    _load_modules(update)
  File "/moddev/.venv/lib/python3.10/site-packages/trytond/modules/__init__.py", line 366, in _load_modules
    graph = create_graph(modules)
  File "/moddev/.venv/lib/python3.10/site-packages/trytond/modules/__init__.py", line 95, in create_graph
    info = get_module_info(module)
  File "/moddev/.venv/lib/python3.10/site-packages/trytond/modules/__init__.py", line 34, in get_module_info
    with tools.file_open(os.path.join(name, 'tryton.cfg')) as fp:
  File "/moddev/.venv/lib/python3.10/site-packages/trytond/tools/misc.py", line 50, in file_open
    return io.open(path, mode, encoding=encoding)
FileNotFoundError: [Errno 2] No such file or directory: '/moddev/.venv/lib/python3.10/site-packages/trytond/modules/company/tryton.cfg'
(.venv) root@DESKTOP-PRHGPAU:/moddev#

So I checked the folder modules under
/moddev/.venv/lib/python3.10/site-packages/trytond/modules/

And there are only few modules there:

modlist_01

So there are only 2 mods there… should I copy those modules from folder
/root/.cookiecutters/tryton/modules/ to be under site-packages/trytond/modules ?

and re-execute the above command?

Regards
Bromo

As I said in Still Unable to Deploy SAO (webui) in Dev - #8 by ced, you must install them in the virtualenv (see Install packages in a virtual environment using pip and venv - Python Packaging User Guide).

1 Like

Hi @ced

Thank you, all works fine now.. :sweat_smile:

Really really appreciate you guys @Xavi @ced and others who helped me

Best regards
Bromo