On Sábado 11 Febrero 2012 10:34:55 Cédric Krier escribió:
> On 10/02/12 18:11 -0300, Felipe Alvarez Harnecker wrote:
> > i'm trying to do something like
> >
> > <field name="producto"
> >
> > domain="If(Equal(Eval('tipo'),'servicio'),[('type','=','service')],[('typ
> > e','!=','service')])"/>
> >
> > that fails. How is the right way to do this in tryton?
>
> What is failing?
> What is the definition of the Model?
Ok. Here are the models ( simplified)
class Report(ModelSQL, ModelView):
'Report'
_name = 'ql_maquinaria.report'
_description = __doc__
tipo = fields.Selection([('servicio','Servicio'),('venta','Venta')],'Tipo',
required=True,
select=1)
lineas = fields.One2Many('ql_maquinaria.report.linea', 'report', 'Lineas')
class LineaReport(ModelSQL, ModelView):
'LineaReport'
_name = 'ql_maquinaria.report.linea'
_description = __doc__
report = fields.Many2One('ql_maquinaria.report', 'Report', required=True,
ondelete='CASCADE')
producto = fields.Many2One('product.product', 'Producto', required=True)
what i need is: if Report.tipo == 'servicio' then when the user choose a
product the widget ( in
LineaRepot ) must show only products of type 'service' and when Report.tipo ==
'venta' the widgets
show only products of type != 'service'
>
>
> PS: Please don't cross-post between tryton and tryton-dev. Most of the
> people are on both mailing list and for them it is boring to read twice
> the same email and for those who are not on both mailing list, it is
> because they don't want to have a kind of email.
> I made the choise via moderation this time.
I'm sorry for cross-posting but it is not clear to me if tryton-dev is for
developing tryton itself
or developing tryton applications.
thnx.
--
Felipe Alvarez Harnecker
[email protected] - 9.874.60.17
--
[email protected] mailing list