OCA/purchase-workflow — pull request #64 by lepistone (2014-11-25 12:01:24+00:00)
Title: purchase_requisition_bid_workflow: generated PO should be in state draft_po

In the core purchase_requisition module, the generated PO from a call
for bids is validated. That is done in a big method generate_po that I
don't want to override.

On the other hand, we added a new state draftpo that is useful exactly
for that situation: an order (i.e. not a bit nor a rfq) that is not
validated yet.

The workaround used here is to add a technical boolean field
keep_in_draft which is checked on the workflow transition. The field is
set in the generated PO so that it is not confirmed, and disabled
immediately after, so that the order can be validated manually
afterwards.

A context cannot be used here because it is not passed via the workflow.

I updated the YAML test to check that the generated order is really in draft.