Skip to Content
Menu
This question has been flagged
4 Replies
10360 Views

that's my source code:

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <data>
        <record id="view_form_biblio_inherited" model="ir.ui.view">
            <field name="name">Heritage biblio – ajout nombre de pages</field>
            <field name="model">biblioth.livre</field>
            <field name="inherit_id" ref="Bibliotheque de test.library_book_view_form"/>
            <field name="arch" type="xml">
                <field name="description" position="after">
                    <field name="pages_number"/>
                </field>

            </field>
        </record>
        <record model="ir.actions.act_window" id="livre_action">
            <field name="name">Document</field>
            <field name="res_model">biblioth.livre</field>
            <field name="view_mode">tree,form,kanban</field>
            <field name="help" type="html">
                <p class="oe_view_nocontent_create">Créer le premier livre de cette bibliotheque
                </p>
            </field>
        </record>
        <record model="ir.actions.act_window" id="inscription_action">
                        <field name="name">Inscription</field>
            <field name="res_model">biblio.inscription</field>
            <field name="view_mode">tree,form,calendar,graph,kanban</field>
            <field name="help" type="html">
                <p class="oe_view_nocontent_create">Enregistrer les inscriptions des utilisateurs de bibliotheque
                </p>
            </field>
        </record>
        <record id="calendar_inscription" model="ir.ui.view">
            <field name="model">biblio.inscription</field>
            <field name="arch" type="xml">
                <calendar date_start="date_debut_inscription" date_stop="date_fin_inscription"
                          color="nom_utilisateur">
                </calendar>
            </field>
        </record>
        <record model="ir.ui.view" id="livres_lus_graph_view">
            <field name="name">biblio.inscription.graph</field>
            <field name="model">biblio.inscription</field>
            <field name="arch" type="xml">
                <graph string="Nombre de livres lus par utilsateur">
                    <field name="nom_utilisateur"/>
                    <field name="nombre_livres_lus" type="measure"/>
                </graph>
            </field>
        </record>
        <record model="ir.ui.view" id="livre_kanban_view">
            <field name="name">VueKanbanlivre</field>
            <field name="model">biblioth.livre</field>
            <field name="arch" type="xml">
                <kanban>
                    <templates>
                        <t t-name="kanban-box">
                            <div class="oe_resource_vignette">
                                <div class="oe_resource_image">
                                    <a type="edit">
                                        <img t-att-src="kanban_image('biblio.livre', 'photo', record.id.value)"
                                             class="oe_resource_picture"/>
                                    </a>

                                </div>
                                <div class="oe_resource_details">
                                    <ul>
                                        OR ADD
                                        <li>
                                            <field name="id"/>
                                        </li>
                                        <li>
                                            <field name="name"/>
                                        </li>
                                        <li>
                                            <field name="description"/>
                                        </li>
                                        <li>
                                            <field name="book_genre"/>
                                                                                    </li>
                                    </ul>
                                </div>
                            </div>
                        </t>
                    </templates>
                </kanban>
            </field>
        </record>
        <record id="library_situation_view_form" model="ir.ui.view">
            <field name="name">Library Book Situation Form</field>
            <field name="model">biblio.general</field>
            <field name="arch" type="xml">
                <form>
                    <group>
                        <field name="total_number_of_books"/>
                        <field name="number_of_books_out"/>
                        <field name="date_situation"/>
                    </group>
                    <group>
                        <field name="taken_books_percentage"/>
                    </group>
                </form>
            </field>
        </record>
        <record model="ir.actions.act_window" id="situation_action">
            <field name="name">Document</field>
            <field name="res_model">biblio.general</field>
            <field name="view_mode">tree,form</field>
            <field name="help" type="html">
                <p class="oe_view_nocontent_create">Donner la situation de la bibliotheque
                </p>
            </field>
        </record>
        <record model="ir.ui.view" id="Workflow_buttons">
            <field name="name">inscription.form</field>
            <field name="model">biblio.inscription</field>
            <field name="arch" type="xml">
        <form string="Inscription Form">
            <header>
                    <button name="action_noninscrit" type="object"
                            string="Mettre fin à l'inscription de cet utilsateur"
                            states="inscrit"/>
                    <button name="action_inscrit" type="object"
                            string="Inscrire cet utilisateur" states="non_inscrit"
                            class="oe_highlight"/>
                    </header>

                    <group>
                        <field name="nom_utilisateur"/>
                        <field name="date_debut_inscription"/>
                        <field name="date_fin_inscription"/>
                        <field name="nombre_livres_lus"/>


                    </group>
                     <group>
                        <field name="state"/>
                    </group>


                </form>
            </field>
        </record>

        <record model="ir.ui.view" id="wizard_form_view">
            <field name="name">wizard.form</field>
            <field name="model">biblio.wizard</field>
            <field name="arch" type="xml">
                <form string="Réinscrire utilisateur">
                    <group>
                        <field name="Date_reinscription"/>
                        <field name="Date_finscription"/>
                    </group>
                    <footer>
                        <button name='action_reinscrire'
                                string='Réinscrire Utilisateur'
                                class='oe_highlight'
                                type='object'/>
                        ou
                        <button string='Cancel'
                                class='btn-default'
                                special='cancel'/>

                    </footer>
                </form>
            </field>
        </record>


        <act_window id="launch_book_wizard"
            name="Reinscire utilisateur"
            binding_model="biblio.inscription"
            res_model="biblio.wizard"
            view_mode="form"
            target="new"
            key2="client_action_multi"/>

        <menuitem id="main_menu" name="H-BiblioTest"/>
        <menuitem id="Livre_menu" name="H-LivreTest" parent="main_menu"/>
        <menuitem id="inscriptiontest_menu" name="H-Inscriptiontest" parent="main_menu"/>
        <menuitem id="ouvrage_menu" name="H-Ouvrage" parent="Livre_menu" action="livre_action"/>
        <menuitem id="inscription_menu" name="H-Inscription" parent="inscriptiontest_menu" action="inscription_action"/>
        <menuitem id="situation_menu" name="H-Situation" parent="Livre_menu" action="situation_action"/>

    </data>
</odoo>

that's is error :

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



----------------------------------------------------------------
I think that the source of error is

<act_window id="launch_book_wizard"
name="Reinscire utilisateur"
binding_model="biblio.inscription"
res_model="biblio.wizard"
view_mode="form"
target="new"
key2="client_action_multi"/>
some body to help me
Avatar
Discard

try to remove that element tag act_window that you think it's the cause of the issue to test if the module install ok and be able to better assert the problem

Author

thank Axel Mendoza it run now. you are best thankkkkkkkkkkkkkkk

Best Answer

Try it without key2 attribute that was removed in favor of binding_type(default to action):

<act_window id="launch_book_wizard"
            name="Reinscire utilisateur"
            binding_model="biblio.inscription"
            res_model="biblio.wizard"
            binding_views="form"
            view_mode="form"
            target="new"
            />

Avatar
Discard
Author Best Answer
yes without this tag the module works normally. while the code containing this tag is very important to me
Avatar
Discard