diff --git a/account_invoice_reference/__openerp__.py b/account_invoice_reference/__openerp__.py index 2ad8758d..cda206a0 100644 --- a/account_invoice_reference/__openerp__.py +++ b/account_invoice_reference/__openerp__.py @@ -141,6 +141,7 @@ Information propagated to the move lines: 'test/out_refund_without_origin.yml', 'test/in_refund_with_supplier_number.yml', 'test/in_refund_without_supplier_number.yml', + 'test/supplier_invoice_number.yml', ], 'installable': True, diff --git a/account_invoice_reference/test/supplier_invoice_number.yml b/account_invoice_reference/test/supplier_invoice_number.yml new file mode 100644 index 00000000..846fc63f --- /dev/null +++ b/account_invoice_reference/test/supplier_invoice_number.yml @@ -0,0 +1,47 @@ +- + In order to check if the reference is populated from the supplier_invoice_number + I create an invoice. +- + !record {model: account.invoice, id: invoice_supplier_invoice_number, view: account.invoice_supplier_form}: + account_id: account.a_pay + check_total: 3000.0 + company_id: base.main_company + currency_id: base.EUR + invoice_line: + - account_id: account.a_expense + name: '[PCSC234] PC Assemble SC234' + price_unit: 300.0 + product_id: product.product_product_3 + quantity: 10.0 + uos_id: product.product_uom_unit + journal_id: account.expenses_journal + partner_id: base.res_partner_12 + reference_type: none + supplier_invoice_number: ZZZ246 + type: in_invoice +- + Set again the type of the invoice (not set on the first one...) +- + !record {model: account.invoice, id: invoice_supplier_invoice_number, view: account.invoice_supplier_form}: + type: in_invoice +- + Ensure that the reference is the same than the supplier_invoice_number +- + !assert {model: account.invoice, id: invoice_supplier_invoice_number}: + - reference == 'ZZZ246' +- + In order to check if the supplier_invoice_number is copied to the supplier_invoice_number + when the reference is empty, I empty the reference +- + !record {model: account.invoice, id: invoice_supplier_invoice_number, view: account.invoice_supplier_form}: + reference: +- + And I write a new supplier_invoice_number +- + !record {model: account.invoice, id: invoice_supplier_invoice_number, view: account.invoice_supplier_form}: + supplier_invoice_number: ABC789 +- + Ensure that the reference is the same than the supplier_invoice_number +- + !assert {model: account.invoice, id: invoice_supplier_invoice_number}: + - reference == 'ABC789'