On 27/06/12 20:21 +0200, Udo Spallek wrote: > Wed, 27 Jun 2012 20:04:55 +0200 > Cédric Krier <[email protected]>: > > On 27/06/12 19:36 +0200, Udo Spallek wrote: > > > Mon, 25 Jun 2012 13:10:16 +0200 > > > Cédric Krier <[email protected]>: > > > > On 25/06/12 11:16 +0200, Udo Spallek wrote: > > > > Also we don't want to have to add every new location created to > > > > the configuration. > > > What is the problem with this? > > It doesn't scale if you have thousand of locations. > For me there is no need to put all existing or new locations to the > configuration. > > > > For me stock.lot.type model looks very restrictive and hard to > > > extend. > > I don't see why. For now it follow the same concept as the location. > > After that it is still possible to extend it by overriding > > Product.lot_is_required > It would be much more flexible when stock.lot.type is a table, > which stores lines of lot types to apply: > > class LotType(ModelSQL, ModelView): > "Stock Lot Type" > _name = 'stock.lot.type' > _description = __doc__ > > location_type = fields.Many2One('stock.location.type', > 'Location Type', states={ > 'required': True, > }) > > LotType() > > class StockLocationType(ModelSQL, ModelView): > "Stock Location Type" > _name = 'stock.location.type' > _description = __doc__ > > name = fields.Char('Name', required=True, translate=True) > code = fields.Char('Code', required=True) > > StockLocationType() > > This kind of lot type has only a selection of a stock location type. > This would make the model much more flexible, because it is possible to > extend it with other criteria then the location type. E.g. one can add > another many2one to stock location.
It is the same except that your design is more complicated. Nothing prevent you to create LotType that are not linked to location. -- Cédric Krier B2CK SPRL Rue de Rotterdam, 4 4000 Liège Belgium Tel: +32 472 54 46 59 Email/Jabber: [email protected] Website: http://www.b2ck.com/
pgpVJZun4l0Qd.pgp
Description: PGP signature
