I want to create using sql command because if i am using self.create that was take a long time to get a result.
@api.multi
def action_create_history(self):
for rec in self :
history_obj = self.env['history.table']
hd = []
hd['partner_id'] = rec.id
hd['old_state'] = rec.state
hd['new_state'] = 'open'
hd['partner_reg_id'] = rec.partner_no
hd['state'] = 'complete'
history = history_obj.create(hd)
partner.write({'history_id' : history.id})
i want change it into sql please give advice