Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
1474 Vizualizări

That's my source code who can guide what's the issue


1)doctor.xml

xml version="1.0" encoding="utf-8"?><odoo>    <recordid="action_hospital_doctor"model="ir.actions.act_window">        <fieldname="name">Doctorfield>        <fieldname="type">ir.actions.act_windowfield>        <fieldname="res_model">hospital.doctorsfield>        <fieldname="view_mode">kanban,tree,formfield>        <fieldname="context">{}field>        <fieldname="help"type="html">            <pclass="o_view_nocontent_smiling_face">                Create your first Doctor.            p>        field>    record>    <menuitemid="menu_doctor_root"name="Doctors"sequence="10"patient="menu_hospital_root"/>
    <menuitemid="menu_doctor"name="Doctors"parent="menu_doctor_root"action="action_hospital_doctor"sequence="10"/>odoo>


2) doctor.py

# -*- coding: utf-8 -*-
fromodooimportmodels,fields,api,_

classHospitalDoctor(models.Model):        _name='hospital.doctor'    _inherit=['portal.mixin','mail.thread','mail.activity.mixin']# inheriting mail.thread class for chatter    _description='Hospital Doctor'
    doctor_name=fields.Char(string='Name',required=True,tracking=True)    age=fields.Integer(string='Age',tracking=True)    gender=fields.Selection([        ('male','Male'),        ('female','Female'),        ('other','Other')        ],required=True,default='male',tracking=True    )    note=fields.Text(string='Description')    image=fields.Binary(string="Doctor Image")



Below is the error that i am recieving:


Odoo Server Error
Traceback (most recent call last):
  File "/home/hamza/odoo/odoo-server/odoo/http.py", line 624, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/hamza/odoo/odoo-server/odoo/http.py", line 310, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/home/hamza/odoo/odoo-server/odoo/tools/pycompat.py", line 14, in reraise
    raise value
  File "/home/hamza/odoo/odoo-server/odoo/http.py", line 669, in dispatch
    result = self._call_function(**self.params)
  File "/home/hamza/odoo/odoo-server/odoo/http.py", line 350, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/hamza/odoo/odoo-server/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/hamza/odoo/odoo-server/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/hamza/odoo/odoo-server/odoo/http.py", line 915, in __call__
    return self.method(*args, **kw)
  File "/home/hamza/odoo/odoo-server/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/home/hamza/odoo/odoo-server/addons/web/controllers/main.py", line 1346, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "/home/hamza/odoo/odoo-server/addons/web/controllers/main.py", line 1334, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/hamza/odoo/odoo-server/odoo/api.py", line 390, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/home/hamza/odoo/odoo-server/odoo/api.py", line 377, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "", line 2, in button_immediate_upgrade
  File "/home/hamza/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 73, in check_and_log
    return method(self, *args, **kwargs)
  File "/home/hamza/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 635, in button_immediate_upgrade
    return self._button_immediate_function(type(self).button_upgrade)
  File "/home/hamza/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 574, in _button_immediate_function
    modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "/home/hamza/odoo/odoo-server/odoo/modules/registry.py", line 87, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/home/hamza/odoo/odoo-server/odoo/modules/loading.py", line 422, in load_modules
    processed_modules += load_marked_modules(cr, graph,
  File "/home/hamza/odoo/odoo-server/odoo/modules/loading.py", line 313, in load_marked_modules
    loaded, processed = load_module_graph(
  File "/home/hamza/odoo/odoo-server/odoo/modules/loading.py", line 225, in load_module_graph
    load_data(cr, idref, mode, kind='data', package=package, report=report)
  File "/home/hamza/odoo/odoo-server/odoo/modules/loading.py", line 68, in load_data
    tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
  File "/home/hamza/odoo/odoo-server/odoo/tools/convert.py", line 736, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/home/hamza/odoo/odoo-server/odoo/tools/convert.py", line 786, in convert_xml_import
    relaxng.assert_(doc)
  File "src/lxml/etree.pyx", line 3547, in lxml.etree._Validator.assert_
AssertionError: Element odoo has extra content: record, line 3

 

Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

There is some syntax issue in your xml code, please refer the attached sample:


<record id="action_hospital_patient" model="ir.actions.act_window">
<field name="name">Patientsfield>
<field name="type">ir.actions.act_windowfield>
<field name="res_model">hospital.patientfield>
<field name="view_mode">tree,formfield>
<field name="context">{'search_default_filter_child':1}field>
<field name="search_view_id" ref="om_hospital.view_hospital_patient_search"/>
record>

<menuitem id="menu_patients"
name="Patients"
parent="menu_hospital_operations"
action="action_hospital_patient"
sequence="10"/>



Thanks

Imagine profil
Abandonează