summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqdp-launchpad@tinyerp.com <>2010-12-21 15:17:59 +0100
committerqdp-launchpad@tinyerp.com <>2010-12-21 15:17:59 +0100
commit7ff1ae996ef02185b73fdfbecd656ef212d5bd85 (patch)
tree3a4f8dc5cd5626457e8f5fdd6ca1217ba41fba5b
parent5d68c5f1f897cc330a27bf514c72ae6e07bbdec7 (diff)
[FIX] purchase: fixed the yaml and unit test
bzr revid: qdp-launchpad@tinyerp.com-20101221141759-rhn6ucsgox02yeay
-rw-r--r--addons/purchase/purchase.py2
-rw-r--r--addons/purchase/purchase_unit_test.xml10
-rw-r--r--addons/purchase/test/purchase_from_order.yml4
-rw-r--r--addons/purchase/test/purchase_from_picking.yml4
4 files changed, 10 insertions, 10 deletions
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index 8e59741124a..3a768a4c218 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -179,7 +179,7 @@ class purchase_order(osv.osv):
'order_line': fields.one2many('purchase.order.line', 'order_id', 'Order Lines', states={'approved':[('readonly',True)],'done':[('readonly',True)]}),
'validator' : fields.many2one('res.users', 'Validated by', readonly=True),
'notes': fields.text('Notes'),
- 'invoice_ids': fields.many2many('account.invoice', 'purchase_invoice_rel', 'purchase_id', 'invoice_id', 'Taxes', help="Invoices generated for a purchase order"),
+ 'invoice_ids': fields.many2many('account.invoice', 'purchase_invoice_rel', 'purchase_id', 'invoice_id', 'Invoices', help="Invoices generated for a purchase order"),
'picking_ids': fields.one2many('stock.picking', 'purchase_id', 'Picking List', readonly=True, help="This is the list of picking list that have been generated for this purchase"),
'shipped':fields.boolean('Received', readonly=True, select=True, help="It indicates that a picking has been done"),
'shipped_rate': fields.function(_shipped_rate, method=True, string='Received', type='float'),
diff --git a/addons/purchase/purchase_unit_test.xml b/addons/purchase/purchase_unit_test.xml
index 93c0e42fae2..b35e0626085 100644
--- a/addons/purchase/purchase_unit_test.xml
+++ b/addons/purchase/purchase_unit_test.xml
@@ -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 -->
diff --git a/addons/purchase/test/purchase_from_order.yml b/addons/purchase/test/purchase_from_order.yml
index 8c14611661c..454580baaf4 100644
--- a/addons/purchase/test/purchase_from_order.yml
+++ b/addons/purchase/test/purchase_from_order.yml
@@ -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)
diff --git a/addons/purchase/test/purchase_from_picking.yml b/addons/purchase/test/purchase_from_picking.yml
index e68668f408d..357d865b9c9 100644
--- a/addons/purchase/test/purchase_from_picking.yml
+++ b/addons/purchase/test/purchase_from_picking.yml
@@ -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)