refactoration de code
This commit is contained in:
parent
66c01206f0
commit
9961933f96
@ -30,19 +30,21 @@ class GolemResourcePack(models.Model):
|
|||||||
|
|
||||||
name = fields.Char(compute='_compute_name', store=True)
|
name = fields.Char(compute='_compute_name', store=True)
|
||||||
reservation_ids = fields.One2many('golem.resource.reservation', 'pack_id',
|
reservation_ids = fields.One2many('golem.resource.reservation', 'pack_id',
|
||||||
readonly=True, states={'draft': [('readonly', False)]},
|
readonly=True, track_visibility='onchange',
|
||||||
track_visibility='onchange')
|
states={'draft': [('readonly', False)],
|
||||||
|
False : [('readonly', False)]})
|
||||||
|
|
||||||
note = fields.Text(help='Notes, optional subject for the reservation, reason',
|
note = fields.Text(help='Notes, optional subject for the reservation, reason',
|
||||||
readonly=True, states={'draft': [('readonly', False)]},
|
track_visibility='onchange',readonly=True,
|
||||||
track_visibility='onchange')
|
states={'draft': [('readonly', False)],
|
||||||
|
False : [('readonly', False)]})
|
||||||
|
|
||||||
user_id = fields.Many2one('res.users', required=True, index=True, readonly=True,
|
user_id = fields.Many2one('res.users', required=True, index=True, readonly=True,
|
||||||
string='User', default=lambda self: self.env.user)
|
string='User', default=lambda self: self.env.user)
|
||||||
partner_id = fields.Many2one('res.partner', string='On behalf of',
|
partner_id = fields.Many2one('res.partner', string='On behalf of', required=True,
|
||||||
required=True, index=True, readonly=True,
|
index=True, track_visibility='onchange', readonly=True,
|
||||||
states={'draft': [('readonly', False)]},
|
states={'draft': [('readonly', False)],
|
||||||
track_visibility='onchange')
|
False : [('readonly', False)]})
|
||||||
state = fields.Selection([('canceled', 'Canceled'),
|
state = fields.Selection([('canceled', 'Canceled'),
|
||||||
('draft', 'Draft'),
|
('draft', 'Draft'),
|
||||||
('confirmed', 'Confirmed'),
|
('confirmed', 'Confirmed'),
|
||||||
|
Loading…
Reference in New Issue
Block a user