Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
7529 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
kvě 21
4949
0
bře 21
2562
2
bře 21
12847
4
lis 23
8527
1
čvc 25
2531