<|endoftext|> Prompt: Create an Odoo model class named AccountBankStatementLine with is_reconciled attribute Completion: class AccountBankStatementLine(models.Model):
    _name = "account.bank.statement.line"
    _inherits = {'account.move': 'move_id'}
    _description = "Bank Statement Line"
    is_reconciled = fields.Boolean(
        string='Is Reconciled',
        compute='_compute_is_reconciled', store=True,
    )
    @api.depends('journal_id', 'currency_id', 'amount', 'foreign_currency_id', 'amount_currency',
                     'move_id.to_check',
                     'move_id.line_ids.account_id', 'move_id.line_ids.amount_currency',
                     'move_id.line_ids.amount_residual_currency', 'move_id.line_ids.currency_id',
                     'move_id.line_ids.matched_debit_ids', 'move_id.line_ids.matched_credit_ids')
    def _compute_is_reconciled(self):
            """ Compute the field indicating if the statement lines are already reconciled with something.
                    This field is used for display purpose (e.g. display the 'cancel' button on the statement lines).
                    Also computes the residual amount of the statement line.
                    """
                    for st_line in self:
                        _liquidity_lines, suspense_lines, _other_lines = st_line._seek_for_lines()
            
                        # Compute residual amount
                        if st_line.to_check:
                            st_line.amount_residual = -st_line.amount_currency if st_line.foreign_currency_id else -st_line.amount
                        elif suspense_lines.account_id.reconcile:
                            st_line.amount_residual = sum(suspense_lines.mapped('amount_residual_currency'))
                        else:
                            st_line.amount_residual = sum(suspense_lines.mapped('amount_currency'))
            
                        # Compute is_reconciled
                        if not st_line.id:
                            # New record: The journal items are not yet there.
                            st_line.is_reconciled = False
                        elif suspense_lines:
                            # In case of the statement line comes from an older version, it could have a residual amount of zero.
                            st_line.is_reconciled = suspense_lines.currency_id.is_zero(st_line.amount_residual)
                        elif st_line.currency_id.is_zero(st_line.amount):
                            st_line.is_reconciled = True
                        else:
                            # The journal entry seems reconciled.
                            st_line.is_reconciled = True
            
            
                # -------------------------------------------------------------------------
                # CONSTRAINT METHODS
                # -------------------------------------------------------------------------
<|endoftext|>