This question has been flagged
1 Reply
15365 Views

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

Avatar
Discard

Did you find the solution to this ?

Yes I found the solution.
Are you facing the same problem ?

Cordialement,

Victor GODAYER
CAPTIVEA
Tél : +33 (0) 482 530 235
Ligne directe : +33 (0) 972 154 011
Fax : +33 (0) 972 238 043
@ : victor.godayer@captivea.fr
Web : www.captivea.fr





2014-06-25 17:54 GMT+02:00 Anabela Damas <adamas-versaointegral-pt@openerp.my.openerp.com>:

Did you find the solution to this ?

--
Anabela Damas Sent by OpenERP S.A. using OpenERP. Access your messages and documents in Odoo

Author Best Answer

I have found the solution.

When there is the tree attribute editable set to bottom, the record is open in tree view as currently open.

I just needed to remove editable="bottom" from the tree tag. After remove it, it will open a form view.

Below an example :

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

Hope this will help.

Avatar
Discard

Doesn't work form me , I don't have "editable" parameter...

Author

give me your view code in an PM message if you want

It works but it isn't what I need, thanks!