Skip to content

Conversation

@moylop260
Copy link
Collaborator

@moylop260 moylop260 commented Jul 29, 2025

Based on the following future change for odoo-19.0:

And inspired by original runbot code to set parameters:

We are checking if this new parameter is needed for the odoo deployed in this image

This change apply only for runbot and local instances generated with t2d

TODO:

  • Fix vxci
  • test dummy MR odoo-out-of-the-box

…0) to use new with-demo parameter

Based on the following future change for odoo-19.0:
 - [[IMP] core: no longer load demo data by default](odoo/odoo#194585)

And inspired by original runbot code to set parameters:
 - https://github.com/odoo/runbot/blob/91834a6b340bb379df06149/runbot/models/build.py#L1164-L1168

We are checking if this new parameter is needed for the odoo deployed in this image
@moylop260 moylop260 self-assigned this Jul 29, 2025
@moylop260 moylop260 merged commit caa9c7a into Vauxoo:main Jul 30, 2025
23 checks passed
@moylop260 moylop260 deleted the main-withdemo-moy branch July 30, 2025 23:22
@luisg123v
Copy link
Contributor

@moylop260 the new option could be added as a config param instead:

  • If the version is older, it shouldn't have any effect
  • If the version is newer, it should be taken
  • If new databases are created inside the container, they will contain data demo by default

@moylop260
Copy link
Collaborator Author

moylop260 commented Jul 31, 2025

@luisg123v

You have a good point!

It could avoid changing the way of creating databases manually if we miss adding the parameter

However, future odoo +19.0 will show warnings if a config parameter is unknown

  • 2025-07-30 20:08:27,586 1904 WARNING ? odoo.tools.config: unknown option 'with_demo' in the config file at /home/odoo/.odoorc, option stored as-is, without parsing

Also, we can not set it directly in the deployv configuration file since the image is used for production

But we could use the same way but adding the parameter in the configuration file:

    configpy = "/home/odoo/instance/odoo/odoo/tools/config.py"
    if os.path.isfile(configpy):
        with open(configpy) as f_configpy:
            for line in f_configpy:
                if "--with-demo" in line:
                    add_configfile_param(os.environ["ODOO_CONF"], "with_demo=True")  # TODO: Dev the method
                    break

But it should be added only one time similar to:

However, it could be a little complex using bash for me

Let's to maturate it in order to develop the best solution to add it to the configuration file as your good proposal

Considering:

  1. Only for t2d (not deployv image)
  2. Only run one time (No each time the entrypoint is called)
  3. Let it be ready when the image is built (not during the container is created)
  4. Using python code

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.

2 participants