diff --git a/account_move_transactionid_import/data/completion_rule_data.xml b/account_move_transactionid_import/data/completion_rule_data.xml index 1f993602..0c1bbd48 100644 --- a/account_move_transactionid_import/data/completion_rule_data.xml +++ b/account_move_transactionid_import/data/completion_rule_data.xml @@ -2,15 +2,15 @@ - Match from Sales Order using transaction ref + Match from Sales Order using transaction ID 30 - get_from_transaction_ref_and_so + get_from_transaction_id_and_so - Match from Invoice using transaction ref + Match from Invoice using transaction ID 40 - get_from_transaction_ref_and_invoice + get_from_transaction_id_and_invoice diff --git a/account_move_transactionid_import/data/statement.csv b/account_move_transactionid_import/data/statement.csv index ecda301b..491df223 100644 --- a/account_move_transactionid_import/data/statement.csv +++ b/account_move_transactionid_import/data/statement.csv @@ -1,4 +1,4 @@ -"transaction_ref";"date";"amount";"commission_amount";"label" +"transaction_id";"date";"amount";"commission_amount";"label" 50969286;2011-03-07 13:45:14;118.4;-11.84;"label a" 51065326;2011-03-05 13:45:14;189;-15.12;"label b" 51179306;2011-03-02 17:45:14;189;-15.12;"label c" diff --git a/account_move_transactionid_import/data/statement.xls b/account_move_transactionid_import/data/statement.xls index 2d1ac865..b734058b 100644 Binary files a/account_move_transactionid_import/data/statement.xls and b/account_move_transactionid_import/data/statement.xls differ diff --git a/account_move_transactionid_import/models/account_move.py b/account_move_transactionid_import/models/account_move.py index c074b292..6d8bb3e5 100644 --- a/account_move_transactionid_import/models/account_move.py +++ b/account_move_transactionid_import/models/account_move.py @@ -13,13 +13,13 @@ class AccountMoveCompletionRule(models.Model): function_to_call = fields.Selection( selection_add=[ - ('get_from_transaction_ref_and_so', - 'Match Sales Order using transaction ref'), - ('get_from_transaction_ref_and_invoice', - 'Match Invoice using transaction ref') + ('get_from_transaction_id_and_so', + 'Match Sales Order using transaction ID'), + ('get_from_transaction_id_and_invoice', + 'Match Invoice using transaction ID') ]) - def get_from_transaction_ref_and_so(self, line): + def get_from_transaction_id_and_so(self, line): """ Match the partner based on the transaction ID field of the SO. Then, call the generic st_line method to complete other values. @@ -35,7 +35,7 @@ class AccountMoveCompletionRule(models.Model): """ res = {} so_obj = self.env['sale.order'] - sales = so_obj.search([('transaction_id', '=', line.transaction_ref)]) + sales = so_obj.search([('transaction_id', '=', line.transaction_id)]) if len(sales) > 1: raise ErrorTooManyPartner( _('Line named "%s" was matched by more than ' @@ -45,7 +45,7 @@ class AccountMoveCompletionRule(models.Model): res['partner_id'] = sale.partner_id.id return res - def get_from_transaction_ref_and_invoice(self, line): + def get_from_transaction_id_and_invoice(self, line): """Match the partner based on the transaction ID field of the invoice. Then, call the generic st_line method to complete other values. @@ -63,7 +63,7 @@ class AccountMoveCompletionRule(models.Model): res = {} invoice_obj = self.env['account.invoice'] invoices = invoice_obj.search( - [('transaction_id', '=', line.transaction_ref)]) + [('transaction_id', '=', line.transaction_id)]) if len(invoices) > 1: raise ErrorTooManyPartner( _('Line named "%s" was matched by more than ' diff --git a/account_move_transactionid_import/parser/transactionid_file_parser.py b/account_move_transactionid_import/parser/transactionid_file_parser.py index a11501c3..93846764 100644 --- a/account_move_transactionid_import/parser/transactionid_file_parser.py +++ b/account_move_transactionid_import/parser/transactionid_file_parser.py @@ -24,7 +24,7 @@ class TransactionIDFileParser(FileParser): header """ conversion_dict = { - 'transaction_ref': ustr, + 'transaction_id': ustr, 'label': ustr, 'date': datetime.datetime, 'amount': float_or_zero, @@ -67,5 +67,5 @@ class TransactionIDFileParser(FileParser): 'date_maturity': line.get('date', datetime.datetime.now().date()), 'credit': amount > 0.0 and amount or 0.0, 'debit': amount < 0.0 and amount or 0.0, - 'transaction_ref': line.get('transaction_ref', '/'), + 'transaction_ref': line.get('transaction_id', '/'), }