Coder Social home page Coder Social logo

yii2-odoo's Introduction

Odoo JSON-RPC Client, Query and ActiveRecord for Yii2


This extension provides the Odoo integration for the Yii framework 2.0. It includes Web Service API support and also implements the Query and ActiveRecord pattern.

Documentation is at Read The Docs.

Build Status Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License

Requirements

  • PHP 7.0 or higher

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist panlatent/yii2-odoo "*"

or add

"panlatent/yii2-odoo": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

Add the component to your application.

'components' => [
    'odoo' => [
        'class' => 'panlatent\odoo\Connection',
        'dsn' => 'localhost:8000/jsonrpc',
        'database' => '',
        'username' => '',
        'password' => '',
    ]
]

The extension support Yii2 Debug extension:

Add the panel component to your application.

'modules' => [
    'debug' => [
        'panels' => [
            'odoo' => [
                'class' => panlatent\odoo\debug\OdooPanel::class,
            ]
        ]
    ]
]

The extension support Yii2 Gii extension:

Add the panel component to your application.

'modules' => [
    'gii' => [
        'generators' => [
             \panlatent\odoo\gii\generators\model\Generator::class,
        ]
    ]
]

License

The Yii2 Odoo is open-sourced software licensed under the MIT license.

yii2-odoo's People

Contributors

jiahuanle avatar kazz3m avatar panlatent avatar verbi avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

yii2-odoo's Issues

Why we need ActiveRecordTrait?

Adding it to ActiveRecord removes id and dates from object. Why we need it here?

With it:
you can't access $var->id as it's added as null to the end of app\models\Odoo\CrmTestVariant

app\models\Odoo\CrmTestVariant Object
(
    [_attributes:yii\db\BaseActiveRecord:private] => Array
        (
            [create_date] => 2021-02-06 12:54:41
            [lock_headquarter_discount] => 1
            [write_uid] => Array
                (
                    [0] => 366
                    [1] => XX Dawid
                )
            [ignore_salesman_discount_model] => 1
            [document_pack_number] => 0
            [id] => 1
            [create_uid] => Array
                (
                    [0] => 500
                    [1] => Dawid XX
                )
            [display_name] => a1
            [__last_update] => 2021-02-10 12:55:21
            [document_number_no_visualization] => 10
            [document_number_visualization] => 12
            [description] => Na start nie zawiera udzielonego jakiegokolwiek rabatu
            [lock_client_tab] => 1
            [lock_offer_deadline] => 
            [lock_salesman_discount] => 1
            [write_date] => 2021-02-10 12:55:21
            [test_id] => Array
                (
                    [0] => 1
                    [1] => Mój Prąd
                )
            [lock_salesman_increase] => 1
            [lock_production_tab] => 
            [lock_configuration_tab] => 
            [name] => a1
            [discount_on_start] => 0
            [lock_credit_zero] => 1
        )
    [_oldAttributes:yii\db\BaseActiveRecord:private] => Array
        (
            [create_date] => 2021-02-06 12:54:41
            [lock_headquarter_discount] => 1
            [write_uid] => Array
                (
                    [0] => 366
                    [1] => XX Dawid
                )
            [ignore_salesman_discount_model] => 1
            [document_pack_number] => 0
            [id] => 1
            [create_uid] => Array
                (
                    [0] => 500
                    [1] => Dawid XX
                )
            [display_name] => a1
            [__last_update] => 2021-02-10 12:55:21
            [document_number_no_visualization] => 10
            [document_number_visualization] => 12
            [description] => Na start nie zawiera udzielonego jakiegokolwiek rabatu
            [lock_client_tab] => 1
            [lock_offer_deadline] => 
            [lock_salesman_discount] => 1
            [write_date] => 2021-02-10 12:55:21
            [test_id] => Array
                (
                    [0] => 1
                    [1] => Mój Prąd
                )
            [lock_salesman_increase] => 1
            [lock_production_tab] => 
            [lock_configuration_tab] => 
            [name] => a1
            [discount_on_start] => 0
            [lock_credit_zero] => 1
        )
    [_related:yii\db\BaseActiveRecord:private] => Array
        (
        )
    [_relationsDependencies:yii\db\BaseActiveRecord:private] => Array
        (
        )
    [_errors:yii\base\Model:private] => 
    [_validators:yii\base\Model:private] => 
    [_scenario:yii\base\Model:private] => default
    [_events:yii\base\Component:private] => Array
        (
        )
    [_eventWildcards:yii\base\Component:private] => Array
        (
        )
    [_behaviors:yii\base\Component:private] => Array
        (
        )
    [id] => 
    [create_date] => 
    [write_date] => 
)

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.