Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
7590 มุมมอง

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.

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ย. 22
398
2
ก.ค. 21
10462
1
ก.พ. 21
3657
1
ก.ค. 19
3484
1
ก.ค. 23
1896