Hello Asmaa,
In Odoo, the 'inherit' keyword is used to inherit an existing view or model and make changes to it. The '_name' variable is used to specify the name of the model.
However, when inheriting an existing view or model, Odoo already knows the name of the model or view being inherited, so there is no need to specify it again using the '_name' variable.
Instead, you can simply use the 'inherit' keyword followed by the name of the view or model you wish to inherit, and then make the necessary changes to it. This approach makes the code simpler and easier to read. Refer below example.
from odoo import fields, models, api, _
class ResPartner(models.Model):
_inherit = "res.partner"
x=fields.Char("my field name"
I hope this helps you.
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari