(self, vals)
return super(ResPartner, self).create(vals)
It overrides create to bind appropriate medical entity.
It overrides create to bind appropriate medical entity.
It overrides create to bind appropriate medical entity .
def create(self, vals):
        """ It overrides create to bind appropriate medical entity. """
        if all((
            vals.get('type', '').startswith('medical.'),
            not self.env.context.get('medical_entity_no_create'),
        )):
            model = self.env[vals['type']].with_context(
                medical_entity_no_create=True,
            )
            medical_entity = model.create(vals)
            return medical_entity.partner_id
        return super(ResPartner, self).create(vals)
def create ( self , vals ) : if all ( ( vals . get ( 'type' , '' ) . startswith ( 'medical.' ) , not self . env . context . get ( 'medical_entity_no_create' ) , ) ) : model = self . env [ vals [ 'type' ] ] . with_context ( medical_entity_no_create = True , ) medical_entity = model . create ( vals ) return medical_entity . partner_id return super ( ResPartner , self ) . create ( vals )