Hi Mersed,
Usually you do this in Odoo within a configuration menu. This configuration menu is connected to a transient model. The data itself is then saved on the company level, meaning you have one configuration per company (per database).
You can find a good and detailed example in Odoo 12 under the "sales" module at https://github.com/odoo/odoo/blob/12.0/addons/sale/models/res_config_settings.py
In short you have a custom model for your settings like this:
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
sale_note = fields.Text(related='company_id.sale_note', string="Terms & Conditions", readonly=False)
You inherit the res.company model to store your custom settings on it:
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
class ResCompany(models.Model):
_inherit = "res.company"
sale_note = fields.Text(string='Default Terms and Conditions', translate=True)
You create a view to add your own custom settings:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.your_module</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="10"/>
<field name="inherit_id" ref="base.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[hasclass('settings')]" position="inside">
<div class="app_settings_block o_not_app" data-string="Your config" string="YourConfig" data-key="your_key">
<h2>Your custom config here</h2>
</div>
</xpath>
</field>
</record>
Regards,
Yenthe