Odoo Help

Welcome!

This community 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.

0

How to add « external-id» column to product.template.product.tree?

By
Pascal Tremblay
on 10/2/14, 1:16 PM 2,537 views

Hellooooooooo!

I already have « database id » and « code » columns in my product.template.product.tree view. I'm very happy of this.

But I would also want an « external id » column. How could I make it?

An idea?

 

Thanks

1
john5000
On 10/13/14, 2:38 PM

The external_id is stored in a separate table from product.template.   The separate table is ir_model_data.

So you cannot just add it to your existing tree view definition.

To make the external_id to show in your tree view you must:

  • Make a view in the database for the product_template table joined to the ir_model_data table to get the external_id.  (Join on the res_id and model fields and get the external_id from the "name" field).
  • Create a model of the columns that are returned from the view.  This would be the same as the product_template model plus the external_id.
  • Then make a tree view that uses that model. 

So you'll have  few steps to do to get that to show.

It is much simpler to just use the export option and select the "id" column which will cause the external ID to be exported. Then view it in a spreadsheet. 

 

 

 

 

0

Pascal Tremblay

--Pascal Tremblay--
1312
| 5 2 7
Alma, Canada
--Pascal Tremblay--


Pascal Tremblay
On 11/15/14, 7:13 PM

<field name="default_code"/>

Your Answer

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/2/14, 1:16 PM
Seen: 2537 times
Last updated: 3/16/15, 8:10 AM