From 0a4abc795f2f72a1c8b3f413e3c6a29e29c44a0f Mon Sep 17 00:00:00 2001 From: eloyoussef Date: Thu, 29 Mar 2018 15:05:48 +0200 Subject: [PATCH] Ajout de fonction de confirmation de pack --- golem_resource_pack/__manifest__.py | 2 +- golem_resource_pack/models/golem_resource_pack.py | 11 +++++++++++ .../views/golem_resource_pack_views.xml | 11 ++++++----- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/golem_resource_pack/__manifest__.py b/golem_resource_pack/__manifest__.py index 1d5a6e6..81dd541 100644 --- a/golem_resource_pack/__manifest__.py +++ b/golem_resource_pack/__manifest__.py @@ -20,7 +20,7 @@ 'name': 'GOLEM resources pack', 'summary': 'GOLEM resources pack', 'description': ''' GOLEM resources pack ''', - 'version': '10.0.0.0.1', + 'version': '10.0.0.0.2', 'category': 'GOLEM', 'author': 'Youssef El Ouahby, Fabien Bourgeois', 'license': 'AGPL-3', diff --git a/golem_resource_pack/models/golem_resource_pack.py b/golem_resource_pack/models/golem_resource_pack.py index 028c7af..ff77af1 100644 --- a/golem_resource_pack/models/golem_resource_pack.py +++ b/golem_resource_pack/models/golem_resource_pack.py @@ -36,3 +36,14 @@ class GolemResourcePack(models.Model): string='User', default=lambda self: self.env.user) partner_id = fields.Many2one('res.partner', string='On behalf of', required=True, index=True) + state = fields.Selection([('canceled', 'Canceled'), + ('draft', 'Draft'), + ('confirmed', 'Confirmed'), + ('validated', 'Validated'), + ('rejected', 'Rejected')], + default='draft') + + @api.multi + def state_confirm(self): + for pack in self: + pack.reservation_ids.state_confirm() diff --git a/golem_resource_pack/views/golem_resource_pack_views.xml b/golem_resource_pack/views/golem_resource_pack_views.xml index 6b0b0ad..526c5a7 100644 --- a/golem_resource_pack/views/golem_resource_pack_views.xml +++ b/golem_resource_pack/views/golem_resource_pack_views.xml @@ -52,10 +52,10 @@ along with this program. If not, see . golem.resource.pack
- - --> + + - +