Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4707 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
lis 24
1798
1
zář 21
9568
1
led 24
17161
0
bře 15
3413
1
bře 15
10090