Community mailing list archives

community@mail.odoo.com

Re: OdooRPC 0.3.0 released

by
Sebastien Alix
- 07/22/2015 05:02:29
Hi Ondrej,

Sorry I do not know exactly, I have never used ERPPeek myself.
I heard that ERPPeek is not only a Python module, but also a CLI tool.

OdooRPC can only be used as a Python module, but propose an API as close 
as possible to the new server-side API.

e.g. relevant methods and magic method of Environment and Model classes 
are re-implemented in OdooRPC.

 >>> odoo = odoorpc.ODOO(...)
 >>> odoo.login(...)
 >>> odoo.env.uid == odoo.env.user.id == odoo.env.user.ids[0]
True
 >>> odoo.env
Environment(db='db_name', uid=1, context={u'lang': u'en_US', u'tz': 
'Europe/Brussels', u'uid': 1})
 >>> odoo.env.context
{'lang': 'en_US', 'tz': 'Europe/Brussels', 'uid': 1}
 >>> odoo.env.lang
'en_US'
 >>> lang_en = odoo.env.ref('base.lang_en')
 >>> lang_en.env == odoo.env
True
 >>> lang_en
Recordset('res.lang', [1])
 >>> lang_en[0]
Recordset('res.lang', [1])
 >>> lang_en.env ==
 >>> odoo.env['res.users']
Model('res.users')
 >>> odoo.env['res.users'].with_context(foo=True)
Model('res.users')
 >>> odoo.env == odoo.env.user.env
True

Etc.
More details here:
http://pythonhosted.org/OdooRPC/ref_env.html
http://pythonhosted.org/OdooRPC/ref_models.html
http://pythonhosted.org/OdooRPC/tutorials.html

Regards,


Le 21/07/2015 17:57, Ondrej Kuznik a écrit :
> On 21/07/15 14:58, Sébastien Alix wrote:
>> Hi,
>>
>> Yes, I maintain OERPLib too.
>> About the difference, you will find some informations in the FAQ section:
>> http://pythonhosted.org/OdooRPC/faq.html#why-odoorpc-and-why-migrate-from-oerplib-to-odoorpc
>>
>> You can see OdooRPC as a rewrite of OERPLib by dropping all legacy code
>> (OERPLib is compatible from 5.0 to 8.0) and focusing on JSON-RPC instead
>> of XML-RPC (which is kept by compatibility but will not evolve anymore,
>> this is what Antony Lesuisse said me last year).
>
> Hi Sébastien,
> apart from the protocol difference again, how does it compare to erppeek?
>
> Regards,
> Ondrej
>
> _______________________________________________
> Mailing-List: https://www.odoo.com/groups/community-59
> Post to: mailto:community@mail.odoo.com
> Unsubscribe: https://www.odoo.com/groups?unsubscribe
>

-- 
Sébastien ALIX
ABF OSIELL