background preloader

New API

Facebook Twitter

Odoo - From v7 to v8: the new api. Definicion de Clases Api Odoo ~ Programando con Odoo (OpenERP) y Python. Como todos sabemos Odoo anteriormente OpenERP, ah modificado su Núcleo de desarrollo, ofreciendo nuevas alternativas para la creación de Módulos para este ERP, ahora trae a nosotros los modulos Website, que permiten integrar una e-shop, un sitio web, añadir temas, chat de contacto, etc.

Definicion de Clases Api Odoo ~ Programando con Odoo (OpenERP) y Python

Podemos observar también modificaciones al Framework de Desarrollo de Módulos, una nueva Api que cambia el Aspecto del desarrollo, pero que es compatible con el Framework de la versión 7 de OpenERP, mis proximas entradas seran con aspectos importantes de esta nueva Version. Method and decorator — Odoo new API guideline 0.1 documentation. New decorators are just mapper around the new API.

Method and decorator — Odoo new API guideline 0.1 documentation

The decorator are mandatory as webclient and HTTP controller are not compliant with new API. api namespace decorators will detect signature using variable name and decide to match old signature or not. Recognized variable names are: cr, cursor, uid, user, user_id, id, ids, context. Method Decorators In Odoo 8. Method Decorators In Odoo 8 Decorator simply decorates a method according to our needs.

Method Decorators In Odoo 8

In odoo 7 we use cursor, uid, context and ids for defining all method here we can’t use such parameters, here we use self as the parameter when defining a method with certain method decorators. This decorator's are passed the parameters explicitly to the method. Which provide a smooth way to write functions and avoid complications. This manages the elements in two different API styles, namely: API ODOO: Metaclases y Decodarores ~ Programando con Odoo (OpenERP) y Python. Implementación de la API de Odoo Utilizando Metaclases y Decoradores API por sus siglas en Ingles Application Programming Interface ( Interfaz de Programación de Aplicaciones), es el conjunto de subrutinas, funciones y procedimientos (o métodos, en la programación orientada a objetos) que ofrece cierta biblioteca para ser utilizado por otro software como una capa de abstracción.

API ODOO: Metaclases y Decodarores ~ Programando con Odoo (OpenERP) y Python

Son usadas generalmente en las bibliotecas. Fuente: wikipedia.org Metaclases: A metaclase puede definirse como "Una clase de Clases". ORM API — odoo 8.0 documentation. Recordsets New in version 8.0: This page documents the New API added in Odoo 8.0 which should be the primary development API going forward.

ORM API — odoo 8.0 documentation

It also provides information about porting from or bridging with the "old API" of versions 7 and earlier, but does not explicitly document that API. See the old documentation for that. Interaction with models and records is performed through recordsets, a sorted set of records of the same model. Warning contrary to what the name implies, it is currently possible for recordsets to contain duplicates. Methods defined on a model are executed on a recordset, and their self is a recordset: Nuevas Propiedades para los Campos en la nueva API Odoo ~ Programando con Odoo (OpenERP) y Python.

Text Podemos definir un campo de tipo texto, es decir un campo sin limite de caracteres: Opciones: translate: Campo traducible a varios idiomas.

Nuevas Propiedades para los Campos en la nueva API Odoo ~ Programando con Odoo (OpenERP) y Python

Selection Almacena cadenas de texto, de una selección especifica (Diferentes Opciones): aselection = fields.Selection([('a', 'A')])aselection = fields.Selection(selection=[('a', 'A')])aselection = fields.Selection(selection='a_function_name') selection: Lista de tuplas con las opciones a elegir, cada tupla se conforma de la clave la cual es almacenada en la Base de Datos y el segundo valor es el Texto para la parte grafica que mostramos al usuario. Si extendemos o heredamos el campo es posible añadir opciones sin reemplazar todo el campo para ello utilizamos: class SomeModel(models.Model): _inherits = 'some.model' type = fields.Selection(selection_add=[('b', 'B'), ('c', 'C')]) Many2one. Method Decorators in Odoo 8 – ERP System. Method Decorators in Odoo 8 Method decorators gives the elements to manage two different API styles, namely the “traditional” and “record” styles.

Method Decorators in Odoo 8 – ERP System

In the “traditional” style, parameters like the db cursor, uid, context dictionary and record ids (usually written as cr, uid, context, ids) are passed explicitly to all methods. In the “record” style, those parameters are hidden into model instances, it gives a more object-oriented feel. ODOO V8 API: Everything about Decorator and Metaclass. An API(Application Programming Interface) is a set of defined functions and procedures that allow the creation of applications which access the features or data of an operating system, application, or other service.

ODOO V8 API: Everything about Decorator and Metaclass

(Source Google) A metaclass is defined as "the class of a class". Any class whose instances are themselves classes, is a metaclass. (Source wikipedia) Enforce different inheritance semantics, e.g. automatically call base class methods when a derived class overrides.Implement class methods (e.g. if the first argument is not named 'self') for precondition and post-condition checking.Implement that each instance is initialized with copies of all class variables.Implement a different way to store instance variables (e.g. in a list kept outside the the instance but indexed by the instance's id()).Automatically wrap or trap all or certain methods:Used for tracingUsed for precondition and post-condition checkingUsed for synchronized methodsUsed for automatic value caching Decorator's.

What is Main difference between @api.onchange and @api.depends in Odoo(openerp)? Odoo - From v7 to v8: the new api.