diff --git a/dynamic_accounts_report/wizard/trial_balance.py b/dynamic_accounts_report/wizard/trial_balance.py index 36cfba1ad..fc303fdd9 100644 --- a/dynamic_accounts_report/wizard/trial_balance.py +++ b/dynamic_accounts_report/wizard/trial_balance.py @@ -176,9 +176,9 @@ class TrialView(models.TransientModel): wheres.append(where_clause.strip()) filters = " AND ".join(wheres) if data['target_move'] == 'posted': - filters += " AND account_move_line__move_id.state = 'posted'" + filters += " AND account_move_line.parent_state = 'posted'" else: - filters += " AND account_move_line__move_id.state in ('draft','posted')" + filters += " AND account_move_line.parent_state in ('draft','posted')" if data.get('date_from'): filters += " AND account_move_line.date >= '%s'" % data.get('date_from') if data.get('date_to'): @@ -235,9 +235,9 @@ class TrialView(models.TransientModel): wheres.append(where_clause.strip()) filters = " AND ".join(wheres) if data['target_move'] == 'posted': - filters += " AND account_move_line__move_id.state = 'posted'" + filters += " AND account_move_line.parent_state = 'posted'" else: - filters += " AND account_move_line__move_id.state in ('draft','posted')" + filters += " AND account_move_line.parent_state in ('draft','posted')" if data.get('date_from'): filters += " AND account_move_line.date < '%s'" % data.get('date_from')