跳至內容
選單
此問題已被標幟
2 回覆
1075 瀏覽次數

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

頭像
捨棄
最佳答案

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})


頭像
捨棄
最佳答案

Hi,

Please refer the following documentation:

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


Hope it helps

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
8月 25
2
2
8月 25
327
0
8月 25
4
0
8月 25
7
0
8月 25
5