Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
1406 Weergaven

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.


 

 

Avatar
Annuleer
Beste antwoord

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)

Avatar
Annuleer
Auteur

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.

Auteur

What is an trial database?

Gerelateerde posts Antwoorden Weergaven Activiteit
2
okt. 23
1635
3
jan. 20
9751
3
jul. 25
2760
1
okt. 24
976
1
okt. 24
1970