forked from Yaltik/golem
[IMP][FIX]GOLEM Resource Account : should not group reservations on a single invoice if parters are not the same (thanks Youssef)
This commit is contained in:
parent
66601c03b9
commit
3050e554b9
@ -20,7 +20,7 @@
|
||||
'name': 'GOLEM resources invoicing',
|
||||
'summary': 'GOLEM resources invoicing',
|
||||
'description': ''' GOLEM resources invoicing ''',
|
||||
'version': '10.0.0.1.2',
|
||||
'version': '10.0.0.1.3',
|
||||
'category': 'GOLEM',
|
||||
'author': 'Youssef El Ouahby, Fabien Bourgeois',
|
||||
'license': 'AGPL-3',
|
||||
|
@ -39,6 +39,10 @@ class GolemResourceReservation(models.Model):
|
||||
@api.multi
|
||||
def check_before_invoicing(self):
|
||||
""" Checks data coherence before invoicing """
|
||||
if len(self.mapped('partner_id')) > 1:
|
||||
raise ValidationError(_('You can\'t group reservations of multiple '
|
||||
'clients in the same invoice, please remove '
|
||||
'inadequate reservations'))
|
||||
for reservation in self:
|
||||
if reservation.state != "validated":
|
||||
raise ValidationError(
|
||||
|
Loading…
Reference in New Issue
Block a user