mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
add a reconcile rule matching a transaction_ref vs a reference
This commit is contained in:
@@ -41,3 +41,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['transaction_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['ref'] or '').lower().strip())
|
||||
|
||||
@@ -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.transaction_ref_vs_ref',
|
||||
'Advanced. Partner and Transaction Ref. vs Ref.'),
|
||||
]
|
||||
return methods
|
||||
|
||||
|
||||
@@ -10,7 +10,12 @@
|
||||
<group colspan="2" col="2">
|
||||
<separator colspan="4" string="Advanced. Partner and Transaction Ref"/>
|
||||
<label string="Match multiple debit vs multiple credit entries. Allow partial reconciliation.
|
||||
The lines should have the partner, the credit entry transaction ref. is matched vs the debit entry transaction ref. or name." colspan="4"/>
|
||||
The lines should have the partner, the credit entry transaction ref. is matched vs the debit entry transaction ref." colspan="4"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator colspan="4" string="Advanced. Partner and Transaction Ref. vs Ref."/>
|
||||
<label string="Match multiple debit vs multiple credit entries. Allow partial reconciliation.
|
||||
The lines should have the partner, the credit entry transaction ref. is matched vs the debit entry reference." colspan="4"/>
|
||||
</group>
|
||||
</page>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user