Odoo Help

0

Get leads data in partner form view

By
Victor Godayer
on 2/13/14, 7:45 AM 1,166 views

Hi,

I'm trying to display lead data related to a partner.

But on module installation, I keep having the ValidateError saying Error occurred while validating the field(s) arch: Invalid XML for View Architecture!

I don't know why this is happening, cause I've double checked fields names, and compared my xml structure and content to other module xml view files.

I've also set dependencies to 'base','crm', in __openerp__.py

Does anyone see something wrong in my code below ?

Here is my piece of python code:

class res_partner(osv.osv):
    _inherit = 'res.partner'
    _columns = {
             'lead_ids': fields.one2many('crm.lead', 'partner_id', 'Leads'),
    }

And here my view:

<?xml version="1.0"?>
  <page string="Accounting" position="after" version="7.0">
  <page string="History" name="cap_history_tab">
    <!-- Customer Leads Group -->
    <group name="grp_leads_history" string="Leads History">
          <field name="lead_ids" colspan="4" nolabel="1">
            <tree string="Partner Leads" editable="false" create="false" delete="false">
              <field name="name" readonly="True"/>
              <field name="create_date" readonly="True"/>
              <field name="date_deadline" readonly="True"/>
              <field name="priority" readonly="True"/>
              <field name="planned_revenue" readonly="True"/>
              <field name="probability" readonly="True"/>
              <field name="state" readonly="True"/>
            </tree>
          </field>
        </group>
  </page>
</page>

Thank you for your help

Cheers

1
Prakash
On 2/13/14, 9:39 AM

In your Code xml file Field name, model, inherit_id data is missing. And also your code depends with Account Moule

so set dependencies to 'base','crm', 'account' in __openerp__.py

you can see the similar example in account module

account/partner_view.xml

<record id="view_partner_property_form" model="ir.ui.view">
            <field name="name">res.partner.property.form.inherit</field>
            <field name="model">res.partner</field>
            <field name="priority">2</field>
            <field name="inherit_id" ref="base.view_partner_form"/>
            <field name="arch" type="xml">
                <page string="History" position="before" version="7.0">
                <page string="Accounting" col="4" name="accounting" attrs="{'invisible': [('is_company','=',False),('parent_id','!=',False)]}">

             </page>
               </page>
            </field>
        </record>

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 2/13/14, 7:45 AM
Seen: 1166 times
Last updated: 3/16/15, 8:10 AM