netsvc.Service.exists( name )

Asked by Asgardinho

Hi,
I installed the latest trunk, and I have a custom module that have this line:

netsvc.Service.exists( name )

this line gives this error
'module' object has no attribute 'Service'

How can I change this line so it can work again?

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Vo Minh Thu
Solved:
Last query:
Last reply:
Revision history for this message
Vo Minh Thu (thu) said :
#1

It depends on what you are trying to achieve (i.e. if it is for a report, workflows, or something else).

Can you be more specific about what your module is doing ?

Revision history for this message
Asgardinho (felipereyesazul) said :
#2

it's for reporting, this module is aeroo_reports.

Revision history for this message
Best Vo Minh Thu (thu) said :
#3

The netsvc.Service._services dictionnary (at least for reports) is openerp.report.interface.report_int._reports.

But really you should not directly access that dictionnary, nor use it in the future: reports should be registered in the database (like ir.actions.report.xml) and rendering them should make a lookup in the database. (That is, the report instances inside that dictionnary shoul be created on-the-fly, when a new rendering is needed).

More generaly the Service concept was unneccessay. If you have an addons, say `addons_a` and it is a dependency of `addons_b`, you can access it with openerp.addons.addons_a. Or if the service was provided by the framework, you can acces it somewhere inside the openerp library.

Revision history for this message
Asgardinho (felipereyesazul) said :
#4

I guess it was not that simple.
thanks I will take that into consideration.

Revision history for this message
Asgardinho (felipereyesazul) said :
#5

Thanks Thu (OpenERP), that solved my question.