跳至内容
菜单
此问题已终结

I've custom module with

"depends": ["sale_management", "mrp"],

 i want to make like when my custom module install it will automatically enable "Multi-Step Routes" in settings, how to configure such a setting by python code.

形象
丢弃
最佳答案

You can inherit res.config.settings model and create all the configurations you want.

Example: 

class ResConfigSettings(models.TransientModel):

    _inherit = ["res.config.settings"]


    max_product_registries = fields.Integer(

        string="Max Product Registries",

        default=5000,

        help="Maximum number of product registries to be updated at once.",

        config_parameter="your_module.max_product_registries",

    )

    product_manufacturer_update = fields.Boolean(

        string="Auto-Update Product Manufacturer",

        default=True,

        help="Choose if the products need to be updated with the manufacturer information automatically with the cron action.",

        config_parameter="your_module.product_manufacturer_update",

    )

形象
丢弃
编写者

i want to enable "Multi-Step Routes" which was already define in stock module

相关帖文 回复 查看 活动
0
2月 25
386
1
4月 25
222
0
4月 25
123
1
3月 25
475
2
3月 25
506