Browse Source

Force ordering Paiement (to reproduce the some order at each time)

Philippe Le Brouster 9 years ago
parent
commit
ed51b0fc3c
1 changed files with 5 additions and 0 deletions
  1. 5 0
      himports/dolibarrAlchemy.py

+ 5 - 0
himports/dolibarrAlchemy.py

@@ -85,18 +85,21 @@ class BankUrl(Base):
         primaryjoin="and_(BankUrl.url_id==Paiement.id, " "BankUrl.type=='payment')",
         foreign_keys=url_id,
         lazy="subquery",
+        order_by="Paiement.datep,Paiement.id",
     )
     payment_sc = relationship(
         "PaiementCharge", backref="bank_urls", uselist=False,
         primaryjoin="and_(BankUrl.url_id==PaiementCharge.id, " "BankUrl.type=='payment_sc')",
         foreign_keys=url_id,
         lazy="subquery",
+        order_by="PaiementCharge.datep,PaiementCharge.id",
     )
     payment_supplier = relationship(
         "PaiementFourn", backref="bank_urls", uselist=False,
         primaryjoin="and_(BankUrl.url_id==PaiementFourn.id, " "BankUrl.type=='payment_supplier')",
         foreign_keys=url_id,
         lazy="subquery",
+        order_by="PaiementFourn.datep,PaiementFourn.id",
     )
 
 
@@ -155,6 +158,7 @@ class PaiementFacture(Base):
     facture = relationship(
         "Facture",
         lazy="subquery",
+        order_by="Facture.facnumber"
     )
     paiement = relationship(
         "Paiement",
@@ -169,6 +173,7 @@ class Paiement(Base):
     factures = relationship(
         "PaiementFacture",
         lazy="subquery",
+        order_by="PaiementFacture.fk_facture,PaiementFacture.rowid",
     )