mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[12.0] account_move_transactionid_import: Fix migration
This commit is contained in:
@@ -13,4 +13,4 @@
|
||||
<field name="function_to_call">get_from_transaction_id_and_invoice</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
</odoo>
|
||||
|
||||
@@ -34,7 +34,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.ref)])
|
||||
if len(sales) > 1:
|
||||
raise ErrorTooManyPartner(
|
||||
_('Line named "%s" was matched by more than '
|
||||
@@ -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.ref)])
|
||||
if len(invoices) > 1:
|
||||
raise ErrorTooManyPartner(
|
||||
_('Line named "%s" was matched by more than '
|
||||
|
||||
@@ -31,14 +31,14 @@ class TestCompletionTransactionId(SingleTransactionCase):
|
||||
'name': 'Test autocompletion on invoice with transaction ID',
|
||||
'account_id': cls.env.ref('account.a_sale').id,
|
||||
'move_id': cls.move.id,
|
||||
'transaction_ref': 'XXX66Z',
|
||||
'ref': 'XXX66Z',
|
||||
'date_maturity': '{}-01-06'.format(datetime.now().year),
|
||||
'credit': 0.0,
|
||||
}
|
||||
)
|
||||
|
||||
def test_sale_order_transaction_id(self):
|
||||
self.move_line.transaction_ref = 'XXX66Z'
|
||||
self.move_line.ref = 'XXX66Z'
|
||||
self.journal.rule_ids = [
|
||||
(
|
||||
4,
|
||||
@@ -104,7 +104,7 @@ class TestCompletionTransactionId(SingleTransactionCase):
|
||||
self.assertEqual(self.move_line.partner_id.name, self.partner.name)
|
||||
|
||||
def test_new_invoice_with_transaction_id(self):
|
||||
self.move_line.transaction_ref = 'XXX77Z'
|
||||
self.move_line.ref = 'XXX77Z'
|
||||
self.move_line.partner_id = None
|
||||
self.journal.rule_ids = [
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user