so i'm trying to add new fields to show up when you create a new contact, with the name, adress, tax ID ...
so i created a custom module called custom_contact this is my models/contacto.py
and i changed the contacts_view.xml in the odoo contacts module to use my custom module
Contacts
ir.actions.act_window
custom_contact.contacto
kanban,tree,form,activity
{'default_is_company': True}
Create a Contact in your address book
Odoo helps you track all activities related to your contacts.
when i go to create a new contact and i hover on one of the fields i see that Model is : custom_contact.contacto
now how i can add those fields and make them visible
from odoo import models, fields
class Contacto(models.Model):
_name = 'custom_contact.contacto'
_inherits = {'res.partner': 'partner_id'}
_description = 'Contacto'
# Custom fields
nis = fields.Char(string='NIS')
nif = fields.Char(string='NIF')
ai = fields.Char(string='AI')
rc = fields.Char(string='RC')
partner_id = fields.Many2one('res.partner', required=True, ondelete='restrict', auto_join=True, index=True, string='Related Partner', help='Partner-related data of the user')
# Inherit existing Many2many fields
channel_ids = fields.Many2many(comodel_name='res.partner', relation='res_partner_channel_rel',column1='partner_id', column2='channel_id', string='Channels')
meeting_ids = fields.Many2many(comodel_name='res.partner', relation='res_partner_meeting_rel', column1='partner_id', column2='meeting_id', string='Meetings')