[MRG] ~therp-nl/banking-addons/ba7.0-manual_multi_match rev 201

This commit is contained in:
Holger Brunn
2013-05-02 17:13:33 +02:00
parent 1b7efc9fe5
commit 71fafee9e2
2 changed files with 10 additions and 41 deletions

View File

@@ -94,8 +94,6 @@ class banking_transaction_wizard(osv.osv_memory):
# The following fields get never written
# they are just triggers for manual matching
# which populates regular fields on the transaction
manual_invoice_id = vals.pop('manual_invoice_id', False)
manual_move_line_id = vals.pop('manual_move_line_id', False)
manual_invoice_ids = vals.pop('manual_invoice_ids', [])
manual_move_line_ids = vals.pop('manual_move_line_ids', [])
@@ -169,17 +167,14 @@ class banking_transaction_wizard(osv.osv_memory):
_("No entry found for the selected invoice. " +
"Try manual reconciliation."))
if manual_move_line_id or manual_invoice_id \
or manual_move_line_ids or manual_invoice_ids:
if manual_move_line_ids or manual_invoice_ids:
move_line_obj = self.pool.get('account.move.line')
invoice_obj = self.pool.get('account.invoice')
statement_line_obj = self.pool.get('account.bank.statement.line')
manual_invoice_ids = (
([manual_invoice_id] if manual_invoice_id else []) +
[i[1] for i in manual_invoice_ids if i[0]==4] +
[j for i in manual_invoice_ids if i[0]==6 for j in i[2]])
manual_move_line_ids = (
([manual_move_line_id] if manual_move_line_id else []) +
[i[1] for i in manual_move_line_ids if i[0]==4] +
[j for i in manual_move_line_ids if i[0]==6 for j in i[2]])
for wiz in self.browse(cr, uid, ids, context=context):
@@ -403,22 +398,15 @@ class banking_transaction_wizard(osv.osv_memory):
'match_type': fields.related(
'import_transaction_id', 'match_type',
type="char", size=16, string='Match type', readonly=True),
'manual_invoice_id': fields.many2one(
'account.invoice', 'Match this invoice',
domain=[('reconciled', '=', False)]),
'manual_move_line_id': fields.many2one(
'account.move.line', 'Or match this entry',
domain=[('account_id.reconcile', '=', True),
('reconcile_id', '=', False)]),
'manual_invoice_ids': fields.many2many(
'account.invoice',
'banking_transaction_wizard_account_invoice_rel',
'wizard_id', 'invoice_id', string='Match following invoices',
'wizard_id', 'invoice_id', string='Match one or more invoices',
domain=[('reconciled', '=', False)]),
'manual_move_line_ids': fields.many2many(
'account.move.line',
'banking_transaction_wizard_account_move_line_rel',
'wizard_id', 'move_line_id', string='Or match this entries',
'wizard_id', 'move_line_id', string='Or match one or more entries',
domain=[('account_id.reconcile', '=', True),
('reconcile_id', '=', False)]),
'payment_option': fields.related('import_transaction_id','payment_option', string='Payment Difference', type='selection', required=True,

View File

@@ -90,34 +90,15 @@
name="trigger_match"
type="object"
string="Match again"/>
<!-- Manual selection -->
</page>
<!-- Manual selection -->
<page string="Manual match">
<field name="manual_invoice_id"/>
<!--
Specify alternative tree_view_ref as a
workaround for lp:1073521 in OpenERP 6.1
Need to also define 'view_mode' to prevent
an instant editable tree view
reconstruction by account.move.line's
fields_view_get().
Both are not needed in OpenERP 6.0 or 7.0.
-->
<field name="manual_move_line_id"
context="{
'tree_view_ref': 'account.view_move_line_tax_tree',
'view_mode': 'yes'
}"
<field name="manual_invoice_ids" colspan="4"
context="{'search_default_partner_id': partner_id}"
/>
<field name="manual_move_line_ids" colspan="4"
context="{'search_default_partner_id': partner_id}"
/>
<newline/>
<button colspan="1"
name="trigger_write"
type="object"
string="Match"/>
</page>
<page string="Multiple manual matches" attrs="{'invisible': ['|', ('match_type', '!=', False), ('statement_line_parent_id', '!=', False)]}">
<field name="manual_invoice_ids" colspan="4"/>
<field name="manual_move_line_ids" colspan="4"/>
<button name="trigger_write"
type="object"
string="Match" />
@@ -147,7 +128,7 @@
</notebook>
<group colspan="2">
<separator/>
<button icon="gtk-ok" string="Done" special="cancel"/>
<button icon="gtk-ok" string="Close" special="cancel"/>
</group>
</group>
</form>