跳至內容
Odoo 選單
  • 登入
  • 免費試用
  • 應用程式
    財政
    • 會計
    • 發票
    • 開支報銷
    • 試算表 (BI)
    • 文件管理
    • 電子簽名
    銷售
    • 客戶關係
    • 銷售
    • POS 銷售點管理 - 零售
    • POS 銷售點管理 - 餐廳
    • 訂閱
    • 租賃
    網站
    • 網站製作
    • 電子商務
    • 網誌
    • 討論區
    • 線上客服
    • 網上學習
    供應鏈
    • 庫存
    • 製造管理
    • 產品生命周期
    • 採購
    • 保養維護
    • 品質管理
    人力資源
    • 員工管理
    • 招聘
    • 休假
    • 工作表現評核
    • 內部推薦
    • 車隊管理
    市場推廣
    • 社交媒體推廣
    • 電郵推廣
    • 短訊營銷
    • 活動
    • 自動化推廣
    • 網上調查
    服務
    • 專案管理
    • 工時管理
    • 外勤服務管理
    • 技術支援
    • 工作規劃
    • 預約管理
    生產力
    • 聊天
    • 批核
    • 物聯網
    • VoIP
    • 知識庫
    • WhatsApp
    第三方應用程式 Odoo Studio Odoo 雲端平台
  • 行業
    零售
    • 書店
    • 服裝店
    • 家具店
    • 食品雜貨店
    • 五金店
    • 玩具店
    餐飲及款待
    • 酒吧及酒館
    • 餐廳
    • 快餐
    • 賓館
    • 飲品分銷商
    • 酒店
    房地產
    • 地產代理公司
    • 建築師事務所
    • 建造業
    • 物業管理
    • 園藝
    • 業主聯會
    顧問服務
    • 會計公司
    • Odoo 合作夥伴
    • 市場推廣公司
    • 律師事務所
    • 人才招募
    • 審計及認證
    製造管理
    • 紡織
    • 金屬
    • 家具
    • 食品
    • 啤酒廠
    • 企業禮品
    保健與健身
    • 運動俱樂部
    • 眼鏡店
    • 健身中心
    • 健康從業人員
    • 藥房
    • 髮型屋
    技術行業
    • 雜工
    • IT 硬體與支援
    • 太陽能系統
    • 鞋匠
    • 清潔服務
    • 暖通空調服務
    其他
    • 非牟利組織
    • 環境保護機構
    • 廣告板租賃
    • 攝影服務
    • 自行車租賃
    • 軟體經銷商
    瀏覽所有行業
  • 社群
    學習
    • 教學影片
    • 使用說明
    • 認證
    • 培訓
    • 網誌
    • Podcast
    增強教學效能
    • 教育計劃
    • Scale Up! 商業遊戲
    • 到訪 Odoo
    取得軟件
    • 下載
    • 版本對照表
    • 版本說明
    合作
    • GitHub
    • 討論區
    • 活動
    • 翻譯
    • 成為合作夥伴
    • 合作夥伴服務
    • 登記你的會計服務公司
    獲取服務相關資料
    • 尋找合作夥伴
    • 尋找會計服務
    • 預約顧問諮詢
    • 安裝及推行服務
    • 客戶案例
    • 支援
    • 軟件升級
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    預約示範
  • 定價
  • 技術支援

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • 客戶關係
  • e-Commerce
  • 會計
  • 庫存
  • PoS
  • 專案管理
  • MRP
All apps
只限註冊用戶才可與社群互動。
所有帖文 人 獎章
標籤 (查看所有)
odoo accounting v14 pos v15
關於此討論區
只限註冊用戶才可與社群互動。
所有帖文 人 獎章
標籤 (查看所有)
odoo accounting v14 pos v15
關於此討論區
支援

raise ValidationError(_('Invalid view %s definition in %s') % (view_name, view.arch_fs))

訂閱

此帖文有活動時,接收通知

此問題已被標幟
Odoo13.0
1 回覆
7820 瀏覽次數
頭像
Ali elgarhi

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>

0
頭像
捨棄
頭像
Niyas Raphy (Walnut Software Solutions)
最佳答案

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

3
頭像
捨棄
喜歡這則討論?不要只閱讀,加入發表意見吧!

今天就建立帳戶,享受獨家功能,與我們精彩的社群互動!

註冊
相關帖文 回覆 瀏覽次數 活動
Odoo 13. Don't close a wizard when Click a button 已解決
Odoo13.0
頭像
頭像
頭像
頭像
4
5月 24
14334
Permission error while user printing excel sheet report in odoo 13 已解決
Odoo13.0
頭像
頭像
1
4月 24
4473
One2many field edited from Transient Model cannot be made empty.
Odoo13.0
頭像
0
11月 23
3160
Blank White Page After log in to Odoo13 已解決
Odoo13.0
頭像
1
9月 23
3283
How can I translate Options in Selection.field? 已解決
Odoo13.0
頭像
頭像
2
8月 23
6116
社群
  • 教學影片
  • 使用說明
  • 討論區
開源
  • 下載
  • GitHub
  • Runbot 測試環境
  • 翻譯
服務
  • odoo.sh 網頁寄存
  • 支援
  • 升級
  • 自訂功能開發
  • 教育及培訓
  • 尋找會計服務
  • 尋找合作夥伴
  • 成為合作夥伴
關於我們
  • 關於 Odoo 公司
  • 品牌資產
  • 聯絡我們
  • 招聘
  • 活動
  • Podcast
  • 網誌
  • 客戶
  • 法律 • 私隱政策
  • 安全性
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo 是一套開放源碼的商業管理系統,涵蓋你公司全部的營運需要,包括客戶關係管理(CRM)、電子商務、會計、庫存管理、POS(銷售點管理)、專案管理等應用程式。

Odoo 的獨特價值是非常簡單易用,同時將不同應用程式完美整合。

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now