Skip to Content
Menu
This question has been flagged
2 Replies
2903 Views

I am trying to create a form on my module, but when i try to open the form  y qet the next error:

Rastreo de error:
Error: [_.sprintf] huh?
    at Function.str_format.parse (http://localhost:8069/web/content/67-9091f7e/web.assets_common.js:192:12)
    at Object.str_format [as sprintf] (http://localhost:8069/web/content/67-9091f7e/web.assets_common.js:174:145)
    at Object.formatFloat [as float] (http://localhost:8069/web/content/68-9c4ee0c/web.assets_backend.js:1025:21)
    at Class._formatValue (http://localhost:8069/web/content/68-9c4ee0c/web.assets_backend.js:900:1237)
    at Class._formatValue (http://localhost:8069/web/content/68-9c4ee0c/web.assets_backend.js:918:20)
    at Class.prototype.<computed> [as _formatValue] (http://localhost:8069/web/content/67-9091f7e/web.assets_common.js:4615:488)
    at Class._prepareInput (http://localhost:8069/web/content/68-9c4ee0c/web.assets_backend.js:913:541)
    at Class._prepareInput (http://localhost:8069/web/content/68-9c4ee0c/web.assets_backend.js:919:98)
    at Class.prototype.<computed> [as _prepareInput] (http://localhost:8069/web/content/67-9091f7e/web.assets_common.js:4615:488)
    at Class._renderEdit (http://localhost:8069/web/content/68-9c4ee0c/web.assets_backend.js:914:105)


This is my view.xml code:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<act_window id="action_lead_stage" name="Lead stages" res_model="leads.leads" view_mode="tree,form"/>

<menuitem name="Leads-Woinfi" id="clientes_woinfi_menu_root"/>
<!-- menu categories -->
<menuitem name="Leads" id="clientes_woinfi.leads" parent="clientes_woinfi_menu_root" action="clientes_woinfi.action_lead_stage"/>

<record id="view_form_lead_ui" model="ir.ui.view">
<field name="name">view_form_lead_ui</field>
<field name="model">leads.leads</field>
<field name="arch" type="xml">
<form>
<group>
<field name="nombre"/>
<field name="apellido"/>
<field name="dni"/>
<field name="municipio"/>
<field name="provincia"/>
<field name="email"/>
<field name="telefono"/>
</group>
<group>
<field name="asunto"/>
<field name="cuando"/>
<field name="ip"/>
<field name="procedencia"/>
<field name="tipo"/>
<field name="fecha"/>
</group>
</form>
</field>
</record>
<record id="view_list_lead_ui" model="ir.ui.view">
<field name="name">view_list_lead_ui</field>
<field name="model">leads.leads</field>
<field name="arch" type="xml">
<tree>
<field name="nombre"/>
<field name="apellido"/>
<field name="dni"/>
<field name="municipio"/>
<field name="provincia"/>
<field name="email"/>
<field name="telefono"/>
<field name="asunto"/>
<field name="cuando"/>
<field name="ip"/>
<field name="procedencia"/>
<field name="tipo"/>
<field name="fecha"/>
</tree>
</field>
</record>
</data>
</odoo>
Avatar
Discard
Best Answer

Hi,

You can try to the following way:

<?xml version="1.0" encoding="utf-8"?>

<odoo>

    <data>

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

            <field name="name">view_form_lead_ui</field>

            <field name="model">leads.leads</field>

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

                <form>

                    <group>

                        <field name="nombre"/>

                        <field name="apellido"/>

                        <field name="dni"/>

                        <field name="municipio"/>

                        <field name="provincia"/>

                        <field name="email"/>

                        <field name="telefono"/>

                    </group>

                    <group>

                        <field name="asunto"/>

                        <field name="cuando"/>

                        <field name="ip"/>

                        <field name="procedencia"/>

                        <field name="tipo"/>

                        <field name="fecha"/>

                    </group>

                </form>

            </field>

        </record>

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

            <field name="name">view_list_lead_ui</field>

            <field name="model">leads.leads</field>

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

                <tree>

                    <field name="nombre"/>

                    <field name="apellido"/>

                    <field name="dni"/>

                    <field name="municipio"/>

                    <field name="provincia"/>

                    <field name="email"/>

                    <field name="telefono"/>

                    <field name="asunto"/>

                    <field name="cuando"/>

                    <field name="ip"/>

                    <field name="procedencia"/>

                    <field name="tipo"/>

                    <field name="fecha"/>

                </tree>

            </field>

        </record>


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

            <field name="name">Lead stages</field>

            <field name="res_model">leads.leads</field>

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

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

              <p class="oe_view_nocontent_create">

                Click to create Leads.

              </p>

            </field>

        </record>


        <menuitem name="Leads Woinfi" id="clientes_woinfi_menu_root"/>

        <!-- menu categories -->

        <menuitem name="Leads" id="clientes_woinfi.leads" parent="clientes_woinfi_menu_root" action="clientes_woinfi.action_lead_stage"/>


    </data>

</odoo>


Thanks

Avatar
Discard
Author Best Answer

Thanks men, is working now

Avatar
Discard
Related Posts Replies Views Activity
0
Mar 15
3443
1
Dec 24
156
0
Nov 24
63
2
Jul 24
698
0
Apr 24
554