Configuration Odoo-如何创建自定义全局配置文件
我用的是奥多10-e。我来自.net,我想做的是,我需要在Odoo中创建自定义设置配置文件,就像asp.net中的Configuration Odoo-如何创建自定义全局配置文件,configuration,openerp,odoo-10,Configuration,Openerp,Odoo 10,我用的是奥多10-e。我来自.net,我想做的是,我需要在Odoo中创建自定义设置配置文件,就像asp.net中的AppSettings文件一样,在asp.net中设置一些静态键值,以便在project中使用它们。如何创建此类文件,以及如何在python代码或xml文件中访问该文件 创建从res.config.settings继承的类(以便您可以编辑记录): class farmacia\u pedido\u config\u设置(models.TransientModel): _inherit
AppSettings
文件一样,在asp.net中设置一些静态键值,以便在project中使用它们。如何创建此类文件,以及如何在python代码或xml文件中访问该文件
class farmacia\u pedido\u config\u设置(models.TransientModel):
_inherit='res.config.settings'
_名称='farmacia.config.settings'
lista_precios_defecto=fields.manyOne(
“产品价格表”,
string='Lista de precios por defecto')
farmacia配置设置
farmacia.config.settings
法马西亚
ir.actions.act\u窗口
farmacia.config.settings
形式
内联
config=ConfigParser()
您的_文件=os.getenv(“HOME”)+os.path.sep+“您的_文件.conf”
如果os.path.isfile(您的_文件):
config.read(您的_文件)
其他:
升起模型。除了(
“错误”,
“找不到文件”+os.getcwd())
class farmacia\u pedido\u config\u设置(models.TransientModel):
_inherit='res.config.settings'
_名称='farmacia.config.settings'
lista_precios_defecto=fields.manyOne(
“产品价格表”,
string='Lista de precios por defecto')
farmacia配置设置
farmacia.config.settings
法马西亚
ir.actions.act\u窗口
farmacia.config.settings
形式
内联
config=ConfigParser()
您的_文件=os.getenv(“HOME”)+os.path.sep+“您的_文件.conf”
如果os.path.isfile(您的_文件):
config.read(您的_文件)
其他:
升起模型。除了(
“错误”,
“找不到文件”+os.getcwd())
签出此链接:签出此链接: