Merge pull request #44 from vrenaville/vre_manual_reconcile_prevent

easy reconcile: don't remove partial reconcile
This commit is contained in:
Leonardo Pistone
2014-10-01 14:53:17 +02:00

View File

@@ -79,10 +79,15 @@ class EasyReconcileBase(orm.AbstractModel):
return "SELECT %s" % ', '.join(self._base_columns(rec))
def _from(self, rec, *args, **kwargs):
return "FROM account_move_line"
return ("FROM account_move_line "
"LEFT OUTER JOIN account_move_reconcile ON "
"(account_move_line.reconcile_partial_id "
"= account_move_reconcile.id)"
)
def _where(self, rec, *args, **kwargs):
where = ("WHERE account_move_line.account_id = %s "
"AND COALESCE(account_move_reconcile.type,'') <> 'manual' "
"AND account_move_line.reconcile_id IS NULL ")
# it would be great to use dict for params
# but as we use _where_calc in _get_filter