Files
odoo_source/addons/purchase/test/process/run_scheduler.yml
T
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00

43 lines
1.3 KiB
YAML

-
In order to test the scheduler to generate RFQ, I create a new product
-
!record {model: product.product, id: scheduler_product}:
name: scheduler prod
type: product
seller_ids:
- delay: 1
name: base.res_partner_2
min_qty: 5.0
-
Add Buy route
-
!python {model: product.product}: |
self.write(cr, uid, [ref("scheduler_product")], {"route_ids": [(4, ref("purchase.route_warehouse0_buy"))]})
-
I create a procurement order.
-
!record {model: procurement.order, id: procurement_order_testcase0}:
location_id: stock.stock_location_stock
name: Test scheduler for RFQ
product_id: scheduler_product
product_qty: 15.0
-
I run the scheduler.
-
!python {model: procurement.order}: |
self.run_scheduler(cr, uid)
-
I check Generated RFQ.
-
!python {model: procurement.order}: |
procurement = self.browse(cr, uid, ref('procurement_order_testcase0'))
assert procurement.purchase_line_id, 'RFQ should be generated!'
-
I delete the line from the purchase order and check that the move and the procurement are cancelled
-
!python {model: procurement.order}: |
procurement = self.browse(cr, uid, ref('procurement_order_testcase0'))
procurement.purchase_line_id.unlink()
procurement.refresh()
assert procurement.state == 'cancel', 'Procurement should be cancelled'