Giter Site home page Giter Site logo

laradoo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laradoo's Issues

Product Variants

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?

Laravel 7 compatibility

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

How to Create/insert Master Detail model on odoo with Larado

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

how to create a custom method call with passing object.

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 to pass a parameter to a function using call method.
  • is it possible to pass an object of another entity to the call method as parameter and odoo recognizes that.?

(1/1) ErrorException Undefined variable: http_response_header

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.

Translations

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

one2many, many2many and selection fields examples

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.

Read Records by Id

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.

Ping

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??

Static function

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();
            ...

Many2Many

Greetings, I am trying to insert in the res.partner model, but I need to add a many2many element, how can I do it?

PHP 8 Support

Hi good day. When will you have support for php 8?

Laravel 8 compatibility

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.

Undefined variable: http_response_header

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.

Float number with decimal become 0

Hi, I'm make an module to migrate data between odoo versions
In the currency[res.currency] model the rounding value is:
image

when get the list of currencies get:
image

in the method to get model data is:
image

The problem is 0 instance of 0.010000
image

How do to get full float number??

How to authenticate users from res.users model

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');`

Switch Companies.

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

Error conection

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

Creating a resource - Ripcord_TransportException: could not access https://host.odoo.com/xmlrpc/object

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 :

  • Laravel Framework 7.13.0
  • Laradoo 2.2

Do you have any idea what could cause this issue ?

Thank you

Possibility to execute orWhere statements ?

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 !

about error exception

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?

Method order by

Hello, I would like to suggest the option to add the orderBy method, as well as the where method
:) pleaseee

something like this:

WhatsApp Image 2021-09-06 at 1 50 57 PM

Store many2many or one2many attribute

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.

Undefined variable: http_response_header

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',
];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.