2011-06-21 13:30:26 +00:00
|
|
|
-
|
2011-06-23 13:42:07 +00:00
|
|
|
create Company
|
|
|
|
-
|
2011-06-24 13:11:17 +00:00
|
|
|
!record {model: res.company, id: res_company_test11}:
|
2011-06-23 13:42:07 +00:00
|
|
|
name: Thomson pvt. ltd.
|
|
|
|
partner_id: 1
|
|
|
|
rml_header: 1
|
|
|
|
rml_header2: 1
|
|
|
|
rml_header3: 1
|
|
|
|
currency_id: 1
|
|
|
|
|
|
|
|
-
|
2011-06-24 13:11:17 +00:00
|
|
|
create partner
|
2011-06-23 13:42:07 +00:00
|
|
|
-
|
2011-06-24 13:11:17 +00:00
|
|
|
!record {model: res.partner, id: res_partner_test20}:
|
2011-06-23 13:42:07 +00:00
|
|
|
name: Junjun wala
|
|
|
|
supplier: False
|
2011-06-24 13:11:17 +00:00
|
|
|
company_id: res_company_test11
|
2011-06-23 13:42:07 +00:00
|
|
|
|
2011-06-24 13:11:17 +00:00
|
|
|
-
|
|
|
|
create customer invoice
|
|
|
|
-
|
|
|
|
!record {model: account.invoice, id: customer_invoice_test}:
|
|
|
|
journal_id: 1
|
|
|
|
partner_id: res_partner_test20
|
2011-06-23 13:42:07 +00:00
|
|
|
currency_id: base.EUR
|
2011-06-24 13:11:17 +00:00
|
|
|
address_invoice_id: base.res_partner_address_11
|
|
|
|
company_id: base.main_company
|
|
|
|
account_id: 1
|
2011-06-23 13:42:07 +00:00
|
|
|
date_invoice: '2011-06-22'
|
2011-06-27 12:26:16 +00:00
|
|
|
name: selling product
|
2011-06-24 13:11:17 +00:00
|
|
|
type: 'out_invoice'
|
2011-06-23 13:42:07 +00:00
|
|
|
invoice_line:
|
2011-06-24 13:11:17 +00:00
|
|
|
- product_id: product.product_product_pc1
|
|
|
|
partner_id: res_partner_test20
|
|
|
|
uos_id: 1
|
2011-06-23 13:42:07 +00:00
|
|
|
quantity: 1.0
|
2011-06-24 13:11:17 +00:00
|
|
|
price_unit: 10.0
|
|
|
|
name: 'basic pc'
|
|
|
|
account_id: 1
|
|
|
|
|
2011-06-23 13:42:07 +00:00
|
|
|
-
|
2011-06-27 06:53:31 +00:00
|
|
|
Tesing of EDI functionality
|
2011-06-21 13:30:26 +00:00
|
|
|
-
|
|
|
|
!python {model: ir.edi.document}: |
|
|
|
|
invoice_obj = self.pool.get('account.invoice')
|
2011-06-24 13:11:17 +00:00
|
|
|
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)
|
|
|
|
|
2011-06-23 13:42:07 +00:00
|
|
|
-
|
2011-06-24 13:11:17 +00:00
|
|
|
Check the customer invoice is exported or not
|
2011-06-23 13:42:07 +00:00
|
|
|
-
|
|
|
|
!python {model: account.invoice}: |
|
2011-06-27 12:26:16 +00:00
|
|
|
ids=self.search(cr, uid, [('partner_id','=',ref("res_partner_test20")),('type','=','out_invoice')])
|
2011-06-23 13:42:07 +00:00
|
|
|
if not ids:
|
|
|
|
raise AssertionError("Invoice is not imported")
|
2011-06-24 13:11:17 +00:00
|
|
|
|
2011-06-27 06:53:31 +00:00
|
|
|
|