This commit is contained in:
oscar alvarez 2022-05-17 10:38:21 -05:00
parent 8a89d25999
commit a5ee365dc0
3 changed files with 11 additions and 11 deletions

View File

@ -248,11 +248,12 @@ class Folio(ModelSQL, ModelView):
@classmethod
def update_room(cls, room, state):
Housekeeping = Pool().get('hotel.housekeeping')
hkrooms = Housekeeping.search([
hk_rooms = Housekeeping.search([
('room', '=', room.id),
])
# method = getattr(Housekeeping, state)
# method([hkrooms])
for hk_room in hk_rooms:
hk_room.state = state
hk_room.save()
def get_invoice_state(self, name=None):
if self.invoice_line:

View File

@ -46,7 +46,7 @@ class Housekeeping(Workflow, ModelSQL, ModelView):
notes = fields.Text('Notes')
check_in_time = fields.Function(fields.Time('Check In Time'), 'get_check_in_time')
check_out_time = fields.Function(fields.Time('Check In Time'), 'get_check_out_time')
amenities = fields.Funtion(fields.Many2Many('hotel.room-hotel.amenities',
amenities = fields.Function(fields.Many2Many('hotel.room-hotel.amenities',
'room', 'amenities', 'Amenities'), 'get_amenities')
@classmethod
@ -136,7 +136,7 @@ class Housekeeping(Workflow, ModelSQL, ModelView):
def get_amenities(self, name=None):
res = []
for ame in room.amenities:
for ame in self.room.amenities:
res.append(ame.id)
return res

View File

@ -18,14 +18,13 @@ this repository contains the full copyright notices and license terms. -->
<field name="cleaning_type" widget="selection"/>
<notebook colspan="4">
<page string="Tasks" id="tasks">
<field name="tasks" colspan="4"/>
<field name="tasks" colspan="2"/>
<field name="amenities" colspan="2"/>
</page>
<page string="Info Addtional" id="comments">
<group col="1" colspan="2" string="Check List" id="check_list">
<field name="check_list" colspan="4"/>
</group>
<field name="amenities" colspan="2"/>
<separator string="Notes" colspan="4" id="configuration_room"/>
<separator string="Check List" colspan="4" id="check_list"/>
<field name="check_list" colspan="4"/>
<separator string="Notes" colspan="4" id="notes"/>
<field name="notes" colspan="4"/>
</page>
<page string="Amenities" id="amenities">