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

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
1636
3
1月 20
9759
3
7月 25
2763
1
10月 24
982
1
10月 24
1972