This question has been flagged
1 Reply
2965 Views

Hi I'm in the process of writing my first module, exciting stuff!

Ok its very, very simple - just one field so far.

The problem is the field "Comment" - I change it in the python code but it doesn't change in the PostgreSQL database!

I've tested the module installation, by removing it, deleting it, re-installing it - Does all this and even removes the field from PostgreSQL database.

But when I change the comment in the python code from Sale Type to Sale Packaging Typeand re-install the module - it reverts back to the original value.

I'm lost! any guidance please. - Could it be something to do with "translation"?

The python code before

from osv import osv, fields
class sale_packaging_type_field(osv.osv):
    # This OpenERP object inherits from sale.order
    # to add a new selection field
    _inherit = 'sale.order'
    _columns = {
        'sale_packaging_type' : fields.selection((('a', 'A'), ('b', 'B'), ('c', 'C')), 'Sale Type'),
    }

and after

from osv import osv, fields
class sale_packaging_type_field(osv.osv):
    # This OpenERP object inherits from sale.order
    # to add a new selection field
    _inherit = 'sale.order'
    _columns = {
        'sale_packaging_type' : fields.selection((('a', 'A'), ('b', 'B'), ('c', 'C')), 'Sale Packaging  Type'),
    }
Avatar
Discard
Best Answer

You have to restart the OpenERP Server after you have changed Python code. And afterwards you have to install/update the module.

Avatar
Discard
Author

Many thanks, it worked. Cheers