Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
4753 Zobrazení

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.

Avatar
Zrušit

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 ...:)

Autor

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

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

Autor

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

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....

Check the postgres whether the field is i it.

Autor

@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"

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

Autor

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

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

Autor

When installed in new database, deleted fields are not available

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