This pull request addresses several issues encountered while using the go-odoo module with Odoo 17:
Error handling for all models generation: Ensures that the generator gracefully handles errors that may occur when attempting to generate code for all available models, preventing unexpected crashes.
Compatibility with models lacking ID property: Addresses an issue where models in Odoo 17 that lack an ID property (e.g., mixins) caused broken file generation due to the reliance on the ID for various methods.
Correct variable naming for MailActivityPlan model: Fixes an issue where the generator incorrectly created a variable named map for the MailActivityPlan model, which caused errors.
Context options for the Create() method: Introduces optional context parameters for the Create() method, allowing for more flexibility when creating model instances. This addition addresses specific use cases, such as setting the install_mode=true context for the res.user model to create an archived user or without sending emails.
Note: Adding context options to Create() introduces a backward compatibility issue. Therefore, it is only implemented for the Create() method, and the template needs to be updated to incorporate this functionality into higher-level methods if needed.
This pull request addresses several issues encountered while using the
go-odoo
module with Odoo 17:MailActivityPlan
model: Fixes an issue where the generator incorrectly created a variable namedmap
for theMailActivityPlan
model, which caused errors.Create()
method: Introduces optional context parameters for theCreate()
method, allowing for more flexibility when creating model instances. This addition addresses specific use cases, such as setting theinstall_mode=true
context for theres.user
model to create an archived user or without sending emails.Note: Adding context options to Create() introduces a backward compatibility issue. Therefore, it is only implemented for the Create() method, and the template needs to be updated to incorporate this functionality into higher-level methods if needed.