Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Error: too many values to unpack

By
bogdan baltatu
on 11/15/13, 4:59 AM 2,347 views

Hello, I want to add a field (position_id) on supplier invoice form but I have a error. I paste my code bellow.

<?xml version="1.0" encoding="utf-8"?>
    <openerp>
        <data>
            <record id="account_supplier_invoice_extended" model="ir.ui.view">
                <field name="name">Supplier invoice extended</field>
                <field name="model">account.invoice</field>
                <field name="inherit_id" ref="account.invoice.supplier.form"/>
                <field name="arch" type="xml">
                    <field name="jurnal_id" position="before">
                        <field name="position_id"/>
                    </field>        
                </field>
            </record>
        </data>
    </openerp>
1

Acespritech

--Acespritech--
839
| 3 2 6
India
--Acespritech--

Having 8+ years of OpenERP Experience. We are Specialized in OpenERP/CRM Solutions, software development, Web development, E commerce solutions & other open source solutions.


Skype : acespritech

Email : info@acespritech.com

Acespritech
On 11/15/13, 5:43 AM

Hi,

There are total two mistakes I can see :

  1. When you inherit the view, you are suppose to pass parent view id not parent view name. Here parent view id is invoice_supplier_form not account.invoice.supplier.form.
  2. The field name you have specified is wrong. In parent view field name is journal_id not jurnal_id.

So the proper way of inheriting the view is as follow:

    <record id="account_supplier_invoice_extended" model="ir.ui.view">
        <field name="name">Supplier invoice extended</field>
        <field name="model">account.invoice</field>
        <field name="inherit_id" ref="account.invoice_supplier_form"/>
        <field name="arch" type="xml">
            <field name="journal_id" position="before">
                <field name="position_id"/>
            </field>        
        </field>
    </record>

Thanks,
www.acespritech.com

Not working. I put ref="account.invoice_supplier_form". but I have next error : except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')

bogdan baltatu
on 11/15/13, 6:14 AM

and <field name="journal_id" position="before"> instead <field name="jurnal_id" position="before">

filsystem
on 11/15/13, 9:10 AM
0

Grover Menacho

--Grover Menacho--
2523
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Systems Engineer + MBA

Grover Menacho
On 11/15/13, 10:48 AM

Try with this:

<record id="account_supplier_invoice_extended" model="ir.ui.view">
    <field name="name">Supplier invoice extended</field>
    <field name="model">account.invoice</field>
    <field name="inherit_id" ref="account.invoice_supplier_form"/>
    <field name="arch" type="xml">
         <xpath expr="//field[@name='journal_id']" position="before">
            <field name="position_id"/>
         </xpath> 
    </field>
</record>

And add account to your dependencies

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/15/13, 4:59 AM
Seen: 2347 times
Last updated: 3/16/15, 8:10 AM