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

Template error when addin history tab to partner kanban view

By
Victor Godayer
on 1/15/14, 12:01 PM 2,133 views

Hi

I'm trying to show the 'History' tab on the partner Kanban view. To do that I created a new module with a *_view.xml file containing as follow:

<?xml version="1.0"?>
<openerp>
<data>
    <menuitem id="menu_config_captivea" name="Captivea"
        groups="base.group_no_one"
        parent="base.menu_base_config" sequence="55"/>

    <record id="view_history_partner_info_form1" model="ir.ui.view">
        <field name="name">res.partner.history.info.form</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="base.view_partner_form"/>
        <field name="priority">20</field>
        <field name="arch" type="xml">
            <xpath expr="//page[@name='page_history']" position="attributes">
                <attribute name="invisible">False</attribute>
            </xpath>
            <xpath expr="//page[@name='page_history']" position="inside">
                <group name="grp_cap_history_partner" string="Invoice History">
                  <field name="state" invisible="True" />
                  <field name="invoice_ids" editable="bottom">
                      <field name="name"/>
                    </tree>
                  </field>
                </group>
            </xpath>
        </field>
    </record>

</data>

</openerp>

I also created a *.py file into the module folder containing the inheritance of the class res_partner:

class res_partner(osv.osv):
_inherit = 'res.partner'
_columns = {
    'invoice_ids': fields.one2many('account.invoice', 'partner_id', 'Invoices'),
    'order_ids': fields.one2many('sale.order', 'partner_id', 'Invoices'),
}

When I go to a partner Kanban view, on the history Tab, I have nothing showed, even if I select a partner that has invoice. If I click on the expandable 'Description' row, I get the error

QWeb2 - template['ListView.row']: Runtime Error: Error: Unknown field state in domain [["state","not in",["draft"]]]

As I don't deal with state in the *view.xml file I don't understand how I come to this error.

Thanks for your help

Cheers

got the same error. Did you solve this? Can you teach me how did you do?

Alcaline
on 11/18/14, 9:47 PM
0

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 1/17/14, 5:05 PM

Victor,

The warning is usual!

<field name="state" invisible="True"/>

You do not have state field on partner, do you?

Thanks.

Even if I remove the field state I get this error : Uncaught Error: Field state unknow in domain [["state","not in",["draft"]]] (translation from french)

Victor Godayer
on 1/21/14, 6:42 AM

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: 1/15/14, 12:01 PM
Seen: 2133 times
Last updated: 3/16/15, 8:10 AM