odoo/addons/account/test/test_edi_invoice.yml

62 lines
1.6 KiB
YAML
Raw Normal View History

-
create Company
-
!record {model: res.company, id: res_company_test11}:
name: Thomson pvt. ltd.
partner_id: 1
rml_header: 1
rml_header2: 1
rml_header3: 1
currency_id: 1
-
create partner
-
!record {model: res.partner, id: res_partner_test20}:
name: Junjun wala
supplier: False
company_id: res_company_test11
-
create customer invoice
-
!record {model: account.invoice, id: customer_invoice_test}:
journal_id: 1
partner_id: res_partner_test20
currency_id: base.EUR
address_invoice_id: base.res_partner_address_11
company_id: base.main_company
account_id: 1
date_invoice: '2011-06-22'
name: selling product
type: 'out_invoice'
invoice_line:
- product_id: product.product_product_pc1
partner_id: res_partner_test20
uos_id: 1
quantity: 1.0
price_unit: 10.0
name: 'basic pc'
account_id: 1
-
Tesing of EDI functionality
-
!python {model: ir.edi.document}: |
invoice_obj = self.pool.get('account.invoice')
invoices = invoice_obj.browse(cr, uid, [ref("customer_invoice_test")])
tokens = self.export_edi(cr, uid, invoices)
for token in tokens:
document = self.get_document(cr, uid, token, context=context)
a = self.import_edi(cr, uid, edi_document = document)
-
Check the customer invoice is exported or not
-
!python {model: account.invoice}: |
ids=self.search(cr, uid, [('partner_id','=',ref("res_partner_test20")),('type','=','out_invoice')])
if not ids:
raise AssertionError("Invoice is not imported")