Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
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
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.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
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
|Asked: 2/21/14, 11:23 AM|
|Seen: 4882 times|
|Last updated: 2/5/16, 4:31 PM|