# Manage some cases with purchase\_requests created from requisitions

**URL:** https://discuss.tryton.org/t/manage-some-cases-with-purchase-requests-created-from-requisitions/4832
**Category:** Developer
**Tags:** purchasing
**Created:** [December 6, 2021, 1:18pm UTC](https://discuss.tryton.org/t/manage-some-cases-with-purchase-requests-created-from-requisitions/4832 "2021-12-06T13:18:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)
#### Post date: [December 6, 2021, 1:18pm UTC](https://discuss.tryton.org/t/manage-some-cases-with-purchase-requests-created-from-requisitions/4832/1 "2021-12-06T13:18:13Z")

</div>

Hi,

We noticed some problems to process purchased\_requests issued by purchase\_requisitions…

With [https://bugs.tryton.org/issue10127](https://bugs.tryton.org/issue10127), unit\_price defined on purchase\_requisition could become a key to create purchase\_line from purchase\_request.

Let’s take the case when different users create purchase\_requisition for the same product with different quantities and different unit\_price. With the above issue, if we select those lines with same product in purchase\_request, the created purchase will have 2 purchase lines with different unit\_price.  
The purchaser will probably try to merge those 2 lines into one with summed quantity and the best unit\_price. In this case, the link on the request will be lost and the request state will return to ‘draft’.  
How to tell your request is managed by another purchase ?

Another case is when your process a purchase request to a purchase and you order more then expected on the purchase (better price, good sale forecasts, …). Few moments later, there’s a new purchase\_request created from a requisition for the same product. How to link this requests to the previous purchase you made ?

To handle such cases, could we imagine that the field “requests” on purchase\_line will be no more read-only and then allow purchaser to link one or multiple ‘draft’ purchase\_request on a ‘draft’ purchase\_line (with domain on product) like for [Blanket Order](https://bugs.tryton.org/issue10962) ?

Is the only way to cancel a request is by creating a purchase and then cancelling ? (in the case of it’s no more possible to purchase a product requested). Or could it be possible to act on the draft\_purchase request before creating the purchase and update the status to ‘cancel’ ?

Thanks for suggestions, solutions, ideas about improvements that could be done in such cases! 🙂

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [December 6, 2021, 3:09pm UTC](https://discuss.tryton.org/t/manage-some-cases-with-purchase-requests-created-from-requisitions/4832/2 "2021-12-06T15:09:00Z")

</div>

> [@maxx](#):
>
> Let’s take the case when different users create purchase\_requisition for the same product with different quantities and different unit\_price. With the above issue, if we select those lines with same product in purchase\_request, the created purchase will have 2 purchase lines with different unit\_price.  
> The purchaser will probably try to merge those 2 lines into one with summed quantity and the best unit\_price. In this case, the link on the request will be lost and the request state will return to ‘draft’.  
> How to tell your request is managed by another purchase ?

Indeed I think we should not group by unit price but only compute the unit price of the purchase line by using the lowest price.

> [@maxx](#):
>
> Few moments later, there’s a new purchase\_request created from a requisition for the same product. How to link this requests to the previous purchase you made ?

I guess we could make the purchase line field on request editable for request originated from request.

> [@maxx](#):
>
> Is the only way to cancel a request is by creating a purchase and then cancelling ?

Yes.

> [@maxx](#):
>
> Or could it be possible to act on the draft\_purchase request before creating the purchase and update the status to ‘cancel’ ?

I do think that you can only know that you can not purchase once you made a request for quotation to a supplier and thus cancel the order.

---

<div class="post-metadata">

### Author: ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)
#### Post date: [December 6, 2021, 3:22pm UTC](https://discuss.tryton.org/t/manage-some-cases-with-purchase-requests-created-from-requisitions/4832/3 "2021-12-06T15:22:03Z")

</div>

> [@ced](#):
>
> I guess we could make the purchase line field on request editable for request originated from request.

So this field (purchase\_line) should be displayed on purchase\_request

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [December 6, 2021, 3:52pm UTC](https://discuss.tryton.org/t/manage-some-cases-with-purchase-requests-created-from-requisitions/4832/4 "2021-12-06T15:52:51Z")

</div>

Probably when it is editable. Or maybe we need to have a dedicated wizard so it can check that the sum of request quantities is bellow the purchased quantity.
