Issue 10729

Title
Manual assign on a location without enough stock save remainder line with assigned line data(location, lot)
Priority
bug
Status
in-progress
Nosy list
ced, mrichez, reviewbot, tbruyere, yangoon
Assigned to
ced
Keywords
backport, review

Created on 2021-09-09.11:36:18 by mrichez, last changed 4 days ago by reviewbot.

Files

File name Uploaded Type Details
bug_assign-2021-09-22_10.19.00.mkv mrichez, 2021-09-22.10:37:03 video/x-matroska view

Messages

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-09-22.11:31:56

Here is review379081002 which I think should be backported even if it modifies the API of the _apply method.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-09-22.11:24:53

Indeed this happens when account_invoice_stock is activated because it override Move.write to call update_unit_price which save the moves. So the application of the key is then stored on the move.
I think we should not rely on modified move instance being not saved by the Move.assign_try and always restore the values of the move that was modified by the application of the key.

Author: [hidden] (mrichez)
Date: 2021-09-22.10:37:03

Video of the behaviour on tryton 6.1 following script in https://bugs.tryton.org/issue10729#msg69950

Tested also in demo 6.0 online.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-09-22.10:03:55
Author: [hidden] (mrichez)
Date: 2021-09-09.11:36:18

This behavior happens in Tryton 6.0 (working in 5.8)

To reproduce:
* Create 2 locations under Stock Location (A1, A2)
* Store product X in A1 : qty 50, in A2 : qty 100
* Create a sale with product X - qty : 80
* Process sale and go to customer shipment
* Select the shipment related to sale and do a manual assign
* Quantity to assign is 80
* As location, select A1 (which contains 50 unit), leave quantity field empty(it means take all at this place) then apply.
* Now, if you try to select a location, list is empty (it should display 'A2' location).
* If you click on cancel in the wizard: displayed lines will be:

  • A1 - X - 50
  • A1 -X - 30 -> Should be : Storage Zone - X - 30

If lot module is activated, lot number will be also on the remainder line. (normally it should be empty)

Can be tested here choosing 'A2' as location with the Manual Assign:
Test Demo Tryton 6.0

History
Date User Action Args
2021-09-22 11:51:35reviewbotsetmessages: + msg70268
nosy: + reviewbot
2021-09-22 11:31:56cedsetkeyword: + backport, review
messages: + msg70266
reviews: 379081002
2021-09-22 11:24:53cedsetassignedto: ced
messages: + msg70265
status: need-eg -> in-progress
2021-09-22 10:37:03mrichezsetfiles: + bug_assign-2021-09-22_10.19.00.mkv
messages: + msg70264
2021-09-22 10:03:55cedsetmessages: + msg70261
nosy: + ced
status: unread -> need-eg
2021-09-09 14:45:20yangoonsetnosy: + yangoon
2021-09-09 13:28:40mrichezsettitle: Manual assign on a location without enough stock save assigned data as remainder line (location, lot) -> Manual assign on a location without enough stock save remainder line with assigned line data(location, lot)
2021-09-09 11:36:18mrichezcreate

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