Skip to Content
Menu
This question has been flagged
2 Replies
18177 Views

I'm in a progress of developing dashboard mobile app for iOS and Android. I'm also aware of analytic & report objects such as: - purchase.report - sale.report - account.invoice.report - etc.

Pulling each record to mobile device and aggregates them in the mobile device would be inefficient. How can I perform aggregate functions such as SUM,AVG,MIN,MAX in the server side?

I wanted to avoid modifying views, adding modules, etc to the OpenERP installation; as I would like the mobile app to be as universal as possible without too much modification on the OpenERP base installation.

It would be also nice if I can run SQL statements via XML-RPC web service calls. Can it be done?

Thanks

Avatar
Discard
Best Answer

It is possible to run SQL commands, but I think that requires you to make your own module.

According to this site, you can use Query objects, maybe that is what yo are looking for?

More specific, this part of the above page is talking about aggregation-grouping.

Update Within openERP, all models extend osv.BaseModel. If you want to know more about the possible methods, read through the source code, or check the following site, which has made HTML documentation out of the source code. You have to look under Namespaces -> Namespace List -> openERP -> osv. One of the things defined here is query (what you are looking for I think). Another thing defined here is BaseModel, which has quite some API interfaces defined.

Avatar
Discard
Author

Hi Patrick, thanks for your answer. XML-RPC web services (object proxy) expose OpenERP objects methods via "call" method (or maybe "execute" to be exact). It also expose the "exec_workflow" method, but I couldn't find the "query" method. Any hints about how to access "query" from web services?

Author

Thanks Patrick for the update, will try that.

Best Answer

Hi,

You can directly execute SQL queries with help of creating POSTGRES instance. In another way, you can make new module or can write methods into existing module and call that with help of API.

Email : info@acespritech.com
Skype : acespritech
Blog : acespritechblog.wordpress.com

Avatar
Discard

the question was if it is possible to use some kind of XML-RPC call to execute SQL, without the need to install additional software / module on the openERP server. So the answer to create a new module or write methods for existing modules is not what Yohanes is looking for....

XML-RPC is communicating with which takes and input as a XML-RPC request and process it. In OpenERP, XML-RPC is mainly working on objects and API. It's not allowing to deal with SQL. For that you have to direct deal with postgresql with help of python programming.

Author

Thanks Dharmesh for you response. Yes actually I wanted to avoid adding custom module, but I guess it's not possible this time. Just wondering, how is the grouping in the web/gtk client (tree view) works? Was it done in the client?

How can i call a python function that executes a select query and returns a result, in my openoffice report? I mean the syntax.

Related Posts Replies Views Activity
1
Mar 15
8315
1
Mar 15
4336
1
May 25
691
2
May 25
1264
0
Mar 25
1036