Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
1048 Vistas

Hi,


I've just started using odoo.sh, using version 18. I've created three branches / environments and I think, from the documentation, it should be possible to somehow change the configuration via a commit on a branch? This would at least be very interesting as we can then track changes and rollback stuff as well as keeping environments in sync.


Is there any help/docs/tutorial/pointers where to begin? I logged in to the online shell and hoped that the click-ops configuration was stored in a file somewhere but it seems it's not?


Any guidance is appreciated!


kind regards

Avatar
Descartar
Mejor respuesta

If you are asking how to "code" the changes it is possible to make interactively via the Settings --> Configuration Menus, something like this is probably what you want:

settings = {}

# general settings - companies - document layout
settings.update({"external_report_layout_id": env.ref('web.external_layout_boxed').id})

# accounting settings - taxes - default taxes
settings.update({"sale_tax_id": False,"purchase_tax_id": False})

# accounting settings - analytics - analytic accounting
settings.update({"group_analytic_accounting": True})

# apply changes
self.env['res.config.settings'].create(settings).execute()


Each App has a series of fields on the res.config.settings model that enable features and store configuration options, for the Accounting App you can see many of them here:

https://github.com/odoo/odoo/blob/18.0/addons/account/models/res_config_settings.py


You can also update records:

company = env.ref('base.main_company')
company.update({'name': 'ACME USA Inc.', 'street': '100 Main Street',
'city': 'Springfield', 'state_id': self.env.ref('base.state_us_5').id,
                'zip': '90123'})


Activate currencies:

self.env.ref('base.AUD').update({'active': True,'symbol': '$AUD'})


Install Apps:

for app in ['stock','contacts','helpdesk','sale_purchase','sale_management','crm','web_studio']:
    self.env['ir.module.module'].search([('name','=',app)],limit=1).button_immediate_install()


Change which view is the default for a Window Action (we don't want the Kanban view by default when looking at Contacts)

self.env['ir.actions.act_window.view'].search([('view_id','=',self.env.ref('base.res_partner_kanban_view').id)]).update({'sequence':5})


Avatar
Descartar
Mejor respuesta

Hi,

Please refer the following documentation:

https://www.odoo.com/documentation/18.0/administration/odoo_sh.html


Hope it helps

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
ago 25
124
1
ago 25
742
0
ago 25
86
1
ago 25
1066
2
ago 25
502