Odoo Help

0

1
2 Answers
2
Sugeesh Ps
15-05-19 02:05

To save the data in res.config.settings you have to use get_values/set_values methods,

field_name = fields.Selection([

        ('field1', 'FIELD1  '),

        ('field2', 'FIELD2')],requaired=True, default='field1')


@api.multi

def set_values(self):

        super(ResConfigSettings, self).set_values()

        select_type = self.env['ir.config_parameter'].sudo()

        select_type.set_param('module_name.type_scheduling', self.type_scheduling)


    @api.model

    def get_values(self):

        res = super(ResConfigSettings, self).get_values()

        select_type = self.env['ir.config_parameter'].sudo()

        sell = select_type.get_param('module_name.field_name')

        res.update({ 'field_name' : sell})

1
Avatar

Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
22738
| 8 9 10
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 

LinkedIn

Blog

Stackoverflow

ERP Harbor Consulting Services

Skype:sudhir@erpharbor.com
Website: http://www.erpharbor.com
Sudhir Arya (ERP Harbor Consulting Services)
14-05-19 22:48

res.config.setting is actually a TransientModel (wizard) which does not store the data for long time. Normally this object set / get the value to or from Company / ir.config.parameter

If you want to set these values, check where these fields are getting the value (company or ir.config.parameter) and then create your data xml accordingly.

Stel een vraag
Writer
Keep Informed
1 volger(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now