Odoo Help

0

0
5 Answers
3
Avatar

Niyas Raphy

--Niyas Raphy--
15198
| 7 6 11
Calicut, India
--Niyas Raphy--

Odoo Techno Functionalist

Feel free to connect :  niyasraphyk@gmail.com

Twitter:https://twitter.com/niyasraphy
LinkedIn: https://www.linkedin.com/in/niyasraphy/
FB:https://www.facebook.com/niyasraphy123

Happy to help :)

Niyas Raphy
1/20/18, 2:16 AM

Hi,

If you are trying to save something in the settings you can do it like this.

_inherit="base.config.settings"

@api.multi
def set_secret_key_validation(self):
    return self.env['ir.values'].sudo().set_default(
            'base.config.settings', 'abcde', self.field_name)

Then to access the saved value in the settings,


ir_values = request.env['ir.values']
field_value = ir_values.get_default('base.config.settings', 'abcde')

Thanks

0
Mohd Shoaib Sayyed
4/19/19, 6:26 AM

@LaoThai, 

Odoo version 11 onwards have res.config.settings instead of base.config.settings.

Its a Transient Model, meaning data wont be persisted and will be cleaned by a CRON Schedular. The values get saved in ir.config_parameter model, which is a persisted model and saves the data based on key,value pairs

0
LaoThai
9/5/18, 10:56 PM

Hi Niyas, why my odoo dont have "base.config.setting" ?? my version is 11 

1 Comment
tyrion
9/6/18, 5:29 AM

base.config.settings. Notice the 's'

Ask a Question
Writer
Keep Informed
1 follower(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