Tryton - Issues

 

Issue7152

Title splitting stock moves in outgoing shipment loses link to invoice lines
Priority bug Status resolved
Superseder Nosy List ced, reviewbot, rmu, roundup-bot
Type behavior Components account_invoice_stock, stock, stock_lot, stock_split
Assigned To ced Keywords review
Reviews 36121002,44871002,36121003,37191002
View: 36121002, 44871002, 36121003, 37191002

Created on 2018-02-20.18:46:17 by rmu, last changed by roundup-bot.

Messages
New changeset 2a0c5501b522 by Cédric Krier in branch 'default':
Add _stock_move_split in context to copy move for split
http://hg.tryton.org/modules/stock_split/rev/2a0c5501b522
New changeset 4d9090a4aab8 by Cédric Krier in branch 'default':
Add _stock_move_split in context to copy move for split
http://hg.tryton.org/modules/stock_lot/rev/4d9090a4aab8
New changeset ce9b75049781 by Cédric Krier in branch 'default':
Do not remove invoice_lines link when copying move for split
http://hg.tryton.org/modules/account_invoice_stock/rev/ce9b75049781
New changeset f8b108843d22 by Cédric Krier in branch 'default':
Add _stock_move_split in context to copy move for split
http://hg.tryton.org/modules/stock/rev/f8b108843d22
review37191002 updated at https://codereview.tryton.org/37191002/#ps1
review36121003 updated at https://codereview.tryton.org/36121003/#ps1
review44871002 updated at https://codereview.tryton.org/44871002/#ps1
review36121002 updated at https://codereview.tryton.org/36121002/#ps1
msg39625 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-04-01.15:57:53
Here are reviews that implements the context switch.
msg38530 (view) Author: [hidden] (rmu) Date: 2018-02-21.11:22:44
clarification: the second issue from msg38525 is caused by the copy in http://hg.tryton.org/modules/stock_lot/file/tip/stock.py#l149, so it is indeed the same issue.
msg38529 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-21.11:01:20
replying to msg38520:
I think we must use a specific contextual keyword when copying Move for splitting moves to update spread quantities. This keyword must not be limited to stock_split.
msg38526 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-21.10:01:55
Your link does not point to the place where the copy is done. It is in the stock_lot module see msg38520
msg38525 (view) Author: [hidden] (rmu) Date: 2018-02-21.09:36:20
I am saying that because of the following scenario:

* create and process sale
* in outgoing shipment, split inventory stock moves (in preparation to eventually assign stock lots)
* assign/...
* link to invoice line is lost except for one move per original line

and in this case it seems as http://hg.tryton.org/modules/stock/file/tip/shipment.py#l1277 ff is syncronising the outgoing moves, copying the stock lots, but the link to invoice line is lost, as the original move is neither split nor copied, just changed to correct quantity.

Perhaps I'm completely mistaken how that is supposed to work, but in order to have stock lots on inventory moves it seems it is not sufficient to set the lots on the outgoing moves. Creating the invoice from the shipment somehow solves that problem (links are created and seem to be fine), but that may be undesireable.
msg38522 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-21.00:20:05
On 2018-02-20 20:44, Robert Schöftner wrote:
> this is only half the story. _sync_inventory_to_outgoing also does not keep links to invoice lines, there is no move.copy involved.

I do not see why you are saying that.
The links exist only on outgoing moves which are created by the
sale. Any move created by _sync_inventory_to_outgoing should precisely
not be linked.
msg38521 (view) Author: [hidden] (rmu) Date: 2018-02-20.20:44:09
this is only half the story. _sync_inventory_to_outgoing also does not keep links to invoice lines, there is no move.copy involved.
msg38520 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-20.19:19:58
I think the solution will be that account_invoice_stock add a contextual switch which prevent to not copy the invoice_lines.
This switch should be added when copying move in stock_split and stock_lot. Or maybe it is better to use an extras_depend and override the methods in account_invoice_stock.

Another option will be to use the '_check_access' context to know if it is a copy from the UI or from the code. But I'm not sure that all copy from code should keep the invoice_lines.
msg38518 (view) Author: [hidden] (rmu) Date: 2018-02-20.18:46:17
scenario:

* create and process sale
* in outgoing shipment, split outgoing stock move
* link to invoice line is lost except for first move

something similar is happening when splitting the inventory move and assign/..., link to invoice line (in outgoing moves) is lost except for first move.
History
Date User Action Args
2018-04-09 10:42:22roundup-botsetmessages: + msg39901
2018-04-09 10:41:41roundup-botsetmessages: + msg39900
2018-04-09 10:41:06roundup-botsetmessages: + msg39899
2018-04-09 10:40:19roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg39898
2018-04-01 16:02:52reviewbotsetmessages: + msg39631
2018-04-01 16:02:50reviewbotsetmessages: + msg39629
2018-04-01 16:02:49reviewbotsetmessages: + msg39628
2018-04-01 16:02:43reviewbotsetnosy: + reviewbot
messages: + msg39627
2018-04-01 15:57:53cedsetstatus: in-progress -> testing
reviews: 36121002,44871002,36121003,37191002
messages: + msg39625
keyword: + review
2018-04-01 15:52:15cedsetcomponent: + stock

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