New OpenERP Server
SAServer will be Enhanced Version OpenERP-Server which will support all Major Databases. Major aim is to make openerp database independent . and customer can make their existing application as it and able to implement openerp easily on the same dababase.
Things to be Take Care
* OpenERP Krenal - osv, orm and fields
* OpenERP Modules
* OpenERP DB Supports - sql_db.py
There are many type of Implementation is in my mind, of course SQLAlchemy is the great ORM so its better to use the same framework inside the openerp, but also take care about the openerp existing framework and modules, which should not be changed at all. and all modules and new development will work as it is.
Prototype 1:
class orm(object):
#__metaclass__ = orm_meta
def __init__(self):
self.tbl = None
self.cols = []
self.conn = engine.connect()
for key, col in self._columns.
if isinstance(col, char):
elif isinstance(col, boolean):
elif isinstance(col, text):
self.cols += [Column('id', Integer, primary_key=True)]
self.tbl = Table(self._name, self.metadata, *self.cols)
def read(self, cr, user, ids, fields=None, context=None, load='_
query = self.tbl.select()
query = query.where(
result = self.conn.
return result.fetchall()
def create(self, cr, user, vals, context=None):
return self.conn.
class DemoModel(orm):
_name = 'account_voucher'
_columns = {
'name' : char('Name', size=64),
}
Prototype 2:
class Partner(
_name = 'res.partner'
_description = 'Partner Data'
id = fields.
name = fields.char('Name', size=256, nullable=False)
ref = fields.char('Code', size=256, nullable=False)
website = fields.
emails = fields.
category_ids = fields.
but in above prototype the openerp model is totally changed but it looks as pure SQLAlchemy Implementation, so this will not be a good prototype
Prototype 3:
if we can do something like described billow based on the OpenERP model during the execution of the server
class Partner(osv.osv):
_name = 'res.partner'
_table = 'res_partner'
def _get_credit(self, cr. uid, context={}):
return [{}]
_columns = {
}
Partner()
#TODO : Convert _columns to _sa automatically
_sa = Table(
_table,
metadata,
Column('id', Integer, primary_key=True),
Column('name', String(256), nullable=False, default="NULL"),
Column('debit', Function(
)
_mapping = mapper(Partner, _sa)
in this case we can easily attract the openerp developer, and also sqlalchemy lovers. thosw weho can either define opener _columns or sqlalchemy table directly in to the openerp model.
Well, Al this model are the based on the research, but there are still many things that is to be take care like
* Relational Fields
* Function Fields
* Sequences
* Indexes
* Selection Fields
* Store Functionality
* Inheritance Functionalists
* and many more
Well More Ideas Invited
Blueprint information
- Status:
- Complete
- Approver:
- Fabien (Open ERP)
- Priority:
- Undefined
- Drafter:
- Mantavya Gajjar (Open ERP)
- Direction:
- Needs approval
- Assignee:
- Mantavya Gajjar (Open ERP)
- Definition:
- Review
- Series goal:
- None
- Implementation:
-
Implemented
- Milestone target:
- None
- Started by
- Mantavya Gajjar (Open ERP)
- Completed by
- Mantavya Gajjar (Open ERP)
Whiteboard
you may fine the good Progress of the SAServer here https:/
there are few changes while starting the server
./openerp-server.py --engine=
--engine is the new parameter which will be directly related to the engine url of the sqlalchemy http://
Work Items
Dependency tree

* Blueprints in grey have been implemented.