forked from Yaltik/golem
[IMP]GOLEM Resource Reservation : display avaibility period and timetable on reservation
This commit is contained in:
parent
bf5314f54f
commit
5c87abbbbc
@ -42,6 +42,10 @@ class GolemResourceReservation(models.Model):
|
|||||||
resource_id = fields.Many2one('golem.resource', required=True, index=True,
|
resource_id = fields.Many2one('golem.resource', required=True, index=True,
|
||||||
string='Resource', readonly=True,
|
string='Resource', readonly=True,
|
||||||
states={'draft': [('readonly', False)]})
|
states={'draft': [('readonly', False)]})
|
||||||
|
resource_avaibility_start = fields.Date(related='resource_id.avaibility_start')
|
||||||
|
resource_avaibility_stop = fields.Date(related='resource_id.avaibility_stop')
|
||||||
|
resource_timetable_ids = fields.One2many(related='resource_id.timetable_ids')
|
||||||
|
|
||||||
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,
|
||||||
states={'draft': [('readonly', False)]})
|
states={'draft': [('readonly', False)]})
|
||||||
|
@ -70,25 +70,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<field name="state" widget="statusbar" />
|
<field name="state" widget="statusbar" />
|
||||||
</header>
|
</header>
|
||||||
<sheet>
|
<sheet>
|
||||||
<group colspan="2">
|
<group>
|
||||||
|
<group string="Resource">
|
||||||
<field name="id" invisible="1" />
|
<field name="id" invisible="1" />
|
||||||
<field name="resource_id" options="{'no_create': True}" />
|
<field name="resource_id" options="{'no_create': True}" />
|
||||||
</group>
|
<field name="resource_avaibility_start" />
|
||||||
<group>
|
<field name="resource_avaibility_stop" />
|
||||||
<group>
|
<field name="resource_timetable_ids" readonly="1" />
|
||||||
<field name="date" />
|
|
||||||
<field name="hour_start" widget="float_time" />
|
|
||||||
<field name="hour_stop" widget="float_time" />
|
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group string="Reservation">
|
||||||
<field name="user_id" options="{'no_create': True}" />
|
<group>
|
||||||
<field name="partner_id" />
|
<field name="date" />
|
||||||
|
<field name="hour_start" widget="float_time" />
|
||||||
|
<field name="hour_stop" widget="float_time" />
|
||||||
|
<field name="user_id" options="{'no_create': True}" />
|
||||||
|
<field name="partner_id" />
|
||||||
|
<field name="rejection_reason"
|
||||||
|
attrs="{'invisible': [('state', '!=', 'rejected')]}"/>
|
||||||
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<group colspan="2">
|
|
||||||
<field name="rejection_reason"
|
|
||||||
attrs="{'invisible': [('state', '!=', 'rejected')]}"/>
|
|
||||||
</group>
|
|
||||||
</sheet>
|
</sheet>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user