Ang3 / php-odoo-api-client

PHP client of Odoo External API client v12.0+
MIT License
37 stars 22 forks source link

[8.x] Expected updates and features #24

Open Ang3 opened 2 years ago

Ang3 commented 2 years ago
jsayer101 commented 2 years ago

Hi, I don't know if you started to develop the implementation of JSONRPC, but I do have an implmentation of JSONRPC that works well on my fork. I'm going to open a PR. That's just a test but we can work from this if you want to.

I did some tests and it seems that JSONRPC is really faster than XMLRPC.

PR : #25

Ang3 commented 2 years ago

Hi, thank you very much for your share mate, but I already did it (branch 8.x ). πŸ˜„ There is many subtil things about arguments into JSON-RPC. I tried all methods on local. Like you, I just need to handle exceptions, so I have to make some functionnal local tests to know how Odoo replies in case of failure.

For performance, no doubt about. I already think about requests multiplexing to perform bulk operations (just an idea atm). ☺️

Ang3 commented 2 years ago

Following PR #25 and branch 8.x - We have to decide: symfony/http-client package (curl or PHP native) dependency or PHP native support for requests. πŸ˜•

jsayer101 commented 2 years ago

@Ang3 Cool ! Hope we can get JSONRPC fast. I think we can use a package that is actively maintained but maybe not using curl ? So you don't have to activate any other php extensions ?

In some companies they have active restrictions on which extensions they can activate or not.. etc. This was the main reason I can think of for using native streams.

The real question is Are there any real advantages to use curl and not native streams ? In the other hand, "many" web hosting companies desactivate "allow_url_fopen = 0" so file_get_content fails but curl is activated.

jsayer101 commented 2 years ago

Btw I think i'm going to close my PR so you can work on your side freely. You worked too fast for me lol. Just a junior dev trying to work on opensource projects that I use in my company 😒

Ang3 commented 2 years ago

Same here with my company ☺️ I copied your code for PHP native stream (I didn't know well) and marked you as co-author πŸ˜‰

Ang3 commented 2 years ago

The real question is Are there any real advantages to use curl and not native streams ? In the other hand, "many" web hosting companies desactivate "allow_url_fopen = 0" so file_get_content fails but curl is activated.

Atm, I implemented a transport layer to be able to choose how to send data. By default, I think PHP stream must be the first (basic) choice because curl needs the extension php-curl. But later we could add a system to prefer curl if the extension is enabled.

jsayer101 commented 2 years ago

Hi, I think this could be a great idea to add a new feature that helps to download reports from Odoo

It is already implemented in OdooRPC for example https://pythonhosted.org/OdooRPC/ref_report.html

(Actually we're trying to download a report from a stock.picking and send back to the user with HTTP attachment)

Ang3 commented 12 months ago

Hi,

Indeed, there are many things to do with Odoo. The aim of this repository is to provide a client for Odoo, basically. The DBAL features should be detached into another repository, like ORM or "actions" features like you described. I named that "actions" because I know we can call public methods from python objects like API controller actions (generating invoices for example). I will try to find how to organize that better, probably with the version 8. :-)