Tryton - Issues

 

Issue7141

Title Unable to open lots by location
Priority bug Status resolved
Superseder Nosy List ced, pokoli, reviewbot, roundup-bot
Type crash Components sale_stock_quantity, stock, stock_lot, stock_lot_sled, stock_supply, stock_supply_production
Assigned To ced Keywords review
Reviews 40111002, 44001002, 44651002, 35951002, 40121002, 41121002, 43151002, 44661002
View: 40111002, 44001002, 44651002, 35951002, 40121002, 41121002, 43151002, 44661002

Created on 2018-02-16.09:38:15 by pokoli, last changed by roundup-bot.

Messages
New changeset 85c685e3bd8b by Cédric Krier in branch 'default':
Replace product_ids by grouping_filter
http://hg.tryton.org/modules/stock_supply_production/rev/85c685e3bd8b
New changeset ccba416fa067 by Cédric Krier in branch 'default':
Replace product_ids by grouping_filter
http://hg.tryton.org/modules/stock_supply/rev/ccba416fa067
New changeset 33f38b52fdfa by Cédric Krier in branch 'default':
Replace product_ids by grouping_filter
http://hg.tryton.org/modules/stock_lot_sled/rev/33f38b52fdfa
New changeset 12ade816609c by Cédric Krier in branch 'default':
Replace product_ids by grouping_filter
http://hg.tryton.org/modules/stock_lot/rev/12ade816609c
New changeset c4a7693a88d1 by Cédric Krier in branch 'default':
Replace product_ids by grouping_filter
http://hg.tryton.org/modules/sale_stock_quantity/rev/c4a7693a88d1
New changeset 8fad27bf9629 by Cédric Krier in branch 'default':
Remove product_ids from products_by_location for grouping_filter
http://hg.tryton.org/modules/stock/rev/8fad27bf9629
New review44661002 at https://codereview.tryton.org/44661002/#ps1
New review43151002 at https://codereview.tryton.org/43151002/#ps1
New review41121002 at https://codereview.tryton.org/41121002/#ps1
New review40121002 at https://codereview.tryton.org/40121002/#ps1
msg38554 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-21.19:22:35
So I removed product_ids from Product.products_by_location and StockMixin._get_quantity
Like this the API is no more ambiguous.
New review35951002 at https://codereview.tryton.org/35951002/#ps1
New review44651002 at https://codereview.tryton.org/44651002/#ps1
msg38551 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-21.18:31:29
I reopen it because Inventory.complete_lines fails with the stock_lot module.
I think the problem is with the design of the API of products_by_location. There are two places where to put the products (as product_ids or in grouping_filter).
For me, the best option is to remove product_ids parameter.
New changeset 5cc05022f003 by Cédric Krier in branch 'default':
Ensure grouping has no duplicate fields
http://hg.tryton.org/modules/stock/rev/5cc05022f003
New changeset a4480c453d21 by Cédric Krier in branch 'default':
Do not group twice per product in Lot.get_quantity
http://hg.tryton.org/modules/stock_lot/rev/a4480c453d21
New changeset 79a7c2330d28 by Cédric Krier in branch 'default':
Do not group twice per product
http://hg.tryton.org/modules/stock_lot/rev/79a7c2330d28
msg38531 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-02-21.12:29:52
review44001002 should be pushed also (otherwise stock_lot test is fails)
New changeset 522d0e466b38 by Cédric Krier in branch 'default':
Ensure grouping_filter has the right length
http://hg.tryton.org/modules/stock/rev/522d0e466b38
review44001002 updated at https://codereview.tryton.org/44001002/#ps1
msg38400 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-02-16.10:56:44
I confirm that latests reviews fixed the problem. Thanks
msg38399 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-16.10:52:00
It should be fixed with latest review40111002 and review44001002
review40111002 updated at https://codereview.tryton.org/40111002/#ps20001
review40111002 updated at https://codereview.tryton.org/40111002/#ps1
msg38396 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-02-16.10:18:46
Although the proposed patch allows to open the lot's location, when running the stock_lot test suite I get the following traceback:

Traceback (most recent call last):
  File "/home/sergi/projectes/nclone/trytond/trytond/tests/test_tryton.py", line 197, in wrapper
    result = func(*args, **kwargs)
  File "/home/sergi/projectes/nclone/trytond/trytond/modules/stock_lot/tests/test_stock_lot.py", line 107, in test_products_by_location
    [product.id], grouping=('product', 'lot')), {
  File "/home/sergi/projectes/nclone/trytond/trytond/modules/stock/product.py", line 176, in products_by_location
    grouping=grouping, grouping_filter=grouping_filter)
  File "/home/sergi/projectes/nclone/trytond/trytond/modules/stock/move.py", line 1019, in compute_quantities_query
    assert grouping_filter is None or len(grouping_filter) == len(grouping)
AssertionError
msg38393 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-16.10:10:04
It should be fixed with review40111002
msg38392 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-02-16.09:38:14
Since changeset 48b680368def when opening opening the lots of a location I get the following traceback:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 70, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 41, in rpc
    request, database_name, *request.rpc_params)
  File "/trytond/wsgi.py", line 41, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 110, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 165, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/modelsql.py", line 779, in read
    getter_results = field.get(ids, cls, field_list, values=result)
  File "/trytond/model/fields/function.py", line 102, in get
    return dict((name, call(name)) for name in names)
  File "/trytond/model/fields/function.py", line 102, in <genexpr>
    return dict((name, call(name)) for name in names)
  File "/trytond/model/fields/function.py", line 94, in call
    return method(records, name)
  File "/trytond/modules/stock_lot/stock.py", line 34, in get_quantity
    grouping=('product', 'lot'))
  File "/trytond/modules/stock/move.py", line 94, in _get_quantity
    grouping=grouping)
  File "/trytond/modules/stock/product.py", line 174, in products_by_location
    grouping_filter = (product_ids,) + tuple(grouping_filter)
TypeError: 'NoneType' object is not iterable
History
Date User Action Args
2018-02-28 18:27:37roundup-botsetmessages: + msg38686
2018-02-28 18:27:11roundup-botsetmessages: + msg38685
2018-02-28 18:26:49roundup-botsetmessages: + msg38684
2018-02-28 18:26:21roundup-botsetmessages: + msg38683
2018-02-28 18:25:49roundup-botsetmessages: + msg38682
2018-02-28 18:25:21roundup-botsetstatus: testing -> resolved
messages: + msg38681
2018-02-21 19:50:47reviewbotsetmessages: + msg38558
2018-02-21 19:50:46reviewbotsetreviews: 40111002, 44001002, 44651002, 35951002, 40121002, 41121002, 43151002 -> 40111002, 44001002, 44651002, 35951002, 40121002, 41121002, 43151002, 44661002
2018-02-21 19:50:45reviewbotsetmessages: + msg38557
2018-02-21 19:50:44reviewbotsetreviews: 40111002, 44001002, 44651002, 35951002, 40121002, 41121002 -> 40111002, 44001002, 44651002, 35951002, 40121002, 41121002, 43151002

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