'Check the order:
if the order is not paid: continue payment,
if the order is paid print ticket.'

@api.multi
def check(self):

    self.ensure_one()
    order = self.env['pos.order'].browse(self.env.context.get('active_id', False))
    amount = (order.amount_total - order.amount_paid)
    data = self.read()[0]
    data['journal'] = data['journal_id'][0]
    if (amount != 0.0):
        order.add_payment(data)
    if order.test_paid():
        order.action_pos_order_paid()
        return {'type': 'ir.actions.act_window_close'}
    return self.launch_payment()
