[FIX]: purchase: Fixed field name in tests

bzr revid: rpa@tinyerp.com-20101221083242-4eyi4sz3ulbprnz4
This commit is contained in:
rpa (Open ERP)
2010-12-21 14:02:42 +05:30
parent 394cfd398f
commit 79e0568ace
4 changed files with 9 additions and 12 deletions
+5 -5
View File
@@ -41,19 +41,19 @@
<!-- Treat generated invoice -->
<assert model="purchase.order" id="test_purchase_1" string="Test purchase has now a corresponding invoice" severity="fatal">
<test expr="bool(invoice_id)" />
<test expr="bool(invoice_ids)" />
</assert>
<assert model="purchase.order" id="test_purchase_1" string="Test purchase's invoice has the same amount and is currently a draft">
<test expr="invoice_id.state">draft</test>
<test expr="invoice_ids[0].state">draft</test>
</assert>
<workflow model="account.invoice" action="invoice_open">
<value model="purchase.order" eval="obj(ref('test_purchase_1')).invoice_id.id" />
<value model="purchase.order" eval="obj(ref('test_purchase_1')).invoice_ids[0].id" />
</workflow>
<function model="account.invoice" name="pay_and_reconcile">
<value model="purchase.order" eval="[obj(ref('test_purchase_1')).invoice_id.id]" />
<value model="purchase.order" eval="[obj(ref('test_purchase_1')).invoice_ids[0].id]" />
<value eval="1164" />
<value eval="ref('account.cash')"/>
<value eval="ref('account.period_' + str(int(time.strftime('%m'))))" />
@@ -64,7 +64,7 @@
</function>
<assert model="purchase.order" id="test_purchase_1" string="Test purchase's invoice is now paid" severity="error">
<test expr="invoice_id.state">paid</test>
<test expr="invoice_ids[0].state">paid</test>
</assert>
<!-- Treat generated picking -->
+2 -2
View File
@@ -133,8 +133,8 @@
-
I check that Traceability moves are created.
-
I check that an invoice_id field of Delivery&Invoices gets bind with the value.
I check that an invoice_ids field of Delivery&Invoices gets bind with the value.
-
!python {model: purchase.order}: |
pur_id2=self.browse(cr, uid, ref("purchase_order_po0"))
assert(pur_id2.invoice_id)
assert(pur_id2.invoice_ids)
@@ -139,8 +139,8 @@
{'active_ids': pick_ids})
self.create_invoice(cr, uid, [id], {"active_ids": pick_ids, "active_id": pick_ids[0]})
-
I check that an invoice_id field of Delivery&Invoices gets bind with the value.
I check that an invoice_ids field of Delivery&Invoices gets bind with the value.
-
!python {model: purchase.order}: |
pur_id2=self.browse(cr, uid, ref("purchase_order_po2"))
assert(pur_id2.invoice_id)
assert(pur_id2.invoice_ids)
@@ -19,8 +19,6 @@
#
##############################################################################
import netsvc
import ir
from osv import osv
from tools.translate import _
@@ -52,7 +50,6 @@ class purchase_line_invoice(osv.osv_memory):
invoices = {}
invoice_obj=self.pool.get('account.invoice')
purchase_line_obj=self.pool.get('purchase.order.line')
purchase_obj = self.pool.get('purchase.order')
property_obj=self.pool.get('ir.property')
account_fiscal_obj=self.pool.get('account.fiscal.position')
invoice_line_obj=self.pool.get('account.invoice.line')