Add user error

This commit is contained in:
oscar alvarez 2023-08-09 08:22:46 -05:00
parent 8a74f2cb76
commit f9811bde8b
2 changed files with 5 additions and 1 deletions

View file

@ -699,6 +699,10 @@ class Booking(Workflow, ModelSQL, ModelView):
else:
party = folio.main_guest
if not party:
raise UserError(
gettext('hotel.msg_missing_main_guest'))
if party.id not in res.keys():
res[party.id] = {
'party': party,

View file

@ -22,7 +22,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="text">You cannot check in before the reserved date!</field>
</record>
<record model="ir.message" id="msg_missing_main_guest">
<field name="text">Missing main guest in lines!</field>
<field name="text">Missing the main guest in folio!</field>
</record>
<record model="ir.message" id="msg_missing_select_room">
<field name="text">Missing select room!</field>