On 2017-03-10 12:10, Ul wrote: > Am 10.03.2017 um 00:34 schrieb Cédric Krier: > > This is a simplification for the developer but for the user it is not as > > he has to enter both lot on each move. Without talking about integrity > > error, how will you prevent a user to encode on a move a lot and a wrong > > supplier lot? > I hide the field for supplier_lot if the from_location is not of type > supplier. So it only shows up were it is relevant. > I think it is even easier for the user, because filling the form of > ShipmentIn, i directly have a field for supplier lot without opening the > internal lot. This is important because i want to automate the > generation of the internal lot in the next step by copying the data of > the supplier lot, replacing the number and origin. So i need to be able > to fill the supplier lot at shipment in before generating the internal lot.
All of this can be achieved while still storing the information on the lot. Indeed when designing the database schema, the UI should never come in the equation. The schema must be right according to the reality of the modeling thing. And in this case, the internal lot number is linked to the supplier lot number and both should follow all over the place. So it is a wrong design to split them on the move because you can no more guarantee this property. > On the other side, if i put the supplier lot into the internal lot it is > harder to hide it when it is irrelevant as for lots generated by > production. Why? You could have an external lot number for a production. For example if the process is delegated to an external producer. > It is possible to show it depending on origin field, but the > field is not filled on generation as the creating shipment or production > sometimes don't have a id yet or it is only filled at saving. > > Perhaps it's easiest to give you my code so you get the full picture: > https://owncloud.datnest.de/index.php/s/2UaeK68nPT7Q6KT I see that indeed for supplier lot, you even reuse the stock.lot. So for me, it breaks the contract that lot should represent the same unique set of products. Because you will have to entries in the stock.lot table for the same set. -- Cédric Krier - B2CK SPRL Email/Jabber: [email protected] Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ -- You received this message because you are subscribed to the Google Groups "tryton" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/20170310120444.GN87763%40tetsuo.
