diff --git a/account_advanced_reconcile_transaction_ref/__init__.py b/account_advanced_reconcile_transaction_ref/__init__.py
index 2b663dd0..e19ad65a 100644
--- a/account_advanced_reconcile_transaction_ref/__init__.py
+++ b/account_advanced_reconcile_transaction_ref/__init__.py
@@ -18,7 +18,6 @@
#
##############################################################################
-from . import account
from . import easy_reconcile
from . import base_advanced_reconciliation
from . import advanced_reconciliation
diff --git a/account_advanced_reconcile_transaction_ref/__openerp__.py b/account_advanced_reconcile_transaction_ref/__openerp__.py
index bd1586cf..d2b0d1cc 100644
--- a/account_advanced_reconcile_transaction_ref/__openerp__.py
+++ b/account_advanced_reconcile_transaction_ref/__openerp__.py
@@ -20,8 +20,8 @@
{'name': 'Advanced Reconcile Transaction Ref',
'description': """
-Advanced reconciliation method for the module account_easy_reconcile
-=================================================
+Advanced reconciliation method for the module account_advanced_reconcile
+========================================================================
Reconcile rules with transaction_ref
""",
diff --git a/account_advanced_reconcile_transaction_ref/account.py b/account_advanced_reconcile_transaction_ref/account.py
deleted file mode 100644
index b3e2cd24..00000000
--- a/account_advanced_reconcile_transaction_ref/account.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# Author: Romain Deheele
-# Copyright 2013 Camptocamp SA
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from openerp.osv.orm import Model, fields
-
-class AccountMoveLine(Model):
- """
- Inherit account.move.line class in order to add transaction_ref field
- """
- _inherit = "account.move.line"
- _columns = {
- 'transaction_ref': fields.char('Transaction Ref.', size=128),
- }
-
-class AccountBankStatement(Model):
- """
- Inherit account.bank.statement class in order to set transaction_ref info on account.move.line
- """
- _inherit = "account.bank.statement"
-
- def _prepare_move_line_vals(
- self, cr, uid, st_line, move_id, debit, credit, currency_id=False,
- amount_currency=False, account_id=False, analytic_id=False,
- partner_id=False, context=None):
-
- if context is None:
- context = {}
- res = super(AccountBankStatement, self)._prepare_move_line_vals(
- cr, uid, st_line, move_id, debit, credit,
- currency_id=currency_id,
- amount_currency=amount_currency,
- account_id=account_id,
- analytic_id=analytic_id,
- partner_id=partner_id, context=context)
- res.update({'transaction_ref': st_line.ref})
- return res
diff --git a/account_advanced_reconcile_transaction_ref/advanced_reconciliation.py b/account_advanced_reconcile_transaction_ref/advanced_reconciliation.py
index 50687d9c..c104cbb3 100644
--- a/account_advanced_reconcile_transaction_ref/advanced_reconciliation.py
+++ b/account_advanced_reconcile_transaction_ref/advanced_reconciliation.py
@@ -32,7 +32,8 @@ class easy_reconcile_advanced_transaction_ref(orm.TransientModel):
will be skipped for reconciliation. Can be inherited to
skip on some conditions. ie: ref or partner_id is empty.
"""
- return not (move_line.get('ref') and move_line.get('partner_id'))
+ return not (move_line.get('transaction_ref') and
+ move_line.get('partner_id'))
def _matchers(self, cr, uid, rec, move_line, context=None):
return (('partner_id', move_line['partner_id']),
@@ -41,3 +42,25 @@ class easy_reconcile_advanced_transaction_ref(orm.TransientModel):
def _opposite_matchers(self, cr, uid, rec, move_line, context=None):
yield ('partner_id', move_line['partner_id'])
yield ('ref', (move_line['transaction_ref'] or '').lower().strip())
+
+
+class easy_reconcile_advanced_transaction_ref_vs_ref(orm.TransientModel):
+
+ _name = 'easy.reconcile.advanced.trans_ref_vs_ref'
+ _inherit = 'easy.reconcile.advanced'
+
+ def _skip_line(self, cr, uid, rec, move_line, context=None):
+ """
+ When True is returned on some conditions, the credit move line
+ will be skipped for reconciliation. Can be inherited to
+ skip on some conditions. ie: ref or partner_id is empty.
+ """
+ return not (move_line.get('ref') and move_line.get('partner_id'))
+
+ def _matchers(self, cr, uid, rec, move_line, context=None):
+ return (('partner_id', move_line['partner_id']),
+ ('ref', move_line['ref'].lower().strip()))
+
+ def _opposite_matchers(self, cr, uid, rec, move_line, context=None):
+ yield ('partner_id', move_line['partner_id'])
+ yield ('ref', (move_line['transaction_ref'] or '').lower().strip())
diff --git a/account_advanced_reconcile_transaction_ref/easy_reconcile.py b/account_advanced_reconcile_transaction_ref/easy_reconcile.py
index a4cf11ab..92930446 100644
--- a/account_advanced_reconcile_transaction_ref/easy_reconcile.py
+++ b/account_advanced_reconcile_transaction_ref/easy_reconcile.py
@@ -32,6 +32,8 @@ class account_easy_reconcile_method(orm.Model):
methods += [
('easy.reconcile.advanced.transaction_ref',
'Advanced. Partner and Transaction Ref.'),
+ ('easy.reconcile.advanced.trans_ref_vs_ref',
+ 'Advanced. Partner and Transaction Ref. vs Ref.'),
]
return methods
diff --git a/account_advanced_reconcile_transaction_ref/easy_reconcile_view.xml b/account_advanced_reconcile_transaction_ref/easy_reconcile_view.xml
index b341e7b8..9d0745d4 100644
--- a/account_advanced_reconcile_transaction_ref/easy_reconcile_view.xml
+++ b/account_advanced_reconcile_transaction_ref/easy_reconcile_view.xml
@@ -10,7 +10,12 @@
+The lines should have the partner, the credit entry transaction ref. is matched vs the debit entry transaction ref." colspan="4"/>
+
+
+
+
diff --git a/account_easy_reconcile/easy_reconcile.xml b/account_easy_reconcile/easy_reconcile.xml
index 56e12b2e..00771b73 100644
--- a/account_easy_reconcile/easy_reconcile.xml
+++ b/account_easy_reconcile/easy_reconcile.xml
@@ -124,7 +124,7 @@ The lines should have the same amount (with the write-off) and the same referenc
account.easy.reconcile.method