Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
1417 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Autor

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.

Autor

What is an trial database?

Related Posts Odpovědi Zobrazení Aktivita
2
říj 23
1637
3
led 20
9759
3
čvc 25
2764
1
říj 24
982
1
říj 24
1973