콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
1454 화면

hai, everyone

So right here I want to try calling data from the custom module that I have created but here there is an error that the module does not exist even though the access right has been added. Is there anything that needs to be added other than 'access right' so that I can read the data, please help.


 

 

아바타
취소
베스트 답변

Hi Arif

It seems like you are trying to get a data from XMLRPC call API

Can you at least try with this kind of format example :
employee_id = models.execute_kw(db_odoo, uid_odoo, password_odoo, 'hr.employee', 'search', [[['id', '=', 1]]])
print(employee_id)

The example above will get employee record which has the ID of 1 from hr.employee model, and it will be assigned into employee_id variable. From there you can access any other record using OOP for example like employee_id.name, employee_id.phone, etc.

make sure to replace "hr.employee" with the custom module name which is defined in "_name" of your bsd_payroll custom folder. You can try to use search instead of search_read. Also, try to put the x_studio_no_pegawai into the 'id' just like the example above.

Best regards,

Altela Pramardhika (altelasoftware.com)

아바타
취소
작성자

this in the module name:
class bsdPayroll(models.Model):
_name = 'bsd_payroll.bsd_payroll'
_description = 'BSD Payroll'

still can't, still error like this
xmlrpc.client.Fault: <Fault 2: "Object 'bsd_payroll.bsd_payroll' does not exist">

the _name of the module seems rare to see, most module name declaration use dot instead of underscore. im not sure if its the main problem but you might try to test changing the _name of the module to become "bsd.payroll" (please do this in trial database only) and see if it works. have you tried to test by accessing other module as well?

heads up : if changing the module name to "bsd.payroll" works, please dont do anything to the live database yet, because changing the module name will also erase the record so you have to be careful on that.

작성자

What is an trial database?

관련 게시물 답글 화면 활동
2
10월 23
1713
3
1월 20
9769
3
7월 25
2827
1
10월 24
1034
1
10월 24
2057