Files
account-reconcile/base_transaction_id/models/account_bank_statement_line.py
Yannick Vaucher d3774be466 [PORT] base_transaction_id to 9.0
- Reactivate module
- move files in views and models dirs
- create README.rst from description
- make list of contributors
- remove change for invoice created on picking as it doesn't exist
anymore in Odoo Community
- move overrides in bank statement as logic moved in move lines
- adapt view inheritance to not depends on string attribute
- Fix definition of javascript customization in reconciliation
- Fix display transaction_ref label on move line view
- Fix move proposition for reconcile. search with transaction_ref
- Use short headers
- Update README for bug tracking
2018-04-06 13:49:22 +02:00

26 lines
1.1 KiB
Python

# -*- coding: utf-8 -*-
# © 2016 Yannick Vaucher (Camptocamp)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import api, models
class AccountBankStatementLine(models.Model):
_inherit = 'account.bank.statement.line'
@api.multi
def get_reconciliation_proposition(self, excluded_ids=None):
""" Look for transaction_ref to give them as proposition move line """
if self.name:
# If the transaction has no partner, look for match in payable and
# receivable account anyway
overlook_partner = not self.partner_id
domain = [('transaction_ref', 'ilike', self.name)]
match_recs = self.get_move_lines_for_reconciliation(
excluded_ids=excluded_ids, limit=2, additional_domain=domain,
overlook_partner=overlook_partner)
if match_recs and len(match_recs) == 1:
return match_recs
_super = super(AccountBankStatementLine, self)
return _super.get_reconciliation_proposition(excluded_ids=excluded_ids)