My class is simply this:
from openerp import tools
from openerp.osv import osv, fields
import requests
import logging
import json
_logger = logging.getLogger(__name__)
class stock_move(osv.Model):
_inherit = 'stock.move'
def create(self, cr, uid, vals, context=None):
new_id = super(stock_move, self).create(cr, uid, vals, context=context)
But when I run it, I get this:
File "/opt/odoo/ebuynow/ebn_oddjobs/models.py", line 15, in create
new_id = super(stock_move, self).create(cr, uid, vals, context=context)
UnboundLocalError: local variable 'stock_move' referenced before assignment
I'm pretty sure this is the correct way to use super(), because this code was working fine on another system. This question is more asking if there is anyone out there who knows what it might be in the system or python environment that could cause it not to recognize stock_move as the class name for the purpose of calling the parent class's create() method.
System is ubuntu server 14.04, python 2.7.6. Previous system the code ran on was ubuntu desktop 14.04 also running python 2.7.6.
I just don't see any reason why this would happen. Why does python think stock_move is a local variable?
Edit:
After changing the class name, I get this:
new_id = super(stock_move_too, self).create(cr, uid, vals, context=context)
UnboundLocalError: local variable 'stock_move' referenced before assignment
stock_move isn't even used at all and the error still shows??
Edit2:
The problem was caused by odoo-server not actually shutting down when I issued the "sudo /etc/init.d/odoo-server restart" command. Once I killed the process, then restarted it, it began restarting properly.