Hello all,
I try to override 2 or 3 methods of the file ../openerp/addons/base/ir/ir_attachment.py.
My goal is to change the name of the stored attachments files on the hard disk.
I already have other custom modules working.
I have tried many combinaison, I have searched, but it doesn't work now.
__init__.py and __openerp__.py seems to be right since my own ir_attachment.py file is loaded.
My module depends on 'base' :
For the moment, I have this code in ../addons/mymodule/ir/ir_attachment.py :
from openerp import models, fields
class PTir_attachment(base.ir_attachment):
_inherit = 'base.ir_attachment'
_name = 'base.ir_attachment'
def _get_path(self, cr, uid):
import pdb; pdb.set_trace()
I always get this error :
import ir_attachment
File "/home/odoo/addons/report_lapagept/ir/ir_attachment.py", line 4, in <module>
class PTir_attachment(openerp.base.ir_attachment):
NameError: name 'openerp' is not defined
Could you help me please? I miss something...