Tryton - Issues



Title Empty stock moves in account invoice lines when Handle Invoice Exception
Priority bug Status in-progress
Superseder Nosy List ced, pokoli, resteve, reviewbot
Type behavior Components account_invoice_stock
Assigned To resteve Keywords review
Reviews 260911002
View: 260911002

Created on 2020-02-03.12:54:21 by resteve, last changed by ced.

msg55202 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-02-04.13:47:50
Also the same issue exists for moved_quantity.
msg55201 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-02-04.13:29:36
For me, it is not a good design and it is killing performance as the state of the linked invoice needs to be read.
Also it will make implementation of issue7280 much more complicated.
And finally, it is logical to link existing moves with there real invoice only.
review260911002 updated at
msg55198 (view) Author: [hidden] (resteve) Date: 2020-02-04.13:04:23
@msg55197 users like to know stock moves (shipments) from invoice lines (ex, show invoice lines grouped by shipment in a report)
msg55197 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-02-04.11:05:48
Indeed I'm wondering if it will not be better to remove the link between invoice line and stock move when the invoice is canceled or the move.
msg55185 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-02-03.15:21:24
Please do not extend existing scenario and particularly not the scenario_sale. It is already too long and too difficult to manage.
This fix needs a test to ensure correctness and completeness.
msg55183 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2020-02-03.14:33:01
You can extend reuse the sale scenario to check the funciontality. For example here:
msg55182 (view) Author: [hidden] (resteve) Date: 2020-02-03.14:21:51
IMHO create a new scenario tests in account_invoice_stock is new task.
msg55181 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2020-02-03.13:56:53
Could you add a test to ensure the behaviour stays?

P.S: If you plan to work on the issue please assign it to yourself and set the proper state.
review254971002 updated at
msg55179 (view) Author: [hidden] (resteve) Date: 2020-02-03.12:54:20

1- Create a sale. Invoice order: Shipment. Process
2- Done shipment.
3- Cancel invoice.

Now return the sale, and Handle Invoice Exception.: create new invoice lines without stock moves (empty relate invoice lines to stock moves).

Example data stored:

>>> Sale = pool.get('')
>>> sale = Sale(2)
>>> for line in sale.lines: line.invoice_lines
(Pool().get('account.invoice.line')(4), Pool().get('account.invoice.line')(5))
>>> line, = sale.lines
>>> inv_line1, inv_line2 = line.invoice_lines
>>> inv_line1.stock_moves
>>> inv_line2.stock_moves
Date User Action Args
2020-02-04 13:47:51cedsetmessages: + msg55202
2020-02-04 13:29:37cedsetmessages: + msg55201
2020-02-04 13:22:08reviewbotsetmessages: + msg55199
2020-02-04 13:13:06restevesetassignedto: resteve
2020-02-04 13:04:23restevesetreviews: 254971002 -> 260911002
messages: + msg55198
2020-02-04 11:05:48cedsetmessages: + msg55197
2020-02-03 15:21:24cedsetnosy: + ced
messages: + msg55185
2020-02-03 14:33:02pokolisetmessages: + msg55183
2020-02-03 14:21:52restevesetmessages: + msg55182
2020-02-03 13:56:54pokolisetstatus: chatting -> in-progress
type: feature request -> behavior
messages: + msg55181
nosy: + pokoli

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