I'm trying to learn OpenERp code logic... I would like to write a new module, and need a new model created..
This is res_certificates.py code
from openerp.osv import fields, osv, orm
class res_certificates(osv.Model):
_name='res_certificates'
_description='Stored Certificates'
_order='name'
_columns = {
'name': fields.char('Name', size=128, help="Internal name for certificate", reguired=True, select=True),
'cert': fields.text('Certificate', help='Certificate (text)') ,
'cert_password': fields.char('Certificate Password', size=64),
'cert_key': fields.text('Private Key', help="Private key for user"),
'key_password':fields.char('Private Key Password', size=64)
}
res_certificates()
called from __init__.py as
import res_certificates
does not create any table table (note: at the moment i just need the table. no views) working on v7.0
If anyone could tell me what am i missing here??
Have you updated the module list and installed the module?
yes, modude is visible in the list, and install returns : openerp.modules.loading: module my_module: loading objects
can you try class res_certificates(osv.osv): ?
yes.. tried it olso.. but.. it should be the same.. because... in openerp.osv.osv lines 211-214 states: "# deprecated - for backward compatibility. osv = Model osv_memory = TransientModel osv_abstract = AbstractModel # ;-)"
see example: https://learnopenerp.blogspot.com/2020/09/how-to-create-model-in-odoo13.html