Contributors mailing list archives

Browse archives


Re: unit test of onchange in v10 - full new api

LasLabs, Dave Lasley
- 27/09/2017 15:39:09
I typically will just make the necessary changes to the record, such as the product in this instance, then run the onchange method. Its all just using the record cache now, so it just works. 

-Dave Lasley

On Sep 27, 2017, at 06:10, David Beal <> wrote:

Hi guys,

I need your advice about unit test and onchange in v10,

Compared to old api there is a behavior I can't reproduce

In old api we had `def my_onchange (self, cr, ..., product, pricelist, ...)`

For test unit, it's easy just call method by replacing product by the product you want test.

example here

But in new api, there is no more argument in onchange method.
Then i can't understand how can i specify a particular product for my own test.

In OCA test, i haven't found any example where i could understand explicitly
where I put my product value.

For sure expert really could help me here.

Thanks a lot

Bonne journée

David BEAL - Akretion
Odoo Development / Integration