From 9961933f9618541cc50f2ae209d131c5e87a9baa Mon Sep 17 00:00:00 2001 From: eloyoussef Date: Sat, 31 Mar 2018 17:17:08 +0200 Subject: [PATCH] refactoration de code --- .../models/golem_resource_pack.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/golem_resource_pack/models/golem_resource_pack.py b/golem_resource_pack/models/golem_resource_pack.py index 279aac2..fa176e5 100644 --- a/golem_resource_pack/models/golem_resource_pack.py +++ b/golem_resource_pack/models/golem_resource_pack.py @@ -30,19 +30,21 @@ class GolemResourcePack(models.Model): name = fields.Char(compute='_compute_name', store=True) reservation_ids = fields.One2many('golem.resource.reservation', 'pack_id', - readonly=True, states={'draft': [('readonly', False)]}, - track_visibility='onchange') + readonly=True, track_visibility='onchange', + states={'draft': [('readonly', False)], + False : [('readonly', False)]}) note = fields.Text(help='Notes, optional subject for the reservation, reason', - readonly=True, states={'draft': [('readonly', False)]}, - track_visibility='onchange') + track_visibility='onchange',readonly=True, + states={'draft': [('readonly', False)], + False : [('readonly', False)]}) user_id = fields.Many2one('res.users', required=True, index=True, readonly=True, string='User', default=lambda self: self.env.user) - partner_id = fields.Many2one('res.partner', string='On behalf of', - required=True, index=True, readonly=True, - states={'draft': [('readonly', False)]}, - track_visibility='onchange') + partner_id = fields.Many2one('res.partner', string='On behalf of', required=True, + index=True, track_visibility='onchange', readonly=True, + states={'draft': [('readonly', False)], + False : [('readonly', False)]}) state = fields.Selection([('canceled', 'Canceled'), ('draft', 'Draft'), ('confirmed', 'Confirmed'),