diff --git a/account_move_base_import/test/completion_test.yml b/account_move_base_import/test/completion_test.yml index 8dd265b6..5df9d89f 100644 --- a/account_move_base_import/test/completion_test.yml +++ b/account_move_base_import/test/completion_test.yml @@ -67,29 +67,19 @@ !python {model: account.move.line}: | import datetime as dt context['check_move_validity'] = False - model.write(cr, uid, [ref('move_line_ci')], - {'name': dt.date.today().strftime('TBNK/%Y/0001'), - 'credit': 210.0}, - context) - model.write(cr, uid, [ref('move_line_si')], - {'name': 'T2S12345', - 'debit': 65.0}, - context) - model.write(cr, uid, [ref('move_line_cr')], - {'name': dt.date.today().strftime('RTEXJ/%Y/0001'), - 'debit': 210.0}, - context) - model.write(cr, uid, [ref('move_line_partner_name')], - {'credit': 600.0}, - context) - model.write(cr, uid, [ref('move_line_partner_label')], - {'debit': 932.4}, - context) + model.write({'name': dt.date.today().strftime('TBNK/%Y/0001'), + 'credit': 210.0}) + model.write({'name': 'T2S12345', + 'debit': 65.0}) + model.write({'name': dt.date.today().strftime('RTEXJ/%Y/0001'), + 'debit': 210.0}) + model.write({'credit': 600.0}) + model.write({'debit': 932.4}) - I run the auto complete - !python {model: account.move}: | - result = self.button_auto_completion(cr, uid, [ref("move_test1")]) + result = self.button_auto_completion() - Now I can check that all is nice and shiny, line 1. I expect the Customer Invoice Number to be recognised. diff --git a/account_move_base_import/test/invoice.yml b/account_move_base_import/test/invoice.yml index 5379f670..14cb6351 100644 --- a/account_move_base_import/test/invoice.yml +++ b/account_move_base_import/test/invoice.yml @@ -27,7 +27,8 @@ - I confirm the Invoice - - !workflow {model: account.invoice, action: invoice_open, ref: invoice_for_completion_1} + !python {model: account.invoice, id: invoice_for_completion_1}: + self.action_invoice_open() - I check that the invoice state is "Open" - @@ -38,5 +39,5 @@ - !python {model: account.invoice}: | import datetime as dt - invoice = model.browse(cr, uid, ref('invoice_for_completion_1'), context) + invoice = model.browse(ref('invoice_for_completion_1')) assert invoice.number == dt.date.today().strftime('TBNK/%Y/0001') diff --git a/account_move_base_import/test/refund.yml b/account_move_base_import/test/refund.yml index 2779ba73..3bcec135 100644 --- a/account_move_base_import/test/refund.yml +++ b/account_move_base_import/test/refund.yml @@ -27,7 +27,8 @@ - I confirm the refund - - !workflow {model: account.invoice, action: invoice_open, ref: refund_for_completion_1} + !python {model: account.invoice, id: invoice_for_completion_1}: + self.action_invoice_open() - I check that the refund state is "Open" - @@ -38,5 +39,5 @@ - !python {model: account.invoice}: | import datetime as dt - invoice = model.browse(cr, uid, ref('refund_for_completion_1'), context) + invoice = model.browse(ref('refund_for_completion_1')) assert invoice.number == dt.date.today().strftime('RTEXJ/%Y/0001') diff --git a/account_move_base_import/test/supplier_invoice.yml b/account_move_base_import/test/supplier_invoice.yml index 4ac8e87d..2eead88a 100644 --- a/account_move_base_import/test/supplier_invoice.yml +++ b/account_move_base_import/test/supplier_invoice.yml @@ -18,7 +18,7 @@ I add a reference to an existing supplier invoce - !python {model: account.invoice}: | - self.write(cr, uid, ref('account.demo_invoice_0'), { + self.write({ 'reference': 'T2S12345' }) - @@ -29,7 +29,8 @@ - Now I confirm it - - !workflow {model: account.invoice, action: invoice_open, ref: account.demo_invoice_0} + !python {model: account.invoice, id: account.demo_invoice_0}: + self.action_invoice_open() - I check that the supplier number is there -