Explorar el Código

[FIX] error de cancelar caja

adrielso hace 5 años
padre
commit
2547570862
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      models/cashbox_statement_cancel.py

+ 1 - 1
models/cashbox_statement_cancel.py

@@ -183,7 +183,7 @@ class eiru_account_statement_cancel(models.Model):
         cashBoxConfirm = self._eiru_account_get_cashbox_confirm(statement.id)
         if (cashBoxConfirm):
             statementOpen = self._eiru_get_account_bank_statement(cashBoxConfirm.statement_open.id)
-            if (statementOpen and statementOpen.state =='confirm'):
+            if (statementOpen and statementOpen.state =='confirm' and cashBoxConfirm.statement_open.id != cashBoxConfirm.statement_id.id ):
                 return {
                     'state': False,
                     'messege': "No se puede reabrir esta caja porque  tiene relación a una caja que ya esta cerrada."