PHP code example of edujugon / laradoo
1. Go to this page and download the library: Download edujugon/laradoo library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
edujugon / laradoo example snippets
'providers' => array(
...
Edujugon\Laradoo\Providers\OdooServiceProvider::class
)
'aliases' => array(
...
'Odoo' => Edujugon\Laradoo\Facades\Odoo::class,
)
php artisan vendor:publish --provider="Edujugon\Laradoo\Providers\OdooServiceProvider" --tag="config"
$odoo = new \Edujugon\Laradoo\Odoo();
$version = $odoo->version();
$odoo = $odoo->connect();
$this->odoo = $this->odoo
->username('my-user-name')
->password('my-password')
->db('my-db')
->host('https://my-host.com')
->connect();
$userId= $this->odoo->getUid();
$can = $odoo->can('read', 'res.partner');
$ids = $odoo->where('customer', '=', true)
->search('res.partner');
$ids = $odoo->where('is_company', true)
->where('customer', '=', true)
->limit(3)
->search('res.partner');
$models = $odoo->where('customer', true)
->limit(3)
->get('res.partner');
$models = $odoo->where('customer', true)
->limit(3)
->fields('name')
->get('res.partner');
$structure = $odoo->fieldsOf('res.partner');
$id = $odoo->create('res.partner',['name' => 'Jonh Odoo']);
$result = $odoo->where('name', 'Jonh Odoo')
->delete('res.partner');
$result = $odoo->deleteById('res.partner',$ids);
$updated = $odoo->where('name', 'John Odoo')
->update('res.partner',['name' => 'John Odoo Odoo','email' => '[email protected] ']);
$odoo->call('res.partner', 'search',[
[
['is_company', '=', true],
['customer', '=', true]
]
],[
'offset'=>1,
'limit'=>5
]);