Technical mailing list archives

Re: Edit domains with new API onchange

Pedro M. Baeza
- 01/08/2015 05:38:10
Hi, Leonardo,

Try this: put a related field on line for the header field, and code an onchange for this field.


2015-01-07 11:27 GMT+01:00 Leonardo "LeartS" Donelli <>:
Thanks for your answers,
I didn't know you can still return 'domain' and 'warning' in a
onchange decorated method, good!

I am now facing another related problem: if you look at my example
you'll see I have to edit
the domain of a field of sale.order.line based on a field of sale.order.

I tried by putting the onchange on sale.order and returning something like

    'domain': {
                'order_line.product_id': [('shelf_life', '=', 'dry')]

but it doesn't work (no errors but the domain is not applied).

I also tried putting the onchange on the line directly:


but it gives an error on initialization:

    _logger.warning("@onchange%r parameters must be field names",
    [ followed by semi related error when trying to log the warning
about list not having _onchange attr ]

Post to: