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

Finding code in master code and addons

By
greg
on 5/3/13, 2:26 PM 1,494 views

Hi All,

My question is on finding code within all of the master code and addons. I'll use a simple example.

I was working on a simple module to change a label on the product.product_normal_form_view.

On the product.product_normal_form_view as shown on the screen there is a label that says "EAN13 Barcode" In looking at the Debug View of product.product_normal_form_view there is nowhere that the label "EAN13 Barcode" shows up. So I figure that there must be a module that has inherited this view and changed/added this label, or some other code that has made this modification.

But when I do a full file search of all of the code and addons I don't see where "EAN13 Barcode" is used, other than in some point of sale module javascript. I am using windows file search and have it set to search file contents.

So the question is what is the correct way to find existing code, and is there any code in the entire system that would not be exposed/found using a simple in depth file search?

Maybe if someone can tell me where the label "EAN13 Barcode" comes from that would point me in the right direction.

Thanks!

3

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 5/5/13, 2:58 AM

Here Product View you will find ean13 field in product_normal_form_view.

Yes I see that, but where is the label "EAN13 Barcode" set as the label?

greg
on 5/5/13, 2:26 PM
1
greg
On 5/4/13, 2:41 PM

Thank you for the information on where to find the applicable model.

I did as you suggested and used Settings > Customization > Database Structure > Models to locate the model, in this case the Field Name "ean13" is in the product.product model/module.

I do see under Settings > Customization > Database Structure > Models / Product that the field named "ean13" has a Field Label of "EAN13 Barcode", but when I look through the code @ OPENERP/ADDONS/PRODUCTS/ I cannot find the XML file that sets this Field Label.

I would expect to see something like:

<field name="ean13"/>
<label for="EAN13 Barcode"/>

But I can not find the applicable code.

Any assistance is appreciated.

UPDATE: I now see where the "EAN13 Barcode" is set...

In the product.py code the _columns include: 'ean13': fields.char('EAN13 Barcode', size=13, help="International Article Number used for product identification."),

UPDATE 2: WINDOWS does not normally search the contents of .py files. To make windows search the contents of a .py file do the following (From AgentPete answers.mircosoft.com)

a. Hit the start button and type "search" in the search box. b. Select "Change How Windows Searches" c. Hit "Advanced" d. Select the "File Types" tab. e. Make sure the file extension for the files you want to search in is on the list and is set to "Index Properties and File Contents"

Hope this helps someone

I have updated with my answer

greg
on 5/5/13, 4:49 PM
1

Gustavo

--Gustavo--
950
| 2 1 4
Buenos Aires, Argentina
--Gustavo--

Python developer, big fan of sailing

Gustavo
On 5/3/13, 2:46 PM

Enable the "developer mode" on the About menu, then hover the object you want to modify. That will give you the information about the model (class name) you want to work with. Then you have to go to Settings > Customization > Database Structure and locate the model. In the model form you will find the information about the modules that create and maintain the model you wish to modify

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: 5/3/13, 2:26 PM
Seen: 1494 times
Last updated: 3/16/15, 8:10 AM