Publicidad

odoo 11.0 development (CRUD)

Odoo Technical Team Leader at MEunity en MEunity
28 de May de 2018
Publicidad

Más contenido relacionado

Publicidad

odoo 11.0 development (CRUD)

  1. Odoo Mastering Odoo 11.0 Development Mohamed Magdy
  2. CRUD ● CRUD is stands for the 4 main operations that performed by Odoo framework. ● The CRUD paradigm is common in constructing web applications, because it provides a memorable framework for reminding developers of how to construct full, usable models.
  3. CRUD ● SQL still an option for the DB operations but not recommended as it will omit the security considerations and data validation. ● Using the ORM framework will ensure of the targeted records and that the user has a sufficient permissions to perform such operation.
  4. CRUD in Odoo ● As any other Framework, CRUD is implemented and ready to be used in Odoo by default. All you need is to have an object that inherits models.Model:
  5. CRUD in Odoo ● C: Stands for Create. It refers to the operation of creating new records in DB. ● In Odoo, you can create new records using the method create() ● create(), according to Odoo: Creates a new record for the model. The new record is initialized using the values from ``vals`` and if necessary those from :meth:`~.default_get`.
  6. CRUD in Odoo ● R: Stands for Read. It refers to the operation of Reading existing records in DB. ● In Odoo, you can find/read existing records using the methods search(), read(), search_read() and browse(). To be continued ...
  7. CRUD in Odoo ● R: Stands for Read. It refers to the operation of Reading existing records in DB. ● search(), according to Odoo: Searches for records based on the ``args`` :returns: at most ``limit`` records matching the search criteria
  8. CRUD in Odoo ● R: Stands for Read. It refers to the operation of Reading existing records in DB. ● read(), according to Odoo: Reads the requested fields for the records in ``self``, low-level/RPC method. In Python code, prefer :meth:`~.browse`. :return: a list of dictionaries mapping field names to their values, with one dictionary per record
  9. CRUD in Odoo ● R: Stands for Read. It refers to the operation of Reading existing records in DB. ● search_read(), according to Odoo: Performs a ``search()`` followed by a ``read()``. :return: List of dictionaries containing the asked fields.
  10. CRUD in Odoo ● R: Stands for Read. It refers to the operation of Reading existing records in DB. ● browse(), according to Odoo: Returns a recordset for the ids provided as parameter in the current environment. Can take no ids, a single id or a sequence of ids.
  11. CRUD in Odoo ● U: Stands for Update. It refers to the operation of Updating existing records in DB. ● In Odoo, you can update existing records using the method write(). ● write(), according to Odoo: Updates all records in the current set with the provided values.
  12. CRUD in Odoo ● D: Stands for Delete. It refers to the operation of Deleting existing records in DB. ● In Odoo, you can Delete existing records using the method unlink(). ● unlink(), according to Odoo: Deletes the records of the current set
  13. Odoo Mastering Odoo 11.0 Development Mohamed Magdy
Publicidad