Skip to Content
Menu
This question has been flagged
1731 Views

hello!

i create a new module depend on purchase, sale, invoice, etc ...

1 - i get error when trying to print a report in odoo12.

2- i get also duplicate menu item and duplicate print button that i don't undertund (you can see it in pictures)


How can i solve my problem?


[PYTHON CODE]

class bp_retenue2(models.Model):

    _name = "bp.retenue2"


    name = fields.Char("Reference")

    date = fields.Date("Date", required=True)

    montant = fields.Float("Montant", required=True) 

    partner_id = fields.Many2one('res.partner', string='Entreprise') 


[/CODE]


[VIEW CODE]

<record id="bpretenue2_tree" model="ir.ui.view">

            <field name="name">bp.retenue2</field>

            <field name="model">bp.retenue2</field>

            <field name="arch" type="xml">

                <tree string="Gestion des retenues">

                        <field name="date" />

                        <field name="name" />

                        <field name="partner_id" />

                        <field name="montant" />

                        

                </tree>

            </field>

        </record>


       <record model="ir.actions.act_window" id="action_bp_retenue2">

        <field name="name">bp.retenue2</field>

        <field name="type">ir.actions.act_window</field>

        <field name="res_model">bp.retenue2</field>

        <field name="view_type">form</field>

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

        <field name="view_id" ref="bpretenue2_tree"/>

        <field name="help" type="html">

            <p class="oe_view_nocontent_create">

            Cliquer ici pour ajouter une retenue

            </p>

        </field>

        </record>

<menuitem id="retenue2" 

            parent="purchase.menu_purchase_root"

            name="Retenue BP"

            action="action_bp_retenue2"

            />

[/CODE]


[PRINT ITEM CODE]

<report 

            id="retenue2"

            model="bp.retenue2"

            string="Retenue BP"

            report_type="qweb-pdf"

            name="bp_report.retenue2"

            file="bp_report.retenue2"

menu="True"

            />

[/CODE]


[ERROR]

Erreur:

Odoo Server Error


Traceback (most recent call last):

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\cache.py", line 88, in lookup

    r = d[key]

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\func.py", line 69, in wrapper

    return func(self, *args, **kwargs)

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\lru.py", line 44, in __getitem__

    a = self.d[obj].me

KeyError: ('ir.qweb', <function IrQWeb.compile at 0x0440D468>, 403, ('fr_FR', False, None, None, None, None))


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\cache.py", line 88, in lookup

    r = d[key]

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\func.py", line 69, in wrapper

    return func(self, *args, **kwargs)

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\lru.py", line 44, in __getitem__

    a = self.d[obj].me

KeyError: ('ir.ui.view', <function View._read_template at 0x0412DAE0>, frozenset({1, 2, 3, 6, 7, 12, 14, 15, 19, 20, 22, 23, 27, 28, 29, 30, 31, 38, 39, 40, 48, 49, 54}), 403, ('fr_FR', False, None, None, None))


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\qweb.py", line 374, in get_template

    document = options.get('load', self.load)(template, options)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_qweb.py", line 122, in load

    template = env['ir.ui.view'].read_template(name)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 1216, in read_template

    return self._read_template(self.get_view_id(xml_id))

  File "<decorator-gen-33>", line 2, in _read_template

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\cache.py", line 93, in lookup

    value = d[key] = self.method(*args, **kwargs)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 1207, in _read_template

    arch = self.browse(view_id).read_combined(['arch'])['arch']

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 821, in read_combined

    arch = self.apply_view_inheritance(arch_tree, root.id, self.model)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 769, in apply_view_inheritance

    source = self.apply_inheritance_specs(source, specs_tree, view_id)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 747, in apply_inheritance_specs

    self.raise_view_error(_("Element '%s' cannot be located in parent view") % tag, inherit_id)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 568, in raise_view_error

    raise ValueError(message)

ValueError: L'élément '<xpath expr="//field[@name='value_ids']/tree/field[@name='name']">' ne peut être localisé dans la vue parente


Contexte de l'erreur :

Vue `product.template.attribute.line.form.inherit`

[view_id: 983, xml_id: sale.product_template_attribute_line_form, model: product.template.attribute.line, parent_id: 403]


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\web\controllers\main.py", line 1686, in report_download

    response = self.report_routes(reportname, docids=docids, converter=converter)

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 519, in response_wrap

    response = f(*args, **kw)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\report_xlsx\controllers\main.py", line 59, in report_routes

    reportname, docids, converter, **data

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 519, in response_wrap

    response = f(*args, **kw)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\web\controllers\main.py", line 1627, in report_routes

    pdf = report.with_context(context).render_qweb_pdf(docids, data=data)[0]

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_actions_report.py", line 727, in render_qweb_pdf

    html = self.with_context(context).render_qweb_html(res_ids, data=data)[0]

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_actions_report.py", line 767, in render_qweb_html

    return self.render_template(self.report_name, data), 'html'

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_actions_report.py", line 540, in render_template

    return view_obj.render_template(template, values)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 1338, in render_template

    return self.browse(self.get_view_id(template)).render(values, engine)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\web_editor\models\ir_ui_view.py", line 29, in render

    return super(IrUiView, self).render(values=values, engine=engine, minimal_qcontext=minimal_qcontext)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 1347, in render

    return self.env[engine].render(self.id, qcontext)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_qweb.py", line 59, in render

    result = super(IrQWeb, self).render(id_or_xml_id, values=values, **context)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\qweb.py", line 275, in render

    self.compile(template, options)(self, body.append, values or {})

  File "<decorator-gen-54>", line 2, in compile

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\cache.py", line 93, in lookup

    value = d[key] = self.method(*args, **kwargs)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_qweb.py", line 114, in compile

    return super(IrQWeb, self).compile(id_or_xml_id, options=options)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\qweb.py", line 292, in compile

    element, document = self.get_template(template, options)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\qweb.py", line 378, in get_template

    raise QWebException("load could not load template", name=template)

odoo.addons.base.models.qweb.QWebException: None

Traceback (most recent call last):

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\cache.py", line 88, in lookup

    r = d[key]

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\func.py", line 69, in wrapper

    return func(self, *args, **kwargs)

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\lru.py", line 44, in __getitem__

    a = self.d[obj].me

KeyError: ('ir.qweb', <function IrQWeb.compile at 0x0440D468>, 403, ('fr_FR', False, None, None, None, None))


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\cache.py", line 88, in lookup

    r = d[key]

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\func.py", line 69, in wrapper

    return func(self, *args, **kwargs)

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\lru.py", line 44, in __getitem__

    a = self.d[obj].me

KeyError: ('ir.ui.view', <function View._read_template at 0x0412DAE0>, frozenset({1, 2, 3, 6, 7, 12, 14, 15, 19, 20, 22, 23, 27, 28, 29, 30, 31, 38, 39, 40, 48, 49, 54}), 403, ('fr_FR', False, None, None, None))


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\qweb.py", line 374, in get_template

    document = options.get('load', self.load)(template, options)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_qweb.py", line 122, in load

    template = env['ir.ui.view'].read_template(name)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 1216, in read_template

    return self._read_template(self.get_view_id(xml_id))

  File "<decorator-gen-33>", line 2, in _read_template

  File "C:\Program Files (x86)\Odoo 12.0\server\odoo\tools\cache.py", line 93, in lookup

    value = d[key] = self.method(*args, **kwargs)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 1207, in _read_template

    arch = self.browse(view_id).read_combined(['arch'])['arch']

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 821, in read_combined

    arch = self.apply_view_inheritance(arch_tree, root.id, self.model)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 769, in apply_view_inheritance

    source = self.apply_inheritance_specs(source, specs_tree, view_id)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 747, in apply_inheritance_specs

    self.raise_view_error(_("Element '%s' cannot be located in parent view") % tag, inherit_id)

  File "c:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_ui_view.py", line 568, in raise_view_error

    raise ValueError(message)

ValueError: L'élément '<xpath expr="//field[@name='value_ids']/tree/field[@name='name']">' ne peut être localisé dans la vue parente


Contexte de l'erreur :

Vue `product.template.attribute.line.form.inherit`

[view_id: 983, xml_id: sale.product_template_attribute_line_form, model: product.template.attribute.line, parent_id: 403]


load could not load template

Template: 403

[ERROR]



Avatar
Discard