[FIX] purchase: fixed the yaml and unit test

bzr revid: qdp-launchpad@tinyerp.com-20101221141759-rhn6ucsgox02yeay
This commit is contained in:
qdp-launchpad@tinyerp.com 2010-12-21 15:17:59 +01:00
parent 5d68c5f1f8
commit 7ff1ae996e
4 changed files with 10 additions and 10 deletions

View File

@ -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'),

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 -->

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)

View File

@ -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)