diff --git a/golem_resource_account/__manifest__.py b/golem_resource_account/__manifest__.py index b6b0cf7..fb647c3 100644 --- a/golem_resource_account/__manifest__.py +++ b/golem_resource_account/__manifest__.py @@ -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', diff --git a/golem_resource_account/models/golem_resource_reservation.py b/golem_resource_account/models/golem_resource_reservation.py index 51b8727..a18ad91 100644 --- a/golem_resource_account/models/golem_resource_reservation.py +++ b/golem_resource_account/models/golem_resource_reservation.py @@ -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(