Skip to Content
Menu
This question has been flagged
1 Reply
6411 Views

Error:
Odoo Server Error

Traceback (most recent call last):
File "/opt/odoo13/odoo/odoo/tools/convert.py", line 713, in parse
self._tag_root(de)
File "/opt/odoo13/odoo/odoo/tools/convert.py", line 675, in _tag_root
f(rec)
File "/opt/odoo13/odoo/odoo/tools/convert.py", line 578, in _tag_record
record = model._load_records([data], self.mode == 'update')
File "/opt/odoo13/odoo/odoo/models.py", line 4058, in _load_records
records = self._load_records_create([data['values'] for data in to_create])
File "/opt/odoo13/odoo/odoo/models.py", line 3972, in _load_records_create
return self.create(values)
File "<decorator-gen-31>", line 2, in create
File "/opt/odoo13/odoo/odoo/api.py", line 344, in _model_create_multi
return create(self, arg)
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_ui_view.py", line 473, in create
return super(View, self).create(vals_list)
File "<decorator-gen-3>", line 2, in create
File "/opt/odoo13/odoo/odoo/api.py", line 344, in _model_create_multi
return create(self, arg)
File "/opt/odoo13/odoo/odoo/models.py", line 3753, in create
fields[0].determine_inverse(batch_recs)
File "/opt/odoo13/odoo/odoo/fields.py", line 1084, in determine_inverse
getattr(records, self.inverse)()
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_ui_view.py", line 299, in _inverse_arch
view.write(data)
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_ui_view.py", line 490, in write
return super(View, self).write(self._compute_defaults(vals))
File "/opt/odoo13/odoo/odoo/models.py", line 3542, in write
real_recs._validate_fields(set(vals) - set(inverse_fields))
File "/opt/odoo13/odoo/odoo/models.py", line 1159, in _validate_fields
check(self)
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_ui_view.py", line 404, in _check_xml
raise ValidationError(_('Invalid view %s definition in %s') % (view_name, view.arch_fs))
odoo.exceptions.ValidationError: ('Invalid view hotel_restaurant_reservation.tree definition in hotel_restaurant/views/hotel_restaurant_view.xml', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/odoo13/odoo/odoo/http.py", line 619, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo13/odoo/odoo/http.py", line 309, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/opt/odoo13/odoo/odoo/tools/pycompat.py", line 14, in reraise
raise value
File "/opt/odoo13/odoo/odoo/http.py", line 664, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo13/odoo/odoo/http.py", line 345, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo13/odoo/odoo/service/model.py", line 93, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo13/odoo/odoo/http.py", line 338, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo13/odoo/odoo/http.py", line 909, in __call__
return self.method(*args, **kw)
File "/opt/odoo13/odoo/odoo/http.py", line 510, in response_wrap
response = f(*args, **kw)
File "/opt/odoo13/odoo/addons/web/controllers/main.py", line 1323, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/opt/odoo13/odoo/addons/web/controllers/main.py", line 1311, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo13/odoo/odoo/api.py", line 395, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo13/odoo/odoo/api.py", line 382, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-58>", line 2, in button_immediate_install
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_module.py", line 72, in check_and_log
return method(self, *args, **kwargs)
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_module.py", line 463, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_module.py", line 573, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/opt/odoo13/odoo/odoo/modules/registry.py", line 85, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/odoo13/odoo/odoo/modules/loading.py", line 420, in load_modules
loaded_modules, update_module, models_to_check)
File "/opt/odoo13/odoo/odoo/modules/loading.py", line 312, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/opt/odoo13/odoo/odoo/modules/loading.py", line 222, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package, report=report)
File "/opt/odoo13/odoo/odoo/modules/loading.py", line 68, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
File "/opt/odoo13/odoo/odoo/tools/convert.py", line 737, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
File "/opt/odoo13/odoo/odoo/tools/convert.py", line 804, in convert_xml_import
obj.parse(doc.getroot())
File "/opt/odoo13/odoo/odoo/tools/convert.py", line 722, in parse
exc_info[2]
File "/opt/odoo13/odoo/odoo/tools/pycompat.py", line 13, in reraise
raise value.with_traceback(tb)
File "/opt/odoo13/odoo/odoo/tools/convert.py", line 713, in parse
self._tag_root(de)
File "/opt/odoo13/odoo/odoo/tools/convert.py", line 675, in _tag_root
f(rec)
File "/opt/odoo13/odoo/odoo/tools/convert.py", line 578, in _tag_record
record = model._load_records([data], self.mode == 'update')
File "/opt/odoo13/odoo/odoo/models.py", line 4058, in _load_records
records = self._load_records_create([data['values'] for data in to_create])
File "/opt/odoo13/odoo/odoo/models.py", line 3972, in _load_records_create
return self.create(values)
File "<decorator-gen-31>", line 2, in create
File "/opt/odoo13/odoo/odoo/api.py", line 344, in _model_create_multi
return create(self, arg)
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_ui_view.py", line 473, in create
return super(View, self).create(vals_list)
File "<decorator-gen-3>", line 2, in create
File "/opt/odoo13/odoo/odoo/api.py", line 344, in _model_create_multi
return create(self, arg)
File "/opt/odoo13/odoo/odoo/models.py", line 3753, in create
fields[0].determine_inverse(batch_recs)
File "/opt/odoo13/odoo/odoo/fields.py", line 1084, in determine_inverse
getattr(records, self.inverse)()
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_ui_view.py", line 299, in _inverse_arch
view.write(data)
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_ui_view.py", line 490, in write
return super(View, self).write(self._compute_defaults(vals))
File "/opt/odoo13/odoo/odoo/models.py", line 3542, in write
real_recs._validate_fields(set(vals) - set(inverse_fields))
File "/opt/odoo13/odoo/odoo/models.py", line 1159, in _validate_fields
check(self)
File "/opt/odoo13/odoo/odoo/addons/base/models/ir_ui_view.py", line 404, in _check_xml
raise ValidationError(_('Invalid view %s definition in %s') % (view_name, view.arch_fs))
odoo.tools.convert.ParseError: "Invalid view hotel_restaurant_reservation.tree definition in hotel_restaurant/views/hotel_restaurant_view.xml
None" while parsing /opt/odoo13/odoo-custom-addons/hotel_restaurant/views/hotel_restaurant_view.xml:1, near
<odoo>
<menuitem id="hotel_restaurant_menu" name="Restaurant" parent="hotel.hotel_management_menu" sequence="3"/>

<record id="view_hotelfolio1_form1_inherited" model="ir.ui.view">
<field name="name">hotel.folio1.form1.inherited</field>
<field name="model">hotel.folio</field>
<field name="inherit_id" ref="hotel.view_hotel_folio_form"/>
<field name="arch" type="xml">
<xpath expr="//form/sheet/notebook/page[3]" position="after">
<page name="hotel_restaurant" string="Hotel Restaurant">
<separator string="Restaurant Order Reservation Details" colspan="4"/>
<field name="hotel_reservation_order_ids" colspan="4" nolabel="1" readonly="1">
<tree string="Order" colors="blue:state == 'draft';green:state == 'order'" toolbar="1">
<field name="order_number"/>
<field name="order_date"/>
<field name="waitername"/>
<field name="table_no"/>
<field name="state"/>
<field name="amount_total" sum="Order Total"/>
</tree>
</field>
<separator string="Restaurant Orders Details" colspan="4"/>
<field name="hotel_restaurant_order_ids" colspan="4" nolabel="1" readonly="1">
<tree string="Order" colors="blue:state == 'draft';green:state == 'order';black:state == 'done';" toolbar="1">
<field name="order_no"/>
<field name="o_date"/>
<field name="waiter_name"/>
<field name="table_no"/>
<field name="state"/>
<field name="amount_total" sum="Table Order Total"/>
</tree>
</field>
</page>
</xpath>
</field>
</record>

<!-- ======= Table Master ======= -->
<!-- Form view of hotel restaurant tables -->
<record id="view_hotel_restaurant_tables_form" model="ir.ui.view">
<field name="name">hotel_restaurant_tables.form</field>
<field name="model">hotel.restaurant.tables</field>
<field name="arch" type="xml">
<form string="Tables Detail">
<sheet>
<group>
<field name="name" colspan="1"/>
<newline/>
<field name="capacity"/>
</group>
</sheet>
</form>
</field>
</record>

<!-- Tree view of hotel restaurant tables -->
<record id="view_hotel_restaurant_tables_tree" model="ir.ui.view">
<field name="name">hotel_restaurant_tables.tree</field>
<field name="model">hotel.restaurant.tables</field>
<field name="arch" type="xml">
<tree string="Tables Detail">
<field name="name"/>
<field name="capacity"/>
</tree>
</field>
</record>

<!-- Search view of hotel restaurant tables -->
<record id="view_hotel_restaurant_tables_search" model="ir.ui.view">
<field name="name">hotel_restaurant_tables.search</field>
<field name="model">hotel.restaurant.tables</field>
<field name="arch" type="xml">
<search string="Tables Detail">
<field name="name"/>
<field name="capacity"/>
<newline/>
<group expand="0" string="Group By">
<filter name="capacity" string="Capacity" icon="terp-stock_symbol-selection" context="{'group_by':'capacity'}"/>
</group>
</search>
</field>
</record>

<!-- Action of hotel restaurant tables -->
<record id="open_view_hotel_restaurant_tables_form_tree" model="ir.actions.act_window">
<field name="name">Tables</field>
<field name="res_model">hotel.restaurant.tables</field>

<field name="view_mode">tree,form</field>
</record>

<menuitem name="Tables" id="menu_open_view_hotel_restaurant_tables_form_tree" action="open_view_hotel_restaurant_tables_form_tree" parent="hotel.hotel_configuration_menu"/>

<!-- ======= Table Reservation ======= -->
<!-- Form view of hotel restaurant reservation -->
<record id="view_hotel_restaurant_reservation_form" model="ir.ui.view">
<field name="name">hotel_restaurant_reservation.form</field>
<field name="model">hotel.restaurant.reservation</field>
<field name="arch" type="xml">
<form string="Table Reservation">
<header>
<button string="Confirm" name="table_reserved" states="draft" type="object" icon="fa-check" class="oe_highlight"/>
<button string="Done" name="table_done" states="confirm" type="object" icon="fa-check-square-o" class="oe_highlight"/>
<button string="Cancel" name="table_cancel" states="confirm" type="object" icon="fa-close" class="oe_highlight"/>
<button string="Set to Draft" name="action_set_to_draft" states="cancel" type="object" icon="fa-files-o" class="oe_highlight"/>
<button string="Create Order" name="create_order" type="object" states="done" icon="fa-file-text-o" class="oe_highlight"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,done"/>
</header>
<sheet>
<h1>
<label for="table_booking" string="Table Booking" colspan="4"/>
<field name="reservation_id" colspan="4"/>
</h1>
<group>
<group colspan="2" col="4">
<field name="is_folio"/>
<newline/>
<field name="folio_id" attrs="{'invisible':[('is_folio','=',False)], 'required':[('is_folio','=',True)]}"/>
<field name="room_no" attrs="{'invisible':[('is_folio','=',False)] ,'required':[('is_folio','=',True)]}"/>
</group>
<newline/>
<group colspan="4" col="4">
<field name="cname"/>
<field name="partner_address_id"/>
<field name="start_date"/>
<field name="end_date"/>
</group>
<group colspan="4">
<separator colspan="4" string="Table List"/>
<field name="tableno" colspan="4" nolabel="1"/>
</group>
</group>
</sheet>
</form>
</field>
</record>

<!-- Tree view of hotel restaurant reservation -->
<record id="view_hotel_restaurant_reservation_tree" model="ir.ui.view">
<field name="name">hotel_restaurant_reservation.tree</field>
<field name="model">hotel.restaurant.reservation</field>
<field name="arch" type="xml">
<tree string="Table Reservation" colors="blue:state == 'draft';red:state == 'cancel';grey:state == 'done';black:state == 'order';green:state == 'confirm'" toolbar="1">
<field name="reservation_id"/>
<field name="folio_id"/>
<field name="room_no"/>
<field name="start_date"/>
<field name="end_date"/>
<field name="cname"/>
<field name="partner_address_id"/>
<field name="tableno"/>
<field name="state"/>
</tree>
</field>
</record>

<!-- Search view of hotel restaurant reservation -->
<record id="view_hotel_restaurant_reservation_search" model="ir.ui.view">
<field name="name">hotel.restaurant.reservation.search</field>
<field name="model">hotel.restaurant.reservation</field>
<field name="arch" type="xml">
<search string="Restaurant Reservation">
<filter domain="[('state','in',('confirm','done','order')),('start_date','<=',datetime.datetime.now()),('end_date','>',datetime.datetime.now())]" string="Current Booking" name="current_booking"/>
<separator/>
<filter name="today" domain="[('start_date','>=',datetime.datetime.now().replace(hour=0, minute=0, second=0)),('end_date','<=',datetime.datetime.now().replace(hour=23, minute=59, second=59))]" string="Today's Booking"/>
<separator/>
<group string="States">
<filter icon="terp-check" domain="[('state','=','draft')]" string="Draft" name="draft"/>
<filter domain="[('state','=','confirm')]" string="Confirm" name="confirm"/>
<filter domain="[('state','=','cancel')]" string="Cancel" name="cancel"/>
<filter domain="[('state','=','done')]" string="Done" name="done"/>
</group>
<field name="room_no"/>
<field name="start_date"/>
<field name="end_date"/>
<field name="cname"/>
<newline/>
<group expand="0" string="Group By">
<filter name="room_no" string="Room Number" icon="terp-personal" domain="[]" context="{'group_by':'room_no'}"/>
<filter name="cname" string="Customer Name" domain="[]" context="{'group_by':'cname'}"/>
</group>
</search>
</field>
</record>

<!-- Action of hotel restaurant reservation -->
<record id="open_view_hotel_restaurant_reservation_form_tree" model="ir.actions.act_window">
<field name="name">Table Booking</field>
<field name="res_model">hotel.restaurant.reservation</field>

<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_hotel_restaurant_reservation_tree"/>
</record>

<menuitem name="Table Booking" id="menu_open_view_hotel_restaurant_reservation_form_tree" action="open_view_hotel_restaurant_reservation_form_tree" parent="hotel_restaurant_menu"/>

<!-- ======= Orders for Reservation ======= -->
<!-- Form view of hotel reservation order -->
<record id="view_hotel_reservation_order_form" model="ir.ui.view">
<field name="name">hotel_reservation_order.form</field>
<field name="model">hotel.reservation.order</field>
<field name="arch" type="xml">
<form string="Order">
<header>
<button string="Generate KOT" name="reservation_generate_kot" type="object" states="draft" icon="fa-arrow-right" class="oe_highlight"/>
<button string="Generate KOT" name="reservation_update_kot" type="object" states="order" icon="fa-arrow-right" class="oe_highlight"/>
<button string="Done" name="done_kot" type="object" states="order" icon="fa-check" class="oe_highlight"/>
<button name="%(report_hotel_reservation_order_bill)d" attrs="{'invisible' : ['|', ('folio_id','!=',False), ('state','in',('draft','order'))]}" type="action" string="Generate Bill" class="oe_highlight"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<h1>
<label for="order" string="Order" colspan="4"/>
<field name="order_number" colspan="4"/>
</h1>
<group>
<group colspan="4" col="4">
<field name="is_folio"/>
<newline/>
<field name="reservationno"/>
<field name="folio_id" attrs="{'invisible': [('is_folio','=',False)]}"/>
</group>
<group colspan="4" col="4">
<field name="order_date"/>
<field name="waitername"/>
<field name="kitchen_id" invisible="1"/>
<field name="rest_id" widget="many2many_tags" invisible="1"/>
</group>
<newline/>
<separator colspan="4" string="Table List"/>
<field name="table_no" colspan="4" nolabel="1"/>
<newline/>
<separator colspan="4" string="Order List"/>
<field name="order_list" colspan="4" nolabel="1">
<form string="Order List">
<group>
<field name="name"/>
<field name="item_qty"/>
<field name="item_rate"/>
<field name="price_subtotal" invisible="1"/>
</group>
</form>
<tree string="Order List">
<field name="name"/>
<field name="item_qty"/>
<field name="item_rate"/>
<field name="price_subtotal"/>
</tree>
</field>
<newline/>
<group colspan="2" class="oe_subtotal_footer oe_right">
<field name="amount_subtotal" widget="monetary"/>
<field name="tax" widget="monetary"/>
<div class="oe_subtotal_footer_separator oe_inline">
<label for="amount_total"/>
</div>
<field name="amount_total" nolabel="1" widget="monetary"/>
</group>
</group>
</sheet>
</form>
</field>
</record>

<!-- Tree view of hotel reservation order -->
<record id="view_hotel_reservation_order_tree" model="ir.ui.view">
<field name="name">hotel_reservation_order.tree</field>
<field name="model">hotel.reservation.order</field>
<field name="arch" type="xml">
<tree string="Order" colors="blue:state == 'draft';green:state == 'order';grey:state == 'done';" toolbar="1">
<field name="order_number"/>
<field name="reservationno"/>
<field name="order_date"/>
<field name="waitername"/>
<field name="table_no"/>
<field name="state"/>
<field name="amount_total" sum="Order Total"/>
</tree>
</field>
</record>

<!-- Search view of hotel reservation order -->
<record id="view_hotel_reservation_order_search" model="ir.ui.view">
<field name="name">hotel.reservation.order.search</field>
<field name="model">hotel.reservation.order</field>
<field name="arch" type="xml">
<search string="Reservation Order">
<filter name="today" domain="[('order_date','>=',datetime.datetime.now().replace(hour=0, minute=0, second=0)),('order_date','<=',datetime.datetime.now().replace(hour=23, minute=59, second=59))]" string="Today's Orders"/>
<field name="reservationno"/>
<group expand="0" string="Group By">
<filter name="waitername" string="Waiter Name" icon="terp-personal" domain="[]" context="{'group_by':'waitername'}"/>
<filter name="order_date" string="Date" domain="[]" context="{'group_by':'order_date'}"/>
</group>
</search>
</field>
</record>

<!-- Action of hotel reservation order -->
<record id="open_view_hotel_reservation_order_form_tree" model="ir.actions.act_window">
<field name="name">Order</field>
<field name="res_model">hotel.reservation.order</field>

<field name="view_mode">tree,form</field>
</record>

<menuitem id="menu_open_view_hotel_reservation_order_form_tree" name="Orders" action="open_view_hotel_reservation_order_form_tree" parent="hotel_restaurant_menu"/>

<!-- ======= Table Order ======= -->
<!-- Form view of hotel restaurant order -->
<record id="view_hotel_restaurant_order_form" model="ir.ui.view">
<field name="name">hotel_restaurant_order.form</field>
<field name="model">hotel.restaurant.order</field>
<field name="arch" type="xml">
<form string="Order">
<header>
<button string="Generate KOT" name="generate_kot" type="object" states="draft" icon="fa-arrow-right" class="oe_highlight"/>
<button string="Generate KOT" name="generate_kot_update" type="object" states="order" icon="fa-arrow-right" class="oe_highlight"/>
<button string="Done" name="done_order_kot" type="object" states="order" icon="fa-check" class="oe_highlight"/>
<button string="Cancel" name="done_cancel" states="draft,order" type="object" icon="fa-close" class="oe_highlight"/>
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="fa-file-o" class="oe_highlight"/>
<button name="%(report_hotel_res_order_bill)d" attrs="{'invisible' : ['|', ('folio_id','!=',False), ('state','in',('draft','order','cancel'))]}" type="action" string="Generate Bill" class="oe_highlight"/>
<field name="state" widget="statusbar" statusbar_visible="draft,done,cancel"/>
</header>
<sheet>
<h1>
<label for="table_order" string="Table Order" colspan="4"/>
<field name="order_no" colspan="4"/>
</h1>
<group>
<group colspan="2" col="2">
<field name="o_date"/>
<field name="is_folio"/>
</group>
<group colspan="2" col="4">
<field name="folio_id" attrs="{'invisible':[('is_folio','=',False)], 'required':[('is_folio','=',True)]}"/>
<field name="room_no" attrs="{'invisible':[('is_folio','=',False)], 'required':[('is_folio','=',True)]}"/>
</group>
<group colspan="2" col="4">
<field name="cname"/>
<field name="waiter_name"/>
<field name="kitchen_id" invisible="1"/>
<field name="rest_item_id" widget="many2many_tags" invisible="1"/>
</group>
<newline/>
<separator colspan="4" string="Table List"/>
<field name="table_no" colspan="4" nolabel="1"/>
<newline/>
<separator colspan="4" string="Order List"/>
<field name="order_list" colspan="4" nolabel="1">
<form string="Order List">
<group>
<field name="name"/>
<field name="item_qty"/>
<field name="item_rate"/>
<field name="price_subtotal" invisible="1"/>
</group>
</form>
<tree string="Order List">
<field name="name"/>
<field name="item_qty"/>
<field name="item_rate"/>
<field name="price_subtotal"/>
</tree>
</field>
<newline/>
<group colspan="2" class="oe_subtotal_footer oe_right">
<field name="amount_subtotal" widget="monetary"/>
<field name="tax" widget="monetary"/>
<div class="oe_subtotal_footer_separator oe_inline">
<label for="amount_total"/>
</div>
<field name="amount_total" nolabel="1" widget="monetary"/>
</group>
</group>
</sheet>
</form>
</field>
</record>

<!-- Tree view of hotel restaurant order -->
<record id="view_hotel_restaurant_order_tree" model="ir.ui.view">
<field name="name">hotel_restaurant_order.tree</field>
<field name="model">hotel.restaurant.order</field>
<field name="arch" type="xml">
<tree string="Order" colors="blue:state == 'draft';green:state == 'order';grey:state == 'done';" toolbar="1">
<field name="order_no"/>
<field name="o_date"/>
<field name="table_no"/>
<field name="room_no"/>
<field name="waiter_name"/>
<field name="state"/>
<field name="amount_total" sum="Table Order Total"/>
</tree>
</field>
</record>

<!-- Search view of hotel restaurant order -->
<record id="view_hotel_restaurant_order_search" model="ir.ui.view">
<field name="name">hotel.restaurant.order.search</field>
<field name="model">hotel.restaurant.order</field>
<field name="arch" type="xml">
<search string="Restaurant Order">
<filter name="today" domain="[('o_date','>=',datetime.datetime.now().replace(hour=0, minute=0, second=0)),('o_date','<=',datetime.datetime.now().replace(hour=23, minute=59, second=59))]" string="Today's Orders"/>
<field name="order_no"/>
<group expand="0" string="Group By">
<filter name="waiter_name" string="waiter name" icon="terp-personal" domain="[]" context="{'group_by':'waiter_name'}"/>
<filter name="o_date" string="date" domain="[]" context="{'group_by':'o_date'}"/>
</group>
</search>
</field>
</record>

<!-- Action of hotel restaurant order -->
<record id="open_view_hotel_restaurant_order_form_tree" model="ir.actions.act_window">
<field name="name">Table Order</field>
<field name="res_model">hotel.restaurant.order</field>

<field name="view_mode">tree,form</field>
</record>

<menuitem id="menu_open_view_hotel_restaurant_order_form_tree" name="Table Order" action="open_view_hotel_restaurant_order_form_tree" sequence="11" parent="hotel_restaurant_menu"/>


<!-- ======= Kitchen Order List ======= -->
<!-- Form view of hotel restaurant kitchen order tickets -->
<record id="view_hotel_restaurant_kitchen_order_tickets_form" model="ir.ui.view">
<field name="name">hotel_restaurant_kitchen_order_tickets.form</field>
<field name="model">hotel.restaurant.kitchen.order.tickets</field>
<field name="arch" type="xml">
<form string="KOT List" create="0" edit="0">
<sheet>
<group>
<group colspan="4">
<field name="orderno"/>
<field name="resno"/>
</group>
<group>
<field name="kot_date"/>
</group>
<group colspan="4" col="4">
<field name="room_no"/>
<field name="w_name"/>
</group>
<newline/>
<separator colspan="4" string="Table List"/>
<field name="tableno" colspan="4" nolabel="1"/>
<newline/>
<separator colspan="4" string="Order List"/>
<field name="kot_list" colspan="4" nolabel="1">
<form string="Order List">
<group>
<field name="name"/>
<field name="item_qty"/>
<field name="item_rate"/>
</group>
</form>
<tree string="Order List">
<field name="name"/>
<field name="item_qty"/>
</tree>
</field>
</group>
</sheet>
</form>
</field>
</record>

<!-- Tree view of hotel restaurant kitchen order tickets -->
<record id="view_hotel_restaurant_kitchen_order_tickets_tree" model="ir.ui.view">
<field name="name">hotel_restaurant_kitchen_order_tickets.tree</field>
<field name="model">hotel.restaurant.kitchen.order.tickets</field>
<field name="arch" type="xml">
<tree string="KOT List" create="0">
<field name="orderno"/>
<field name="resno"/>
<field name="kot_date"/>
<field name="room_no"/>
<field name="w_name"/>
<field name="tableno"/>
<field name="kot_list"/>
</tree>
</field>
</record>

<!-- Search view of hotel restaurant kitchen order tickets -->
<record id="view_hotel_restaurant_kitchen_order_search" model="ir.ui.view">
<field name="name">hotel.restaurant.kitchen.order.tickets.search
</field>
<field name="model">hotel.restaurant.kitchen.order.tickets</field>
<field name="arch" type="xml">
<search string="Restaurant kitchen Order">
<filter name="today" domain="[('kot_date','>=',datetime.datetime.now().replace(hour=0, minute=0, second=0)),('kot_date','<=',datetime.datetime.now().replace(hour=23, minute=59, second=59))]" string="Today's Orders"/>
<field name="orderno"/>
<group expand="0" string="Group By">
<filter name="w_name" string="Waiter Name" icon="terp-personal" domain="[]" context="{'group_by':'w_name'}"/>
<filter name="kot_date" string="Date" domain="[]" context="{'group_by':'kot_date'}"/>
</group>
</search>
</field>
</record>

<!-- Action of hotel restaurant kitchen order tickets -->
<record id="open_view_hotel_restaurant_kitchen_order_tickets_form_tree" model="ir.actions.act_window">
<field name="name">Kitchen Order Tickets</field>
<field name="res_model">hotel.restaurant.kitchen.order.tickets</field>

<field name="view_mode">tree,form</field>
</record>

<menuitem name="Kitchen Order Ticket" id="menu_open_view_hotel_restaurant_kitchen_order_tickets_form_tree" action="open_view_hotel_restaurant_kitchen_order_tickets_form_tree" sequence="12" parent="hotel_restaurant_menu"/>

<!-- ======= Food Item Category ======= -->
<!-- Form view of hotel menu card type -->
<record id="view_hotel_menucard_type_form" model="ir.ui.view">
<field name="name">hotel_menucard_type_form</field>
<field name="model">hotel.menucard.type</field>
<field name="arch" type="xml">
<form string="Hotel Food Items Type">
<sheet>
<group>
<field name="name" string="Food Item Name"/>
<field name="menu_id" string="Food Item Type"/>
<field name="child_ids" invisible="1"/>
</group>
</sheet>
</form>
</field>
</record>

<!-- Tree view of hotel menu card type -->
<record id="view_hotel_menucard_type_list" model="ir.ui.view">
<field name="name">hotel_menucard_type_list</field>
<field name="model">hotel.menucard.type</field>
<field name="arch" type="xml">
<tree string="Hotel Food Items Type">
<field name="name"/>
</tree>
</field>
</record>

<!-- Action of hotel menu card type -->
<record id="action_hotel_menucard_type_view_form" model="ir.actions.act_window">
<field name="name">Food Item Type</field>
<field name="res_model">hotel.menucard.type</field>

<field name="view_mode">tree,form</field>
</record>

<menuitem id="menu_hotel_food_item" name="Food Item" parent="hotel.hotel_configuration_menu" sequence="2"/>
<menuitem id="menu_action_hotel_menucard_type_view_form" name="Food Item Types" action="action_hotel_menucard_type_view_form" parent="menu_hotel_food_item" sequence="12"/>

<!-- Form view of hotel menu card -->
<record model="ir.ui.view" id="view_hotel_menucard_form">
<field name="name">hotel.menucard.form</field>
<field name="model">hotel.menucard</field>
<field name="arch" type="xml">
<form string="Hotel Menucard">
<sheet>
<field name="image" widget="image" class="oe_avatar oe_left"/>
<div class="oe_title">
<div class="oe_edit_only">
<label for="name" string="Food Item Name"/>
</div>
<h1>
<field name="name"/>
</h1>
</div>
<notebook>
<page name="information" string="Information">
<group colspan="4" col="2">
<group colspan="4" col="4">
<field name="type" select="2" string="Food Type"/>
<field name="categ_id" string="Food Item Type"/>
<field name="product_manager" select="2" string="Food Manager"/>
<field name="uom_id"/>
<field name="uom_po_id"/>
</group>
</group>
<newline/>
<separator string="Supplier Taxes" colspan="4"/>
<field name="supplier_taxes_id" colspan="4" help="List of supplier taxes applied on the perticular Food Item. "/>
<newline/>
<separator string="Customer Taxes" colspan="4"/>
<field name="taxes_id" colspan="4" help="List of customer taxes applied on the perticular Food Item."/>
</page>
<page name="procurement" string="Procurement">
<group colspan="4" col="4">
<field name="cost_method"/>
<field name="active" select="2"/>
<field name="list_price"/>
<field name="sale_ok" select="2"/>
<field name="standard_price"/>
<field name="rental" select="2"/>
<field name="price_extra"/>
<separator string="Suppliers" colspan="4"/>
<field name="seller_ids" colspan="4" nolabel="1" widget="one2many_list"/>
</group>
</page>
<page name="description" string="Descriptions">
<separator string="Description"/>
<field name="description" colspan="4" nolabel="1"/>
<separator string="Sale Description"/>
<field name="description_sale" colspan="4" nolabel="1"/>
<separator string="Purchase Description"/>
<field name="description_purchase" colspan="4" nolabel="1"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>

<!-- Tree view of hotel menu card -->
<record id="view_hotel_menucard_tree" model="ir.ui.view">
<field name="name">hotel.menucard.tree</field>
<field name="model">hotel.menucard</field>
<field name="arch" type="xml">
<tree string="Hotel Menucard">
<field name="name"/>
<field name="categ_id" string="Food Item Type"/>
<field name="list_price" string="Food Item Rate"/>
</tree>
</field>
</record>

<!-- Search view of hotel menu card -->
<record id="view_hotel_menucard_search_new" model="ir.ui.view">
<field name="name">hotel.menucard.search</field>
<field name="model">hotel.menucard</field>
<field name="arch" type="xml">
<search string="Hotel Menucard">
<field name="name"/>
<field name="categ_id" string="Food Item Type"/>
<field name="list_price"/>
<separator/>
<group expand="0" string="Group By">
<filter name="category" string="Categoty" domain="[]" context="{'group_by':'categ_id'}"/>
</group>
</search>
</field>
</record>

<!-- Kanban view of hotel menu card -->
<record id="hotel_manucard_kanban_view" model="ir.ui.view">
<field name="name">Menucard Kanban</field>
<field name="model">hotel.menucard</field>
<field name="arch" type="xml">
<kanban>
<field name="id"/>
<field name="image_small"/>
<field name="lst_price"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="o_kanban_image">
<img alt="" t-att-src="kanban_image('hotel.menucard', 'image_small', record.id.raw_value)"/>
</div>
<div class="oe_kanban_details">
<h4>
<a type="open">
<t t-if="record.code.raw_value">
[
<field name="code"/>
]
</t>
<field name="name"/>
</a>
</h4>
<div name="tags"/>
<ul>
<li>
Price:
<field name="lst_price"/>
</li>
<li>
Category:
<field name="categ_id"/>
</li>
</ul>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>

<!-- Action of hotel menu card -->
<record id="action_hotel_menucard_form" model="ir.actions.act_window">
<field name="name">Food Item</field>
<field name="res_model">hotel.menucard</field>

<field name="view_mode">kanban,tree,form</field>
<field name="context">{'default_available_in_pos':0}
</field>
<field name="search_view_id" ref="view_hotel_menucard_search_new"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to Add Food Items
</p>
<p>
No Food Items
</p>
</field>
</record>

<menuitem name="Food Items" id="menu_open_hotel_menucard_form" action="action_hotel_menucard_form" parent="menu_hotel_food_item"/>

</odoo>

Avatar
Discard
Best Answer

Hi,

Update the tree view like this,

<record id="view_hotel_restaurant_reservation_tree" model="ir.ui.view" >
<field name="name">hotel_restaurant_reservation.tree</field>
<field name="model">hotel.restaurant.reservation</field>
<field name="arch" type="xml">
<tree string="Table Reservation">
<field name="reservation_id"/>
<field name="folio_id"/>
<field name="room_no"/>
<field name="start_date"/>
<field name="end_date"/>
<field name="cname"/>
<field name="partner_address_id"/>
<field name="tableno"/>
<field name="state"/>
</tree>
</field>
</record>

Remove colors="blue:state == 'draft';green:state == 'order';grey:state == 'done';" toolbar="1" . 

Rather than posting the entire code please try to post the necessary lines, in the error message itself, it is specified issue is in tree view, so you better post the code of tree view only. Also while posting the code, try to keep indendations.

Thanks

Avatar
Discard
Related Posts Replies Views Activity
4
May 24
10074
1
Apr 24
1564
0
Nov 23
525
1
Sep 23
567
2
Aug 23
2427