跳至内容
Odoo 菜单
  • 登录
  • 免费试用
  • 应用程序
    财务
    • 会计
    • 发票
    • 费用
    • 电子表格 (BI)
    • 文档
    • 电子签名
    销售
    • 客户关系管理
    • 销售
    • POS 销售点管理-零售
    • POS 销售点管理 - 餐厅
    • 订阅
    • 租赁
    网站
    • 网站设计
    • 电子商务
    • 博客
    • 论坛
    • 在线客服
    • 在线学习
    供应链
    • 库存
    • 制造
    • 产品生命周期
    • 采购
    • 维护保养
    • 品控
    人力资源
    • 员工
    • 招聘
    • 休假
    • 评价
    • 内部推荐
    • 车队
    营销
    • 社媒营销
    • 电邮营销
    • 短信营销
    • 近期活动
    • 营销自动化
    • 网上调查
    服务
    • 项目管理
    • 工时单
    • 现场服务
    • 服务台
    • 排期
    • 预约
    生产力
    • 讨论
    • 批核
    • IoT物联网
    • VoIP
    • 知识库
    • WhatsApp
    第三方应用软件 Odoo 定制 Odoo云端平台
  • 行业
    零售
    • 书店
    • 服装店
    • 家具店
    • 食品杂货店
    • 五金店
    • 玩具店
    餐饮与酒店服务
    • 酒吧及酒馆
    • 餐厅
    • 快餐
    • 民宿
    • 饮品分销商
    • 酒店
    房地产
    • 房地产代理
    • 建筑师事务所
    • 建造业
    • 地产管理
    • 园艺
    • 业主协会
    咨询
    • 会计师事务所
    • Odoo合作伙伴
    • 市场推广公司
    • 律师事务所
    • 人才招聘
    • 审核 & 认证
    制造
    • 纺织
    • 金属
    • 家具
    • 食品
    • 啤酒厂
    • 企业礼品
    保健与健身
    • 体育俱乐部
    • 眼镜店
    • 健身中心
    • 健康从业者
    • 药房
    • 发型屋
    商贸服务
    • 维修人员
    • IT 硬件及支持
    • 太阳能系统
    • 鞋匠
    • 清洁服务
    • 暖通空调服务
    其他
    • 非营利组织
    • 环境机构
    • 广告牌租赁
    • 摄影服务
    • 自行车租赁
    • 软件经销商
    浏览所有行业
  • 社区
    学习
    • 教学视频
    • 文档
    • 认证
    • 培训
    • 博客
    • 播客
    赋能教育
    • 教育计划
    • 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 回复
7797 查看
形象
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
14302
Permission error while user printing excel sheet report in odoo 13 已解决
Odoo13.0
形象
形象
1
4月 24
4465
One2many field edited from Transient Model cannot be made empty.
Odoo13.0
形象
0
11月 23
3145
Blank White Page After log in to Odoo13 已解决
Odoo13.0
形象
1
9月 23
3281
How can I translate Options in Selection.field? 已解决
Odoo13.0
形象
形象
2
8月 23
6101
社区
  • 教学视频
  • 文档
  • 论坛
开源
  • 下载
  • Github
  • Runbot
  • 翻译
服务
  • Odoo.sh 托管
  • 支持
  • 升级
  • 自定义开发服务
  • 教育
  • 查找会计服务
  • 寻找合作伙伴
  • 成为合作伙伴
关于我们
  • 我们的公司
  • 品牌资产
  • 联系我们
  • 招聘
  • 近期活动
  • 播客
  • 博客
  • 客户
  • 法律 • 隐私
  • 安全
الْعَرَبيّة 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致力于为企业管理提供高效智能的开源解决方案,是全球业内高速成长的软件服务商之一,逾七百五十万用户选择Odoo进行数字化升级。通过一系列全业务链覆盖、高度集成、简单易用的商业应用,助力企业实现信息化改革、降本增效并释放公司增长潜力。

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