Odoo Help


How change data selection type in Openerp 7

fenny senjaya
on 7/4/13, 2:54 AM 4,093 views

I want to change the field type selection in document management form..

Any one knows where and how I can change it? It been set url and binary by default.

to what type field you want to change

dianne jose
on 7/4/13, 5:16 AM

type : binary and url change with Type : document and url in selection type

fenny senjaya
on 7/5/13, 8:22 AM

I didnt get u.Can you please explain it clearly.

dianne jose
on 7/5/13, 10:58 AM

if you open module knowledge - document - create in form document you can see type of data, then i want to change that from binary and url to document and ural, how i can change that? i perhaps you undderstand what i mean...thanks

fenny senjaya
on 7/7/13, 11:39 PM

did u mean by chanding the selection field value to document and Url, if so i have edited the code below

dianne jose
on 7/8/13, 3:53 AM
dianne jose
On 7/5/13, 4:40 AM

that view is placed in ir.attachment , just inherit that model and redefine that field the python code is as:

class ir_attachment(osv.osv):
              'type':fields.selection( [ ('url','URL'), ('document','Document'), ],
            'Type', help="Document File or URL", required=True, change_default=True)
_defaults = {
    'type': 'document',

xml view is:

  <record id="ir_attachment_inherit" model="ir.ui.view">
                <field name="name">ir.attachment.form</field>
                <field name="model">ir.attachment</field>
                <field name="inherit_id" ref="base.view_attachment_form" />
                <field name="arch" type="xml">
                    <field name="type" position="replace">
                        <field name="type"/>


where i do suppose to put that your code?

fenny senjaya
on 7/8/13, 4:56 AM

you put that code in your .py file and .xml file(if you have)

dianne jose
on 7/8/13, 5:05 AM

in document page addons?

fenny senjaya
on 7/8/13, 5:15 AM

do you have with you a created openerp module

dianne jose
on 7/8/13, 5:22 AM

yes..which .py file and .xml file do i have to put your code in?

fenny senjaya
on 7/8/13, 5:26 AM

u can add this code class ir_attachment(osv.osv): .......ir_attachment() to your python file and the xml view to your xml file. if its not working please show me your screenshot of your py file and xml file

dianne jose
on 7/8/13, 5:49 AM
On 8/6/14, 5:32 AM

It work..thank you for your help..

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 7/4/13, 2:54 AM
Seen: 4093 times
Last updated: 3/16/15, 8:10 AM