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