Skip to Content
Menu
This question has been flagged
1 Reply
7707 Views

Hi, everyone is there anyway to get values from configuration settings without using the set and get parameters method? because in my multi company case value is displayed in settings but i'm unable to get that like this:

self.env['ir.config_parameter'].sudo().get_param('real_estate.account_journal_id')

how can i do that?
Avatar
Discard
Best Answer

Hi Hamza !

maybe you can use "dot notation" for example company.fieldname

class ResConfigSettings:
_inherit_ = 'res.config.setting'


@api.model
def get_values(self):
res = super(ResConfigSettings, self).get_values()
res['field'] = self.env['ir.config_parameter'].sudo().get_param('company.fieldname')
return res

def set_values(self):
self.env['ir.config_parameter'].sudo().set_param('company.fieldname', self.field)

super(ResConfigSettings, self).set_values()





Avatar
Discard
Related Posts Replies Views Activity
1
May 21
5029
0
Mar 21
2731
2
Mar 21
12978
4
Nov 23
8660
1
Jul 25
2680