2014-04-09 14:29 GMT+02:00 jmartin <jmar...@zikzakmedia.com>: > Hi, > > I'm trying to add a domain in the product field os sale.line that is > filled from the sale.sale form view, in order to avoid make sales of some > products grouped by their categories to some parties. This is the code: > > class SaleLine: > __name__ = 'sale.line' > product_domain = fields.Function(fields.One2Many( > 'product.product', None, 'Product Category Domain', > on_change_with=['_parent_party', 'product'], > depends=['_parent_party']), >
I'm not sure if it is the problem, but I think this "parent" references are wrong, they should be "_parent_sale.party". If I'm not wrong :-P the "parent" reference always have to include the field that acts as parent relation because a model can have different "parents". -- Guillem Barba http://www.guillem.alcarrer.net