跳至内容
菜单
此问题已终结
1 回复
7427 查看

I was proposed to install a "Saas Server Demo " but that module demands a function from the odoo base module which is "ir_module.py".

get_values_from_terp() function is presented in base module but throws some error like,

AttributeError: module 'odoo.addons.base.models.ir_module' has no attribute 'get_values_from_terp'



Example code snippet:

from odoo.addons.base.models import ir_module as A

 A.get_values_from_terp(terp)


Kindly revive me to discover this issue.


形象
丢弃
最佳答案

I guess there is a confusion here. The function get_values_from_terp() is a static method in the class Module. The class Module is defined in the file odoo/odoo/addons/base/models/ir_module.py, so the correct import statement should be:

from odoo.addons.base.models.ir_module import Module

Module.get_values_from_terp()


I only checked the code in Odoo14, Odoo12 maybe different, you may check it too

形象
丢弃
编写者

You are right. Thanks for the solution.

相关帖文 回复 查看 活动
1
9月 22
398
2
7月 21
10282
1
2月 21
3545
1
7月 19
3387
1
7月 23
1797