On 01 May 19:27, Guillem Barba Domingo wrote: > 2014-04-28 9:04 GMT+02:00 Cédric Krier <[email protected]>: > > > On 28 Apr 08:53, Guillem Barba Domingo wrote: > > > 2014-04-25 12:55 GMT+02:00 Cédric Krier <[email protected]>: > > > > > > > Hi, > > > > > > > > I created the issue3867 that implements a Mixin for a pattern we use in > > > > some places in Tryton (and to use it for supplier prices). > > > > So comments are welcome (especially on wording). > > > > > > > > > > I think the pattern list items should include the operator to could be > > > used, for example, in the pricelist items selection (and similar use > > cases). > > > > Please clarrify. > > > My proposition is that the "pattern" that receive 'match()' method includes > the operator to avoid the extension of 'match()' method done in > product_price_list module [1]. > The pattern, that in this case is set here [2] shoud be like this: > pattern['quantity'] = ('<=', Uom.compute_qty(uom, quantity, > product.default_uom, round=False) if product else quantity) > for product, it should be: > patter['product'] = ('=', product and product.id or None) > > It makes the 'pattern' more explicit, but it also makes it more complex, so > I'm not sure if its an improvement over your solution.
For me this design is wrong because it push the responsability to the caller. -- Cédric Krier - B2CK SPRL Email/Jabber: [email protected] Tel: +32 472 54 46 59 Website: http://www.b2ck.com/
pgpcB6pwRa0oS.pgp
Description: PGP signature
