Issue 10591

Title
Missing origin loop when assign on stock shipment in return
Priority
bug
Status
chatting
Nosy list
bernatnan, ced
Assigned to
Keywords

Created on 2021-07-20.16:06:57 by bernatnan, last changed 5 days ago by bernatnan.

Messages

Author: [hidden] (bernatnan)
Date: 2021-07-20.17:27:08
>
> No this will miss the point of the check. Shipping product without an
> origin is a bad practice as it is missing the workflow of the sale or
> purchase.
>

You are right. Will be better your solution.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-07-20.17:21:05
On 2021-07-20 17:10, Bernat Brunet wrote:
> Another solution may be could be fill the origin of the new move with the
> 'stock.move,ID' of the original move and this will avoid the missing origin
> warning.

No this will miss the point of the check. Shipping product without an
origin is a bad practice as it is missing the workflow of the sale or
purchase.
Author: [hidden] (bernatnan)
Date: 2021-07-20.17:10:10
Missatge de Cédric Krier <bugs@tryton.org> del dia dt., 20 de jul. 2021 a
les 17:00:

>
> Cédric Krier <cedric.krier@b2ck.com> added the comment:
>
> On 2021-07-20 16:30, Bernat Brunet wrote:
> > I have created Product01 and make an inventory of 100 units.
> > You have a shipment in return (id:2) with 150 units and if you try to
> Assign, appear the loop origin warning.
>
> Indeed it happens when Move.assign_try create a new move to be assigned.
> So on each run it is a new id that is used for this new move.
> I think we should find a way to distinct new records in Warning_.format
> so we use another value than the id to build the key.
> I think to distinct we could the `Transaction.create_records` and to
> replace the id we could use the value of the fields excepted for binary.
>

Another solution may be could be fill the origin of the new move with the
'stock.move,ID' of the original move and this will avoid the missing origin
warning.

> ______________________________________
> Tryton issue tracker <bugs@tryton.org>
> <https://bugs.tryton.org/issue10591>
> ______________________________________
>

-- 

Bernat Brunet

Tel. (+34) 935 531 803

<https://www.nan-tic.com/en/news/>  <http://twitter.com/nan_tic>
<https://www.linkedin.com/company/nan-tic/>

Pot consultar la informació sobre el tractament que realitzem de les dades
de caràcter personal de conformitat amb l’article 11 LOPD aquí
<https://www.nan-tic.com/lopd>.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-07-20.17:00:06
On 2021-07-20 16:30, Bernat Brunet wrote:
> I have created Product01 and make an inventory of 100 units.
> You have a shipment in return (id:2) with 150 units and if you try to Assign, appear the loop origin warning.

Indeed it happens when Move.assign_try create a new move to be assigned.
So on each run it is a new id that is used for this new move.
I think we should find a way to distinct new records in Warning_.format
so we use another value than the id to build the key.
I think to distinct we could the `Transaction.create_records` and to
replace the id we could use the value of the fields excepted for binary.
Author: [hidden] (bernatnan)
Date: 2021-07-20.16:30:45

Reproduced on demo.tryton.org (it redirect to https://demo6.0.tryton.org)
I have created Product01 and make an inventory of 100 units.
You have a shipment in return (id:2) with 150 units and if you try to Assign, appear the loop origin warning.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-07-20.16:13:49

Can not reproduce on demo.tryton.org.
Such infinite warning loop happens if the assigned move was created during the assignation. But for supplier shipment return there is no such creation.

Author: [hidden] (bernatnan)
Date: 2021-07-20.16:06:57

Need to have installed purchase and stock modules.
For example, Product01 have 100 units of stock.
- Try to create a shipment in return manually of 150 units of the Product01, for error.
- When try to assign the shipment, first, appear the warning about the move has not origin.
- If you say YES to proceed, it enter in a loop appearing continuously the same warning, and never appear the warning about stock it's not enough.

History
Date User Action Args
2021-07-20 17:27:08bernatnansetmessages: + msg68956
2021-07-20 17:21:05cedsetmessages: + msg68955
2021-07-20 17:10:10bernatnansetmessages: + msg68954
2021-07-20 17:00:06cedsetmessages: + msg68953
2021-07-20 16:30:45bernatnansetmessages: + msg68952
status: need-eg -> chatting
2021-07-20 16:13:49cedsetmessages: + msg68951
nosy: + ced
status: chatting -> need-eg
2021-07-20 16:06:57bernatnancreate

Showing 10 items. Show all history (warning: this could be VERY long)