[FIX] fix the yml error in account/account/test/test_edi_invoice.ymlsale/test/edi_sale_order.yml and sale module
bzr revid: tpa@tinyerp.com-20120227114130-ctllm9ci3v180j7t
This commit is contained in:
parent
6888c92426
commit
9493fb1dda
|
@ -50,72 +50,72 @@
|
|||
!python {model: account.invoice}: |
|
||||
import time
|
||||
edi_document = {
|
||||
"__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.random_invoice_763jsms",
|
||||
"__module": "account",
|
||||
"__model": "account.invoice",
|
||||
"__version": [6,1,0],
|
||||
"internal_number": time.strftime("SAJ/%Y/002"),
|
||||
"__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.random_invoice_763jsms",
|
||||
"__module": "account",
|
||||
"__model": "account.invoice",
|
||||
"__version": [6,1,0],
|
||||
"internal_number": time.strftime("SAJ/%Y/002"),
|
||||
"company_address": {
|
||||
"__id": "base:b22acf7a-ddcd-11e0-a4db-701a04e25543.main_address",
|
||||
"__module": "base",
|
||||
"__model": "res.partner.address",
|
||||
"city": "Gerompont",
|
||||
"zip": "1367",
|
||||
"country_id": ["base:b22acf7a-ddcd-11e0-a4db-701a04e25543.be", "Belgium"],
|
||||
"phone": "(+32).81.81.37.00",
|
||||
"__model": "res.partner.address",
|
||||
"city": "Gerompont",
|
||||
"zip": "1367",
|
||||
"country_id": ["base:b22acf7a-ddcd-11e0-a4db-701a04e25543.be", "Belgium"],
|
||||
"phone": "(+32).81.81.37.00",
|
||||
"street": "Chaussee de Namur 40",
|
||||
"bank_ids": [
|
||||
["base:b22acf7a-ddcd-11e0-a4db-701a04e25543.res_partner_bank-ZrTWzesfsdDJzGbp","Sample bank: 123465789-156113"]
|
||||
],
|
||||
},
|
||||
"company_id": ["account:b22acf7a-ddcd-11e0-a4db-701a04e25543.res_company_test11", "Thomson pvt. ltd."],
|
||||
},
|
||||
"company_id": ["account:b22acf7a-ddcd-11e0-a4db-701a04e25543.res_company_test11", "Thomson pvt. ltd."],
|
||||
"currency": {
|
||||
"__id": "base:b22acf7a-ddcd-11e0-a4db-701a04e25543.EUR",
|
||||
"__module": "base",
|
||||
"__model": "res.currency",
|
||||
"code": "EUR",
|
||||
"symbol": "€",
|
||||
},
|
||||
},
|
||||
"partner_id": ["account:b22acf7a-ddcd-11e0-a4db-701a04e25543.res_partner_test20", "Junjun wala"],
|
||||
"partner_address": {
|
||||
"__id": "base:5af1272e-dd26-11e0-b65e-701a04e25543.res_partner_address_7wdsjasdjh",
|
||||
"__module": "base",
|
||||
"__model": "res.partner.address",
|
||||
"phone": "(+32).81.81.37.00",
|
||||
"street": "Chaussee de Namur 40",
|
||||
"city": "Gerompont",
|
||||
"zip": "1367",
|
||||
"country_id": ["base:5af1272e-dd26-11e0-b65e-701a04e25543.be", "Belgium"],
|
||||
"phone": "(+32).81.81.37.00",
|
||||
"street": "Chaussee de Namur 40",
|
||||
"city": "Gerompont",
|
||||
"zip": "1367",
|
||||
"country_id": ["base:5af1272e-dd26-11e0-b65e-701a04e25543.be", "Belgium"],
|
||||
},
|
||||
"date_invoice": time.strftime('%Y-%m-%d'),
|
||||
"name": "sample invoice",
|
||||
"date_invoice": time.strftime('%Y-%m-%d'),
|
||||
"name": "sample invoice",
|
||||
"tax_line": [{
|
||||
"__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.account_invoice_tax-4g4EutbiEMVl",
|
||||
"__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.account_invoice_tax-4g4EutbiEMVl",
|
||||
"__module": "account",
|
||||
"__model": "account.invoice.tax",
|
||||
"amount": 1000.0,
|
||||
"manual": True,
|
||||
"name": "sale tax",
|
||||
}],
|
||||
"type": "out_invoice",
|
||||
"__model": "account.invoice.tax",
|
||||
"amount": 1000.0,
|
||||
"manual": True,
|
||||
"name": "sale tax",
|
||||
}],
|
||||
"type": "out_invoice",
|
||||
"invoice_line": [{
|
||||
"__module": "account",
|
||||
"__model": "account.invoice.line",
|
||||
"__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.account_invoice_line-1RP3so",
|
||||
"uos_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_uom_unit", "PCE"],
|
||||
"name": "Basic PC",
|
||||
"price_unit": 10.0,
|
||||
"product_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_product_pc1", "[PC1] Basic PC"],
|
||||
"uos_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_uom_unit", "Unit"],
|
||||
"name": "Basic PC",
|
||||
"price_unit": 10.0,
|
||||
"product_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_product_pc1", "[PC1] Basic PC"],
|
||||
"quantity": 1.0
|
||||
},
|
||||
{
|
||||
"__module": "account",
|
||||
"__model": "account.invoice.line",
|
||||
"__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.account_invoice_line-u2XV5",
|
||||
"uos_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_uom_unit", "PCE"],
|
||||
"name": "Medium PC",
|
||||
"price_unit": 100.0,
|
||||
"product_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_product_pc3", "[PC3] Medium PC"],
|
||||
"uos_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_uom_unit", "Unit"],
|
||||
"name": "Medium PC",
|
||||
"price_unit": 100.0,
|
||||
"product_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_product_pc3", "[PC3] Medium PC"],
|
||||
"quantity": 5.0
|
||||
}]
|
||||
}
|
||||
|
@ -137,12 +137,12 @@
|
|||
assert len(invoice_new.invoice_line) == 2, "invoice lines are not same"
|
||||
for inv_line in invoice_new.invoice_line:
|
||||
if inv_line.name == 'Basic PC':
|
||||
assert inv_line.uos_id.name == "PCE" , "uom is not same"
|
||||
assert inv_line.uos_id.name == "Unit" , "uom is not same"
|
||||
assert inv_line.price_unit == 10 , "price unit is not same"
|
||||
assert inv_line.quantity == 1 , "product qty is not same"
|
||||
assert inv_line.price_subtotal == 10, "price sub total is not same"
|
||||
elif inv_line.name == 'Medium PC':
|
||||
assert inv_line.uos_id.name == "PCE" , "uom is not same"
|
||||
assert inv_line.uos_id.name == "Unit" , "uom is not same"
|
||||
assert inv_line.price_unit == 100 , "price unit is not same"
|
||||
assert inv_line.quantity == 5 , "product qty is not same"
|
||||
assert inv_line.price_subtotal == 500, "price sub total is not same"
|
||||
|
|
|
@ -57,52 +57,52 @@
|
|||
"__id": "base:5af1272e-dd26-11e0-b65e-701a04e25543.some_address",
|
||||
"__module": "base",
|
||||
"__model": "res.partner.address",
|
||||
"phone": "(+32).81.81.37.00",
|
||||
"street": "Chaussee de Namur 40",
|
||||
"city": "Gerompont",
|
||||
"zip": "1367",
|
||||
"phone": "(+32).81.81.37.00",
|
||||
"street": "Chaussee de Namur 40",
|
||||
"city": "Gerompont",
|
||||
"zip": "1367",
|
||||
"country_id": ["base:5af1272e-dd26-11e0-b65e-701a04e25543.be", "Belgium"],
|
||||
"bank_ids": [
|
||||
["base:5af1272e-dd26-11e0-b65e-701a04e25543.res_partner_bank-adaWadsadasdDJzGbp","Ladies bank: 032465789-156113"]
|
||||
],
|
||||
},
|
||||
"partner_id": ["purchase:5af1272e-dd26-11e0-b65e-701a04e25543.res_partner_test20", "jones white"],
|
||||
},
|
||||
"partner_id": ["purchase:5af1272e-dd26-11e0-b65e-701a04e25543.res_partner_test20", "jones white"],
|
||||
"partner_address": {
|
||||
"__id": "base:5af1272e-dd26-11e0-b65e-701a04e25543.res_partner_address_7wdsjasdjh",
|
||||
"__module": "base",
|
||||
"__model": "res.partner.address",
|
||||
"phone": "(+32).81.81.37.00",
|
||||
"street": "Chaussee de Namur 40",
|
||||
"city": "Gerompont",
|
||||
"zip": "1367",
|
||||
"country_id": ["base:5af1272e-dd26-11e0-b65e-701a04e25543.be", "Belgium"],
|
||||
"phone": "(+32).81.81.37.00",
|
||||
"street": "Chaussee de Namur 40",
|
||||
"city": "Gerompont",
|
||||
"zip": "1367",
|
||||
"country_id": ["base:5af1272e-dd26-11e0-b65e-701a04e25543.be", "Belgium"],
|
||||
},
|
||||
"order_line": [{
|
||||
"__id": "purchase:5af1272e-dd26-11e0-b65e-701a04e25543.purchase_order_line-AlhsVDZGoKvJ",
|
||||
"__module": "purchase",
|
||||
"__id": "purchase:5af1272e-dd26-11e0-b65e-701a04e25543.purchase_order_line-AlhsVDZGoKvJ",
|
||||
"__module": "purchase",
|
||||
"__model": "purchase.order.line",
|
||||
"__import_module": "sale",
|
||||
"__import_model": "sale.order.line",
|
||||
"name": "Basic PC",
|
||||
"date_planned": "2011-09-30",
|
||||
"price_unit": 150.0,
|
||||
"__import_module": "sale",
|
||||
"__import_model": "sale.order.line",
|
||||
"name": "Basic PC",
|
||||
"date_planned": "2011-09-30",
|
||||
"price_unit": 150.0,
|
||||
"product_id": ["product:5af1272e-dd26-11e0-b65e-701a04e25543.product_product_pc1", "[PC1] Basic PC"],
|
||||
"product_qty": 1.0,
|
||||
"product_uom": ["product:5af1272e-dd26-11e0-b65e-701a04e25543.product_uom_unit", "PCE"],
|
||||
"product_qty": 1.0,
|
||||
"product_uom": ["product:5af1272e-dd26-11e0-b65e-701a04e25543.product_uom_unit", "Unit"],
|
||||
},
|
||||
{
|
||||
"__id": "purchase:5af1272e-dd26-11e0-b65e-701a04e25543.purchase_order_line-Alsads33e",
|
||||
"__module": "purchase",
|
||||
"__id": "purchase:5af1272e-dd26-11e0-b65e-701a04e25543.purchase_order_line-Alsads33e",
|
||||
"__module": "purchase",
|
||||
"__model": "purchase.order.line",
|
||||
"__import_module": "sale",
|
||||
"__import_module": "sale",
|
||||
"__import_model": "sale.order.line",
|
||||
"name": "Medium PC",
|
||||
"date_planned": "2011-09-15",
|
||||
"price_unit": 100.0,
|
||||
"name": "Medium PC",
|
||||
"date_planned": "2011-09-15",
|
||||
"price_unit": 100.0,
|
||||
"product_id": ["product:5af1272e-dd26-11e0-b65e-701a04e25543.product_product_pc3", "[PC3] Medium PC"],
|
||||
"product_qty": 2.0,
|
||||
"product_uom": ["product:5af1272e-dd26-11e0-b65e-701a04e25543.product_uom_unit", "PCE"],
|
||||
}],
|
||||
"product_qty": 2.0,
|
||||
"product_uom": ["product:5af1272e-dd26-11e0-b65e-701a04e25543.product_uom_unit", "Unit"],
|
||||
}],
|
||||
}
|
||||
new_sale_order_id = sale_order_pool.edi_import(cr, uid, edi_document, context=context)
|
||||
assert new_sale_order_id, 'Sale order import failed'
|
||||
|
@ -120,12 +120,12 @@
|
|||
for sale_line in order_new.order_line:
|
||||
if sale_line.name == 'Basic PC':
|
||||
assert sale_line.delay == 18 , "incorrect delay: got %s, expected 18"%(sale_line.delay,)
|
||||
assert sale_line.product_uom.name == "PCE" , "uom is not same"
|
||||
assert sale_line.product_uom.name == "Unit" , "uom is not same"
|
||||
assert sale_line.price_unit == 150 , "unit price is not same, got %s, expected 150"%(sale_line.price_unit,)
|
||||
assert sale_line.product_uom_qty == 1 , "product qty is not same"
|
||||
elif sale_line.name == 'Medium PC':
|
||||
assert sale_line.delay == 3 , "incorrect delay: got %s, expected 3"%(sale_line.delay,)
|
||||
assert sale_line.product_uom.name == "PCE" , "uom is not same"
|
||||
assert sale_line.product_uom.name == "Unit" , "uom is not same"
|
||||
assert sale_line.price_unit == 100 , "unit price is not same, got %s, expected 100"%(sale_line.price_unit,)
|
||||
assert sale_line.product_uom_qty == 2 , "product qty is not same"
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue