Tryton - Issues

 

Issue6442

Title Add serial number functionalities to lot
Priority feature Status resolved
Superseder Prevent modify product lot if there are any move, RFC: Inventory Counting wizard
View: 7516, 7515
Nosy List Timitos, ced, nblock, nicoe, pokoli, resteve, reviewbot, roundup-bot
Type feature request Components
Assigned To ced Keywords review
Reviews 28251002
View: 28251002

Created on 2017-04-14.18:08:12 by nicoe, last changed by roundup-bot.

Messages
New changeset d3b79816d7d1 by Cédric Krier in branch 'default':
Add stock_lot_unit and count wizard on inventory
https://hg.tryton.org/tryton-env/rev/d3b79816d7d1
New changeset 2fbd11633ede by Cédric Krier in branch 'default':
Initial commit
https://hg.tryton.org/modules/stock_lot_unit/rev/2fbd11633ede
review28251002 updated at https://codereview.tryton.org/28251002/#ps370001
review28251002 updated at https://codereview.tryton.org/28251002/#ps350001
msg41958 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-06-29.09:18:34
Last patch version was missing a super call.
review28251002 updated at https://codereview.tryton.org/28251002/#ps330001
msg41952 (view) Author: [hidden] (Timitos) Date: 2018-06-28.19:34:49
I tested the latest version and it seems that there are no stock moves created any more. I tested it with a product with lots and with one without lots. No difference on this problem for these types. I had only the following reviews applied:
https://codereview.tryton.org/28251002/
https://codereview.tryton.org/52371002/
https://codereview.tryton.org/49461002/

Am i missing something?
review28251002 updated at https://codereview.tryton.org/28251002/#ps310001
msg41935 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-06-28.11:30:03
I added on last version a check at the inventory confirmation.
msg41916 (view) Author: [hidden] (Timitos) Date: 2018-06-27.14:20:44
The validation does not raise an error if you add to a lot that already has a quantity of 1 in stock another quantity of 1 (expected quantity: 1, quantity: 2, lot_unit: 1 unit) as in this case the quantity of the stock move is not greater than the lot unit.
msg41662 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-06-26.13:07:53
I do not understand what you mean by validation. On confirmation, if the inventory creates such moves, an exception will be raised https://codereview.tryton.org/28251002/diff/290001/stock.py#newcode100
msg41660 (view) Author: [hidden] (Timitos) Date: 2018-06-26.12:52:31
It is still possible to enter a quantity for a lot that is higher than the defined quantity on the lot. And there is no error raised on validation of the inventory.
msg41430 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-06-15.18:33:39
Indeed make lot required on inventory is not correct see issue7519, so I put an error message on issue7515.
msg41423 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-06-15.16:52:44
I understand so I think the inventory line should make the lot required. But it is not really linked to this issue so I will create a new one.
msg41404 (view) Author: [hidden] (Timitos) Date: 2018-06-14.11:04:15
I think that this is too late. The user should not be able to enter values that do not validate in a later stage of the process
msg41402 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-06-14.10:41:23
It will be verified at the validation of the inventory.
msg41401 (view) Author: [hidden] (Timitos) Date: 2018-06-14.10:27:53
With the new counting wizard it is currently possible to add a quantity that is higher than the quantity of the selected lot. And it is possible to select a product that requires a lot and to add any quantity without selecting a lot. Both should be not possible.
review28251002 updated at https://codereview.tryton.org/28251002/#ps290001
review28251002 updated at https://codereview.tryton.org/28251002/#ps270001
review28251002 updated at https://codereview.tryton.org/28251002/#ps230022
msg41372 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-06-12.11:10:05
On 2018-06-12 10:42, Korbinian Preisler wrote:
>     AttributeError: "product.product,1" has no attribute "lot_unit"

Must be fixed in last patch.
msg41371 (view) Author: [hidden] (Timitos) Date: 2018-06-12.10:42:24
When running the tests on the newest version i get this error:

trytond/trytond/tests/run-tests.py -m stock_lot_unit

Failed example:
    lot = Lot(number='00001', product=product)
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest scenario_stock_lot_unit.rst[51]>", line 1, in <module>
        lot = Lot(number='00001', product=product)
      File "/home/kpreisler/fab_venv/projects/trytondev/proteus/proteus/__init__.py", line 726, in __init__
        setattr(self, field_name, value)
      File "/home/kpreisler/fab_venv/projects/trytondev/proteus/proteus/__init__.py", line 265, in __set__
        super(Many2OneDescriptor, self).__set__(instance, value)
      File "/home/kpreisler/fab_venv/projects/trytondev/proteus/proteus/__init__.py", line 129, in __set__
        instance._on_change([self.name])
      File "/home/kpreisler/fab_venv/projects/trytondev/proteus/proteus/__init__.py", line 1094, in _on_change
        changes = getattr(self._proxy, 'on_change')(values, names, context)
      File "/home/kpreisler/fab_venv/projects/trytondev/proteus/proteus/config.py", line 185, in __call__
        result = rpc.result(meth(inst, *args, **kwargs))
      File "/home/kpreisler/fab_venv/projects/trytondev/trytond/trytond/model/modelview.py", line 683, in on_change
        method()
      File "/home/kpreisler/fab_venv/projects/trytondev/trytond/trytond/model/modelview.py", line 84, in wrapper
        result = func(self, *args, **kwargs)
      File "/home/kpreisler/fab_venv/projects/trytondev/trytond/trytond/model/fields/field.py", line 113, in wrapper
        return func(self, *args, **kwargs)
      File "/home/kpreisler/fab_venv/projects/trytondev/trytond/trytond/modules/stock_lot_unit/stock.py", line 50, in on_change_product
        if self.product and self.product.lot_unit:
      File "/home/kpreisler/fab_venv/projects/trytondev/trytond/trytond/model/modelstorage.py", line 1226, in __getattr__
        raise AttributeError('"%s" has no attribute "%s"' % (self, name))
    AttributeError: "product.product,1" has no attribute "lot_unit"
review28251002 updated at https://codereview.tryton.org/28251002/#ps240001
review28251002 updated at https://codereview.tryton.org/28251002/#ps220001
msg41330 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-06-11.14:28:13
I updated the review to implement design of msg41322
The behavior did not change too much as the scenario had received only small changes.
msg41322 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-06-08.12:48:46
I think the current proposal is too strict by defining the serial property only on the product.
Indeed I think we could have serial number for a pack of products. This will be expressed by a different unit of measure with still 1 as quantity.
The same product could have different kind of serial number, one when it was in a bigger packaging and one when it is unpacked.
For this, I think that the serial property should be stored on the lot itself.
This serial property will be stored as a UoM which represent the total quantity that contains the lot. This way the constraints will be that a move with this lot can not have a quantity greater than the 1 UoM of the lot (and for shipment constraint the sum can not be greater).
The serial case will be managed by using the smallest UoM with 0 digits and rounding of 1.

As serial number will be just a particular case of this module, I think we should have a better name. I propose stock_lot_unit
review28251002 updated at https://codereview.tryton.org/28251002/#ps200001
review28251002 updated at https://codereview.tryton.org/28251002/#ps180001
msg39064 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-03-19.10:21:38
I'm wondering if we should also check that the quantity of an inventory is not greater than 1 for serializable products.
review28251002 updated at https://codereview.tryton.org/28251002/#ps160001
review28251002 updated at https://codereview.tryton.org/28251002/#ps140001
review28251002 updated at https://codereview.tryton.org/28251002/#ps120001
review28251002 updated at https://codereview.tryton.org/28251002/#ps100001
review28251002 updated at https://codereview.tryton.org/28251002/#ps80001
review28251002 updated at https://codereview.tryton.org/28251002/#ps60001
review28251002 updated at https://codereview.tryton.org/28251002/#ps40001
review28251002 updated at https://codereview.tryton.org/28251002/#ps20001
review28251002 updated at https://codereview.tryton.org/28251002/#ps1
msg33237 (view) Author: [hidden] (nicoe) (Tryton committer) (Tryton translator) Date: 2017-04-14.18:08:11
Following the discussion on https://discuss.tryton.org/t/serial-numbers-on-products-and-stock-moves/137 we can implement serial numbers as lot numbers.
History
Date User Action Args
2018-07-27 17:30:04roundup-botsetmessages: + msg42395
2018-07-27 17:14:12roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg42392
2018-07-05 10:13:07reviewbotsetmessages: + msg42066
2018-06-29 09:23:16reviewbotsetmessages: + msg41959
2018-06-29 09:18:34cedsetmessages: + msg41958
2018-06-28 19:58:49reviewbotsetmessages: + msg41953
2018-06-28 19:34:50Timitossetmessages: + msg41952
2018-06-28 11:33:13reviewbotsetmessages: + msg41936
2018-06-28 11:30:03cedsetmessages: + msg41935
2018-06-27 14:20:44Timitossetmessages: + msg41916

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