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 remove a field from py file

By
Atchuthan - Technical Consultant, Sodexis Inc
on 12/11/13, 2:22 AM 1,228 views

Hi friendz,

I am facing a problem in which my added field in project needs to be removed. When I deleted the field, restarted the server and upgraded the module, the field deleted was still available in my local server.

class account_voucher(osv.osv):
    _inherit = 'account.voucher'
    _columns = {
        'transId': fields.char('Transaction ID', size=128, readonly=True, help="The transaction ID returned by Authorize.net.  Used for voiding a transaction."),
        'error_text': fields.char('Authorization Status', size=128, readonly=True, help="The transaction error details reported by Authorize.net. Left blank if the transaction was successful."),
        'is_approved': fields.boolean('Approved', readonly=True),
        'state': fields.selection(
            [('draft','Draft'),
            ('dispute','Error'),
            ('cancel','Cancelled'),
            ('proforma','Pro-forma'),
            ('posted','Posted'),
            ], 'Status', readonly=True, size=32, track_visibility='onchange',),
        'cim_id': fields.many2one('account.authnet.cim', 'Customer Profile', domain="[('partner_id','=',partner_id)]"),
        'cim_payment_id': fields.many2one('account.authnet.cim.payprofile', 'Card on File', domain="[('cim_id','=',cim_id)]"),
        'card_type': fields.char('Card Type', size=16, help="The type of card used to pay.  Visa, MasterCard, American Express, etc."),
        'transaction_ids': fields.one2many('credit.card.transaction','payment_id', string='CC Transaction', readonly=True),
    }

TO

class account_voucher(osv.osv):
    _inherit = 'account.voucher'
    _columns = {
        'is_approved': fields.boolean('Approved', readonly=True),
        'state': fields.selection(
            [('draft','Draft'),
            ('dispute','Error'),
            ('cancel','Cancelled'),
            ('proforma','Pro-forma'),
            ('posted','Posted'),
            ], 'Status', readonly=True, size=32, track_visibility='onchange',),
        'cim_id': fields.many2one('account.authnet.cim', 'Customer Profile', domain="[('partner_id','=',partner_id)]"),
        'cim_payment_id': fields.many2one('account.authnet.cim.payprofile', 'Card on File', domain="[('cim_id','=',cim_id)]"),
        'transaction_ids': fields.one2many('credit.card.transaction','payment_id', string='CC Transaction', readonly=True),
    }

Is there any procedure to do for removing field added by inheriting.? fields deleted -transId, error_text, card_type

Thanks

Atchuthan, T.U.

hello Atchuthan, in order to remove these fileds you have to remove from py as well as from xml. After that you must have to restart your openerp server, and upgrade your module from openerp admin. Hope it will work for you ...:)

ravi
on 12/11/13, 2:50 AM

@Ravi Raushan, I did all steps mentioned by you... still showing the field in account.voucher

Atchuthan - Technical Consultant, Sodexis Inc
on 12/11/13, 2:58 AM

So you should check once more time that you have updated the correct files, and also upgrade the account.voucher module once more.

ravi
on 12/11/13, 3:01 AM

@Ravi Raushan, I did these steps also... any more suggestions?

Atchuthan - Technical Consultant, Sodexis Inc
on 12/11/13, 3:12 AM

Make sure you are updating the files in right Addons. if yes then might be your openerp server script is not working. To check it first stop the server and check openerp should not work....

ravi
on 12/11/13, 3:21 AM

Check the postgres whether the field is i it.

Gopakumar N G
on 12/11/13, 3:45 AM

@Ravi Raushan, I tried to stop the server and check whether server is stopping, it had no problems

Yes, I checked @ postgres, the field is still available in it

When i see model overview print report for account.voucher, the fields removed were available in it and field came from my module "account_payment_cc_authorizenet"

Atchuthan - Technical Consultant, Sodexis Inc
on 12/11/13, 4:14 AM

Try deleting the field from postgres and then restart and update the module.

Gopakumar N G
on 12/11/13, 4:36 AM

yes tried this too...!! but still field is available @ account.voucher

Atchuthan - Technical Consultant, Sodexis Inc
on 12/11/13, 10:04 AM

Create a new databse and install the module, then check.

Gopakumar N G
on 12/12/13, 12:41 AM

When installed in new database, deleted fields are not available

Atchuthan - Technical Consultant, Sodexis Inc
on 12/12/13, 4:04 AM

I don't know the problem actually as the deleted fields are no longer available in the new database.

Gopakumar N G
on 12/12/13, 8:47 AM

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

0 follower(s)

Stats

Asked: 12/11/13, 2:22 AM
Seen: 1228 times
Last updated: 3/31/15, 5:36 PM