Whenever I create a new user, a new res.partner record is automatically generated. So, I find the create function in res.partner class in addons. But I cannot find it. And I inherited the res.partner class as follow.
class ResPartner(models.Model):
_name = 'res.partner'
_inherit = 'res.partner'
_description = 'Res Partner'
department_id = fields.Many2one('hr.department', 'Department')
@api.model
def create(self, vals):
res = super(ResPartner, self).create(vals)
company_id = res.company_id.id
return res
In the dictionary vals, there is no department_id, so I want to add department_id to vals. How can I
achieve this? Thanks in advance!