I've extended the partner model as below.
from openerp import models, fields, api, exceptions
class Partner(models.Model):
_name = 'res.partner'
_inherit = 'res.partner'
@api.model
def _get_partner_category(self):
id = self.env['res.partner.category'].search([['name', '=', 'Registrant']]).id
return [(6,0,[id])]
national_id = fields.Char(string="National ID")
_defaults = {
'category_id': _get_partner_category,
}
As above, the code has made category_id and set the default tag to "Registrant".
However, this affect other modules that uses the res.partner model.
Can I set defaults on my views instead via the model?