Skip to Content
Menú
This question has been flagged
1 Respondre
4735 Vistes

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

Avatar
Descartar
Best Answer

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>
Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de nov. 24
1827
1
de set. 21
9571
1
de gen. 24
17175
0
de març 15
3419
1
de març 15
10103