Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
1399 Lượt xem

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.


 

 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

Refer the blog:

https://www.cybrosys.com/blog/how-to-create-record-rule-in-odoo-16


Hope it helps

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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)

Ảnh đại diện
Huỷ bỏ
Tác giả

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.

Tác giả

What is an trial database?

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 10 23
1635
3
thg 1 20
9744
3
thg 7 25
2758
1
thg 10 24
974
1
thg 10 24
1968