2
votes

I have developped a module which adds a tab on the partner form view. On that tab I gather details about meetings, calls, invoices, quotations under their own tree view.

I would like the records showed to be 'clickable'. The action associated to a record clicked would lead the user to the form view of the record.

I thought it was native behavior on a tree view, apparently it is not.

Here is one of my tree view :

<?xml version="1.0"?>
  <openerp>
  <data>

  <!--  Partners inherited form -->
  <record id="view_history_partner_info_form" model="ir.ui.view">
   <field name="name">res.partner.cap_history.form.inherit</field>
   <field name="inherit_id" ref="base.view_partner_form"/>
   <field name="model">res.partner</field>
   <field name="arch" type="xml">
    <page string="Accounting" position="after" version="7.0">
      <page string="History" name="cap_history_tab">

        <group name="grp_invoice_history" string="Invoices History">
          <field name="invoice_ids" colspan="4" nolabel="1">
            <tree string="Partner Invoices" editable="bottom" create="false" delete="false">
              <field name="number" readonly="True"/>
              <field name="origin" readonly="True"/>
              <field name="name" string="Reference" readonly="True"/>
              <field name="date_invoice" readonly="True"/>
              <field name="x_category" readonly="True"/>
              <field name="state" readonly="True"/>
              <field name="payment_term" readonly="True"/>
              <field name="amount_total" readonly="True"/>
            </tree>
          </field>
        </group>

   </data>
</openerp>

Then I added the following action, I thought that would be enough, but it does not change anything.

<record id="action_history_invoice_tree" model="ir.actions.act_window">
  <field name="name">action.invoices.history.tree</field>
  <field name="res_model">account.invoice</field>
  <field name="view_mode">form</field>
  <field name="view_id" ref="invoice_form"/>
</record>

I can't see what is wrong in the action definition and I know this is the only wrong part the rest is working fine.

Does anyone could share his knowledge about this issue ? Thank you

Cheers

1

1 Answers

3
votes

When you set tree attribute editable="bottom", the record is open in tree view as currently open. Just remove editable="bottom" from tree tag attribute. After remove it, you will open form view. Like..

<tree string="Partner Invoices" create="false" delete="false">

Hope this will help you.