Project

General

Profile

« Previous | Next » 

Revision 52829527

Added by Mikaël Ates over 11 years ago

actes: Allow to rebill a single act if it was billed with the old system.

View differences:

calebasse/actes/views.py
4 4
from django.views.generic.edit import ModelFormMixin
5 5
from django.shortcuts import redirect
6 6

  
7
from calebasse.cbv import ListView, UpdateView
7
from calebasse.cbv import ListView, UpdateView, FormView
8 8
from calebasse.agenda.views import NewAppointmentView
9 9

  
10 10
import models
......
87 87

  
88 88
update_act = UpdateActView.as_view()
89 89

  
90
class RebillActView(UpdateView):
91
    model = models.Act
92
    template_name = 'actes/act_rebill.html'
93
    success_url = '..'
94

  
95
    def post(self, request, *args, **kwarg):
96
        act = models.Act.objects.get(pk=kwarg['pk'])
97
        act.is_billed = False
98
        act.healthcare = None
99
        act.save()
100
        return super(RebillActView, self).post(request, *args, **kwarg)
101

  
102
rebill_act = RebillActView.as_view()

Also available in: Unified diff