Commit 949d3006 authored by plb's avatar plb
Browse files

dolibarr 4.0 compatibility (partially)

table llx_accountingaccount -> llx_accounting_account

The multicurrency is not supported
parent 6458a236
......@@ -52,6 +52,9 @@ class DolibarrSQLAlchemy(object):
class DolibarrBase(DeferredReflection, Base):
__abstract__ = True
@classmethod
def is40(cls):
return cls.metadata.info['dolibarr_version'].startswith("4.0")
class Bank(DolibarrBase):
__tablename__ = "llx_bank"
......@@ -304,6 +307,8 @@ class DolibarrSQLAlchemy(object):
lazy="subquery",
)
if DolibarrBase.is40():
fk_code_ventilation = Column(Integer, ForeignKey('llx_accounting_account.rowid'))
class FactureFournDet(DolibarrBase):
__tablename__ = "llx_facture_fourn_det"
......@@ -329,12 +334,16 @@ class DolibarrSQLAlchemy(object):
lazy="subquery",
)
if DolibarrBase.is40():
fk_code_ventilation = Column(Integer, ForeignKey('llx_accounting_account.rowid'))
class AccountingAccount(DolibarrBase):
__tablename__ = "llx_accountingaccount"
id = Column("rowid", Integer, primary_key=True)
if DolibarrBase.is40():
__tablename__ = "llx_accounting_account"
self.Bank = Bank
self.Facture = Facture
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment