AGamr gaberincodeodoo.com路Mar 2, 2024 路 1 min readModel.with_env() in OdooModel.with_env() The with_env() method temporarily changes the environment of the current model to the new environment. This can be useful for testing code in different contexts or accessing data that is not normally accessible in the current environ...00
AGamr gaberincodeodoo.com路Mar 2, 2024 路 1 min readExecuting SQL Queries in OdooHow do I execute an SQL query inside an Odoo module? Steps: cr = self.env.cr You can use the self.env.cr object. This object provides a direct connection to the database. cr.execute() Use the cr.execute() method to execute the query. You can pass i...00
AGamr gaberincodeodoo.com路Mar 1, 2024 路 1 min read饾悇饾惂饾惎饾悽饾惈饾惃饾惂饾惁饾悶饾惂饾惌 饾悎饾惂 饾悗饾悵饾惃饾惃The environment in Odoo is an object that stores various contextual data used by the ORM. This data includes: uid: The current user, used to check access rights. cr: The current database cursor (for database queries). context: The current context,...00
AGamr gaberincodeodoo.com路Mar 1, 2024 路 1 min readORM Methods: Read()This method allows you to read data from the database. It takes a list of fields as input and returns a list of dictionaries mapping field names to their values. Parameters: fields: This parameter specifies which fields you want to read from the data...00
AGamr gaberincodeodoo.com路Mar 1, 2024 路 1 min read饾悗饾悜饾悓 饾悓饾悶饾惌饾悺饾惃饾悵饾惉 : 饾悞饾悶饾悮饾惈饾悳饾悺()The search() Method allows you to find records that match specific criteria. It enables you to search for records in a model based on a particular domain. Parameters: domain: a list of tuples that define the criteria that the records must match. Use...00