Created on 2020-02-03.12:54:21 by resteve, last changed 7 months ago by roundup-bot.
New changeset f13c08053541 by Cédric Krier in branch 'default': Skip canceled move and invoice when computing quantity https://hg.tryton.org/tryton-env/rev/f13c08053541
New changeset 4539f4758d35 by Cédric Krier in branch 'default': Skip canceled move and invoice when computing quantity https://hg.tryton.org/modules/account_invoice_stock/rev/4539f4758d35
Here is review258971002 which fixes both cases. I decided to not include test scenario because: * the module is a glue module and testing can not be done without extra modules * the properties are already tested in purchase and sale scenario * handling exception should be tested in purchase and sale module and not in account_invoice_stock. I followed the state test instead of unlink because it will make triggering re-computation for issue7280 more complex indeed.
Also the same issue exists for moved_quantity.
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.
@msg55197 users like to know stock moves (shipments) from invoice lines (ex, show invoice lines grouped by shipment in a report)
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.
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.
You can extend reuse the sale scenario to check the funciontality. For example here: https://hg.tryton.org/modules/sale/file/702bf7fc4e03/tests/scenario_sale.rst#l251
IMHO create a new scenario tests in account_invoice_stock is new task.
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.
Scenario: 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') >>> 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 (Pool().get('stock.move')(3),) >>> inv_line2.stock_moves ()
|2020-03-26 00:11:48||roundup-bot||set||messages: + msg56657|
|2020-03-26 00:11:36||roundup-bot||set||status: testing -> resolved|
nosy: + roundup-bot
messages: + msg56656
|2020-03-14 17:21:14||reviewbot||set||messages: + msg56266|
|2020-03-14 17:16:27||ced||set||status: in-progress -> testing|
reviews: 260911002 -> 260911002,258971002
messages: + msg56265
assignedto: resteve -> ced
|2020-02-04 13:47:51||ced||set||messages: + msg55202|
|2020-02-04 13:29:37||ced||set||messages: + msg55201|
|2020-02-04 13:22:08||reviewbot||set||messages: + msg55199|
|2020-02-04 13:13:06||resteve||set||assignedto: resteve|
|2020-02-04 13:04:23||resteve||set||reviews: 254971002 -> 260911002|
messages: + msg55198
|2020-02-04 11:05:48||ced||set||messages: + msg55197|
Showing 10 items. Show all history (warning: this could be VERY long)