edujugon / laradoo Goto Github PK
View Code? Open in Web Editor NEWOdoo ERP API for Laravel
License: MIT License
Odoo ERP API for Laravel
License: MIT License
How can we use the package to connect to odoo.sh ?
This work on php 7.2??
Odoo versión: 8
In this case sendme an error in line 485 from edujugon/laradoo/src/ripcord/ripcord_client.php
$this->responseHeaders = $http_response_header;
Thanks.
Greetings, I am trying to insert in the res.partner model, but I need to add a many2many element, how can I do it?
Hello, I wanted to make a custom method call at a certain module, and pass an object of another model as this method accepts an object. I tried to send in form of array, json, but no matter what parameter is passed, It throws the error that the parameter is required. so there are two questions here.
How can we update workflow like Validate Invoice ?
Hello,
I'm trying to create a new res_partner resource on Odoo Cloud with Laradoo.
Unfortunately, when I call the create method, I get the following error.
$person = $odoo->create('res.partner',[
'parent_id' => $request->customer_id,
'name' => $request->name,
'email' => $request->email,
'is_company' => false
]);
Response
Ripcord_TransportException: Could not access https://host.odoo.com/xmlrpc/object in file /path/to/laravel-app/vendor/edujugon/laradoo/src/ripcord/ripcord_client.php on line 488
I don't have any issue retrieving data from Odoo Cloud though.
My packages :
Do you have any idea what could cause this issue ?
Thank you
laradoo.php
return [
'api-suffix' => 'xmlrpc/2',
'host' => 'example.com',
'db' => 'db',
'username' => 'username',
'password' => 'password',
];
When is use above config file it is giving Undefined variable: http_response_header
error.
I was able to find a solution for it by changing host to https://example.com
from example.com
.
Updated laradoo.php
return [
'api-suffix' => 'xmlrpc/2',
'host' => 'https://example.com',
'db' => 'db',
'username' => 'username',
'password' => 'password',
];
Hi good job.
I'm making a connector with Laravel 6 to take products from odoo, but in some case the server is down, how can make with Laravel request send a ping to odoo server and validate is online??
dose it support laravel 9
Hi Eduardo,
wouldn't it make more sense to write connect() as a static function ?
That way, when creating a class, one could write something in the likes of:
class OdooConnection
{
private Odoo $odoo;
public function __construct() {
try {
$this->odoo = Odoo::connect();
...
is there anyway where we can download a file?
The error connection say this:
ErrorException in Odoo.php line 650:
Argument 1 passed to Edujugon\Laradoo\Odoo::setApiEndPoint() must be an instance of Edujugon\Laradoo\string, string given, called in Z:\PortableApps\xampp\htdocs\sitios\instrutek\erp\vendor\edujugon\laradoo\src\Odoo.php on line 318 and defined
I am having the subject issue with PHP version 7.1, Please Let me Know How to proceed as I have the following in laradoo.php configuration file
'xmlrpc', // 'xmlrpc' from version 7.0 and earlier, 'xmlrpc/2' from version 8.0 and above. //Credentials 'host' => 'http://myhost.com:8029', 'db' => 'dbname', 'username' => 'username', 'password' => 'password', ]; It is working fine on my local computer but when I deploy application on server this issue arises.After connection, I want to authenticate users from res.users model. I have tried this but not had any success.
`$odoo = new \Edujugon\Laradoo\Odoo();
$odoo = $odoo->connect();
$password = "12345";
$iterations = 1000;
// Generate a random IV using openssl_random_pseudo_bytes()
// random_bytes() or another suitable source of randomness
$salt = openssl_random_pseudo_bytes(16);
$hash = hash_pbkdf2("sha512", $password, $salt, $iterations, 20);
$models = $odoo->where('login', '[email protected]')->where('password', $hash)->fields('name','login','password')->get('res.users');`
Hi @Edujugon ,
Is it possible to switch companies in the get request to Odoo via the package?, e.g. If there are multiple companies in the Odoo instance, but we only wanted to get/put/delete data from company id 4? Is this viable?
Andy
I just tried to use where() with operator of like but the problem it is a case senstive it should not be.
and there's no support for RAW sql.
I want to ask how to insert/create master detail on odoo model with larado library, for example
i want to insert stock.picking as header and stock.move as detail at once.
fyi, i try to insert once by once and it succesfully,
first i create / insert data stock.picking after i got picking_id, i insert ht stock.move.line model.
now how to create / insert both of models relation at once...
thanks
Hi my friend Eduardo Marcos. I am writing to say hello and ask you again if you could update this vendor to be compatible with laravel 8 please. Brotherly hug.
Hi,
Thanks for this great project. It helps me tremendously.
I have, however, an issue: I am connecting my multi-language site to Odoo.
Would anyone by any chance know how to call upon translated information in Odoo?
Thanks
I try to load lots of related records from a one2many relation but there is no plain read method defined.
Can we add a method to load records by id like it is done within the search method?
Furthermore all the methods like makeResponse, resetParams and buildParams are Private so there is no chance to inherit your Odoo class and extend it with custom Methods.
Hi,
Can your create a new TAG from master?
Because PHP 8.0 is not in the TAG 3.1.0
Error upgrading from Laravel 6 to 7.
Problem 1
- Conclusion: remove edujugon/laradoo 2.1.0
- Conclusion: don't install edujugon/laradoo 2.1.0
First, thank you for this great library, it's well documented and easy to use.
Only thing that I can't figure out is how to properly create many2many or one2many relationship on a model.
An example:
I have a custom model named Item, that is already populated with items.
Then i create another model named Order, that has these attributes: ['customer_id', 'order_type', 'item_ids'].
request would be like this:
->create('custom_db.order', [ 'customer_id' => 'name', 'order_type' => 0, 'item_ids' => [1, 2, 3]]
Order gets stored in Odoo with correct customer data and order type, but 'item_ids' is empty every time. I've also tried following the Odoo documentation (https://www.odoo.com/documentation/11.0/reference/orm.html#odoo.models.Model.write )
with these examples, but no luck:
"item_ids" => [4, [1, 2, 3], 0] or "item_ids" => [0, 0, [1, 2, 3]]
thank you for your help.
Hi @Edujugon, first, thanks for your package which is giving me great help for Odoo API requests !
I was wondering if there was a way to execute a a statement like that with the Odoo API :
(new Odoo)->connect()
->where('tag_ids', [1])
->orWhere('tags_ids, [2])
->get('crm.leads');
In fact, if we put several tag ids in one and only ->where()
statement, it behaves like a where and where
and not where or where
.
I imagine this is possible but I couldn't manage to find the information.
Thanks by advance for your reply !
can u upgrade this version to laravel 9
The config values are not loaded after a config:cache
command.
The values are read the wrong way here : https://github.com/Edujugon/laradoo/blob/master/src/Odoo.php#L723.
They should be read this way, in order to get the cached values when the command above is executed : config('laradoo.db')
.
I can't ignore error pages using "try catch"
I use this code
try { $order_line = $this->odoo->create('sale.order.line', $fields); } catch (Exception $e) { return redirect()->route('createOrder')->with('errorInfo',$e->getMessage())->withInput(); }
redirect errorpage:
Edujugon\Laradoo\Exceptions\OdooException Traceback (most recent call last): File "/home/odoo/src/odoo/odoo/addons/base/controllers/rpc.py", line 84, in xmlrpc_1 response = self._xmlrpc(service) File "/home/odoo/src/odoo/odoo/addons/base/controllers/rpc.py", line 73 ...
How can i do?
Could you please provide a simple example in the readme of the usage for dealing with Odoo's one2many, many2many and selection fields? Particularly how one would use them with create() and update(). In Python, it seems as if these are dealt with using special tuple commands however for PHP documentation seems very hard to find for these types of things and it would be extremely helpful.
For illustrative purposes in my particular project, I haven't been able to figure out how to relate a CRM lead tag to a lead during the creation process using Laradoo:
$id = $odoo->create('crm.lead', [
'type' => 'lead',
'priority' => 0, <-- what do we pass here for this selection field?
'name' => 'Example',
'contact_name' => 'John Doe',
'phone' => '555-555-5555',
'email_from' => '[email protected]',
'description' => 'Just some text.',
'tag_ids' => [1], <-- What do we pass here for this one2many field?
]);
In the example above when trying to set the priority selection field to an int other than 0 fails and when trying to pass an array of tag_ids (1 is valid tag id in my project) the lead remains untagged.
I can successfully create a product like this:
$odooProductId = $odoo->create('product.product', [ 'id' => $xProduct->id, 'name' => $xProduct->title, 'price' => $ifPrice, ] );
Any ideas on how to add product variants?
Hi good day. When will you have support for php 8?
Hi, first and mostly, awesome package!
I have a question. Is there a way that i can switch between diferents Odoo databases directly from the controller in Laravel 8?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.