Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
1998 Представления

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

Related Posts Ответы Просмотры Активность
0
февр. 25
850
1
мая 25
830
1
апр. 25
599
0
апр. 25
579
1
мар. 25
808